feat(tasks): make done at column available for selection in table view

This change adds the done at column of tasks to the table view. It also ensures it is possible to sort the tasks by that column.

https://community.vikunja.io/t/is-it-possible-to-list-done-tasks-with-their-completion-date/1922
This commit is contained in:
kolaente 2024-02-12 17:55:54 +01:00
parent 28ed754c66
commit ee065d9238
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
3 changed files with 18 additions and 1 deletions

View File

@ -21,6 +21,7 @@ export interface SortBy {
percent_done?: Order
created?: Order
updated?: Order
done_at?: Order,
}
// FIXME: merge with DEFAULT_PARAMS in filters.vue

View File

@ -716,7 +716,8 @@
"repeat": "Repeat",
"startDate": "Start Date",
"title": "Title",
"updated": "Updated"
"updated": "Updated",
"doneAt": "Done At"
},
"subscription": {
"subscribedTaskThroughParentProject": "You can't unsubscribe here because you are subscribed to this task through its project.",

View File

@ -52,6 +52,9 @@
<Fancycheckbox v-model="activeColumns.percentDone">
{{ $t('task.attributes.percentDone') }}
</Fancycheckbox>
<Fancycheckbox v-model="activeColumns.doneAt">
{{ $t('task.attributes.doneAt') }}
</Fancycheckbox>
<Fancycheckbox v-model="activeColumns.created">
{{ $t('task.attributes.created') }}
</Fancycheckbox>
@ -144,6 +147,13 @@
@click="sort('percent_done')"
/>
</th>
<th v-if="activeColumns.doneAt">
{{ $t('task.attributes.doneAt') }}
<Sort
:order="sortBy.done_at"
@click="sort('done_at')"
/>
</th>
<th v-if="activeColumns.created">
{{ $t('task.attributes.created') }}
<Sort
@ -223,6 +233,10 @@
<td v-if="activeColumns.percentDone">
{{ t.percentDone * 100 }}%
</td>
<DateTableCell
v-if="activeColumns.doneAt"
:date="t.doneAt"
/>
<DateTableCell
v-if="activeColumns.created"
:date="t.created"
@ -297,6 +311,7 @@ const ACTIVE_COLUMNS_DEFAULT = {
created: false,
updated: false,
createdBy: false,
doneAt: false,
}
const SORT_BY_DEFAULT: SortBy = {