feat/alphabetical-sort #1162

Merged
dpschen merged 9 commits from :feat/alphabetical-sort into main 2021-12-21 16:29:50 +00:00
16 changed files with 4 additions and 21 deletions
Showing only changes of commit 1b6d50860c - Show all commits

View File

@ -195,7 +195,7 @@ import NamespaceService from '@/services/namespace'
import EditLabels from '@/components/tasks/partials/editLabels.vue'
import {objectToSnakeCase} from '@/helpers/case'
import {getDefaultParams} from "../../tasks/mixins/taskList"
import {getDefaultParams} from '../../tasks/mixins/taskList'
dpschen marked this conversation as resolved Outdated

Use @

Use `@`
// FIXME: merge with DEFAULT_PARAMS in taskList.js
const DEFAULT_PARAMS = {
@ -226,6 +226,8 @@ const DEFAULT_FILTERS = {
namespace: '',
}
const ALPHABETICAL_SORT = ['title']
export default {
name: 'filters',
components: {
@ -503,7 +505,7 @@ export default {
this.params.sort_by = getDefaultParams().sort_by
this.sortAlphabetically = false
konrad marked this conversation as resolved Outdated

Please use a const for that.

Please use a const for that.
} else {
this.params.sort_by = ['title']
this.params.sort_by = ALPHABETICAL_SORT
this.sortAlphabetically = true
}
this.change()

View File

@ -373,7 +373,6 @@
"includeNulls": "Zahrnout úkoly, které nemají nastavenou hodnotu",
"requireAll": "Vyžaduje aby všechny filtry odpovídaly, aby se úkol zobrazil",
"showDoneTasks": "Zobrazit dokončené úkoly",
"sortAlphabetically": "Sort Alphabetically",
"enablePriority": "Povolit filtrování podle priority",
konrad marked this conversation as resolved Outdated

This will be synced from crowdin automatically - please don't include it in this PR, only the string in en.json.

This will be synced from crowdin automatically - please don't include it in this PR, only the string in `en.json`.
"enablePercentDone": "Povolit filtrování dle dokončenosti",
"dueDateRange": "Rozsah termínu",

View File

@ -373,7 +373,6 @@
"includeNulls": "Aufgaben ohne Werte einbeziehen",
"requireAll": "Alle Filterkriterien müssen erfüllt sein, damit eine Aufgabe angezeigt wird",
"showDoneTasks": "Erledigte Aufgaben anzeigen",
"sortAlphabetically": "Sort Alphabetically",
"enablePriority": "Filter nach Priorität aktivieren",
"enablePercentDone": "Filter nach % Erledigt aktivieren",
"dueDateRange": "Fälligkeitsbereich",

View File

@ -373,7 +373,6 @@
"includeNulls": "Uufgabe ohni Wert iihbezieh",
"requireAll": "Alli Filter mend wahr sii, demits die Uufgab ahzeigt",
"showDoneTasks": "Zeig die fertige Uufgabe",
"sortAlphabetically": "Sort Alphabetically",
"enablePriority": "Filter nach Priorität aktiviere",
"enablePercentDone": "Filter nach Prozent iihschalte",
"dueDateRange": "Fälligkeitsberiich",

View File

@ -373,7 +373,6 @@
"includeNulls": "Include Tasks which don't have a value set",
"requireAll": "Require all filters to be true for a task to show up",
"showDoneTasks": "Show Done Tasks",
"sortAlphabetically": "Sort Alphabetically",
"enablePriority": "Enable Filter By Priority",
"enablePercentDone": "Enable Filter By Percent Done",
"dueDateRange": "Due Date Range",

View File

@ -373,7 +373,6 @@
"includeNulls": "Inclure les tâches sans valeurs",
"requireAll": "Exiger tous les filtres pour quune tâche saffiche",
"showDoneTasks": "Afficher les tâches terminées",
"sortAlphabetically": "Sort Alphabetically",
"enablePriority": "Activer le filtre par priorité",
"enablePercentDone": "Par % dachèvement",
"dueDateRange": "Plage de dates déchéance",

View File

@ -373,7 +373,6 @@
"includeNulls": "Includi attività che non hanno un valore impostato",
"requireAll": "Tutti i filtri devono essere veri affinché l'attività venga mostrata",
"showDoneTasks": "Mostra Attività Fatte",
"sortAlphabetically": "Sort Alphabetically",
"enablePriority": "Abilita Filtro Per Priorità",
"enablePercentDone": "Abilitare Filtro Per Percentuale Fatta",
"dueDateRange": "Intervallo Data Di Scadenza",

View File

@ -373,7 +373,6 @@
"includeNulls": "Include Tasks which don't have a value set",
"requireAll": "Require all filters to be true for a task to show up",
"showDoneTasks": "Show Done Tasks",
"sortAlphabetically": "Sort Alphabetically",
"enablePriority": "Enable Filter By Priority",
"enablePercentDone": "Enable Filter By Percent Done",
"dueDateRange": "Due Date Range",

View File

@ -373,7 +373,6 @@
"includeNulls": "Include Tasks which don't have a value set",
"requireAll": "Require all filters to be true for a task to show up",
"showDoneTasks": "Show Done Tasks",
"sortAlphabetically": "Sort Alphabetically",
"enablePriority": "Enable Filter By Priority",
"enablePercentDone": "Enable Filter By Percent Done",
"dueDateRange": "Due Date Range",

View File

@ -373,7 +373,6 @@
"includeNulls": "Include Tasks which don't have a value set",
"requireAll": "Require all filters to be true for a task to show up",
"showDoneTasks": "Show Done Tasks",
"sortAlphabetically": "Sort Alphabetically",
"enablePriority": "Enable Filter By Priority",
"enablePercentDone": "Enable Filter By Percent Done",
"dueDateRange": "Due Date Range",

View File

@ -373,7 +373,6 @@
"includeNulls": "Include Tasks which don't have a value set",
"requireAll": "Require all filters to be true for a task to show up",
"showDoneTasks": "Show Done Tasks",
"sortAlphabetically": "Sort Alphabetically",
"enablePriority": "Enable Filter By Priority",
"enablePercentDone": "Enable Filter By Percent Done",
"dueDateRange": "Due Date Range",

View File

@ -373,7 +373,6 @@
"includeNulls": "Включать задачи, у которых не установлено значение",
"requireAll": "Для отображения задачи требовать истинность всех фильтров",
"showDoneTasks": "Показывать завершённые задачи",
"sortAlphabetically": "Sort Alphabetically",
"enablePriority": "Вкл. фильтр по приоритету",
"enablePercentDone": "По % завершения",
"dueDateRange": "Диапазон срока",

View File

@ -373,7 +373,6 @@
"includeNulls": "Include Tasks which don't have a value set",
"requireAll": "Require all filters to be true for a task to show up",
"showDoneTasks": "Show Done Tasks",
"sortAlphabetically": "Sort Alphabetically",
"enablePriority": "Enable Filter By Priority",
"enablePercentDone": "Enable Filter By Percent Done",
"dueDateRange": "Due Date Range",

View File

@ -373,7 +373,6 @@
"includeNulls": "Include Tasks which don't have a value set",
"requireAll": "Require all filters to be true for a task to show up",
"showDoneTasks": "Show Done Tasks",
"sortAlphabetically": "Sort Alphabetically",
"enablePriority": "Enable Filter By Priority",
"enablePercentDone": "Enable Filter By Percent Done",
"dueDateRange": "Due Date Range",

View File

@ -373,7 +373,6 @@
"includeNulls": "Bao gồm các Công việc không có bộ giá trị",
"requireAll": "Yêu cầu tất cả các bộ lọc phải đúng để một công việc được hiển thị",
"showDoneTasks": "Hiển thị các công việc đã hoàn thành",
"sortAlphabetically": "Sort Alphabetically",
"enablePriority": "Bật Bộ lọc theo mức độ ưu tiên",
"enablePercentDone": "Bật Bộ lọc theo tỉ lệ % hoàn thành",
"dueDateRange": "Phạm vi ngày đến hạn",

View File

@ -261,11 +261,6 @@ export default {
this.$refs.newTaskInput.$refs.newTaskInput.focus()
},
updateTaskList() {
// const tasks = [
// task,
// ...this.tasks,
// ]
// this.tasks = tasks
this.$store.commit(HAS_TASKS, true)
this.reloadTasksWithCurrentFilterAndSorting()
dpschen marked this conversation as resolved Outdated

Still not quite happy with reloading everything. This gives a very noticable load flickering. I get why it is nessecary though. Maybe only reload if there are filters set and otherwise prepend the task as done already?

Still not quite happy with reloading everything. This gives a very noticable load flickering. I get why it is nessecary though. Maybe only reload if there are filters set and otherwise prepend the task as done already?

The sorting should probably happen on client and server side.
This way the client can sort already what he is aware of and fetches an update.

The sorting should probably happen on client _and_ server side. This way the client can sort already what he is aware of and fetches an update.

Since this would require a bit of work, I think we should do this in another PR and keep the current logic of prepending new tasks to the list.

Since this would require a bit of work, I think we should do this in another PR and keep the current logic of prepending new tasks to the list.

So should I do reload only if filters and/or sorts are set ?

So should I do reload only if filters and/or sorts are set ?

I think that would be a good idea.

I think that would be a good idea.
},
dpschen marked this conversation as resolved
Review

Instead of putting this in a new function just make a comment:

// reload tasks with current filter and sorting
this.loadTasks(1, undefined, undefined, true)
Instead of putting this in a new function just make a comment: ```js // reload tasks with current filter and sorting this.loadTasks(1, undefined, undefined, true) ```