class="fa fa-chevron-left mr-2"></i>Template List</button>
</div>
<div class="col text-right">
+ <button (click)="cancel()" [hidden]="!templatesExist || edit" class="btn btn-outline-danger"
+ title="Delete Template">Cancel</button>
<button data-toggle="modal" [hidden]="!edit" data-target="#templateDeletionModal2"
class="btn btn-outline-danger" title="Delete Template">Delete</button>
- <button (click)="cancel()" [hidden]="fileName?.length <=0 || edit"
+ <button (click)="clear()" [hidden]="fileName?.length <=0 || edit"
class="btn btn-outline-secondary">Clear</button>
<button tourAnchor="tm-templateFinish" (click)="saveToStore()" [disabled]="fileName?.length <=0"
title="Submit template and close" class="btn btn-primary">Finish</button>
-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';
currentTemplate: any;
currentMapping: any;
edit = false;
+ templatesExist = false;
fileToDelete: any = {};
parserFactory: ParserFactory;
selectedProps: Set<string>;
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;
}
return map.key;
}
- cancel() {
+ clear() {
this.fileName = '';
this.templateFileContent = '';
this.resourceDictionaryRes = [];
this.currentTemplate = {};
// this.closeCreationForm();
}
+ cancel() {
+ this.openListView();
+ }
saveToStore() {
if (this.fileName) {
// check file duplication