diff options
author | miriame <miriam.eini@amdocs.com> | 2019-02-13 15:17:26 +0200 |
---|---|---|
committer | miriame <miriam.eini@amdocs.com> | 2019-02-14 10:45:13 +0200 |
commit | c2ce914541e694c7d1c8853b88936095e8b9ede4 (patch) | |
tree | d9d6dfa4b011c6868048d83a2116743b283b1cb1 /catalog-ui/src/app/models/componentsInstances/componentInstance.ts | |
parent | d72aaa18d4dbfb8017dce566d9c41ccc00985528 (diff) |
Add 'Service Dependencies' tab in composition page
Issue-ID: SDC-1987
Change-Id: Ib5b688c12234c81fe6f89b2b5d37dd16a75b0db9
Signed-off-by: miriame <miriam.eini@amdocs.com>
Diffstat (limited to 'catalog-ui/src/app/models/componentsInstances/componentInstance.ts')
-rw-r--r-- | catalog-ui/src/app/models/componentsInstances/componentInstance.ts | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/catalog-ui/src/app/models/componentsInstances/componentInstance.ts b/catalog-ui/src/app/models/componentsInstances/componentInstance.ts index fcc3298249..f95d6553cd 100644 --- a/catalog-ui/src/app/models/componentsInstances/componentInstance.ts +++ b/catalog-ui/src/app/models/componentsInstances/componentInstance.ts @@ -61,6 +61,11 @@ export class ComponentInstance { public groupInstances:Array<Module>; public invariantName:string; public originArchived:boolean; + public directives: Array<string>; + + DIRECTIVES_TYPES = { + SELECTABLE: 'selectable' + }; constructor(componentInstance?:ComponentInstance) { @@ -92,6 +97,7 @@ export class ComponentInstance { this.sourceModelUid = componentInstance.sourceModelUid; this.sourceModelUuid = componentInstance.sourceModelUuid; this.originArchived = componentInstance.originArchived; + this.directives = componentInstance.directives; } } @@ -177,4 +183,19 @@ export class ComponentInstance { public get iconClass() { return this.iconSprite + ' ' + this.icon; } + + public isDependent = () : boolean => { + return this.directives && this.directives.indexOf(this.DIRECTIVES_TYPES.SELECTABLE) !== -1; + } + + public markAsDependent = () : void => { + this.directives.push(this.DIRECTIVES_TYPES.SELECTABLE); + } + + public unmarkAsDependent = () : void => { + let index = this.directives.indexOf(this.DIRECTIVES_TYPES.SELECTABLE); + if(index >= 0) { + this.directives.splice(index, 1); + } + } } |