From 61f635b859d9b965b4bd8bea932ccf6718299293 Mon Sep 17 00:00:00 2001 From: Sergii Leonenko Date: Wed, 4 Nov 2020 13:43:09 +0200 Subject: [PATCH] TT#96802 CSC: As a Customer, I want to filter PBXGroups AC: Can filter by display_name Can filter by extension Can filter by primary_number Can filter by alias_number Can filter the same way as it is possible for PBXSeats Can navigate through filtered items via pagination - in addition there were added "data-cy" attributes to simplify selectors for E2E tools like Cypress. Change-Id: Iba3919a198c2464982502d529b54182bc266bb01 --- src/api/pbx-groups.js | 2 + .../PbxConfiguration/CscPbxGroupAddForm.vue | 9 + .../PbxConfiguration/CscPbxGroupFilters.vue | 162 ++++++++++++++++++ src/i18n/en.json | 2 + src/pages/CscPagePbxGroups.vue | 87 +++++++++- src/store/pbx-groups.js | 4 +- 6 files changed, 256 insertions(+), 10 deletions(-) create mode 100644 src/components/pages/PbxConfiguration/CscPbxGroupFilters.vue diff --git a/src/api/pbx-groups.js b/src/api/pbx-groups.js index 82a6800c..997d8c91 100644 --- a/src/api/pbx-groups.js +++ b/src/api/pbx-groups.js @@ -85,10 +85,12 @@ export function getGroupsOnly (options) { export function getGroupList (options) { return new Promise((resolve, reject) => { const page = _.get(options, 'page', 1) + const filters = _.get(options, 'filters', {}) Promise.all([ getGroups({ params: { page: page, + ...filters, order_by: PBX_CONFIG_ORDER_BY, order_by_direction: PBX_CONFIG_ORDER_DIRECTION } diff --git a/src/components/pages/PbxConfiguration/CscPbxGroupAddForm.vue b/src/components/pages/PbxConfiguration/CscPbxGroupAddForm.vue index d423e2d9..c4ab2f95 100644 --- a/src/components/pages/PbxConfiguration/CscPbxGroupAddForm.vue +++ b/src/components/pages/PbxConfiguration/CscPbxGroupAddForm.vue @@ -16,6 +16,7 @@ :disable="loading" :readonly="loading" :label="$t('pbxConfig.groupName')" + data-cy="group-name" @input="$v.data.name.$touch" /> @@ -70,6 +74,7 @@ :readonly="loading" :label="$t('pbxConfig.aliasNumbers')" :options="aliasNumberOptions" + data-cy="group-alias-numbers" /> @@ -103,6 +110,7 @@ flat color="default" icon="clear" + data-cy="group-btn-clear" @mousedown.native="cancel()" > {{ $t('buttons.cancel') }} @@ -113,6 +121,7 @@ color="primary" icon="group" :disable="$v.data.$invalid" + data-cy="group-btn-save" @click="save()" > {{ $t('pbxConfig.createGroup') }} diff --git a/src/components/pages/PbxConfiguration/CscPbxGroupFilters.vue b/src/components/pages/PbxConfiguration/CscPbxGroupFilters.vue new file mode 100644 index 00000000..6cb783a7 --- /dev/null +++ b/src/components/pages/PbxConfiguration/CscPbxGroupFilters.vue @@ -0,0 +1,162 @@ + + + diff --git a/src/i18n/en.json b/src/i18n/en.json index ad3a5bc2..a3d465e1 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -460,6 +460,7 @@ "removeGroup": "Remove group", "removeGroupTitle": "Remove group", "removeGroupText": "You are about to remove group {group}", + "filterGroups": "Filter groups", "name": "Name", "seatName": "Seat name", "addSeat": "Add Seat", @@ -483,6 +484,7 @@ "noMacAddress": "Could not find any device with MAC address matching the filter criteria", "noStationName": "Could not find any device with station name matching the filter criteria", "noGroups": "No groups created yet", + "noGroupsFound": "Could not find any group matching any of the filter criteria", "noSeats": "No seats created yet", "noCallQueues": "No call queues created yet", "noSoundSets": "No sound sets created yet", diff --git a/src/pages/CscPagePbxGroups.vue b/src/pages/CscPagePbxGroups.vue index 080b133a..1fcc8bc9 100644 --- a/src/pages/CscPagePbxGroups.vue +++ b/src/pages/CscPagePbxGroups.vue @@ -4,7 +4,7 @@ class="q-pa-lg" > + + +
+ + +
+ {{ $t('pbxConfig.noGroupsFound') }} +
+
{{ $t('pbxConfig.noGroups') }} @@ -100,6 +134,7 @@