aboutsummaryrefslogtreecommitdiffstats
path: root/cds-ui/designer-client/src/app/modules/feature-modules
diff options
context:
space:
mode:
authorAhmedeldeeb50 <ahmed.eldeeb.ext@orange.com>2020-11-23 11:12:04 +0200
committerAhmed Eldeeb <ahmed.eldeeb.ext@orange.com>2020-11-23 09:43:25 +0000
commit404e8af1a9f4de2cad05097a8861560560305d79 (patch)
treee5ecb8e2392bd93d9887d73db6dfc545511556fd /cds-ui/designer-client/src/app/modules/feature-modules
parent36db9a541fc469cd59649729243471cf7a8aef3e (diff)
remove output&properties from JSON if they are empty.
fix delete button in template&mapping. Issue-ID: CCSDK-2900 Signed-off-by: Ahmedeldeeb50 <ahmed.eldeeb.ext@orange.com> Change-Id: Ice491108959b4daf2a2575feac566c68696032ab
Diffstat (limited to 'cds-ui/designer-client/src/app/modules/feature-modules')
-rw-r--r--cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.component.ts4
-rw-r--r--cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/functions-attribute/functions-attribute.component.ts8
-rw-r--r--cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.ts11
3 files changed, 11 insertions, 12 deletions
diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.component.ts
index a2b57d6ad..3011dd790 100644
--- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.component.ts
+++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.component.ts
@@ -138,10 +138,6 @@ export class DesignerComponent implements OnInit, OnDestroy {
});
}
- // private _toggleSidebar3() {
- // this.functionAttributeSidebar = !this.functionAttributeSidebar;
- // }
-
/**
* - There is a board (main paper) that will the action and function selected from the palette
diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/functions-attribute/functions-attribute.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/functions-attribute/functions-attribute.component.ts
index 3890a980d..6ebf536b5 100644
--- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/functions-attribute/functions-attribute.component.ts
+++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/functions-attribute/functions-attribute.component.ts
@@ -195,12 +195,17 @@ export class FunctionsAttributeComponent implements OnInit, OnDestroy {
// instantiate the final node_template object to save
this.nodeTemplates.type = type;
+ delete this.nodeTemplates.properties;
node_templates[finalFunctionData['instance-name']] = this.nodeTemplates;
delete finalFunctionData['instance-name'];
// tslint:disable-next-line: no-string-literal
delete finalFunctionData['type'];
+ if (finalFunctionData.outputs === {} || Object.keys(finalFunctionData.outputs).length <= 0) {
+ delete finalFunctionData.outputs;
+ }
+
this.nodeTemplates.interfaces = {
[this.interfaceChildName]: {
operations: {
@@ -210,11 +215,12 @@ export class FunctionsAttributeComponent implements OnInit, OnDestroy {
}
}
};
-
console.log(finalFunctionData);
console.log(node_templates);
+ // save function to store
// tslint:disable-next-line: no-unused-expression
this.designerStore.addNodeTemplate(instanceName, type, node_templates[instanceName]);
+ // create a new package
this.saveEvent.emit('save');
}
// Template logic
diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.ts
index 4087dee3e..e49d7a4cd 100644
--- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.ts
+++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.ts
@@ -282,15 +282,12 @@ export class TemplMappCreationComponent implements OnInit, OnDestroy, AfterViewI
confirmDelete() {
// Delete from templates
this.sharedService.deleteFromList(this.fileName);
- this.packageCreationStore.state.templates.files.delete(this.fileToDelete);
+ console.log('Templates/' + this.fileName + '-template.' + this.templateInfo.ext);
+ this.packageCreationStore.state.templates.files.delete('Templates/' + this.fileName + '-template.' + this.templateInfo.ext);
// Delete from Mapping
this.packageCreationStore.state.mapping.files.delete(this.fileToDelete);
- if (
- this.packageCreationStore.state.templates.files.size > 0 ||
- this.packageCreationStore.state.mapping.files.size > 0
- ) {
- this.openListView();
- }
+ this.openListView();
+
}
uploadFile() {