Angular upgrade
[osm/NG-UI.git] / src / app / vim-accounts / new-vimaccount / NewVimaccountComponent.html
index ce7a5d1..7f719a2 100644 (file)
@@ -16,17 +16,23 @@ limitations under the License.
 Author: KUMARAN M (kumaran.m@tataelxsi.co.in), RAJESH S (rajesh.s@tataelxsi.co.in), BARATH KUMAR R (barath.r@tataelxsi.co.in)
 -->
 <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 class="d-flex flex-row justify-content-between">
+        <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">
             <label class="col-sm-12 col-form-label mandatory-label"
-                [ngClass]="{'text-danger': vimNewAccountForm.invalid === true && submitted === true}">{{'MANDATORYCHECK' | translate}}</label>
+                [ngClass]="{'text-danger': vimNewAccountForm.invalid === true && submitted === true}">
+                {{'MANDATORYCHECK' | translate}}
+            </label>
             <div class="col-sm-3">
                 <label for="name">{{'PAGE.VIMDETAILS.NAME' | translate}}*</label>
             </div>
-            <div class="col-sm-3">
+            <div class="col-sm-3 mb-3">
                 <input autocomplete="off" class="form-control" placeholder="{{'PAGE.VIMDETAILS.NAME' | translate}}"
                     type="text" formControlName="name" id="name"
                     [ngClass]="{ 'is-invalid': submitted && f.name.errors }">
