fix: archive list
continuous-integration/drone/pr Build is passing Details

This commit is contained in:
Dominik Pschenitschni 2022-11-18 17:54:14 +01:00
parent 537f4ed3ae
commit cba7692f16
Signed by: dpschen
GPG Key ID: B257AC0149F43A77
4 changed files with 16 additions and 6 deletions

View File

@ -22,6 +22,13 @@
>
{{ $t('menu.unarchive') }}
</dropdown-item>
<dropdown-item
:to="{ name: 'list.settings.delete', params: { listId: list.id } }"
icon="trash-alt"
class="has-text-danger"
>
{{ $t('menu.delete') }}
</dropdown-item>
</template>
<template v-else>
<dropdown-item

View File

@ -169,7 +169,6 @@
"title": "List Title",
"color": "Color",
"lists": "Lists",
"list": "List",
"search": "Type to search for a list…",
"searchSelect": "Click or press enter to select this list",
"shared": "Shared Lists",
@ -187,7 +186,8 @@
"unarchive": "Un-Archive this list",
"unarchiveText": "You will be able to create new tasks or edit it.",
"archiveText": "You won't be able to edit this list or create new tasks until you un-archive it.",
"success": "The list was successfully archived."
"successArchived": "The list has been successfully archived.",
"successUnarchived": "The list has been successfully unarchived."
},
"background": {
"title": "Set list background",

View File

@ -183,14 +183,17 @@ export const useListStore = defineStore('list', () => {
}
}
async function archiveList(list: IList) {
async function toggleArchiveList(list: IList) {
try {
const newList = await updateList({
...list,
isArchived: !list.isArchived,
})
baseStore.setCurrentList(newList)
success({message: i18n.global.t('list.archive.success')})
success({message: newList.isArchived
? i18n.global.t('list.archive.successArchived')
: i18n.global.t('list.archive.successUnarchived'),
})
} finally {
router.back()
}
@ -316,7 +319,7 @@ export const useListStore = defineStore('list', () => {
updateList,
deleteList,
archiveList,
toggleArchiveList,
//duplciate
isDuplicatingList,

View File

@ -1,7 +1,7 @@
<template>
<modal
@close="$router.back()"
@submit="listStore.archiveList(list)"
@submit="listStore.toggleArchiveList(list)"
>
<template #header>
<span>{{