summaryrefslogtreecommitdiffstats
path: root/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation
diff options
context:
space:
mode:
authorAhmedEldeeb50 <ahmed.eldeeb.ext@orange.com>2020-06-23 16:21:03 +0200
committerAhmedEldeeb50 <ahmed.eldeeb.ext@orange.com>2020-06-23 16:21:03 +0200
commit491fc69cb8a3e32f6c1becc1b74adc1922601ab7 (patch)
tree16460cda8e5e15f91e2fc2cd36ad22cc4d9099ed /cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation
parent7434214a2126de38769b35896d8e776aeb8fded3 (diff)
Fix template&mapping in view/create
Issue-ID: CCSDK-2450 Signed-off-by: AhmedEldeeb50 <ahmed.eldeeb.ext@orange.com> Change-Id: If84fba1cb7835cd3338767f9546bce0544d3dd1c
Diffstat (limited to 'cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation')
-rw-r--r--cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.html6
-rw-r--r--cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.ts23
2 files changed, 15 insertions, 14 deletions
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 cdc73f1b9..e1b0f83d6 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
@@ -1,12 +1,12 @@
<div class="row template-mapping-action">
<div class="col">
<h6 [hidden]="edit" class="create-title">Create Template</h6>
- <button (click)="closeCreationForm()" [hidden]="!edit" class="btn btn-outline-secondary"><i
+ <button (click)="openListView()" [hidden]="!edit" class="btn btn-outline-secondary"><i
class="fa fa-chevron-left mr-2"></i>Template List</button>
</div>
<div class="col text-right">
- <button data-toggle="modal" [hidden]="!edit" (click)="initDelete()" data-target="#templateDeletionModal2"
+ <button data-toggle="modal" [hidden]="!edit" data-target="#templateDeletionModal2"
class="btn btn-outline-danger" title="Delete Template">Delete</button>
@@ -301,4 +301,4 @@
</div>
</div>
</div>
-</div>
+</div> \ No newline at end of file
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 f6bae0600..af7acc2d0 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
@@ -18,11 +18,11 @@ declare var $: any;
styleUrls: ['./templ-mapp-creation.component.css']
})
export class TemplMappCreationComponent implements OnInit, OnDestroy {
- @Output() showListViewParent = new EventEmitter<any>();
- @Output() openList = new EventEmitter<any>();
+ @Output() showListView = new EventEmitter<any>();
+ @Output() showCreationView = new EventEmitter<any>();
public uploadedFiles: FileSystemFileEntry[] = [];
- private fileNames: Set<string> = new Set();
- private jsonConvert = new JsonConvert();
+ fileNames: Set<string> = new Set();
+ jsonConvert = new JsonConvert();
public files: NgxFileDropEntry[] = [];
fileName: any;
templateInfo = new TemplateInfo();
@@ -179,8 +179,6 @@ export class TemplMappCreationComponent implements OnInit, OnDestroy {
this.uploadedFiles.splice(index, 1);
}
- initDelete(file) {
- }
confirmDelete() {
// Delete from templates
this.sharedService.deleteFromList(this.fileName);
@@ -191,7 +189,7 @@ export class TemplMappCreationComponent implements OnInit, OnDestroy {
this.packageCreationStore.state.templates.files.size > 0 ||
this.packageCreationStore.state.mapping.files.size > 0
) {
- this.closeCreationForm();
+ this.openListView();
}
}
@@ -267,11 +265,13 @@ export class TemplMappCreationComponent implements OnInit, OnDestroy {
}
openListView() {
- this.showListViewParent.emit('tell parent to open create views');
+ console.log('open List view');
+ this.showListView.emit('tell parent to open create views');
}
- closeCreationForm() {
- this.openList.emit('close create form and open list');
+ openCreationView() {
+ console.log('close creation view');
+ this.showCreationView.emit('close create form and open list');
}
getMappingTableFromTemplate(e) {
@@ -337,7 +337,7 @@ export class TemplMappCreationComponent implements OnInit, OnDestroy {
// }
this.fileName = '';
this.toastr.success('File is created', 'success');
- this.closeCreationForm();
+ this.openListView();
} else {
console.log('this file already exist');
this.toastr.error('File name already exist', 'Error');
@@ -351,6 +351,7 @@ export class TemplMappCreationComponent implements OnInit, OnDestroy {
selectSource(dict, e) {
const source = e.target.value;
let keyDepend = null;
+ this.dependancies.set(dict.name, null);
try {
keyDepend = dict.definition.sources[source].properties['key-dependencies'] || null;
} catch (e) { }