@@ -34,7 +40,7 @@ Author: KUMARAN M (kumaran.m@tataelxsi.co.in), RAJESH S (rajesh.s@tataelxsi.co.i
             <div class="col-sm-3">
                 <label for="vim_tenant_name">{{'PAGE.VIMDETAILS.TENANTNAME' | translate}}*</label>
             </div>
-            <div class="col-sm-3">
+            <div class="col-sm-3 mb-3">
                 <input autocomplete="off" class="form-control"
                     placeholder="{{'PAGE.VIMDETAILS.TENANTNAME' | translate}}" type="text"
                     formControlName="vim_tenant_name" id="vim_tenant_name"
@@ -45,17 +51,18 @@ Author: KUMARAN M (kumaran.m@tataelxsi.co.in), RAJESH S (rajesh.s@tataelxsi.co.i
             <div class="col-sm-3">
                 <label for="vim_type">{{'PAGE.VIMDETAILS.VIMTYPE' | translate}}*</label>
             </div>
-            <div class="col-sm-3">
+            <div class="col-sm-3 mb-3">
                 <ng-select bindLabel="title" bindValue="value" [items]="vimType" placeholder="{{'SELECT' | translate}}"
-                    formControlName="vim_type" id="vim_type" [(ngModel)]="selectedVimType" [addTag]="sharedService.addCustomTag"
-                    [ngClass]="{ 'is-invalid': submitted && f.vim_type.errors }" (change)="clearConfig()">
+                    formControlName="vim_type" id="vim_type" [(ngModel)]="selectedVimType"
+                    [addTag]="sharedService.addCustomTag" [ngClass]="{ 'is-invalid': submitted && f.vim_type.errors }"
+                    (change)="clearConfig()">
                 </ng-select>
                 <small class="text-info">{{'TYPEINFO' | translate}}</small>
             </div>
             <div class="col-sm-3">
                 <label for="description">{{'PAGE.VIMDETAILS.DESCRIPTION' | translate}}</label>
             </div>
-            <div class="col-sm-3">
+            <div class="col-sm-3 mb-3">
                 <textarea class="form-control" placeholder="{{'PAGE.VIMDETAILS.DESCRIPTION' | translate}}" type="text"
                     formControlName="description" id="description"></textarea>
             </div>
@@ -64,7 +71,7 @@ Author: KUMARAN M (kumaran.m@tataelxsi.co.in), RAJESH S (rajesh.s@tataelxsi.co.i
             <div class="col-sm-3">
                 <label for="vim_url">{{'PAGE.VIMDETAILS.VIMURL' | translate}}*</label>
             </div>
-            <div class="col-sm-3">
+            <div class="col-sm-3 mb-3">
                 <input autocomplete="off" class="form-control" placeholder="{{'PAGE.VIMDETAILS.VIMURL' | translate}}"
                     type="url" formControlName="vim_url" id="vim_url"
                     [ngClass]="{ 'is-invalid': submitted && f.vim_url.errors }">
@@ -75,7 +82,7 @@ Author: KUMARAN M (kumaran.m@tataelxsi.co.in), RAJESH S (rajesh.s@tataelxsi.co.i
             <div class="col-sm-3">
                 <label for="schema_type">{{'PAGE.VIMDETAILS.SCHEMATYPE' | translate}}</label>
             </div>
-            <div class="col-sm-3">
+            <div class="col-sm-3 mb-3">
                 <input autocomplete="off" class="form-control"
                     placeholder="{{'PAGE.VIMDETAILS.SCHEMATYPE' | translate}}" type="text" formControlName="schema_type"
                     id="schema_type">
@@ -85,7 +92,7 @@ Author: KUMARAN M (kumaran.m@tataelxsi.co.in), RAJESH S (rajesh.s@tataelxsi.co.i
             <div class="col-sm-3">
                 <label for="vim_user">{{'PAGE.VIMDETAILS.VIMUSERNAME' | translate}}*</label>
             </div>
-            <div class="col-sm-3">
+            <div class="col-sm-3 mb-3">
                 <input autocomplete="off" class="form-control"
                     placeholder="{{'PAGE.VIMDETAILS.VIMUSERNAME' | translate}}" type="text" formControlName="vim_user"
                     id="vim_user" [ngClass]="{ 'is-invalid': submitted && f.vim_user.errors }">
@@ -93,7 +100,7 @@ Author: KUMARAN M (kumaran.m@tataelxsi.co.in), RAJESH S (rajesh.s@tataelxsi.co.i
             <div class="col-sm-3">
                 <label for="vim_password">{{'PAGE.VIMDETAILS.VIMPASSWORD' | translate}}*</label>
             </div>
-            <div class="col-sm-3">
+            <div class="col-sm-3 mb-3">
                 <input autocomplete="off" class="form-control" placeholder="VIM Password" type="password"
                     formControlName="vim_password" id="vim_password"
                     [ngClass]="{ 'is-invalid': submitted && f.vim_password.errors }">
@@ -103,28 +110,33 @@ Author: KUMARAN M (kumaran.m@tataelxsi.co.in), RAJESH S (rajesh.s@tataelxsi.co.i
             <div class="col-sm-3">
                 <label for="location">{{'PAGE.VIMDETAILS.VIMLOCATION' | translate}}</label>
             </div>
-            <div class="col-sm-3" formGroupName="config">
-                <ng-select [items]="getVIMLocation" bindLabel="label" bindValue="value"
-                    placeholder="{{'PAGE.VIMDETAILS.VIMLOCATION' | translate}}" formControlName="location" id="location"
-                    (keydown.enter)="fetchLocationLatLong($event.target.value)" (change)="locationChange($event)">
-                </ng-select>
-                <small class="text-info">{{'PAGE.VIM.LOCATIONINFO' | translate}}</small>
+            <div class="col-sm-9 form-inline mb-3">
+                <div class="input-group">
+                    <input autocomplete="off" formControlName="locationName" type="text" class="form-control"
+                        placeholder="{{'PAGE.VIMDETAILS.NAME' | translate}}"
+                        [ngClass]="{ 'is-invalid': submitted && f.locationName.errors }">
+                    <input autocomplete="off" formControlName="latitude" type="text" class="form-control"
+                        placeholder="Latitude" [ngClass]="{ 'is-invalid': submitted && f.latitude.errors }">
+                    <input autocomplete="off" formControlName="longitude" type="text" class="form-control"
+                        placeholder="Longitude" [ngClass]="{ 'is-invalid': submitted && f.longitude.errors }">
+                </div>
+                <small class="text-info mt-1 me-1">{{'PAGE.VIM.LOCATIONINFO' | translate}}</small>
             </div>
+        </div>
+        <div class="row form-group content-style">
             <div class="col-sm-3">
                 <label>{{'UPLOADCONFIG' | translate}}</label>
             </div>
             <div class="col-sm-3 form-group">
                 <div class="custom-file">
-                    <input [disabled]="!selectedVimType" type="file" #fileInput class="custom-file-input"
+                    <input [disabled]="!selectedVimType" type="file" #fileInput class="fileupload custom-file-input"
                         (change)="filesDropped($event.target.files)" id="customFile">
-                    <label class="custom-file-label" #fileInputLabel
-                        for="customFile">{{'CHOOSEFILE' | translate}}</label>
                 </div>
                 <small class="text-info">{{'UPLOADCONFIGLABEL' | translate}}</small>
             </div>
         </div>
         <div class="row" [hidden]="!selectedVimType">
-            <div class="col-12">
+            <div class="d-grid col-12">
                 <button type="button" class="btn btn-block border-0 bg-light text-dark"
                     (click)="isCollapsed = !isCollapsed"
                     [attr.aria-expanded]="!isCollapsed">{{'PAGE.VIMDETAILS.CONFIGPARAMETERS' | translate}}</button>
@@ -133,24 +145,25 @@ Author: KUMARAN M (kumaran.m@tataelxsi.co.in), RAJESH S (rajesh.s@tataelxsi.co.i
         <div id="configurationparameters" class="row collapse mt-3" [ngbCollapse]="isCollapsed">
             <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()">
+                    <div class="form-group mb-3" *ngIf="!vimID">
+                        <button type="button" class="btn btn-warning btn-sm me-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>
             </div>
         </div>
-        <div class="modal-footer border-0">
+        <div class="modal-footer border-0 mb-3 mt-3 me-3">
             <button type="button" (click)="onVimAccountBack()"
-                class="btn btn-danger">{{'PAGE.VIMDETAILS.BACKTOVIMACCOUNTS' | translate}}</button>
-            <button type="submit" class="btn btn-primary">{{'CREATE' | translate}}</button>
+                class="btn btn-danger me-2">{{'PAGE.VIMDETAILS.BACKTOVIMACCOUNTS' | 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>