aboutsummaryrefslogtreecommitdiffstats
path: root/cds-ui/designer-client
diff options
context:
space:
mode:
authorKAPIL SINGAL <ks220y@att.com>2021-01-19 04:17:52 +0000
committerGerrit Code Review <gerrit@onap.org>2021-01-19 04:17:52 +0000
commit6281b63c9b417e3bf8826d9c2a61e8f3781f3d71 (patch)
tree0931d61b4eba42ac403b8d6c1d363a09f3403a0d /cds-ui/designer-client
parentfc5fa67b192b25a6507212cf1b3082134c6cb2a6 (diff)
parent529d7205b6b3cc36abe4dd2fb507e3c10bb38a79 (diff)
Merge "Remove save button from function Attributes tab"
Diffstat (limited to 'cds-ui/designer-client')
-rw-r--r--cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/functions-attribute/functions-attribute.component.html15
-rw-r--r--cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/functions-attribute/functions-attribute.component.ts33
-rw-r--r--cds-ui/designer-client/tslint.json3
3 files changed, 37 insertions, 14 deletions
diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/functions-attribute/functions-attribute.component.html b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/functions-attribute/functions-attribute.component.html
index a3e662d0f..52b66a3a1 100644
--- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/functions-attribute/functions-attribute.component.html
+++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/functions-attribute/functions-attribute.component.html
@@ -87,8 +87,8 @@
class="icon-required-star" type="button"
[ngClass]="{'optional-attribute' : getValue(requiredInput,requiredInputs).required==false}"
aria-hidden="true"></i></label>
- <input [(ngModel)]="currentFuncion['inputs'][requiredInput]" type="text"
- class="form-control">
+ <input [(ngModel)]="currentFuncion['inputs'][requiredInput]"
+ (focusout)="saveFunctionData()" type="text" class="form-control">
</div>
<!--JSON
<div *ngIf="getValue(requiredInput,requiredInputs).type=='json'"
@@ -109,7 +109,7 @@
[ngClass]="{'optional-attribute' : getValue(requiredInput,requiredInputs).required==false}"
aria-hidden="true"></i></label>
<input [(ngModel)]="currentFuncion['inputs'][requiredInput]" type="number"
- class="form-control" placeholder="">
+ (focusout)="saveFunctionData()" class="form-control" placeholder="">
</div>
<!--boolean-->
<!-- <div *ngIf="getValue(requiredInput,requiredInputs).type=='boolean'"> -->
@@ -123,7 +123,7 @@
<div class="custom-control custom-radio custom-control-inline">
<input [value]="true"
[(ngModel)]="currentFuncion['inputs'][requiredInput]" type="radio"
- id="{{'functionRadioInline' + i}}"
+ id="{{'functionRadioInline' + i}}" (focusout)="saveFunctionData()"
name="{{'functionRadioInline' + i}}" class="custom-control-input">
<label class="custom-control-label"
for="{{'functionRadioInline' + i}}">True</label>
@@ -132,7 +132,8 @@
<input [value]="false"
[(ngModel)]="currentFuncion['inputs'][requiredInput]" type="radio"
id="{{'functionRadioInline' + i+'-a'}}"
- name="{{'functionRadioInline' + i}}" class="custom-control-input">
+ (focusout)="saveFunctionData()" name="{{'functionRadioInline' + i}}"
+ class="custom-control-input">
<label class="custom-control-label"
for="{{'functionRadioInline' + i+'-a'}}">False</label>
</div>
@@ -179,7 +180,7 @@
<label for="exampleInputEmail1">{{ requiredOutput }} <i class="icon-required-star"
type="button" aria-hidden="true"></i></label>
<input [(ngModel)]="currentFuncion['outputs'][requiredOutput]" type=" text"
- class="form-control">
+ (focusout)="saveFunctionData()" class="form-control">
</div>
</div>
</div>
@@ -218,7 +219,7 @@
</div>
</div>
<br />
- <button class="btn btn-select-template m-auto" (click)="saveFunctionData()">Save</button>
+ <!-- <button class="btn btn-select-template m-auto" (click)="saveFunctionData()">Save</button> -->
</div>
<!--function - Select Template - Modal-->
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 70ccb7305..86552b7db 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
@@ -97,6 +97,8 @@ export class FunctionsAttributeComponent implements OnInit, OnDestroy {
}
+
+
onInitMapping() {
// selectedTemplates , templateAndMappingMap
// this.selectedTemplates = new Map<string, TemplateAndMapping>();
@@ -121,6 +123,7 @@ export class FunctionsAttributeComponent implements OnInit, OnDestroy {
this.selectedTemplates = new Map(this.finalTemplates);
}
+
toNodeProcess(nodeTemplate, functionName) {
console.log(nodeTemplate);
this.currentFuncion['instance-name'] = functionName;
@@ -139,11 +142,11 @@ export class FunctionsAttributeComponent implements OnInit, OnDestroy {
if (inputs) {
for (const [key, value] of Object.entries(inputs)) {
console.log(key + ' - ' + value);
- /* if (typeof value === 'object' || this.isValidJson(value)) {
- this.currentFuncion.inputs[key] = JSON.stringify(value);
- } else {*/
+ /* if (typeof value === 'object' || this.isValidJson(value)) {
+ this.currentFuncion.inputs[key] = JSON.stringify(value);
+ } else {*/
this.currentFuncion.inputs[key] = value;
- // }
+ // }
}
}
if (outputs) {
@@ -183,11 +186,25 @@ export class FunctionsAttributeComponent implements OnInit, OnDestroy {
addTemplates() {
this.finalTemplates = new Map(this.selectedTemplates);
+ this.saveFunctionData();
}
cancel() {
this.selectedTemplates = new Map<string, TemplateAndMapping>();
}
+ setProcessAttr(isInput, key, e) {
+ console.log(e.target.value);
+ // tslint:disable-next-line: no-string-literal
+ if (isInput) {
+ this.currentFuncion['inputs'][key] = e.target.value;
+ } else {
+ this.currentFuncion['outputs'][key] = e.target.value;
+ }
+
+
+ this.saveFunctionData();
+ }
+
saveFunctionData() {
this.nodeTemplates = new NodeTemplate('');
// tslint:disable-next-line: variable-name
@@ -196,6 +213,8 @@ export class FunctionsAttributeComponent implements OnInit, OnDestroy {
// tslint:disable-next-line: no-string-literal
const type = finalFunctionData['type'];
const instanceName = finalFunctionData['instance-name'];
+ finalFunctionData.inputs['artifact-prefix-names'] = [];
+
// insert selected templates in nodeTemplates.artifacts
this.selectedTemplates.forEach((value, key) => {
console.log(key);
@@ -226,7 +245,6 @@ 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;
@@ -254,7 +272,7 @@ export class FunctionsAttributeComponent implements OnInit, OnDestroy {
// tslint:disable-next-line: no-unused-expression
this.designerStore.addNodeTemplate(instanceName, type, node_templates[instanceName]);
// create a new package
- this.saveEvent.emit('save');
+ // this.saveEvent.emit('save');
}
// Template logic
private setIsMappingOrTemplate(key: string, templateAndMapping: TemplateAndMapping, isFromTemplate: boolean) {
@@ -286,7 +304,10 @@ export class FunctionsAttributeComponent implements OnInit, OnDestroy {
setTemplate(file: string) {
if (this.selectedTemplates.has(file)) {
+ console.log('Not exist');
this.selectedTemplates.delete(file);
+ this.finalTemplates.delete(file);
+
} else {
this.selectedTemplates.set(file, this.templateAndMappingMap.get(file));
}
diff --git a/cds-ui/designer-client/tslint.json b/cds-ui/designer-client/tslint.json
index f85fc68d9..d3dd2da59 100644
--- a/cds-ui/designer-client/tslint.json
+++ b/cds-ui/designer-client/tslint.json
@@ -71,6 +71,7 @@
true,
"single"
],
+ "no-string-literal": false,
"trailing-comma": false,
"no-conflicting-lifecycle": true,
"no-host-metadata-property": true,
@@ -88,4 +89,4 @@
"rulesDirectory": [
"codelyzer"
]
-}
+} \ No newline at end of file