<tr *ngFor="let item of uploadedFiles; let i=index">
<th width="40"><img src="assets/img/icon-file-code.svg" /></th>
<th>{{ item.name }}</th>
- <th width="40" class="text-right"><img src="assets/img/icon-remove-file.svg" /></th>
+ <th (click)="removeInitFile(i)" width="40" class="text-right"><img
+ src="assets/img/icon-remove-file.svg" /></th>
</tr>
</thead>
</table>
}
});
}
-
+ removeInitFile(index) {
+ this.uploadedFiles.splice(index, 1);
+ }
public dropped(files: NgxFileDropEntry[]) {
this.files = files;
for (const droppedFile of files) {
<tr *ngFor="let item of uploadedFiles; let i=index">
<th width="40"><img src="assets/img/icon-file-code.svg" /></th>
<th>{{ item.name }}</th>
- <th width="40" class="text-right"><img src="assets/img/icon-remove-file.svg" /></th>
+ <th (click)="removeInitFile(i)" width="40" class="text-right"><img src="assets/img/icon-remove-file.svg" /></th>
</tr>
</thead>
</table>
<button (click)="resetTheUploadedFiles()" class="btn btn-sm btn-secondary" data-dismiss="modal"
type="button">Cancel
</button>
- <button (click)="setFilesToStore()" class="btn btn-sm btn-primary" data-dismiss="modal" type="button">
+ <button (click)="setFilesToStore()" class="btn btn-sm btn-primary" [disabled]="uploadedFiles?.length<=0" data-dismiss="modal" type="button">
Import
</button>
</div>
}
}
}
+
+ removeInitFile(index) {
+ this.uploadedFiles.splice(index, 1);
+ }
+
initDelete(file) {
this.fileToDelete = file;
}
-
<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 class="fa fa-chevron-left mr-2"></i>Template List</button>
+ <button (click)="closeCreationForm()" [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 (click)="cancel()" [disabled]="fileName?.length <=0" class="btn btn-outline-secondary">Cancel</button>
<tr *ngFor="let item of uploadedFiles; let i=index">
<th width="40"><img src="assets/img/icon-file-code.svg" /></th>
<th>{{ item.name }}</th>
- <th width="40" class="text-right"><img src="assets/img/icon-remove-file.svg" /></th>
+ <th (click)="removeFile(i)" width="40" class="text-right"><img src="assets/img/icon-remove-file.svg" /></th>
</tr>
</thead>
</table>
</div>
<div class="modal-footer">
- <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal"
+ <button type="button" class="btn btn-sm btn-secondary btn-cancel" data-dismiss="modal"
(click)="resetTheUploadedFiles()">Cancel
</button>
- <button (click)="uploadFile();openListView()" class="btn btn-sm btn-primary" data-dismiss="modal"
- type="button">
+ <button data-dismiss="modal" (click)="uploadFile()" class="btn btn-sm btn-primary" type="button">
Import
</button>
</div>
-import { Component, EventEmitter, OnDestroy, OnInit, Output, ViewChild, AfterViewInit, ElementRef } 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';
import { PackageCreationUtils } from '../../package-creation.utils';
import { JsonConvert, Any } from 'json2typescript';
import { ToastrService } from 'ngx-toastr';
-import { Router, ActivatedRoute } from '@angular/router';
+import { ActivatedRoute } from '@angular/router';
import { SharedService } from '../shared-service';
+declare var $: any;
@Component({
selector: 'app-templ-mapp-creation',
}
}
}
+ removeFile(index) {
+ this.uploadedFiles.splice(index, 1);
+ }
uploadFile() {
this.dependancies.clear();
} else {
this.setTemplateFilesToStore();
}
+ $('.btn-cancel').click();
+
+
}
fetchCSVkeys() {