| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame^] | 1 | <!-- |
| 2 | Copyright 2020 TATA ELXSI |
| 3 | |
| 4 | Licensed under the Apache License, Version 2.0 (the 'License'); |
| 5 | you may not use this file except in compliance with the License. |
| 6 | You may obtain a copy of the License at |
| 7 | |
| 8 | http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | Unless required by applicable law or agreed to in writing, software |
| 11 | distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | See the License for the specific language governing permissions and |
| 14 | limitations under the License. |
| 15 | |
| 16 | Author: SANDHYA JS (sandhya.j@tataelxsi.co.in) |
| 17 | --> |
| 18 | <div class="modal-header"> |
| 19 | <h4 class="modal-title" id="modal-basic-title">{{'PAGE.K8S.ATTACHDETATCHPROFILE' | translate}}</h4> |
| 20 | <button class="button-xs" type="button" class="close" aria-label="Close" (click)="activeModal.close()"> |
| 21 | <i class="fas fa-times-circle text-danger"></i> |
| 22 | </button> |
| 23 | </div> |
| 24 | <form [formGroup]="attachForm" (ngSubmit)="attachProfile()"> |
| 25 | <div class="modal-body" *ngIf="checkDetails" formArrayName="infra_config_profiles"> |
| 26 | <div class="form-group row p-2 bg-light text-white projects-roles-head text-white justify-content-end"> |
| 27 | <div class="col-4"> |
| 28 | <button [disabled]="isAttach" type="button" class="btn btn-primary" (click)="addMapping()"> |
| 29 | <i class="fas fa-plus-circle"></i> {{'PAGE.K8S.ATTACHPROFILE' | translate}}</button> |
| 30 | </div> |
| 31 | </div> |
| 32 | <label class="col-sm-12 col-form-label mandatory-label ps-2" |
| 33 | [ngClass]="{'text-danger': attachForm.invalid === true && submitted === true}">{{'MANDATORYCHECK' | |
| 34 | translate}}</label> |
| 35 | <div *ngFor="let params of getControls(); let i = index;" [formGroupName]="i"> |
| 36 | <div class="card bg-light"> |
| 37 | <div class="card-body"> |
| 38 | <div class="form-group row"> |
| 39 | <label class="col-sm-3 col-md-3 col-form-label" for="profile_name_{{i}}">{{'PAGE.K8S.PROFILE' | |
| 40 | translate}}*</label> |
| 41 | <div class="col-sm-8 col-md-8"> |
| 42 | <ng-select placeholder="{{'SELECT' | translate}}" [items]="userDetails" bindLabel="name" |
| 43 | bindValue="_id" formControlName="profile_name" id="profile_name_{{i}}" |
| 44 | [ngClass]="{ 'is-invalid': submitted && params.controls.profile_name.errors }"> |
| 45 | <ng-option *ngFor="let option of userDetails" [value]="option._id">{{ option.name }}</ng-option> |
| 46 | </ng-select> |
| 47 | </div> |
| 48 | <div class="col-sm-1" |
| 49 | *ngIf="profileDetails.infra_config_profiles[i] ? profileDetails.infra_config_profiles[i].profile_name === '' : true"> |
| 50 | <button class="button-xs" type="button" class="delete" (click)="removeMapping(i)" |
| 51 | placement="right" ngbTooltip="{{ 'CANCEL' | translate }}"> |
| 52 | <i class="fas fa-minus-circle text-danger"></i> |
| 53 | </button> |
| 54 | </div> |
| 55 | <div class="col-sm-1" |
| 56 | *ngIf="profileDetails.infra_config_profiles[i] ? profileDetails.infra_config_profiles[i].profile_name !== '' : false"> |
| 57 | <button class="button-xs" type="button" class="delete" |
| 58 | (click)="deleteProfile(profileDetails.infra_config_profiles[i])" |
| 59 | placement="right" ngbTooltip="{{ 'PAGE.K8S.DETATCH' | translate }}"> |
| 60 | <i class="fas fa-trash-alt text-danger"></i> |
| 61 | </button> |
| 62 | </div> |
| 63 | </div> |
| 64 | </div> |
| 65 | </div> |
| 66 | </div> |
| 67 | </div> |
| 68 | <div class="modal-footer"> |
| 69 | <button type="button" class="btn btn-danger" (click)="activeModal.close()">{{'CANCEL' | translate}}</button> |
| 70 | <button type="submit" class="btn btn-primary">{{'APPLY' | translate}}</button> |
| 71 | </div> |
| 72 | </form> |
| 73 | <app-loader [waitingMessage]="message" *ngIf="isLoadingResults"></app-loader> |