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" (click)="allowedExt=['.'+templateExt]"
75 data-target="#templateModal"><b>Import
76 File</b></a>. <br /> <span class="templateNote"><i class="icon-info"
77 aria-hidden="true"></i> When you import new file, the new attributes will replace
78 current attributes.</span></div>
79 <div class="editor-container mb-4">
80 <app-source-editor [lang]="'velocity'" (textChange)="textChanges($event,templateInfo.fileName)"
81 [(text)]="templateFileContent">
88 <div class="card-header" id="headingTwo">
90 <button tourAnchor="tm-mappingContent" class="btn btn-link collapsed" id="mappingTab"
91 data-toggle="collapse" data-target="#collapseTwo" aria-expanded="false"
92 aria-controls="collapseTwo">
93 2. Manage Mapping <span
94 class="accordian-title">{{currentMapping?.fileName?.split('/')[1]}}</span>
98 <div id="collapseTwo" class="collapse" aria-labelledby="headingTwo" data-parent="#accordion">
99 <div class="card-body">
100 <p class="text-center"><b>Select a source to load config parameters</b></p>
101 <div class="text-center">
102 <button [disabled]="!(templateFileContent?.trim()?.length > 0)"
103 (click)="getMappingTableFromTemplate($event)" class="mapping-source-load" [ngClass]="templateFileContent?.trim()?.length > 0
104 ?'hover-enable':'hover-disable'">
105 <i class="icon-use-attributes"></i>
107 <span>Use Current Template Instance</span>
109 <a href="#" (click)="allowedExt=['.csv','.xml']" data-toggle="modal"
110 data-target="#templateModal" class="mapping-source-load">
111 <i class="icon-upload-attributes"></i>
113 <div>Upload Attributes List</div>
114 <div class="source-load-note">CSV or XML files</div>
116 <!-- <a href="#" class="mapping-source-load">
117 <i class="icon-import-cds"></i>
119 <span>Import from SDC Model</span>
123 <div class="table-container">
130 <div id="mapping-table" [hidden]="resourceDictionaryRes?.length == 0" class="mapping-table mx-4 my-2">
131 <div class="btn-group mapping-editBar" role="group">
132 <div class="custom-control custom-checkbox" tooltip="Select All" placement="bottom">
133 <input type="checkbox" (click)="selectAllProps()" class="custom-control-input"
135 [checked]="resourceDictionaryRes.length>0&&resourceDictionaryRes.length === this.selectedProps.size">
136 <label class="custom-control-label" for="customCheck1"></label>
138 <button [disabled]="selectedProps.size <=0" type="button" class="btn" (click)="reMap()"
139 tooltip="Re-mapping" placement="bottom"><i class="icon-autoMap"></i></button>
140 <button [disabled]="selectedProps.size <=0" type="button" class="btn" (click)="removeProps()"
141 tooltip="Remove" placement="bottom"><i class="icon-delete-sm"></i></button>
142 <div style="line-height: 35px;font-size: 10px;">
143 <span>{{selectedProps.size}} selected </span>
144 <span>({{resourceDictionaryRes.length}} attributes in total)</span>
147 <table datatable [dtOptions]="initDtOptions" [dtTrigger]="dtTrigger" class="row-border hover">
152 <th>Parameter Name</th>
153 <th>Dictionary Name</th>
154 <th>Dictionary Source</th>
155 <th>Dependancies</th>
159 <th>Entry Schema</th>
163 <tr *ngFor="let dict of resourceDictionaryRes;let i=index;trackBy: identify">
165 <div class="custom-control custom-checkbox" tooltip="Select" placement="bottom">
166 <input type="checkbox" class="custom-control-input"
167 id="customCheck-{{dict.name}}" [checked]="selectedProps.has(dict.name)"
168 (click)="selectProp(dict.name)">
169 <label class="custom-control-label" for="customCheck-{{dict.name}}"></label>
171 <!-- <input type="checkbox" [checked]="selectedProps.has(dict.name)"
172 (click)="selectProp(dict.name)"></td> -->
175 <div class="custom-control custom-checkbox reuiredInput">
176 <input type="checkbox" class="custom-control-input"
177 id="customCheck-{{dict.name}}" [checked]="selectedProps.has(dict.name)"
178 (click)="selectProp(dict.name)">
179 <label class="custom-control-label" for="customCheck-{{dict.name}}"></label>
182 <img *ngIf="dict.definition?.property?.required"
183 src="/assets/img/icon-required-yes.svg">
184 <img *ngIf="!dict.definition?.property?.required"
185 src="/assets/img/icon-required-no.svg">
187 <td>{{ dict.name }}</td>
188 <td>{{ dict.name }}</td>
190 <select class="custom-select" (click)="selectSource(dict,$event)">
191 <option *ngFor="let val of dict.definition.sources | keyvalue">
192 {{initMap(dict.name,val)}}
198 <!-- <select class="custom-select">
199 <option *ngFor="let val of getKeys(dependancies)">
200 {{ getValue(dict.name)}}</option>
202 <input type="text" class="form-control" [ngModel]="getValue(dict.name)">
203 <!-- {{ dict.definition.sources }} -->
205 <td>{{ dict.definition?.property?.default }}</td>
206 <td><input type="text" class="form-control" #velocity
207 (input)="setVelocity(i,velocity.value)"></td>
208 <td>{{ dict.definition?.property?.type }}</td>
209 <td>{{ dict.definition?.property['entry_schema'] }}</td>
215 <div id="mapping-table-res" [hidden]="mappingRes?.length == 0" class="mapping-table mx-4 my-2">
216 <!-- <div class="btn-group mapping-editBar" role="group">
217 <div class="custom-control custom-checkbox" tooltip="Select All" placement="bottom">
218 <input type="checkbox" (click)="selectAllProps()" class="custom-control-input"
220 [checked]="resourceDictionaryRes.length>0&&resourceDictionaryRes.length === this.selectedProps.size">
221 <label class="custom-control-label" for="customCheck2"></label>
223 <button [disabled]="selectedProps.size <=0" type="button" class="btn" (click)="reMap()"
224 tooltip="Re-mapping" placement="bottom"><i class="icon-autoMap"></i></button>
225 <button [disabled]="selectedProps.size <=0" type="button" class="btn" (click)="removeProps()"
226 tooltip="Remove" placement="bottom"><i class="icon-delete-sm"></i></button>
228 <table datatable [dtOptions]="dtOptions" [dtTrigger]="resTableDtTrigger" class="row-border hover">
233 <th>Parameter Name</th>
234 <th>Dictionary Name</th>
235 <th>Dictionary Source</th>
236 <th>Dependancies</th>
240 <th>Entry Schema</th>
244 <tr *ngFor="let dict of mappingRes">
246 <div class="custom-control custom-checkbox" tooltip="Select" placement="bottom">
247 <input type="checkbox" class="custom-control-input"
248 id="customCheck2-{{dict.name}}" [checked]="selectedProps.has(dict.name)"
249 (click)="selectProp(dict.name)">
250 <label class="custom-control-label" for="customCheck2-{{dict.name}}"></label>
254 <img *ngIf="dict.definition?.property?.required"
255 src="/assets/img/icon-required-yes.svg">
256 <img *ngIf="!dict.definition?.property?.required"
257 src="/assets/img/icon-required-no.svg">
259 <td>{{ dict['name'] }}</td>
260 <td>{{ dict['name'] }}</td>
262 <input type="text" class="form-control" [value]="dict['dictionary-source']"
267 <input type="text" class="form-control" [value]="dict['dependencies']" disabled>
268 <!-- {{ dict.definition.sources }} -->
270 <td>{{ dict['property']['default'] }}</td>
271 <td *ngIf="dict?.property?.metadata">
272 {{dict?.property?.metadata['transform-template']}}
274 <td *ngIf="!dict?.property?.metadata"></td>
275 <td>{{ dict['property']['type'] }}</td>
276 <td>{{ dict['property']['entry_schema'] }}</td>
292 <div class="modal fade" id="templateModal" tabindex="-1" role="dialog" aria-labelledby="templateModalLabel"
294 <div class="modal-dialog" role="document">
295 <div class="modal-content">
296 <div class="modal-header">
297 <h5 class="modal-title" id="templateModalLabel">Import File</h5>
298 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
299 <img src="assets/img/icon-close.svg" />
302 <div class="modal-body">
303 <ngx-file-drop [multiple]="false" [accept]="allowedExt" dropZoneLabel="Drop files here"
304 (onFileDrop)="dropped($event)" (onFileOver)="fileOver($event)" (onFileLeave)="fileLeave($event)">
305 <ng-template ngx-file-drop-content-tmp let-openFileSelector="openFileSelector">
306 <div class="folder-upload">
307 <img src="assets/img/folder-upload.svg" />
309 <div class="folder-upload-text">
312 <div class="folder-upload-text">or
313 <button type="button" class="btn btn-sm btn-primary" (click)="openFileSelector()">Browse
317 <div class="folder-upload-type">Allowed file type:
322 <div class="upload-table">
323 <table class="table">
325 <tr *ngFor="let item of uploadedFiles; let i=index">
326 <th width="40"><img src="assets/img/icon-file-code.svg" /></th>
327 <th>{{ item.name }}</th>
328 <th (click)="removeFile(i)" width="40" class="text-right"><img
329 src="assets/img/icon-remove-file.svg" class="btn-modal-remove-file" /></th>
336 <div class="modal-footer">
337 <button type="button" class="btn btn-sm btn-secondary btn-cancel" data-dismiss="modal"
338 (click)="resetTheUploadedFiles()">Cancel
341 <button data-dismiss="modal" (click)="uploadFile()" class="btn btn-sm btn-primary" type="button">
349 <!-- Delete Modal -->
350 <div class="modal fade" id="templateDeletionModal2" tabindex="-1" role="dialog"
351 aria-labelledby="templateDeletionModal2Label" aria-hidden="true">
352 <div class="modal-dialog" role="document">
353 <div class="modal-content">
354 <div class="modal-header">
355 <h5 class="modal-title" id="templateDeletionModal2Label">Delete Script</h5>
356 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
357 <img src="assets/img/icon-close.svg" />
360 <div class="modal-body">
361 <p>Are you sure you want to delete Template file
362 <span>{{fileToDelete}}</span>?</p>
364 <div class="modal-footer">
365 <button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
366 <button type="button" (click)="confirmDelete()" data-dismiss="modal"
367 class="btn btn-primary">Delete</button>