From bb91b6eedec5d15ec4d9e473f27dd63592762cf9 Mon Sep 17 00:00:00 2001 From: Ahmedeldeeb50 Date: Tue, 12 Jan 2021 13:07:45 +0200 Subject: Add icon beside the selected templates in Function attributes tab update create_resource_dictionary API Issue-ID: CCSDK-3082 Issue-ID: CCSDK-3078 Signed-off-by: Ahmedeldeeb50 Change-Id: Ic5038dfba0c7b59c5e51096b9864aa0baff56c2b --- .../src/app/common/constants/app-constants.ts | 105 +++++++++++---------- .../functions-attribute.component.html | 3 +- .../dictionary-creation.service.ts | 2 +- .../resource-dictionary-creation.component.ts | 11 ++- 4 files changed, 64 insertions(+), 57 deletions(-) (limited to 'cds-ui/designer-client/src') diff --git a/cds-ui/designer-client/src/app/common/constants/app-constants.ts b/cds-ui/designer-client/src/app/common/constants/app-constants.ts index 51b183640..6f64ee1e8 100644 --- a/cds-ui/designer-client/src/app/common/constants/app-constants.ts +++ b/cds-ui/designer-client/src/app/common/constants/app-constants.ts @@ -25,63 +25,63 @@ export const GlobalContants = { endpoints: {}, cbawizard: { stepsRequired: + { + stepCount: 4, + steps: [{ + name: 'CBA Metadata', + componentURL: '/controllerBlueprint/selectTemplate', + label: 'CBA Metadata', + link: '/blueprint/selectTemplate', + index: 0, + component: 'SelectTemplateComponent' + }, { - stepCount: 4, - steps: [{ - name: 'CBA Metadata', - componentURL: '/controllerBlueprint/selectTemplate', - label: 'CBA Metadata', - link: '/blueprint/selectTemplate', - index: 0, - component: 'SelectTemplateComponent' - }, - { - name: 'Controller Blueprint Designer', - componentURL: '/controllerBlueprint/modifyTemplate', - label: 'Controller Blueprint Designer', - link: '/blueprint/modifyTemplate', - index: 1, - component: 'ModifyTemplateComponent' - }, - { - name: 'Test', - componentURL: '/controllerBlueprint/testTemplate', - label: 'Test', - link: '/blueprint/testTemplate', - index: 2, - component: 'TestTemplateComponent' - }, - { - name: 'Deploy', - componentURL: '/controllerBlueprint/deployTemplate', - label: 'Deploy', - link: '/blueprint/deployTemplate', - index: 3, - component: 'DeployTemplateComponent' - }] - } + name: 'Controller Blueprint Designer', + componentURL: '/controllerBlueprint/modifyTemplate', + label: 'Controller Blueprint Designer', + link: '/blueprint/modifyTemplate', + index: 1, + component: 'ModifyTemplateComponent' + }, + { + name: 'Test', + componentURL: '/controllerBlueprint/testTemplate', + label: 'Test', + link: '/blueprint/testTemplate', + index: 2, + component: 'TestTemplateComponent' + }, + { + name: 'Deploy', + componentURL: '/controllerBlueprint/deployTemplate', + label: 'Deploy', + link: '/blueprint/deployTemplate', + index: 3, + component: 'DeployTemplateComponent' + }] + } }, datadictionary: { stepsRequired: - { - stepCount: 3, - steps: [{ - name: 'Resource Creation', componentURL: '/dataDictionary/selectTemplate', - label: 'Resource Creation', - component: 'ResourceCreationComponent' + { + stepCount: 3, + steps: [{ + name: 'Resource Creation', componentURL: '/dataDictionary/selectTemplate', + label: 'Resource Creation', + component: 'ResourceCreationComponent' - }, - { - name: 'Edit/Validate', componentURL: '/dataDictionary/modifyTemplate', - label: 'Edit/Validate', - component: 'ResourceEditComponent' - }, - { - name: 'Save', componentURL: '/dataDictionary/saveTemplate', - label: 'Save Resource', - component: 'SaveResourceComponent' - }] - } + }, + { + name: 'Edit/Validate', componentURL: '/dataDictionary/modifyTemplate', + label: 'Edit/Validate', + component: 'ResourceEditComponent' + }, + { + name: 'Save', componentURL: '/dataDictionary/saveTemplate', + label: 'Save Resource', + component: 'SaveResourceComponent' + }] + } } }; @@ -105,6 +105,7 @@ export const BlueprintURLs = { export const ResourceDictionaryURLs = { saveResourceDictionary: '/resourcedictionary/save', + saveDictionary: '/resourcedictionary/definition', searchResourceDictionaryByTags: '/resourcedictionary/search', searchResourceDictionaryByName: '', searchResourceDictionaryByNames: '/resourcedictionary/search/by-names', 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 e619f3a88..a3e662d0f 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 @@ -237,6 +237,7 @@ - + \ No newline at end of file diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/dictionary-creation.service.ts b/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/dictionary-creation.service.ts index 445be2015..a1d614bc5 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/dictionary-creation.service.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/dictionary-creation.service.ts @@ -35,6 +35,6 @@ export class DictionaryCreationService { } save(metadata) { - return this.api.post(ResourceDictionaryURLs.saveResourceDictionary, { ...metadata }); + return this.api.post(ResourceDictionaryURLs.saveDictionary, { ...metadata }); } } diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/resource-dictionary-creation.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/resource-dictionary-creation.component.ts index c40679718..fb454ed1f 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/resource-dictionary-creation.component.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/resource-dictionary-creation.component.ts @@ -25,6 +25,7 @@ import { Definition } from '../model/definition.model'; import { DictionaryMetadataComponent } from './dictionary-metadata/dictionary-metadata.component'; import { SourcesTemplateComponent } from './sources-template/sources-template.component'; import { DictionaryCreationService } from './dictionary-creation.service'; +import { ToastrService } from 'ngx-toastr'; @Component({ selector: 'app-resource-dictionary-creation', @@ -36,7 +37,8 @@ export class ResourceDictionaryCreationComponent implements OnInit { constructor( private router: Router, private dictionaryCreationStore: DictionaryCreationStore, - private dictionaryService: DictionaryCreationService + private dictionaryService: DictionaryCreationService, + private toaster: ToastrService ) { } @@ -72,17 +74,20 @@ export class ResourceDictionaryCreationComponent implements OnInit { } createDictionary() { + console.log('-----'); this.metadataTabComponent.saveMetaDataToStore(); this.dictionaryCreationStore.state$.subscribe(res => { console.log('---------------------------------------'); console.log(res); this.dictionaryService.save(res.metaData).subscribe(data => { - + this.toaster.success('Dictionary Resource created'); }, err => { + this.toaster.error('An error happened ...'); + }, () => { }); - }); + }).unsubscribe(); // this.sourcesTemplateComponent.saveSorcesDataToStore(); } -- cgit 1.2.3-korg