argos/dmp-frontend/src/app/ui/dmp/editor/add-organization/add-organization.component....

29 lines
2.3 KiB
HTML

<form *ngIf="formGroup" [formGroup]="formGroup">
<h1 mat-dialog-title>{{'ADDORGANIZATION-EDITOR.TITLE' | translate}}</h1>
<div mat-dialog-content class="row pb-2">
<mat-form-field class="col-12">
<input matInput formControlName="reference" [placeholder]="'DMP-EDITOR.MAIN-INFO.UNIQUE-IDENTIFIER' | translate" required>
<mat-error *ngIf="formGroup.get('reference').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
<i matSuffix class="fa fa-spinner fa-spin" *ngIf="formGroup.get('reference').pending !referenceExists"></i>
<mat-error *ngIf="formGroup.get('reference').hasError('organizationIdentifierExists')">{{'DMP-EDITOR.MAIN-INFO.ORGANISATION-IDENTIFIER-EXISTS' | translate}}</mat-error>
<mat-icon *ngIf="!formGroup.get('reference').pending && formGroup.get('reference').dirty && formGroup.get('reference').valid && !referenceExists" class="text-success" matSuffix>check</mat-icon>
<mat-icon *ngIf="!formGroup.get('reference').pending && formGroup.get('reference').dirty && formGroup.get('reference').invalid || referenceExists" class="text-danger" matSuffix>clear</mat-icon>
<small *ngIf="referenceExists" class="text-danger">{{'DMP-EDITOR.MAIN-INFO.IDENTIFIER-EXISTS-ORGANISATION-LIST' | translate}}</small>
</mat-form-field>
<mat-form-field class="col-12">
<input matInput formControlName="name" placeholder="{{'ADDORGANIZATION-EDITOR.NAME' | translate}}" required>
<mat-error *ngIf="formGroup.get('name').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</mat-form-field>
<!-- <mat-form-field class="col-12">
<input matInput formControlName="lastName" placeholder="{{'ADDORGANIZATION-EDITOR.LAST_NAME' | translate}}" required>
<mat-error *ngIf="formGroup.get('lastName').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</mat-form-field> -->
<div class="col-12">
<div class="row">
<div class="ml-auto col-auto"><button mat-raised-button mat-dialog-close type="button">{{'ADDORGANIZATION-EDITOR.ACTIONS.CANCEL' | translate}}</button></div>
<div class="col-auto"><button mat-raised-button [disabled]="!isFormValid()" color="primary" (click)="addOrganization()" type="button">{{'ADDORGANIZATION-EDITOR.ACTIONS.SAVE' | translate}}</button></div>
</div>
</div>
</div>
</form>