Fix Bug 2291: No option to update VIM Account in NG-UI
[osm/NG-UI.git] / src / app / vim-accounts / new-vimaccount / NewVimaccountComponent.html
index 883563f..7720afa 100644 (file)
@@ -17,7 +17,11 @@ Author: KUMARAN M (kumaran.m@tataelxsi.co.in), RAJESH S (rajesh.s@tataelxsi.co.i
 -->
 <form [formGroup]="vimNewAccountForm" (ngSubmit)="newVimAccountSubmit()" autocomplete="off">
     <div class="row d-flex flex-row justify-content-between">
-        <div class="d-flex align-items-center header-style">{{'PAGE.VIMDETAILS.NEWVIMACCOUNT' | translate}} </div>
+        <div *ngIf="vimID;else empty" class="d-flex align-items-center header-style">{{'PAGE.VIMDETAILS.EDITVIMACCOUNT'
+            | translate}} </div>
+        <ng-template #empty>
+            <div class="d-flex align-items-center header-style">{{'PAGE.VIMDETAILS.NEWVIMACCOUNT' | translate}} </div>
+        </ng-template>
     </div>
     <div class="context-style bg-white p-3">
         <div class="row form-group content-style">
@@ -145,14 +149,14 @@ Author: KUMARAN M (kumaran.m@tataelxsi.co.in), RAJESH S (rajesh.s@tataelxsi.co.i
             <div class="col-sm-12">
                 <div class="ngx-codemirror new-vim" [hidden]="!selectedVimType">
                     <div class="form-group">
-                        <button type="button" class="btn btn-warning btn-sm mr-3" (click)="loadSampleConfig()">
+                        <button type="button" class="btn btn-warning btn-sm mr-3" (click)="checkData()">
                             <i class="fa fa-clone" aria-hidden="true"></i>
                             {{'PAGE.VIMDETAILS.LOADSAMPLECONFIG' | translate}}</button>
                         <button type="button" class="btn btn-danger btn-sm" (click)="clearConfig()">
                             <i class="fa fa-times-circle" aria-hidden="true"></i>
                             {{'PAGE.VIMDETAILS.CLEARCONFIG' | translate}}</button>
                     </div>
-                    <ngx-codemirror [options]="options" [ngModel]="defaults[mode]" [autoFocus]="true"
+                    <ngx-codemirror *ngIf="check" [options]="options" [ngModel]="defaults[mode]" [autoFocus]="false"
                         (ngModelChange)="handleChange($event)" [ngModelOptions]="{standalone: true}">
                     </ngx-codemirror>
                 </div>
@@ -161,7 +165,8 @@ Author: KUMARAN M (kumaran.m@tataelxsi.co.in), RAJESH S (rajesh.s@tataelxsi.co.i
         <div class="modal-footer border-0">
             <button type="button" (click)="onVimAccountBack()"
                 class="btn btn-danger">{{'PAGE.VIMDETAILS.BACKTOVIMACCOUNTS' | translate}}</button>
-            <button type="submit" class="btn btn-primary">{{'CREATE' | translate}}</button>
+            <button *ngIf="!vimID" type="submit" class="btn btn-primary">{{'CREATE' | translate}}</button>
+            <button *ngIf="vimID" type="submit" class="btn btn-primary">{{'UPDATE' | translate}}</button>
         </div>
     </div>
 </form>