feat:Users Translate Module (#1824)

This commit is contained in:
RADHA THAKARE
2023-09-15 14:19:12 -06:00
committed by GitHub
parent 13fb191e3b
commit a042b74211
4 changed files with 63 additions and 63 deletions
@@ -9,66 +9,66 @@
<div fxLayout="row wrap" fxLayoutGap="2%" fxLayout.lt-md="column">
<mat-form-field fxFlex="48%">
<mat-label>Username</mat-label>
<mat-label>{{ 'labels.inputs.Username' |translate}}</mat-label>
<input matInput required formControlName="username"/>
<mat-error *ngIf="editUserForm.controls.username.hasError('required')">
Username is <strong>required</strong>
{{ 'labels.inputs.Username' |translate}} {{ "labels.commons.is" |translate}} <strong>{{ "labels.commons.required" |translate}}</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>Email</mat-label>
<mat-label>{{ 'labels.inputs.Email' |translate}}</mat-label>
<input matInput required formControlName="email">
<mat-error *ngIf="editUserForm.controls.email.hasError('email')">
Email is <strong>invalid</strong>
{{ 'labels.inputs.Email' |translate}} {{ "labels.commons.is" |translate}} <strong>{{ "labels.commons.invalid' |translate}}</strong>
</mat-error>
<mat-error *ngIf="editUserForm.controls.email.hasError('required')">
Email is <strong>required</strong>
{{ 'labels.inputs.Email' |translate}} {{ "labels.commons.is" |translate}} <strong>{{ "labels.commons.required" |translate}}</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>First name</mat-label>
<mat-label>{{ 'labels.inputs.First Name' |translate}}</mat-label>
<input matInput required formControlName="firstname"/>
<mat-error *ngIf="editUserForm.controls.firstname.hasError('pattern')">
First Name <strong>cannot begin with a special character or number</strong>
{{ 'labels.inputs.First Name' |translate}} <strong>{{ "labels.commons.cannot begin with a special character or number" |translate}}</strong>
</mat-error>
<mat-error *ngIf="editUserForm.controls.firstname.hasError('required')">
First Name is <strong>required</strong>
{{ 'labels.inputs.First Name' |translate}} {{ "labels.commons.is" |translate}} <strong>{{ "labels.commons.required" |translate}}</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>Last name</mat-label>
<mat-label>{{ 'labels.inputs.Last Name' |translate}}</mat-label>
<input matInput required formControlName="lastname"/>
<mat-error *ngIf="editUserForm.controls.lastname.hasError('pattern')">
Last Name <strong>cannot begin with a special character or number</strong>
{{ 'labels.inputs.Last Name' |translate}} <strong>{{ "labels.commons.cannot begin with a special character or number" |translate}}</strong>
</mat-error>
<mat-error *ngIf="editUserForm.controls.lastname.hasError('required')">
Last Name is <strong>required</strong>
{{ 'labels.inputs.Last Name' |translate}} {{ "labels.commons.is" |translate}} <strong>{{ "labels.commons.required" |translate}}</strong>
</mat-error>
</mat-form-field>
<div class="password-never-expires-wrapper" fxFlex="48%">
<mat-checkbox labelPosition="before" formControlName="passwordNeverExpires" >
Override password expiry policy
{{ 'labels.inputs.Override password expiry policy' |translate}}
</mat-checkbox>
</div>
<mat-form-field fxFlex="48%">
<mat-label>Office</mat-label>
<mat-label>{{ 'labels.inputs.Office' |translate}}</mat-label>
<mat-select required formControlName="officeId" (selectionChange)="officeChanged($event.value)">
<mat-option *ngFor="let office of officesData" [value]="office.id">
{{ office.name }}
</mat-option>
</mat-select>
<mat-error *ngIf="editUserForm.controls.officeId.hasError('required')">
Office is <strong>required</strong>
{{ 'labels.inputs.Office' |translate}} {{ "labels.commons.is" |translate}} <strong>{{ "labels.commons.required" |translate}}</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>Staff</mat-label>
<mat-label>{{ 'labels.inputs.Staff' |translate}}</mat-label>
<mat-select formControlName="staffId">
<mat-option *ngFor="let staff of staffData" [value]="staff.id">
{{ staff.displayName }}
@@ -77,14 +77,14 @@
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>Roles</mat-label>
<mat-label>{{ 'labels.inputs.Roles' |translate}}</mat-label>
<mat-select required formControlName="roles" multiple>
<mat-option *ngFor="let role of rolesData" [value]="role.id">
{{ role.name }}
</mat-option>
</mat-select>
<mat-error *ngIf="editUserForm.controls.roles.hasError('required')">
At least one role <strong>must be selected</strong>
{{ "labels.commons.At least one role" |translate}} <strong>{{ "labels.commons.must be selected" |translate}}</strong>
</mat-error>
</mat-form-field>
@@ -93,8 +93,8 @@
</mat-card-content>
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!editUserForm.valid">Submit</button>
<button type="button" mat-raised-button [routerLink]="['../']">{{ 'labels.buttons.Cancel' |translate}}</button>
<button mat-raised-button color="primary" [disabled]="!editUserForm.valid">{{ 'labels.buttons.Submit' |translate}}</button>
</mat-card-actions>
</form>