| Barath Kumar R | 403234e | 2020-07-07 15:48:58 +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: 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]="osmrepoForm" (ngSubmit)="osmRepoSubmit();"> |
| 19 | <div class="modal-header"> |
| 20 | <h4 class="modal-title" id="modal-basic-title">{{(getCreateupdateType === 'Add' ? 'PAGE.OSMREPO.NEWOSMREPO' : 'PAGE.OSMREPO.EDITOSMREPO') | translate }}</h4> |
| 21 | <button class="button-xs" type="button" class="close" aria-label="Close" (click)="activeModal.close()"> |
| 22 | <i class="fas fa-times-circle text-danger"></i> |
| 23 | </button> |
| 24 | </div> |
| 25 | <div class="modal-body osmrepoadd"> |
| 26 | <div class="form-group row"> |
| 27 | <label class="col-sm-12 col-form-label mandatory-label" |
| 28 | [ngClass]="{'text-danger': osmrepoForm.invalid === true && submitted === true}">{{'MANDATORYCHECK' | translate}}</label> |
| 29 | <label class="col-sm-4 col-form-label" for="name">{{'NAME' | translate}}*</label> |
| 30 | <div class="col-sm-8"> |
| 31 | <input autocomplete="off" class="form-control" placeholder="{{'NAME' | translate}}" type="text" |
| 32 | formControlName="name" id="name" [ngClass]="{ 'is-invalid': submitted && f.name.errors }" |
| 33 | maxlength="{{sharedService.MAX_LENGTH_NAME}}" required> |
| 34 | </div> |
| 35 | </div> |
| 36 | <div class="form-group row"> |
| 37 | <label class="col-sm-4 col-form-label" for="type">{{'TYPE' | translate}}*</label> |
| 38 | <div class="col-sm-8"> |
| 39 | <ng-select bindLabel="title" bindValue="value" [items]="osmrepoType" |
| 40 | placeholder="{{'SELECT' | translate}} {{'TYPE' | translate}}" formControlName="type" id="type" |
| 41 | [ngClass]="{ 'is-invalid': submitted && f.type.errors }" required> |
| 42 | </ng-select> |
| 43 | </div> |
| 44 | </div> |
| 45 | <div class="form-group row"> |
| 46 | <label class="col-sm-4 col-form-label" for="url">{{'URL' | translate}}*</label> |
| 47 | <div class="col-sm-8"> |
| 48 | <input autocomplete="off" class="form-control" placeholder="{{'URL' | translate}}" type="url" |
| 49 | formControlName="url" id="url" [ngClass]="{ 'is-invalid': submitted && f.url.errors }" required> |
| 50 | <div *ngIf="osmrepoForm.invalid" class="invalid-feedback"> |
| 51 | <div *ngIf="f.url.errors && f.url.value">{{'DOMVALIDATIONS.INVALIDURL' | translate}}</div> |
| 52 | </div> |
| 53 | </div> |
| 54 | </div> |
| 55 | <div class="form-group row"> |
| 56 | <label class="col-sm-4 col-form-label" for="description">{{'DESCRIPTION' | translate}}*</label> |
| 57 | <div class="col-sm-8"> |
| 58 | <textarea rows="5" cols="50" class="form-control" placeholder="{{'DESCRIPTION' | translate}}" type="text" |
| 59 | formControlName="description" id="description" [ngClass]="{ 'is-invalid': submitted && f.description.errors }" |
| 60 | maxlength="{{sharedService.MAX_LENGTH_DESCRIPTION}}" required></textarea> |
| 61 | </div> |
| 62 | </div> |
| 63 | </div> |
| 64 | <div class="modal-footer"> |
| 65 | <button type="button" class="btn btn-danger" (click)="activeModal.close()">{{'CANCEL' | translate}}</button> |
| 66 | <button type="submit" |
| 67 | class="btn btn-primary">{{(getCreateupdateType === 'Add' ? 'ADD' : 'UPDATE') | translate}}</button> |
| 68 | </div> |
| 69 | </form> |
| 70 | <app-loader [waitingMessage]="message" *ngIf="isLoadingResults"></app-loader> |