Fix bug 1565 to reset the project quotas count
[osm/NG-UI.git] / src / app / projects / project-create-update / ProjectCreateUpdateComponent.html
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: 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">
20 <h4 class="modal-title" id="modal-basic-title">{{ (getProjectType == 'Add' ? 'NEW' : 'EDIT') | translate}}
21 {{'PROJECT' | translate}}</h4>
22 <button class="button-xs" type="button" class="close" aria-label="Close" (click)="activeModal.close()">
23 <i class="fas fa-times-circle text-danger"></i>
24 </button>
25 </div>
26 <div class="modal-body modal-body-custom-height">
27 <div class="row" *ngIf="getProjectType === 'Add'">
28 <label class="col-xs-10 col-sm-10 col-md-10 col-lg-10 col-xl-10">{{'RECENTLY' | translate}}
29 {{'CREATED' | translate}} {{'PROJECT' | translate}}:
30 <b>{{(recentProject)?recentProject.name:''}}</b>
31 </label>
32 </div>
33 <div class="form-group row">
34 <label class="col-sm-12 col-form-label mandatory-label"
35 [ngClass]="{'text-danger': projectForm.invalid === true && submitted === true}">{{'MANDATORYCHECK' | translate}}</label>
36 <label class="col-sm-4 col-form-label">{{'PROJECT' | translate}} {{'NAME' | translate}}*</label>
37 <div class="col-sm-4">
38 <input placeholder="{{'PROJECT' | translate}} {{'NAME' | translate}}" type="text" class="form-control"
39 formControlName="project_name" [ngClass]="{ 'is-invalid': submitted && f.project_name.errors }" required>
40 </div>
41 </div>
42 <div class="form-group row" *ngIf="getProjectType === 'Add'">
43 <label class="col-sm-4 col-form-label">{{'DOMAIN' | translate}} {{'NAME' | translate}}</label>
44 <div class="col-sm-4">
45 <ng-select [clearable]="false" placeholder="{{'SELECT' | translate}}" [items]="domains" bindLabel="title"
46 bindValue="value" formControlName="domain_name" id="domain_name"
47 [ngClass]="{ 'is-invalid': submitted && f.domain_name.errors }"></ng-select>
48 </div>
49 </div>
50 <div class="form-check form-check-inline ml-2">
51 <input class="form-check-input" type="checkbox" formControlName="enable_quota" (change)="checkQuota()"
52 id="quotaCheck" *ngIf="getProjectType === 'Add' || quotaRefs === null">
53 <label class="form-check-label" for="quotaCheck"><b>{{'PAGE.PROJECT.QUOTA' | translate}}</b></label>
54 </div>
55 <div class="row mt-1" [ngbCollapse]="!f.enable_quota.value">
56 <div class="form-group col-sm-6" *ngFor="let quota of quotaItems;">
57 <div class="row">
58 <label class="col-sm-7 col-form-label">{{quota.title | translate}}*</label>
59 <div class="col-sm-5">
60 <input placeholder="{{'COUNT' | translate}}" type="number"
61 class="form-control" [formControlName]="quota.value" [ngClass]="{ 'is-invalid': submitted && f[quota.value].errors }">
62 </div>
63 </div>
64 </div>
65 </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>
72 <app-loader [waitingMessage]="message" *ngIf="isLoadingResults"></app-loader>