summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/models/operation.ts
diff options
context:
space:
mode:
authorArielk <Ariel.Kenan@amdocs.com>2019-05-13 15:30:27 +0300
committerAvi Gaffa <avi.gaffa@amdocs.com>2019-05-13 14:50:55 +0000
commit3d5b80b9035b9832f86326858b4c6c2cecd952a3 (patch)
tree62109696bdc736bd2c7d3bfb68d730a2b44a3946 /catalog-ui/src/app/models/operation.ts
parent8364c2d4c986e37cc1ea7e4120f5d13d14b03067 (diff)
operation artifact optional and fixes
Change-Id: Ibce96d60248b26716ed518747444836b437f209f Issue-ID: SDC-2249 Signed-off-by: Arielk <Ariel.Kenan@amdocs.com>
Diffstat (limited to 'catalog-ui/src/app/models/operation.ts')
-rw-r--r--catalog-ui/src/app/models/operation.ts19
1 files changed, 12 insertions, 7 deletions
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);