From bb8b842d5d405874c745e054afeffb0e20bc2865 Mon Sep 17 00:00:00 2001 From: Ahmedeldeeb50 Date: Mon, 19 Oct 2020 22:39:16 +0200 Subject: handle integer and checkbox in functional attribute. Fix finish problem in Mapping. Issue-ID: CCSDK-2900 Signed-off-by: Ahmedeldeeb50 Change-Id: I08697cb61814db37144f66f7f15773d3c02c9848 --- .../functions-attribute.component.html | 99 ++++++++++++++-------- .../functions-attribute.component.ts | 46 +++++++++- .../designer/model/desinger.nodeTemplate.model.ts | 8 ++ .../packages/designer/model/nodeTemplates.ts | 5 ++ .../templ-mapp-creation.component.html | 9 +- .../templ-mapp-creation.component.ts | 9 +- 6 files changed, 133 insertions(+), 43 deletions(-) create mode 100644 cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/model/nodeTemplates.ts (limited to 'cds-ui') 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 115bf6d54..3107c9368 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 @@ -3,7 +3,8 @@
- +
@@ -11,7 +12,8 @@
- +
@@ -50,20 +52,22 @@
-
- -
- -

@@ -71,42 +75,63 @@ class="btn btn-select-template m-auto"> Select Template
- -
-
+ +
+ +
- -
-
- - - - +
+ +
-
- - -
-
- - + + +
+
+ +
+ + +

+
+ + +
+ +
+ + + +
@@ -140,7 +165,8 @@
- +
@@ -178,6 +204,7 @@ + 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 4eee1f30c..624f9c7a8 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 @@ -6,6 +6,7 @@ import { distinctUntilChanged, takeUntil } from 'rxjs/operators'; import { CBAPackage } from '../../package-creation/mapping-models/CBAPacakge.model'; import { TemplateAndMapping } from '../../package-creation/template-mapping/TemplateAndMapping'; import { FunctionsStore } from '../functions.store'; +import { NodeProcess, NodeTemplate } from '../model/desinger.nodeTemplate.model'; @Component({ selector: 'app-functions-attribute', @@ -25,6 +26,8 @@ export class FunctionsAttributeComponent implements OnInit, OnDestroy { OptionalInputs = new Map(); optionalOutputs = new Map(); artifactPrefix = false; + currentFuncion = new NodeProcess(); + nodeTemplates = new NodeTemplate(''); constructor( private designerStore: DesignerStore, @@ -70,8 +73,42 @@ export class FunctionsAttributeComponent implements OnInit, OnDestroy { this.ngUnsubscribe.next(); this.ngUnsubscribe.complete(); } - // Template logic + displayFunctionData() { + this.selectedTemplates.forEach((value, key) => { + console.log(key); + console.log(value); + + if (value.isMapping) { + this.nodeTemplates.artifacts[key + '-mapping'] = { + type: 'artifact-mapping-resource', + file: 'Templates/' + key + '-mapping.json' + }; + } + + if (value.isTemplate) { + this.nodeTemplates.artifacts[key + '-template'] = { + type: 'artifact-template-resource', + file: 'Templates/' + key + '-template.vtl' + }; + } + }); + this.nodeTemplates.interfaces = { + ResourceResolutionComponent: { + operations: { + process: { + ...this.currentFuncion + } + } + } + }; + setTimeout(() => { + console.log(this.currentFuncion); + console.log(this.nodeTemplates); + + }, 1500); + } + // Template logic private setIsMappingOrTemplate(key: string, templateAndMapping: TemplateAndMapping, isFromTemplate: boolean) { const nameOfFile = isFromTemplate ? key.split('/')[1].split('.')[0].split('-template')[0] @@ -88,6 +125,13 @@ export class FunctionsAttributeComponent implements OnInit, OnDestroy { } addTemplates() { } + setArtifact(predefined: boolean) { + if (predefined) { + + } else { + this.currentFuncion.inputs['artifact-prefix-names'] = { get_input: 'template-prefix' }; + } + } addToInputs(optionalInput) { this.requiredInputs.set(optionalInput, this.OptionalInputs.get(optionalInput)); this.OptionalInputs.delete(optionalInput); diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/model/desinger.nodeTemplate.model.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/model/desinger.nodeTemplate.model.ts index 8715e44c2..bd3240b88 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/model/desinger.nodeTemplate.model.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/model/desinger.nodeTemplate.model.ts @@ -11,5 +11,13 @@ export class NodeTemplate { constructor(type) { this.type = type; this.properties = {}; + this.artifacts = {}; + this.interfaces = {}; } } + +export class NodeProcess { + inputs: {} = {}; + outputs: {} = {}; +} + diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/model/nodeTemplates.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/model/nodeTemplates.ts new file mode 100644 index 000000000..2baae2cc9 --- /dev/null +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/model/nodeTemplates.ts @@ -0,0 +1,5 @@ +export class Nodetemplates { + type: string; + interfaces: {}; + artifacts: {}; +} diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.html b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.html index 70b1644ab..82010db1c 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.html +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.html @@ -149,12 +149,13 @@ ({{resourceDictionaryRes.length}} attributes in total) - + + Filter - +
@@ -262,8 +263,8 @@ Filter - -
+ +
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 0bf4d9c54..a26f3b90e 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 @@ -74,8 +74,8 @@ export class TemplMappCreationComponent implements OnInit, OnDestroy, AfterViewI dataSource: MatTableDataSource<{}>; initDataSource: MatTableDataSource<{}>; // dataSource = new MatTableDataSource(); - @ViewChild(MatPaginator, { static: true }) paginator: MatPaginator; - @ViewChild(MatSort, { static: true }) sort: MatSort; + @ViewChild('paginate', { static: true }) paginator: MatPaginator; + @ViewChild('sort', { static: true }) sort: MatSort; @ViewChild(MatPaginator, { static: true }) initPaginator: MatPaginator; @ViewChild(MatSort, { static: true }) initSort: MatSort; @@ -519,6 +519,11 @@ export class TemplMappCreationComponent implements OnInit, OnDestroy, AfterViewI rerender(): void { this.initDataSource = new MatTableDataSource(this.resourceDictionaryRes); // this.cdr.detectChanges(); + /* + Hint: the intial page size for the table will be the result size; I did that because the table doesn't load element in DOM, + as result some function are not working well like save and you have to move to other pages to fix that. + */ + this.initPaginator.pageSize = this.resourceDictionaryRes.length; this.initDataSource.paginator = this.initPaginator; this.initDataSource.sort = this.initSort; } -- cgit 1.2.3-korg
Required