Skip to content

Commit

Permalink
fix(admin-ui): Make emailAddress required in CustomerDetail form
Browse files Browse the repository at this point in the history
Relates to #438
michaelbromley committed Aug 18, 2020
1 parent 6c76ebe commit 2a9ee2e
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -49,20 +49,20 @@
>
<input id="lastName" type="text" formControlName="lastName" />
</vdr-form-field>
<vdr-form-field
[label]="'customer.phone-number' | translate"
for="phoneNumber"
[readOnlyToggle]="!(isNew$ | async)"
>
<input id="phoneNumber" type="text" formControlName="phoneNumber" />
</vdr-form-field>
<vdr-form-field
[label]="'customer.email-address' | translate"
for="emailAddress"
[readOnlyToggle]="!(isNew$ | async)"
>
<input id="emailAddress" type="text" formControlName="emailAddress" />
</vdr-form-field>
<vdr-form-field
[label]="'customer.phone-number' | translate"
for="phoneNumber"
[readOnlyToggle]="!(isNew$ | async)"
>
<input id="phoneNumber" type="text" formControlName="phoneNumber" />
</vdr-form-field>
<vdr-form-field [label]="'customer.password' | translate" for="password" *ngIf="isNew$ | async">
<input id="password" type="password" formControlName="password" />
</vdr-form-field>
Original file line number Diff line number Diff line change
@@ -80,7 +80,7 @@ export class CustomerDetailComponent extends BaseDetailComponent<CustomerWithOrd
firstName: ['', Validators.required],
lastName: ['', Validators.required],
phoneNumber: '',
emailAddress: '',
emailAddress: ['', [Validators.required, Validators.email]],
password: '',
customFields: this.formBuilder.group(
this.customFields.reduce((hash, field) => ({ ...hash, [field.name]: '' }), {}),

0 comments on commit 2a9ee2e

Please sign in to comment.