Fix Bug 2291: No option to update VIM Account in NG-UI
- NG-UI support for VIM Update
- Added edit button in VIM Account Action
- Patched the value in edit form using vimaccounts get api
- schema_type support is not given in patch method
- Disabled vim url and type in vim update action
Change-Id: I7c90e55fc4223d6c41ce12333ee23536358cab43
Signed-off-by: SANDHYA.JS <sandhya.j@tataelxsi.co.in>
diff --git a/src/app/vim-accounts/new-vimaccount/NewVimaccountComponent.html b/src/app/vim-accounts/new-vimaccount/NewVimaccountComponent.html
index 883563f..7720afa 100644
--- a/src/app/vim-accounts/new-vimaccount/NewVimaccountComponent.html
+++ b/src/app/vim-accounts/new-vimaccount/NewVimaccountComponent.html
@@ -17,7 +17,11 @@
-->
<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 @@
<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 @@
<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>