From d5b29fb6603dfc21bc516238611b1c7cc7e8f57d Mon Sep 17 00:00:00 2001 From: Ahmedeldeeb50 Date: Sun, 4 Oct 2020 10:06:09 +0200 Subject: add cacncel button to template creation Issue-ID: CCSDK-2795 Signed-off-by: Ahmedeldeeb50 Change-Id: I3415f81b975ae8e7d9f0686386bda18a4f701591 --- .../templ-mapp-creation/templ-mapp-creation.component.html | 4 +++- .../templ-mapp-creation/templ-mapp-creation.component.ts | 10 ++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation') 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 429fa4193..de97a4679 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 @@ -5,9 +5,11 @@ class="fa fa-chevron-left mr-2">Template List
+ - 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 2971ecad9..8c4eab8f5 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 @@ -1,4 +1,4 @@ -import { Component, EventEmitter, OnDestroy, OnInit, Output, ViewChild } from '@angular/core'; +import {Component, EventEmitter, OnDestroy, OnInit, Output, ViewChild } from '@angular/core'; import { FileSystemFileEntry, NgxFileDropEntry } from 'ngx-file-drop'; import { PackageCreationStore } from '../../package-creation.store'; import { TemplateInfo, TemplateStore } from '../../template.store'; @@ -52,6 +52,7 @@ export class TemplMappCreationComponent implements OnInit, OnDestroy { currentTemplate: any; currentMapping: any; edit = false; + templatesExist = false; fileToDelete: any = {}; parserFactory: ParserFactory; selectedProps: Set; @@ -107,6 +108,8 @@ export class TemplMappCreationComponent implements OnInit, OnDestroy { this.sharedService.isEdit().subscribe(res => { console.log('------------------------....'); + this.templatesExist = this.packageCreationStore.state.templates.files.size > 0 + || this.packageCreationStore.state.mapping.files.size > 0; console.log(res); this.edit = res; @@ -397,7 +400,7 @@ export class TemplMappCreationComponent implements OnInit, OnDestroy { } return map.key; } - cancel() { + clear() { this.fileName = ''; this.templateFileContent = ''; this.resourceDictionaryRes = []; @@ -406,6 +409,9 @@ export class TemplMappCreationComponent implements OnInit, OnDestroy { this.currentTemplate = {}; // this.closeCreationForm(); } + cancel() { + this.openListView(); + } saveToStore() { if (this.fileName) { // check file duplication -- cgit 1.2.3-korg