From 31f0c384ac3a45b242464b2a8bd8424ef8cbdfc7 Mon Sep 17 00:00:00 2001 From: konrad Date: Sat, 13 Nov 2021 19:48:06 +0000 Subject: [PATCH] feat: add button to clear active filters (#924) Co-authored-by: kolaente Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/924 Reviewed-by: dpschen Co-authored-by: konrad Co-committed-by: konrad --- cypress/integration/list/list.spec.js | 4 +- src/components/list/partials/filter-popup.vue | 96 +++++++----- src/components/list/partials/filters.vue | 10 +- src/components/misc/popup.vue | 54 +++++++ src/components/tasks/gantt-component.vue | 12 +- src/components/tasks/mixins/taskList.js | 8 +- src/i18n/lang/en.json | 1 + src/styles/components/list.scss | 5 - src/views/list/views/Kanban.vue | 42 ++---- src/views/list/views/List.vue | 28 ++-- src/views/list/views/Table.vue | 141 +++++++++--------- 11 files changed, 227 insertions(+), 174 deletions(-) create mode 100644 src/components/misc/popup.vue diff --git a/cypress/integration/list/list.spec.js b/cypress/integration/list/list.spec.js index 596c6adc..864b533b 100644 --- a/cypress/integration/list/list.spec.js +++ b/cypress/integration/list/list.spec.js @@ -219,10 +219,10 @@ describe('Lists', () => { cy.get('.table-view .filter-container .items .button') .contains('Columns') .click() - cy.get('.table-view .filter-container .card .card-content .fancycheckbox .check') + cy.get('.table-view .filter-container .card.columns-filter .card-content .fancycheckbox .check') .contains('Priority') .click() - cy.get('.table-view .filter-container .card .card-content .fancycheckbox .check') + cy.get('.table-view .filter-container .card.columns-filter .card-content .fancycheckbox .check') .contains('Done') .click() diff --git a/src/components/list/partials/filter-popup.vue b/src/components/list/partials/filter-popup.vue index e761fb9e..cabc5cfb 100644 --- a/src/components/list/partials/filter-popup.vue +++ b/src/components/list/partials/filter-popup.vue @@ -1,37 +1,49 @@ + + diff --git a/src/components/list/partials/filters.vue b/src/components/list/partials/filters.vue index d7679353..95a849d2 100644 --- a/src/components/list/partials/filters.vue +++ b/src/components/list/partials/filters.vue @@ -458,15 +458,7 @@ export default { return } - let foundDone = false - this.params.filter_by.forEach((f, i) => { - if (f === 'done') { - foundDone = i - } - }) - if (foundDone === false) { - this.filters.done = true - } + this.filters.done = this.params.filter_by.some((f) => f === 'done') === false }, async prepareRelatedObjectFilter(kind, filterName = null, servicePrefix = null) { if (filterName === null) { diff --git a/src/components/misc/popup.vue b/src/components/misc/popup.vue new file mode 100644 index 00000000..fcfa420e --- /dev/null +++ b/src/components/misc/popup.vue @@ -0,0 +1,54 @@ + + + + + diff --git a/src/components/tasks/gantt-component.vue b/src/components/tasks/gantt-component.vue index ac1df28d..9e56c755 100644 --- a/src/components/tasks/gantt-component.vue +++ b/src/components/tasks/gantt-component.vue @@ -9,12 +9,12 @@ > {{ $t('filters.title') }} + -