fix: archive list
This commit is contained in:
parent
1f35499227
commit
78661dd57f
|
@ -30,6 +30,13 @@
|
||||||
>
|
>
|
||||||
{{ $t('menu.unarchive') }}
|
{{ $t('menu.unarchive') }}
|
||||||
</dropdown-item>
|
</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>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<dropdown-item
|
<dropdown-item
|
||||||
|
|
|
@ -169,7 +169,6 @@
|
||||||
"title": "List Title",
|
"title": "List Title",
|
||||||
"color": "Color",
|
"color": "Color",
|
||||||
"lists": "Lists",
|
"lists": "Lists",
|
||||||
"list": "List",
|
|
||||||
"search": "Type to search for a list…",
|
"search": "Type to search for a list…",
|
||||||
"searchSelect": "Click or press enter to select this list",
|
"searchSelect": "Click or press enter to select this list",
|
||||||
"shared": "Shared Lists",
|
"shared": "Shared Lists",
|
||||||
|
@ -187,7 +186,8 @@
|
||||||
"unarchive": "Un-Archive this list",
|
"unarchive": "Un-Archive this list",
|
||||||
"unarchiveText": "You will be able to create new tasks or edit it.",
|
"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.",
|
"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": {
|
"background": {
|
||||||
"title": "Set list background",
|
"title": "Set list background",
|
||||||
|
|
|
@ -183,14 +183,17 @@ export const useListStore = defineStore('list', () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function archiveList(list: IList) {
|
async function toggleArchiveList(list: IList) {
|
||||||
try {
|
try {
|
||||||
const newList = await updateList({
|
const newList = await updateList({
|
||||||
...list,
|
...list,
|
||||||
isArchived: !list.isArchived,
|
isArchived: !list.isArchived,
|
||||||
})
|
})
|
||||||
baseStore.setCurrentList(newList)
|
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 {
|
} finally {
|
||||||
router.back()
|
router.back()
|
||||||
}
|
}
|
||||||
|
@ -316,7 +319,7 @@ export const useListStore = defineStore('list', () => {
|
||||||
updateList,
|
updateList,
|
||||||
deleteList,
|
deleteList,
|
||||||
|
|
||||||
archiveList,
|
toggleArchiveList,
|
||||||
|
|
||||||
//duplciate
|
//duplciate
|
||||||
isDuplicatingList,
|
isDuplicatingList,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<modal
|
<modal
|
||||||
@close="$router.back()"
|
@close="$router.back()"
|
||||||
@submit="listStore.archiveList(list)"
|
@submit="listStore.toggleArchiveList(list)"
|
||||||
>
|
>
|
||||||
<template #header>
|
<template #header>
|
||||||
<span>{{
|
<span>{{
|
||||||
|
|
Reference in New Issue
Block a user