Skip to content

Commit

Permalink
fix(admin-ui): Add custom field support to Customer list
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbromley committed Sep 7, 2023
1 parent 6e70794 commit 298e90c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,5 @@
{{ customer.emailAddress }}
</ng-template>
</vdr-dt2-column>
<vdr-dt2-custom-field-column *ngFor="let field of customFields" [customField]="field" [sorts]="sorts" />
</vdr-data-table-2>
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export class CustomerListComponent
extends TypedBaseListComponent<typeof CustomerListQueryDocument, 'customers'>
implements OnInit
{
readonly customFields = this.getCustomFieldConfig('Customer');
readonly filters = this.createFilterCollection()
.addIdFilter()
.addDateFilters()
Expand All @@ -58,6 +59,7 @@ export class CustomerListComponent
label: _('customer.email-address'),
filterField: 'emailAddress',
})
.addCustomFieldFilters(this.customFields)
.connectToRoute(this.route);

readonly sorts = this.createSortCollection()
Expand All @@ -66,6 +68,7 @@ export class CustomerListComponent
.addSort({ name: 'updatedAt' })
.addSort({ name: 'lastName' })
.addSort({ name: 'emailAddress' })
.addCustomFieldSorts(this.customFields)
.connectToRoute(this.route);

constructor() {
Expand Down

0 comments on commit 298e90c

Please sign in to comment.