This is an automated email from the ASF dual-hosted git repository. dgnatyshyn pushed a commit to branch DLAB-1534 in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git
commit 1663aee38f1c360bc5e3167c4c9efd67362453dc Author: Dmytro Gnatyshyn <[email protected]> AuthorDate: Wed Feb 12 12:58:52 2020 +0200 [DLAB-1534]: Added possibility to choose the same endpoint after edge termination on UI --- .../project/project-form/project-form.component.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/project/project-form/project-form.component.ts b/services/self-service/src/main/resources/webapp/src/app/administration/project/project-form/project-form.component.ts index 683e7d7..6c095bd 100644 --- a/services/self-service/src/main/resources/webapp/src/app/administration/project/project-form/project-form.component.ts +++ b/services/self-service/src/main/resources/webapp/src/app/administration/project/project-form/project-form.component.ts @@ -29,7 +29,7 @@ import { CheckUtils, FileUtils, PATTERNS } from '../../../core/util'; import { Project } from '../project.component'; import { DICTIONARY } from '../../../../dictionary/global.dictionary'; -export interface GenerateKey { privateKey: string, publicKey: string }; +export interface GenerateKey { privateKey: string; publicKey: string; } @Component({ selector: 'project-form', @@ -139,7 +139,7 @@ export class ProjectFormComponent implements OnInit { } public selectOptions(list, key, select?) { - let filter = key === 'endpoints' ? list.map(el => el.name) : list; + const filter = key === 'endpoints' ? list.map(el => el.name) : list; this.projectForm.controls[key].setValue(select ? filter : []); } @@ -156,8 +156,7 @@ export class ProjectFormComponent implements OnInit { } public editSpecificProject(item) { - const endpoints = item.endpoints.map((endpoint: any) => endpoint.name); - + const endpoints = item.endpoints.filter(endpoint => endpoint.status !== 'TERMINATED').map((endpoint: any) => endpoint.name); this.projectForm = this._fb.group({ 'key': [''], 'name': [item.name, Validators.required], @@ -170,7 +169,11 @@ export class ProjectFormComponent implements OnInit { isDisabled(endpoint: any): boolean { if (this.item) { - const endpoints = this.item.endpoints.map((item: any) => item.name); + const endpoints = this.item.endpoints.map((item: any) => { + if (item.status !== 'TERMINATED') { + return item.name; + } + }); return endpoints.includes(endpoint); } } --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
