1 <div class="row template-mapping-action">
3 <h6 [hidden]="edit" class="create-title">Create Template</h6>
4 <button (click)="openListView()" [hidden]="!edit" class="btn btn-outline-secondary"><i
5 class="fa fa-chevron-left mr-2"></i>Template List</button>
7 <div class="col text-right">
8 <button data-toggle="modal" [hidden]="!edit" data-target="#templateDeletionModal2"
9 class="btn btn-outline-danger" title="Delete Template">Delete</button>
10 <button (click)="cancel()" [hidden]="fileName?.length <=0 || edit"
11 class="btn btn-outline-secondary">Clear</button>
12 <button tourAnchor="tm-templateFinish" (click)="saveToStore()" [disabled]="fileName?.length <=0"
13 title="Submit template and close" class="btn btn-primary">Finish</button>
16 <div class="card creat-card">
17 <div class="single-line-model">
18 <label class="label-name">Name
19 <span _ngcontent-uew-c3="">*</span>
22 <div class="label-input">
23 <input tourAnchor="tm-templateName" type="input" [disabled]="edit" [(ngModel)]="fileName"
24 placeholder="Template name" name="templateName" autofocus [autofocus]="true">
29 <div class="template-mapping-accordion">
30 <div class="accordion" id="accordion">
32 <div class="card-header" id="headingOne">
33 <h5 class="mb-0 d-flex justify-content-between">
34 <button class="btn btn-link" data-toggle="collapse" data-target="#collapseOne" id="templateTab"
35 aria-expanded="true" aria-controls="collapseOne">
36 1. Template <span class="accordian-title">{{currentTemplate?.fileName?.split('/')[1]}}</span>
42 <div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion">
43 <div class="card-body">
44 <div tourAnchor="tm-templateType" class="single-line">
45 <label class="label-name">Template Type</label>
46 <div class="label-input">
47 <label name="trst" (click)="allowedExt=['.vtl'];templateExt='vtl'">
48 <input class="form-check-input" [(ngModel)]="templateExt" type="radio"
49 name="exampleRadios" id="exampleRadios1" value=vtl>
54 <label name="trst" (click)="allowedExt=['.j2','.jinja2'];templateExt='j2'">
55 <input class="form-check-input" [(ngModel)]="templateExt" type="radio"
56 name="exampleRadios" id="exampleRadios1" value=j2>
62 <label tourAnchor="tm-templateContent" name="trst"
63 (click)="allowedExt=['.kt'];templateExt='kt'">
64 <input class="form-check-input" [(ngModel)]="templateExt" type="radio"
65 name="exampleRadios" id="exampleRadios1" value=kt>
73 <div class="create-template-import">Use the editor to add parameters or you can also
74 <a href="#" data-toggle="modal" data-target="#templateModal"><b>Import
75 File</b></a>. <br /> <span class="templateNote"><i class="icon-info"
76 aria-hidden="true"></i> When you import new file, the new attributes will replace
77 current attributes.</span></div>
78 <div class="editor-container mb-4">
79 <app-source-editor [lang]="'velocity'" (textChange)="textChanges($event,templateInfo.fileName)"
80 [(text)]="templateFileContent">
87 <div class="card-header" id="headingTwo">
89 <button tourAnchor="tm-mappingContent" class="btn btn-link collapsed" id="mappingTab"
90 data-toggle="collapse" data-target="#collapseTwo" aria-expanded="false"
91 aria-controls="collapseTwo">
92 2. Manage Mapping <span
93 class="accordian-title">{{currentMapping?.fileName?.split('/')[1]}}</span>
97 <div id="collapseTwo" class="collapse" aria-labelledby="headingTwo" data-parent="#accordion">
98 <div class="card-body">
99 <p class="text-center"><b>Select a source to load config parameters</b></p>
100 <div class="text-center">
101 <button [disabled]="!(variables?.length>0 && templateFileContent?.trim()?.length > 0)"
102 (click)="getMappingTableFromTemplate($event)" class="mapping-source-load" [ngClass]="variables?.length>0 && templateFileContent?.trim()?.length > 0
103 ?'hover-enable':'hover-disable'">
104 <i class="icon-use-attributes"></i>
106 <span>Use Current Template Instance</span>
108 <a href="#" (click)="allowedExt=['.csv','.xml']" data-toggle="modal"
109 data-target="#templateModal" class="mapping-source-load">
110 <i class="icon-upload-attributes"></i>
112 <div>Upload Attributes List</div>
113 <div class="source-load-note">CSV or XML files</div>
115 <!-- <a href="#" class="mapping-source-load">
116 <i class="icon-import-cds"></i>
118 <span>Import from SDC Model</span>
122 <div class="table-container">
129 <div id="mapping-table" [hidden]="resourceDictionaryRes?.length == 0" class="mapping-table mx-4 my-2">
130 <div class="btn-group mapping-editBar" role="group">
131 <div class="custom-control custom-checkbox" tooltip="Select All" placement="bottom">
132 <input type="checkbox" class="custom-control-input" id="customCheck1" checked>
133 <label class="custom-control-label" for="customCheck1"></label>
135 <button type="button" class="btn" tooltip="Re-mapping" placement="bottom"><i class="icon-autoMap"></i></button>
136 <button type="button" class="btn" tooltip="Remove" placement="bottom"><i class="icon-delete-sm"></i></button>
138 <table datatable [dtOptions]="initDtOptions" [dtTrigger]="dtTrigger" class="row-border hover">
143 <th>Parameter Name</th>
144 <th>Dictionary Name</th>
145 <th>Dictionary Source</th>
146 <th>Dependancies</th>
149 <th>Entry Schema</th>
153 <tr *ngFor="let dict of resourceDictionaryRes">
155 <div class="custom-control custom-checkbox" tooltip="Select" placement="bottom">
156 <input type="checkbox" class="custom-control-input" id="customCheck2" [checked]="selectedProps.has(dict.name)"
157 (click)="selectProp(dict.name)">
158 <label class="custom-control-label" for="customCheck2"></label>
160 <!-- <input type="checkbox" [checked]="selectedProps.has(dict.name)"
161 (click)="selectProp(dict.name)"></td> -->
163 <img *ngIf="dict.definition?.property?.required"
164 src="/assets/img/icon-required-yes.svg">
165 <img *ngIf="!dict.definition?.property?.required"
166 src="/assets/img/icon-required-no.svg">
168 <td>{{ dict.name }}</td>
169 <td>{{ dict.name }}</td>
171 <select class="custom-select" (click)="selectSource(dict,$event)">
172 <option *ngFor="let val of dict.definition.sources | keyvalue">
173 {{initMap(dict.name,val)}}
179 <!-- <select class="custom-select">
180 <option *ngFor="let val of getKeys(dependancies)">
181 {{ getValue(dict.name)}}</option>
184 <input type="text" class="form-control" [ngModel]="getValue(dict.name)">
185 <!-- {{ dict.definition.sources }} -->
187 <td>{{ dict.definition?.property?.default }}</td>
188 <td>{{ dict.definition?.property?.type }}</td>
189 <td>{{ dict.definition?.property['entry_schema'] }}</td>
195 <div id="mapping-table-res" [hidden]="mappingRes?.length == 0" class="mapping-table mx-4 my-2">
196 <table datatable [dtOptions]="dtOptions" [dtTrigger]="resTableDtTrigger" class="row-border hover">
200 <th>Parameter Name</th>
201 <th>Dictionary Name</th>
202 <th>Dictionary Source</th>
203 <th>Dependancies</th>
206 <th>Entry Schema</th>
210 <tr *ngFor="let dict of mappingRes">
212 <img *ngIf="dict.definition?.property?.required"
213 src="/assets/img/icon-required-yes.svg">
214 <img *ngIf="!dict.definition?.property?.required"
215 src="/assets/img/icon-required-no.svg">
217 <td>{{ dict['name'] }}</td>
218 <td>{{ dict['name'] }}</td>
220 <input type="text" class="form-control" [value]="dict['dictionary-source']"
225 <input type="text" class="form-control" [value]="dict['dependencies']" disabled>
226 <!-- {{ dict.definition.sources }} -->
228 <td>{{ dict['property']['default'] }}</td>
229 <td>{{ dict['property']['type'] }}</td>
230 <td>{{ dict['property']['entry_schema'] }}</td>
246 <div class="modal fade" id="templateModal" tabindex="-1" role="dialog" aria-labelledby="templateModalLabel"
248 <div class="modal-dialog" role="document">
249 <div class="modal-content">
250 <div class="modal-header">
251 <h5 class="modal-title" id="templateModalLabel">Import File</h5>
252 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
253 <img src="assets/img/icon-close.svg" />
256 <div class="modal-body">
257 <ngx-file-drop [multiple]="false" [accept]="allowedExt" dropZoneLabel="Drop files here"
258 (onFileDrop)="dropped($event)" (onFileOver)="fileOver($event)" (onFileLeave)="fileLeave($event)">
259 <ng-template ngx-file-drop-content-tmp let-openFileSelector="openFileSelector">
260 <div class="folder-upload">
261 <img src="assets/img/folder-upload.svg" />
263 <div class="folder-upload-text">
266 <div class="folder-upload-text">or
267 <button type="button" class="btn btn-sm btn-primary" (click)="openFileSelector()">Browse
271 <div class="folder-upload-type">Allowed file type:
276 <div class="upload-table">
277 <table class="table">
279 <tr *ngFor="let item of uploadedFiles; let i=index">
280 <th width="40"><img src="assets/img/icon-file-code.svg" /></th>
281 <th>{{ item.name }}</th>
282 <th (click)="removeFile(i)" width="40" class="text-right"><img
283 src="assets/img/icon-remove-file.svg" class="btn-modal-remove-file" /></th>
290 <div class="modal-footer">
291 <button type="button" class="btn btn-sm btn-secondary btn-cancel" data-dismiss="modal"
292 (click)="resetTheUploadedFiles()">Cancel
295 <button data-dismiss="modal" (click)="uploadFile()" class="btn btn-sm btn-primary" type="button">
303 <!-- Delete Modal -->
304 <div class="modal fade" id="templateDeletionModal2" tabindex="-1" role="dialog"
305 aria-labelledby="templateDeletionModal2Label" aria-hidden="true">
306 <div class="modal-dialog" role="document">
307 <div class="modal-content">
308 <div class="modal-header">
309 <h5 class="modal-title" id="templateDeletionModal2Label">Delete Script</h5>
310 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
311 <img src="assets/img/icon-close.svg" />
314 <div class="modal-body">
315 <p>Are you sure you want to delete Template file
316 <span>{{fileToDelete}}</span>?</p>
318 <div class="modal-footer">
319 <button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
320 <button type="button" (click)="confirmDelete()" data-dismiss="modal"
321 class="btn btn-primary">Delete</button>