From 6cffd9e3eecb10281d880ea7d217f0ecddf8fb5a Mon Sep 17 00:00:00 2001 From: vasraz Date: Thu, 31 Mar 2022 13:35:04 +0100 Subject: Update Interface definition on VFC Signed-off-by: aribeiro Change-Id: I13678c92ae6088016a78554ffaf0da47b82f7e65 Signed-off-by: Vasyl Razinkov Issue-ID: SDC-3893 Signed-off-by: andre.schmid --- catalog-ui/src/app/models/interfaceOperation.ts | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'catalog-ui/src/app/models/interfaceOperation.ts') diff --git a/catalog-ui/src/app/models/interfaceOperation.ts b/catalog-ui/src/app/models/interfaceOperation.ts index 9d8ab366a2..0768054df3 100644 --- a/catalog-ui/src/app/models/interfaceOperation.ts +++ b/catalog-ui/src/app/models/interfaceOperation.ts @@ -103,6 +103,10 @@ export class BEInterfaceOperationModel { } export class InterfaceOperationModel extends BEInterfaceOperationModel { + isCollapsed: boolean = true; + isEllipsis: boolean; + MAX_LENGTH = 75; + interfaceType: string; interfaceId: string; operationType: string; @@ -127,9 +131,22 @@ export class InterfaceOperationModel extends BEInterfaceOperationModel { public displayType(): string { return displayType(this.interfaceType); } + + getDescriptionEllipsis(): string { + if (this.isCollapsed && this.description.length > this.MAX_LENGTH) { + return this.description.substr(0, this.MAX_LENGTH - 3) + '...'; + } + return this.description; + } + + toggleCollapsed(e) { + e.stopPropagation(); + this.isCollapsed = !this.isCollapsed; + } + } -export class ComponentInstanceInterfaceModel { +export class ComponentInterfaceDefinitionModel { type: string; uniqueId: string; operations: Array; -- cgit 1.2.3-korg