This is an automated email from the ASF dual-hosted git repository. dgnatyshyn pushed a commit to branch DLAB-1466 in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git
commit 384c3027613d8d3ff07dbdc6296834a4072858eb Author: Dmytro Gnatyshyn <di1...@ukr.net> AuthorDate: Fri Jan 24 18:53:42 2020 +0200 [DLAB-1466]: Fixed set of minor issues --- .../administration/project/project-data.service.ts | 33 +++++++++++++++++----- .../project/project-list/project-list.component.ts | 12 -------- ...utational-resource-create-dialog.component.html | 2 +- ...mputational-resource-create-dialog.component.ts | 6 ++-- .../manage-ungit/manage-ungit.component.html | 2 +- 5 files changed, 32 insertions(+), 23 deletions(-) diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/project/project-data.service.ts b/services/self-service/src/main/resources/webapp/src/app/administration/project/project-data.service.ts index ad877f2..c86d6d5 100644 --- a/services/self-service/src/main/resources/webapp/src/app/administration/project/project-data.service.ts +++ b/services/self-service/src/main/resources/webapp/src/app/administration/project/project-data.service.ts @@ -18,17 +18,17 @@ */ import { Injectable } from '@angular/core'; -import { BehaviorSubject } from 'rxjs'; +import { BehaviorSubject, of } from 'rxjs'; +import { mergeMap} from 'rxjs/operators'; -import { ProjectService } from '../../core/services'; +import { ProjectService, EndpointService } from '../../core/services'; import { Project } from './project.component'; @Injectable() export class ProjectDataService { - _projects = new BehaviorSubject<any>(null); - constructor(private projectService: ProjectService) { + constructor(private projectService: ProjectService, private endpointService: EndpointService) { this.getProjectsList(); } @@ -37,7 +37,26 @@ export class ProjectDataService { } private getProjectsList() { - this.projectService.getProjectsList().subscribe( - (response: Project[]) => this._projects.next(response)); + this.projectService.getProjectsList() + .pipe( + mergeMap ((response: Project[]) => { + this.endpointService.getEndpointsData().subscribe((endpoints: any) => { + if(response) { + response.forEach(project => project.endpoints.forEach(endpoint => { + const filtredEndpoints = endpoints.filter(v => v.name === endpoint.name); + if(filtredEndpoints.length){ + endpoint.endpointStatus = endpoints.filter(v => v.name === endpoint.name)[0].status; + }else{ + endpoint.endpointStatus = "N/A" + } + })); + } + }); + return of(response); + })) + .subscribe( + (response: Project[]) => { + return this._projects.next(response); + }); } -} \ No newline at end of file +} diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/project/project-list/project-list.component.ts b/services/self-service/src/main/resources/webapp/src/app/administration/project/project-list/project-list.component.ts index 146e99e..b245bfe 100644 --- a/services/self-service/src/main/resources/webapp/src/app/administration/project/project-list/project-list.component.ts +++ b/services/self-service/src/main/resources/webapp/src/app/administration/project/project-list/project-list.component.ts @@ -70,18 +70,6 @@ export class ProjectListComponent implements OnInit, OnDestroy { setTimeout(() => {this.progressBarService.startProgressBar()} , 0); this.subscriptions.add(this.projectDataService._projects.subscribe((value: Project[]) => { this.projectList = value; - this.endpointService.getEndpointsData().subscribe((endpoints: any) => { - if(this.projectList){ - this.projectList.forEach(project => project.endpoints.forEach(endpoint => { - const filtredEndpoints = endpoints.filter(v => v.name === endpoint.name); - if(filtredEndpoints.length){ - endpoint.endpointStatus = endpoints.filter(v => v.name === endpoint.name)[0].status; - }else{ - endpoint.endpointStatus = "N/A" - } - })) - } - }); if (value) this.dataSource = new MatTableDataSource(value); this.progressBarService.stopProgressBar(); }, () => this.progressBarService.stopProgressBar())); diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/computational/computational-resource-create-dialog/computational-resource-create-dialog.component.html b/services/self-service/src/main/resources/webapp/src/app/resources/computational/computational-resource-create-dialog/computational-resource-create-dialog.component.html index 7b956fc..aab4e24 100644 --- a/services/self-service/src/main/resources/webapp/src/app/resources/computational/computational-resource-create-dialog/computational-resource-create-dialog.component.html +++ b/services/self-service/src/main/resources/webapp/src/app/resources/computational/computational-resource-create-dialog/computational-resource-create-dialog.component.html @@ -124,7 +124,7 @@ <label class="label">Slave instance size</label> <div class="control selector-wrapper"> <mat-form-field> - <mat-label>Select {{ DICTIONARY.notebook_instance_size }}</mat-label> + <mat-label>Select instance size</mat-label> <mat-select formControlName="shape_slave" disableOptionCentering> <mat-optgroup *ngFor="let item of (selectedImage.computation_resources_shapes | keys)" [label]="item.key | underscoreless"> diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/computational/computational-resource-create-dialog/computational-resource-create-dialog.component.ts b/services/self-service/src/main/resources/webapp/src/app/resources/computational/computational-resource-create-dialog/computational-resource-create-dialog.component.ts index eeb8bdb..28f01cd 100644 --- a/services/self-service/src/main/resources/webapp/src/app/resources/computational/computational-resource-create-dialog/computational-resource-create-dialog.component.ts +++ b/services/self-service/src/main/resources/webapp/src/app/resources/computational/computational-resource-create-dialog/computational-resource-create-dialog.component.ts @@ -139,9 +139,9 @@ export class ComputationalResourceCreateDialogComponent implements OnInit { private initFormModel(): void { this.resourceForm = this._fb.group({ template_name: ['', [Validators.required]], - version: [''], + version: ['', Validators.required], shape_master: ['', Validators.required], - shape_slave: ['', Validators.required], + shape_slave: ['', Validators.required], cluster_alias_name: ['', [Validators.required, Validators.pattern(PATTERNS.namePattern), Validators.maxLength(DICTIONARY[this.PROVIDER].max_cluster_name_length), this.checkDuplication.bind(this)]], instance_number: ['', [Validators.required, Validators.pattern(PATTERNS.nodeCountPattern), this.validInstanceNumberRange.bind(this)]], @@ -158,8 +158,10 @@ export class ComputationalResourceCreateDialogComponent implements OnInit { this.resourceForm.get('template_name').valueChanges.subscribe(val => { if (val === 'AWS EMR cluster') { this.resourceForm.addControl('shape_slave', new FormControl('', [ Validators.required ])); + this.resourceForm.addControl('version', new FormControl('', [ Validators.required ])); } else { this.resourceForm.removeControl('shape_slave'); + this.resourceForm.removeControl('version'); } this.resourceForm.updateValueAndValidity(); }); diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/manage-ungit/manage-ungit.component.html b/services/self-service/src/main/resources/webapp/src/app/resources/manage-ungit/manage-ungit.component.html index bcecfd2..a6c2610 100644 --- a/services/self-service/src/main/resources/webapp/src/app/resources/manage-ungit/manage-ungit.component.html +++ b/services/self-service/src/main/resources/webapp/src/app/resources/manage-ungit/manage-ungit.component.html @@ -125,7 +125,7 @@ <input type="password" formControlName="password" placeholder="Enter Password"> </div> <span class="danger_color" - *ngIf="!updateAccountCredentialsForm.controls['password'].valid && updateAccountCredentialsForm.controls['password'].touched && updateAccountCredentialsForm.value.password === updateAccountCredentialsForm.value.confirmPassword"> + *ngIf="!updateAccountCredentialsForm.controls['password'].valid && updateAccountCredentialsForm.controls['password'].touched"> Field is required. Password must be at least 6 characters </span> </div> --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org