blob: 26a16c84650f7c73644236953742a6fb0de4f734 [file] [log] [blame]
kumaran.m3b4814a2020-05-01 19:48:54 +05301<!--
2Copyright 2020 TATA ELXSI
3
4Licensed under the Apache License, Version 2.0 (the 'License');
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15
16Author: KUMARAN M (kumaran.m@tataelxsi.co.in), RAJESH S (rajesh.s@tataelxsi.co.in), BARATH KUMAR R (barath.r@tataelxsi.co.in)
17-->
18<form [formGroup]="projectForm" (ngSubmit)="projectAction(getProjectType)">
19 <div class="modal-header">
Barath Kumar R09cd4ec2020-07-07 16:12:32 +053020 <h4 class="modal-title" id="modal-basic-title">{{ (getProjectType == 'Add' ? 'NEW' : 'EDIT') | translate}}
21 {{'PROJECT' | translate}}</h4>
SANDHYA.JSc84f1122024-06-04 21:50:03 +053022 <button class="button-xs-2" type="button" class="close" aria-label="Close" (click)="activeModal.close()">
kumaran.m3b4814a2020-05-01 19:48:54 +053023 <i class="fas fa-times-circle text-danger"></i>
24 </button>
25 </div>
Barath Kumar R09cd4ec2020-07-07 16:12:32 +053026 <div class="modal-body modal-body-custom-height">
27 <div class="row" *ngIf="getProjectType === 'Add'">
SANDHYA.JSc84f1122024-06-04 21:50:03 +053028 <label class="col-xs-10 col-sm-10 col-md-10 col-lg-10 col-xl-10 mb-2">{{'RECENTLY' | translate}}
Barath Kumar R09cd4ec2020-07-07 16:12:32 +053029 {{'CREATED' | translate}} {{'PROJECT' | translate}}:
30 <b>{{(recentProject)?recentProject.name:''}}</b>
31 </label>
32 </div>
kumaran.m3b4814a2020-05-01 19:48:54 +053033 <div class="form-group row">
Barath Kumar R09cd4ec2020-07-07 16:12:32 +053034 <label class="col-sm-12 col-form-label mandatory-label"
35 [ngClass]="{'text-danger': projectForm.invalid === true && submitted === true}">{{'MANDATORYCHECK' | translate}}</label>
kumaran.m3b4814a2020-05-01 19:48:54 +053036 <label class="col-sm-4 col-form-label">{{'PROJECT' | translate}} {{'NAME' | translate}}*</label>
Barath Kumar R2e02e7d2021-06-09 09:18:17 +053037 <div class="col-sm-4">
Barath Kumar R09cd4ec2020-07-07 16:12:32 +053038 <input placeholder="{{'PROJECT' | translate}} {{'NAME' | translate}}" type="text" class="form-control"
39 formControlName="project_name" [ngClass]="{ 'is-invalid': submitted && f.project_name.errors }" required>
kumaran.m3b4814a2020-05-01 19:48:54 +053040 </div>
41 </div>
SANDHYA.JSc84f1122024-06-04 21:50:03 +053042 <div class="form-group row mt-3" *ngIf="getProjectType === 'Add'">
kumaran.m3b4814a2020-05-01 19:48:54 +053043 <label class="col-sm-4 col-form-label">{{'DOMAIN' | translate}} {{'NAME' | translate}}</label>
Barath Kumar R2e02e7d2021-06-09 09:18:17 +053044 <div class="col-sm-4">
Barath Kumar R16070582021-02-08 18:19:35 +053045 <ng-select [clearable]="false" placeholder="{{'SELECT' | translate}}" [items]="domains" bindLabel="title"
46 bindValue="value" formControlName="domain_name" id="domain_name"
Barath Kumar R09cd4ec2020-07-07 16:12:32 +053047 [ngClass]="{ 'is-invalid': submitted && f.domain_name.errors }"></ng-select>
48 </div>
kumaran.m3b4814a2020-05-01 19:48:54 +053049 </div>
SANDHYA.JSc84f1122024-06-04 21:50:03 +053050 <div class="form-check form-check-inline mt-3">
51 <input class="quotacheck form-check-input" type="checkbox" formControlName="enable_quota" (change)="checkQuota()"
Barath Kumar R09cd4ec2020-07-07 16:12:32 +053052 id="quotaCheck" *ngIf="getProjectType === 'Add' || quotaRefs === null">
SANDHYA.JSc84f1122024-06-04 21:50:03 +053053 <label class="form-check-label" for="quotaCheck" [ngClass]="getProjectType === 'Edit'&& quotaRefs !== null?'quotaCheck-label':''"><b>{{'PAGE.PROJECT.QUOTA' | translate}}</b></label>
Barath Kumar R09cd4ec2020-07-07 16:12:32 +053054 </div>
SANDHYA.JSc84f1122024-06-04 21:50:03 +053055 <div class="row" [ngbCollapse]="!f.enable_quota.value">
56 <div class="form-group col-sm-6 mb-2 mt-2" *ngFor="let quota of quotaItems;">
Barath Kumar R09cd4ec2020-07-07 16:12:32 +053057 <div class="row">
58 <label class="col-sm-7 col-form-label">{{quota.title | translate}}*</label>
59 <div class="col-sm-5">
SANDHYA.JSc84f1122024-06-04 21:50:03 +053060 <input placeholder="{{'COUNT' | translate}}" type="number" min="0"
Barath Kumar R2e02e7d2021-06-09 09:18:17 +053061 class="form-control" [formControlName]="quota.value" [ngClass]="{ 'is-invalid': submitted && f[quota.value].errors }">
Barath Kumar R09cd4ec2020-07-07 16:12:32 +053062 </div>
63 </div>
64 </div>
kumaran.m3b4814a2020-05-01 19:48:54 +053065 </div>
66 </div>
67 <div class="modal-footer">
68 <button type="button" class="btn btn-danger" (click)="activeModal.close()">{{'CANCEL' | translate}}</button>
69 <button type="submit" class="btn btn-primary">{{(getProjectType == 'Add' ? 'CREATE' : 'APPLY') | translate}}</button>
70 </div>
71</form>
Barath Kumar R09cd4ec2020-07-07 16:12:32 +053072<app-loader [waitingMessage]="message" *ngIf="isLoadingResults"></app-loader>