From fff6f190ae0e3bec0d92472afb055805644f4c1a Mon Sep 17 00:00:00 2001 From: Michael Bromley Date: Tue, 27 Aug 2019 11:00:32 +0200 Subject: [PATCH] feat(admin-ui): Add filtering to countries list --- admin-ui/src/app/data/providers/settings-data.service.ts | 5 ++++- .../components/country-list/country-list.component.html | 7 +++++++ .../components/country-list/country-list.component.scss | 4 ++++ .../components/country-list/country-list.component.ts | 8 ++++++-- admin-ui/src/i18n-messages/en.json | 1 + 5 files changed, 22 insertions(+), 3 deletions(-) diff --git a/admin-ui/src/app/data/providers/settings-data.service.ts b/admin-ui/src/app/data/providers/settings-data.service.ts index 2073d0380b..8b4d56c2d0 100644 --- a/admin-ui/src/app/data/providers/settings-data.service.ts +++ b/admin-ui/src/app/data/providers/settings-data.service.ts @@ -89,11 +89,14 @@ import { BaseDataService } from './base-data.service'; export class SettingsDataService { constructor(private baseDataService: BaseDataService) {} - getCountries(take: number = 10, skip: number = 0) { + getCountries(take: number = 10, skip: number = 0, filterTerm?: string) { return this.baseDataService.query(GET_COUNTRY_LIST, { options: { take, skip, + filter: { + name: filterTerm ? { contains: filterTerm } : null, + }, }, }); } diff --git a/admin-ui/src/app/settings/components/country-list/country-list.component.html b/admin-ui/src/app/settings/components/country-list/country-list.component.html index 4512dd37ca..05fc299cc4 100644 --- a/admin-ui/src/app/settings/components/country-list/country-list.component.html +++ b/admin-ui/src/app/settings/components/country-list/country-list.component.html @@ -1,5 +1,12 @@ +