You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dlab.apache.org by an...@apache.org on 2019/11/15 16:17:31 UTC
[incubator-dlab] branch DLAB-1262 created (now 1ff587f)
This is an automated email from the ASF dual-hosted git repository.
ankovalyshyn pushed a change to branch DLAB-1262
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git.
at 1ff587f [DLAB-1262]: image validation extention; unique per project images
This branch includes the following new commits:
new 1ff587f [DLAB-1262]: image validation extention; unique per project images
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org
[incubator-dlab] 01/01: [DLAB-1262]: image validation extention;
unique per project images
Posted by an...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ankovalyshyn pushed a commit to branch DLAB-1262
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git
commit 1ff587f2956625a80b159302f28c33b9da0f1ed8
Author: Andriana Kovalyshyn <An...@epam.com>
AuthorDate: Fri Nov 15 18:17:19 2019 +0200
[DLAB-1262]: image validation extention; unique per project images
---
.../services/applicationServiceFacade.service.ts | 4 ++--
.../src/app/core/services/userResource.service.ts | 5 +++--
.../ami-create-dialog.component.html | 11 +++++++----
.../ami-create-dialog.component.ts | 21 +++++++--------------
4 files changed, 19 insertions(+), 22 deletions(-)
diff --git a/services/self-service/src/main/resources/webapp/src/app/core/services/applicationServiceFacade.service.ts b/services/self-service/src/main/resources/webapp/src/app/core/services/applicationServiceFacade.service.ts
index cffcf03..9fc1e2b 100644
--- a/services/self-service/src/main/resources/webapp/src/app/core/services/applicationServiceFacade.service.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/core/services/applicationServiceFacade.service.ts
@@ -359,9 +359,9 @@ export class ApplicationServiceFacade {
image);
}
- public buildGetImagesList(): Observable<any> {
+ public buildGetImagesList(param): Observable<any> {
return this.buildRequest(HTTPMethod.GET,
- this.requestRegistry.Item(ApplicationServiceFacade.IMAGE),
+ this.requestRegistry.Item(ApplicationServiceFacade.IMAGE) + param,
null);
}
diff --git a/services/self-service/src/main/resources/webapp/src/app/core/services/userResource.service.ts b/services/self-service/src/main/resources/webapp/src/app/core/services/userResource.service.ts
index 224ba9c..496ad28 100644
--- a/services/self-service/src/main/resources/webapp/src/app/core/services/userResource.service.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/core/services/userResource.service.ts
@@ -152,9 +152,10 @@ export class UserResourceService {
catchError(ErrorUtils.handleServiceError));
}
- public getImagesList(): Observable<{}> {
+ public getImagesList(project?): Observable<{}> {
+ const body = project ? `/all?project=${project}` : '';
return this.applicationServiceFacade
- .buildGetImagesList()
+ .buildGetImagesList(body)
.pipe(
map(response => response),
catchError(ErrorUtils.handleServiceError));
diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/ami-create-dialog/ami-create-dialog.component.html b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/ami-create-dialog/ami-create-dialog.component.html
index cc817fe..b3510c4 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/ami-create-dialog/ami-create-dialog.component.html
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/ami-create-dialog/ami-create-dialog.component.html
@@ -29,10 +29,12 @@
<label class="label">Name</label>
<div class="control">
<input type="text" formControlName="name" placeholder="Enter {{ DICTIONARY.image }} name">
- <span class="danger_color" *ngIf="createAMIForm.controls['name'].hasError('duplication')">This {{ DICTIONARY.image }} name already exists.</span>
- <span class="danger_color" *ngIf="!createAMIForm.valid && createAMIForm.controls['name'].dirty && !createAMIForm.controls['name'].hasError('duplication')">
+ <span class="error" *ngIf="createAMIForm.controls['name'].hasError('duplication')">This
+ {{ DICTIONARY.image }} name already exists in project.</span>
+ <span class="error"
+ *ngIf="!createAMIForm.valid && createAMIForm.controls['name'].dirty && !createAMIForm.controls['name'].hasError('duplication')">
{{ DICTIONARY.image }} name
- <span *ngIf="DICTIONARY.cloud_provider === 'azure'"> cannot be longer than 10 characters and</span>
+ <span *ngIf="DICTIONARY.cloud_provider === 'azure'"> cannot be longer than 10 characters and</span>
can only contain letters, numbers, hyphens and '_'</span>
</div>
</div>
@@ -45,7 +47,8 @@
</form>
<div class="text-center m-top-30 m-bott-10">
<button mat-raised-button type="button" class="butt action" (click)="dialogRef.close()">Cancel</button>
- <button mat-raised-button type="button" [disabled]="!createAMIForm.valid" (click)="assignChanges(createAMIForm.value)" class="butt butt-success action">Create</button>
+ <button mat-raised-button type="button" [disabled]="!createAMIForm.valid"
+ (click)="assignChanges(createAMIForm.value)" class="butt butt-success action">Create</button>
</div>
</div>
</div>
diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/ami-create-dialog/ami-create-dialog.component.ts b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/ami-create-dialog/ami-create-dialog.component.ts
index bfa4f3a..430f6cb 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/ami-create-dialog/ami-create-dialog.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/ami-create-dialog/ami-create-dialog.component.ts
@@ -49,22 +49,15 @@ export class AmiCreateDialogComponent implements OnInit {
) { }
ngOnInit() {
- this._userResource.getImagesList().subscribe(res => this.imagesList = res);
- this.open(this.data);
- }
-
- public open(notebook): void {
- this.notebook = notebook;
+ this.notebook = this.data;
this.initFormModel();
- this._userResource.getImagesList().subscribe(res => this.imagesList = res);
+ this._userResource.getImagesList(this.data.project).subscribe(res => this.imagesList = res);
}
public assignChanges(data) {
this._userResource.createAMI(data).subscribe(
- response => {
- if (response.status === HTTP_STATUS_CODES.ACCEPTED) this.dialogRef.close();
- },
+ response => response.status === HTTP_STATUS_CODES.ACCEPTED && this.dialogRef.close(),
error => this.toastr.error(error.message || `${DICTIONARY.image.toLocaleUpperCase()} creation failed!`, 'Oops!'));
}
@@ -81,10 +74,6 @@ export class AmiCreateDialogComponent implements OnInit {
return control.value.length <= 10 ? null : { valid: false };
}
- private delimitersFiltering(resource): string {
- return resource.replace(this.delimitersRegex, '').toString().toLowerCase();
- }
-
private checkDuplication(control) {
if (control.value)
return this.isDuplicate(control.value) ? { duplication: true } : null;
@@ -97,4 +86,8 @@ export class AmiCreateDialogComponent implements OnInit {
}
return false;
}
+
+ private delimitersFiltering(resource): string {
+ return resource.replace(this.delimitersRegex, '').toString().toLowerCase();
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org