diff options
author | 2020-06-23 16:01:14 +0000 | |
---|---|---|
committer | 2020-06-23 16:01:14 +0000 | |
commit | c1ba2446334c41117ac67bd4a9288fe5cc8b9d1b (patch) | |
tree | bdc6dbff3438d10cb5f54966a2ab7509c7f1a3e7 /cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-listing/templ-mapp-listing.component.ts | |
parent | 42b3d82ccbe1f0cdf7fa46f605d9f5a2fd96364d (diff) | |
parent | 491fc69cb8a3e32f6c1becc1b74adc1922601ab7 (diff) |
Merge "Fix template&mapping in view/create"
Diffstat (limited to 'cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-listing/templ-mapp-listing.component.ts')
-rw-r--r-- | cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-listing/templ-mapp-listing.component.ts | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-listing/templ-mapp-listing.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-listing/templ-mapp-listing.component.ts index c790422c1..26740f3e1 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-listing/templ-mapp-listing.component.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-listing/templ-mapp-listing.component.ts @@ -13,11 +13,11 @@ import { SharedService } from '../shared-service'; styleUrls: ['./templ-mapp-listing.component.css'] }) export class TemplMappListingComponent implements OnInit { - @Output() showCreationViewParentNotification = new EventEmitter<any>(); - @Output() showFullView = new EventEmitter<any>(); - private templateAndMappingMap = new Map<string, TemplateAndMapping>(); - private templates: Template; - private mapping: Mapping; + @Output() showCreationView = new EventEmitter<any>(); + @Output() showListView = new EventEmitter<any>(); + templateAndMappingMap = new Map<string, TemplateAndMapping>(); + templates: Template; + mapping: Mapping; isCreate = true; currentFile: string; edit = false; @@ -40,6 +40,11 @@ export class TemplMappListingComponent implements OnInit { } this.packageCreationStore.state$.subscribe(cba => { + if (this.packageCreationStore.state.mapping.files.size > 0 || this.packageCreationStore.state.templates.files.size > 0) { + this.openListView(); + } else { + this.openCreationView(); + } if (cba.templates) { this.templates = cba.templates; this.mapping = cba.mapping; @@ -58,7 +63,6 @@ export class TemplMappListingComponent implements OnInit { const isFromTemplate = false; this.setIsMappingOrTemplate(key, templateAndMapping, isFromTemplate); }); - console.log('hello there '); console.log(this.templateAndMappingMap); } this.deleteFromList(); @@ -83,6 +87,7 @@ export class TemplMappListingComponent implements OnInit { console.log('response from actionList'); console.log(res); if (res) { + console.log('xccccccccccvvvvvv'); this.templateAndMappingMap.delete(res); if (this.templateAndMappingMap.size <= 0) { this.openCreationView(); @@ -91,14 +96,17 @@ export class TemplMappListingComponent implements OnInit { }); } + createNewTemplate() { + this.openCreationView(); + this.sharedService.disableEdit(); + } openCreationView() { - this.showCreationViewParentNotification.emit('tell parent to open create views'); + this.showCreationView.emit('tell parent to open create views'); console.log('disable edit mode'); - this.sharedService.disableEdit(); - } - FullView() { - this.showFullView.emit('show full view'); + openListView() { + console.log('open list view'); + this.showListView.emit('show full view'); } setSourceCodeEditor(key: string) { @@ -125,7 +133,7 @@ export class TemplMappListingComponent implements OnInit { templateInfo.type += 'mapping'; } this.templateStore.changeTemplateInfo(templateInfo); - this.FullView(); + this.openCreationView(); this.sharedService.enableEdit(); }); } |