From 3d5b80b9035b9832f86326858b4c6c2cecd952a3 Mon Sep 17 00:00:00 2001 From: Arielk Date: Mon, 13 May 2019 15:30:27 +0300 Subject: operation artifact optional and fixes Change-Id: Ibce96d60248b26716ed518747444836b437f209f Issue-ID: SDC-2249 Signed-off-by: Arielk --- catalog-ui/src/app/models/operation.ts | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'catalog-ui/src/app/models/operation.ts') diff --git a/catalog-ui/src/app/models/operation.ts b/catalog-ui/src/app/models/operation.ts index 7b0039b184..bf037729e4 100644 --- a/catalog-ui/src/app/models/operation.ts +++ b/catalog-ui/src/app/models/operation.ts @@ -39,7 +39,10 @@ export class BEOperationModel { workflowId: string; workflowVersionId: string; - implementation?: { artifactUUID: string; }; + implementation?: { + artifactName: string; + artifactUUID: string; + }; constructor(operation?: any) { if (operation) { @@ -53,7 +56,7 @@ export class BEOperationModel { this.workflowAssociationType = operation.workflowAssociationType; this.workflowId = operation.workflowId; this.workflowVersionId = operation.workflowVersionId; - this.implementation = operation.implementation; + this.implementation = operation.implementation || {}; } } @@ -76,7 +79,7 @@ export class BEOperationModel { export class OperationModel extends BEOperationModel { interfaceType: string; interfaceId: string; - artifactFile: any; + artifactFileName: string; artifactData: any; constructor(operation?: any) { @@ -84,12 +87,13 @@ export class OperationModel extends BEOperationModel { if (operation) { this.interfaceId = operation.interfaceId; this.interfaceType = operation.interfaceType; + this.artifactFileName = operation.artifactFileName; + this.artifactData = operation.artifactData; } } public displayType(): string { - const lastDot = this.interfaceType ? this.interfaceType.lastIndexOf('.') : -1; - return lastDot === -1 ? this.interfaceType : this.interfaceType.substr(lastDot + 1); + return displayType(this.interfaceType); } } @@ -107,7 +111,8 @@ export class InterfaceModel { } public displayType(): string { - const lastDot = this.type ? this.type.lastIndexOf('.') : -1; - return lastDot === -1 ? this.type : this.type.substr(lastDot + 1); + return displayType(this.type); } } + +const displayType = (type:string) => type && type.substr(type.lastIndexOf('.') + 1); -- cgit 1.2.3-korg