operation artifact optional and fixes
Change-Id: Ibce96d60248b26716ed518747444836b437f209f
Issue-ID: SDC-2249
Signed-off-by: Arielk <Ariel.Kenan@amdocs.com>
diff --git a/catalog-ui/src/app/models/operation.ts b/catalog-ui/src/app/models/operation.ts
index 7b0039b..bf03772 100644
--- a/catalog-ui/src/app/models/operation.ts
+++ b/catalog-ui/src/app/models/operation.ts
@@ -39,7 +39,10 @@
workflowId: string;
workflowVersionId: string;
- implementation?: { artifactUUID: string; };
+ implementation?: {
+ artifactName: string;
+ artifactUUID: string;
+ };
constructor(operation?: any) {
if (operation) {
@@ -53,7 +56,7 @@
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 OperationModel extends BEOperationModel {
interfaceType: string;
interfaceId: string;
- artifactFile: any;
+ artifactFileName: string;
artifactData: any;
constructor(operation?: any) {
@@ -84,12 +87,13 @@
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 @@
}
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);