Explorar o código

feat(admin-ui): Add phoneNumber to customer detail form

Closes #359
Michael Bromley %!s(int64=5) %!d(string=hai) anos
pai
achega
768c838d3d

+ 7 - 0
packages/admin-ui/src/lib/customer/src/components/customer-detail/customer-detail.component.html

@@ -46,6 +46,13 @@
     >
         <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"

+ 2 - 0
packages/admin-ui/src/lib/customer/src/components/customer-detail/customer-detail.component.ts

@@ -145,6 +145,7 @@ export class CustomerDetailComponent extends BaseDetailComponent<CustomerWithOrd
             emailAddress: formValue.emailAddress,
             firstName: formValue.firstName,
             lastName: formValue.lastName,
+            phoneNumber: formValue.phoneNumber,
         };
         this.dataService.customer.createCustomer(customer, formValue.password).subscribe(
             (data) => {
@@ -187,6 +188,7 @@ export class CustomerDetailComponent extends BaseDetailComponent<CustomerWithOrd
                             emailAddress: formValue.emailAddress,
                             firstName: formValue.firstName,
                             lastName: formValue.lastName,
+                            phoneNumber: formValue.phoneNumber,
                         };
                         saveOperations.push(this.dataService.customer.updateCustomer(customer));
                     }