diff options
author | 2020-02-24 20:10:40 +0200 | |
---|---|---|
committer | 2020-02-25 22:34:59 +0200 | |
commit | e70a0e413947cc3e5e21d041f0ed3d7582b44d7a (patch) | |
tree | c9d769d4ab2251f38a23ef6c771c713941d244c3 /cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.html | |
parent | 568ff4d867dd09c087246fe7cc343c1d581e6255 (diff) |
import maaping from CSV file or the current template
Issue-ID: CCSDK-2065
Signed-off-by: ahmedeldeeb50 <ahmed.eldeeb.ext@orange.com>
Change-Id: Idc5b1deccf2966438aed13329290df6d9b3f0da7
Diffstat (limited to 'cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.html')
-rw-r--r-- | cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.html | 106 |
1 files changed, 73 insertions, 33 deletions
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 c3a36c9cb..d08ada98d 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 @@ -17,7 +17,7 @@ <div class="card-header" id="headingOne"> <h5 class="mb-0 d-flex justify-content-between"> <button class="btn btn-link" data-toggle="collapse" data-target="#collapseOne" aria-expanded="true" - aria-controls="collapseOne"> + aria-controls="collapseOne"> 1. Create Template </button> @@ -29,25 +29,24 @@ <div class="single-line"> <label class="label-name">Template Type</label> <div class="label-input"> - <label name="trst"> - <input class="form-check-input" type="radio" name="exampleRadios" id="exampleRadios1" - value=Velcoity> - + <label name="trst" (click)="allowedExt=['.vtl']"> + <input class="form-check-input" [(ngModel)]="templateExt" type="radio" + name="exampleRadios" id="exampleRadios1" value=Velcoity> <span> Velcoity </span> </label> - <label name="trst"> - <input class="form-check-input" type="radio" name="exampleRadios" id="exampleRadios1" - value=Velcoity> + <label name="trst" (click)="allowedExt=['.j2','.jinja2']"> + <input class="form-check-input" [(ngModel)]="templateExt" type="radio" + name="exampleRadios" id="exampleRadios1" value=Jinja> <span> Jinja </span> </label> - <label name="trst"> - <input class="form-check-input" type="radio" name="exampleRadios" id="exampleRadios1" - value=Velcoity> + <label name="trst" (click)="allowedExt=['.kt']"> + <input class="form-check-input" [(ngModel)]="templateExt" type="radio" + name="exampleRadios" id="exampleRadios1" value=Kotlin> <span> Kotlin @@ -56,12 +55,11 @@ </div> </div> <div class="create-template-import">Use the editor to add parameters or you can also <a href="#" - data-toggle="modal" - data-target="#exampleModal">Import - File</a></div> + data-toggle="modal" data-target="#exampleModal">Import + File</a></div> <div class="editor-container"> - <app-source-editor - (textChange)="textChanges($event,templateInfo.fileName)" [(text)]="templateInfo.fileContent"></app-source-editor> + <app-source-editor (textChange)="textChanges($event,templateInfo.fileName)" + [(text)]="templateFileContent"></app-source-editor> </div> </div> </div> @@ -70,7 +68,7 @@ <div class="card-header" id="headingTwo"> <h5 class="mb-0"> <button class="btn btn-link collapsed" data-toggle="collapse" data-target="#collapseTwo" - aria-expanded="false" aria-controls="collapseTwo"> + aria-expanded="false" aria-controls="collapseTwo"> 2. Manage Mapping </button> </h5> @@ -79,14 +77,15 @@ <div class="card-body"> <h6 class="text-center">Select a source to load config parameters</h6> <div class="text-center"> - <a (click)="initTemplateMappingTableFromCurrentTemplate()" class="mapping-source-load"> + <a href="#" (click)="getMappingTableFromTemplate($event)" class="mapping-source-load"> <i class="icon-current-template"></i> - <br/> + <br /> <span>Use Current Template Instance</span> </a> - <a href="#" data-toggle="modal" data-target="#exampleModal" class="mapping-source-load"> + <a href="#" (click)="allowedExt=['.csv']" data-toggle="modal" data-target="#exampleModal" + class="mapping-source-load"> <i class="icon-Upload-attribute"></i> - <br/> + <br /> <div>Upload attribute list</div> <div class="source-load-note">(Should be comma delimited file)</div> </a> @@ -102,23 +101,64 @@ </div> </div> + <div id="mapping-table" [hidden]="resourceDictionaryRes?.length == 0" class="mx-4 my-2"> + <table datatable [dtOptions]="dtOptions" [dtTrigger]="dtTrigger" class="row-border hover"> + <thead> + <tr> + <th>Required</th> + <th>Parameter Name</th> + <th>Dictionary Name</th> + <th>Dictionary Source</th> + <th>Dependancies</th> + <th>Default</th> + <th>Data Type</th> + <th>Entry Schema</th> + </tr> + </thead> + <tbody> + <tr *ngFor="let dict of resourceDictionaryRes"> + <td>{{ dict.definition?.property?.required }}</td> + <td>{{ dict.name }}</td> + <td>{{ dict.name }}</td> + <td> + <select class="custom-select"> + <option *ngFor="let val of dict.definition.sources | keyvalue">{{val.key}} + </option> + + </select> + </td> + <td> + <select class="custom-select"> + <option + *ngFor="let val of dict?.definition?.sources?.sdnc?.properties['key-dependencies'] "> + {{val}}</option> + + </select> + <!-- {{ dict.definition.sources }} --> + </td> + <td>{{ dict.definition?.property?.default }}</td> + <td>{{ dict.dataType }}</td> + <td>{{ dict.entrySchema }}</td> + </tr> + </tbody> + </table> + </div> </div> </div> - <div class="template-mapping-action"> <button class="btn btn-sm btn-outline-secondary">Cancel</button> - <button class="btn btn-sm btn-primary">Finish</button> + <button (click)="saveToStore()" class="btn btn-sm btn-primary">Finish</button> </div> </div> </div> <div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" - aria-hidden="true"> + aria-hidden="true"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> @@ -128,11 +168,11 @@ </button> </div> <div class="modal-body"> - <ngx-file-drop dropZoneLabel="Drop files here" (onFileDrop)="dropped($event)" - (onFileOver)="fileOver($event)" (onFileLeave)="fileLeave($event)"> + <ngx-file-drop [accept]="allowedExt" dropZoneLabel="Drop files here" (onFileDrop)="dropped($event)" + (onFileOver)="fileOver($event)" (onFileLeave)="fileLeave($event)"> <ng-template ngx-file-drop-content-tmp let-openFileSelector="openFileSelector"> <div class="folder-upload"> - <img src="assets/img/folder-upload.svg"/> + <img src="assets/img/folder-upload.svg" /> </div> <div class="folder-upload-text"> Drag & Drop file @@ -148,9 +188,9 @@ <div class="upload-table" *ngFor="let item of uploadedFiles; let i=index"> <table class="table"> <thead> - <tr> - <th>Name : {{ item.name }}</th> - </tr> + <tr> + <th>Name : {{ item.name }}</th> + </tr> </thead> </table> </div> @@ -158,13 +198,13 @@ <div class="modal-footer"> <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal" - (click)="resetTheUploadedFiles()">Cancel + (click)="resetTheUploadedFiles()">Cancel </button> <button type="button" class="btn btn-sm btn-primary" data-dismiss="modal" - (click)="setFilesToStore()" (click)="openListView()"> + (click)="uploadFile();openListView()"> Import </button> </div> </div> </div> -</div> +</div>
\ No newline at end of file |