From 86efb07f098392f50ebf607c070f321d34697205 Mon Sep 17 00:00:00 2001 From: kolaente Date: Tue, 2 Nov 2021 21:59:14 +0100 Subject: [PATCH] feat: create new popup component to handle popups generally --- src/components/list/partials/filter-popup.vue | 73 +++++-------------- src/components/misc/popup.vue | 63 ++++++++++++++++ src/components/tasks/mixins/taskList.js | 6 +- src/views/list/views/Kanban.vue | 14 +--- src/views/list/views/List.vue | 10 +-- src/views/list/views/Table.vue | 10 +-- 6 files changed, 88 insertions(+), 88 deletions(-) create mode 100644 src/components/misc/popup.vue diff --git a/src/components/list/partials/filter-popup.vue b/src/components/list/partials/filter-popup.vue index 8d0381119..ab1d496d9 100644 --- a/src/components/list/partials/filter-popup.vue +++ b/src/components/list/partials/filter-popup.vue @@ -6,39 +6,42 @@ > {{ $t('filters.clear') }} - + + + + - - diff --git a/src/components/misc/popup.vue b/src/components/misc/popup.vue new file mode 100644 index 000000000..55d40fea4 --- /dev/null +++ b/src/components/misc/popup.vue @@ -0,0 +1,63 @@ + + + + + diff --git a/src/components/tasks/mixins/taskList.js b/src/components/tasks/mixins/taskList.js index 13d33d5b0..5326b25ed 100644 --- a/src/components/tasks/mixins/taskList.js +++ b/src/components/tasks/mixins/taskList.js @@ -1,16 +1,14 @@ import TaskCollectionService from '@/services/taskCollection' // FIXME: merge with DEFAULT_PARAMS in filters.vue -const DEFAULT_PARAMS = { +export const getDefaultParams = () => ({ sort_by: ['position', 'id'], order_by: ['asc', 'desc'], filter_by: ['done'], filter_value: ['false'], filter_comparator: ['equals'], filter_concat: 'and', -} - -export const getDefaultParams = () => ({...DEFAULT_PARAMS}) +}) /** * This mixin provides a base set of methods and properties to get tasks on a list. diff --git a/src/views/list/views/Kanban.vue b/src/views/list/views/Kanban.vue index a0b555ecc..ac220296c 100644 --- a/src/views/list/views/Kanban.vue +++ b/src/views/list/views/Kanban.vue @@ -2,16 +2,9 @@
- - {{ $t('filters.title') }} -
@@ -300,7 +293,6 @@ export default { filter_comparator: [], filter_concat: 'and', }, - showFilters: false, } }, created() { @@ -359,10 +351,6 @@ export default { }, methods: { - toggleFilterPopup() { - this.showFilters = !this.showFilters - }, - loadBuckets() { // Prevent trying to load buckets if the task popup view is active if (this.$route.name !== 'list.kanban') { diff --git a/src/views/list/views/List.vue b/src/views/list/views/List.vue index 9200aab31..c42314dc8 100644 --- a/src/views/list/views/List.vue +++ b/src/views/list/views/List.vue @@ -41,15 +41,7 @@ v-if="!showTaskSearch" />
- - {{ $t('filters.title') }} - @@ -154,6 +146,7 @@ import FilterPopup from '@/components/list/partials/filter-popup.vue' import {HAS_TASKS} from '@/store/mutation-types' import Nothing from '@/components/misc/nothing.vue' import Pagination from '@/components/misc/pagination.vue' +import Popup from '@/components/misc/popup' import draggable from 'vuedraggable' import {calculateItemPosition} from '../../../helpers/calculateItemPosition' @@ -197,6 +190,7 @@ export default { taskList, ], components: { + Popup, Nothing, FilterPopup, SingleTaskInList, diff --git a/src/views/list/views/Table.vue b/src/views/list/views/Table.vue index 56fa57e49..0d3656945 100644 --- a/src/views/list/views/Table.vue +++ b/src/views/list/views/Table.vue @@ -3,21 +3,13 @@
{{ $t('list.table.columns') }} - - {{ $t('filters.title') }} -