mirror of https://kolaente.dev/vikunja/api.git
add user setting for comment ordering
This commit is contained in:
parent
574c7f218e
commit
d1799ff980
|
@ -269,7 +269,8 @@ async function loadComments(taskId: ITask['id']) {
|
|||
newComment.taskId = taskId
|
||||
commentEdit.taskId = taskId
|
||||
commentToDelete.taskId = taskId
|
||||
comments.value = await taskCommentService.getAll({taskId})
|
||||
let order = authStore.settings.frontendSettings.commentOrder;
|
||||
comments.value = await taskCommentService.getAll({taskId}, {order: order})
|
||||
}
|
||||
|
||||
watch(
|
||||
|
|
|
@ -150,6 +150,11 @@
|
|||
"dark": "Dark"
|
||||
}
|
||||
},
|
||||
"commentOrder": {
|
||||
"title": "Comment order",
|
||||
"asc": "Oldest first",
|
||||
"desc": "Newest first"
|
||||
},
|
||||
"apiTokens": {
|
||||
"title": "API Tokens",
|
||||
"general": "API tokens allow you to use Vikunja's API without user credentials.",
|
||||
|
@ -1206,4 +1211,4 @@
|
|||
"years": "year|years"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ export interface IFrontendSettings {
|
|||
quickAddMagicMode: PrefixMode
|
||||
colorSchema: BasicColorSchema
|
||||
filterIdUsedOnOverview: IProject['id'] | null
|
||||
commentOrder: string
|
||||
}
|
||||
|
||||
export interface IUserSettings extends IAbstract {
|
||||
|
|
|
@ -19,6 +19,7 @@ export default class UserSettingsModel extends AbstractModel<IUserSettings> impl
|
|||
playSoundWhenDone: true,
|
||||
quickAddMagicMode: PrefixMode.Default,
|
||||
colorSchema: 'auto',
|
||||
commentOrder: 'asc',
|
||||
}
|
||||
|
||||
constructor(data: Partial<IUserSettings> = {}) {
|
||||
|
|
|
@ -103,6 +103,7 @@ export const useAuthStore = defineStore('auth', () => {
|
|||
playSoundWhenDone: true,
|
||||
quickAddMagicMode: PrefixMode.Default,
|
||||
colorSchema: 'auto',
|
||||
commentOrder: 'asc',
|
||||
...newSettings.frontendSettings,
|
||||
},
|
||||
})
|
||||
|
|
|
@ -187,6 +187,23 @@
|
|||
</div>
|
||||
</label>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="is-flex is-align-items-center">
|
||||
<span>
|
||||
{{ $t('user.settings.commentOrder.title') }}
|
||||
</span>
|
||||
<div class="select ml-2">
|
||||
<select v-model="settings.frontendSettings.commentOrder">
|
||||
<option value="asc">
|
||||
{{ $t('user.settings.commentOrder.asc') }}
|
||||
</option>
|
||||
<option value="desc">
|
||||
{{ $t('user.settings.commentOrder.desc') }}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<x-button
|
||||
v-cy="'saveGeneralSettings'"
|
||||
|
|
Loading…
Reference in New Issue