2021-01-30 17:17:04 +01:00
|
|
|
<template>
|
|
|
|
<dropdown>
|
|
|
|
<template v-if="isSavedFilter">
|
|
|
|
<dropdown-item
|
2021-11-01 18:19:59 +01:00
|
|
|
:to="{ name: 'filter.settings.edit', params: { listId: list.id } }"
|
2021-01-30 17:17:04 +01:00
|
|
|
icon="pen"
|
|
|
|
>
|
2021-06-24 01:24:57 +02:00
|
|
|
{{ $t('menu.edit') }}
|
2021-01-30 17:17:04 +01:00
|
|
|
</dropdown-item>
|
|
|
|
<dropdown-item
|
2021-11-01 18:19:59 +01:00
|
|
|
:to="{ name: 'filter.settings.delete', params: { listId: list.id } }"
|
2021-01-30 17:17:04 +01:00
|
|
|
icon="trash-alt"
|
|
|
|
>
|
2021-06-24 01:24:57 +02:00
|
|
|
{{ $t('misc.delete') }}
|
2021-01-30 17:17:04 +01:00
|
|
|
</dropdown-item>
|
|
|
|
</template>
|
2021-11-01 18:19:59 +01:00
|
|
|
|
2021-01-30 17:17:04 +01:00
|
|
|
<template v-else-if="list.isArchived">
|
|
|
|
<dropdown-item
|
2021-11-01 18:19:59 +01:00
|
|
|
:to="{ name: 'list.settings.archive', params: { listId: list.id } }"
|
2021-01-30 17:17:04 +01:00
|
|
|
icon="archive"
|
|
|
|
>
|
2021-06-24 01:24:57 +02:00
|
|
|
{{ $t('menu.unarchive') }}
|
2021-01-30 17:17:04 +01:00
|
|
|
</dropdown-item>
|
|
|
|
</template>
|
|
|
|
<template v-else>
|
|
|
|
<dropdown-item
|
2021-11-01 18:19:59 +01:00
|
|
|
:to="{ name: 'list.settings.edit', params: { listId: list.id } }"
|
2021-01-30 17:17:04 +01:00
|
|
|
icon="pen"
|
|
|
|
>
|
2021-06-24 01:24:57 +02:00
|
|
|
{{ $t('menu.edit') }}
|
2021-01-30 17:17:04 +01:00
|
|
|
</dropdown-item>
|
|
|
|
<dropdown-item
|
|
|
|
v-if="backgroundsEnabled"
|
2021-11-01 18:19:59 +01:00
|
|
|
:to="{ name: 'list.settings.background', params: { listId: list.id } }"
|
2021-01-30 17:17:04 +01:00
|
|
|
icon="image"
|
|
|
|
>
|
2021-06-24 01:24:57 +02:00
|
|
|
{{ $t('menu.setBackground') }}
|
2021-01-30 17:17:04 +01:00
|
|
|
</dropdown-item>
|
|
|
|
<dropdown-item
|
2021-11-01 18:19:59 +01:00
|
|
|
:to="{ name: 'list.settings.share', params: { listId: list.id } }"
|
2021-01-30 17:17:04 +01:00
|
|
|
icon="share-alt"
|
|
|
|
>
|
2021-06-24 01:24:57 +02:00
|
|
|
{{ $t('menu.share') }}
|
2021-01-30 17:17:04 +01:00
|
|
|
</dropdown-item>
|
|
|
|
<dropdown-item
|
2021-11-01 18:19:59 +01:00
|
|
|
:to="{ name: 'list.settings.duplicate', params: { listId: list.id } }"
|
2021-01-30 17:17:04 +01:00
|
|
|
icon="paste"
|
|
|
|
>
|
2021-06-24 01:24:57 +02:00
|
|
|
{{ $t('menu.duplicate') }}
|
2021-01-30 17:17:04 +01:00
|
|
|
</dropdown-item>
|
|
|
|
<dropdown-item
|
2021-11-01 18:19:59 +01:00
|
|
|
:to="{ name: 'list.settings.archive', params: { listId: list.id } }"
|
2021-01-30 17:17:04 +01:00
|
|
|
icon="archive"
|
|
|
|
>
|
2021-06-24 01:24:57 +02:00
|
|
|
{{ $t('menu.archive') }}
|
2021-01-30 17:17:04 +01:00
|
|
|
</dropdown-item>
|
2021-02-14 20:18:51 +01:00
|
|
|
<task-subscription
|
2022-01-30 13:40:14 +01:00
|
|
|
v-if="subscription"
|
2021-02-14 20:18:51 +01:00
|
|
|
class="dropdown-item has-no-shadow"
|
|
|
|
:is-button="false"
|
|
|
|
entity="list"
|
|
|
|
:entity-id="list.id"
|
|
|
|
:subscription="subscription"
|
|
|
|
@change="sub => subscription = sub"
|
|
|
|
/>
|
2021-01-30 17:17:04 +01:00
|
|
|
<dropdown-item
|
2021-11-01 18:19:59 +01:00
|
|
|
:to="{ name: 'list.settings.delete', params: { listId: list.id } }"
|
2021-01-30 17:17:04 +01:00
|
|
|
icon="trash-alt"
|
|
|
|
class="has-text-danger"
|
|
|
|
>
|
2021-06-24 01:24:57 +02:00
|
|
|
{{ $t('menu.delete') }}
|
2021-01-30 17:17:04 +01:00
|
|
|
</dropdown-item>
|
|
|
|
</template>
|
|
|
|
</dropdown>
|
|
|
|
</template>
|
|
|
|
|
2022-01-30 13:40:14 +01:00
|
|
|
<script setup lang="ts">
|
|
|
|
import {ref, computed, watchEffect} from 'vue'
|
|
|
|
import {useStore} from 'vuex'
|
|
|
|
|
2021-01-30 17:17:04 +01:00
|
|
|
import {getSavedFilterIdFromListId} from '@/helpers/savedFilter'
|
2021-07-25 15:27:15 +02:00
|
|
|
import Dropdown from '@/components/misc/dropdown.vue'
|
|
|
|
import DropdownItem from '@/components/misc/dropdown-item.vue'
|
|
|
|
import TaskSubscription from '@/components/misc/subscription.vue'
|
2022-01-30 13:40:14 +01:00
|
|
|
import ListModel from '@/models/list'
|
|
|
|
import SubscriptionModel from '@/models/subscription'
|
2021-01-30 17:17:04 +01:00
|
|
|
|
2022-01-30 13:40:14 +01:00
|
|
|
const props = defineProps({
|
|
|
|
list: {
|
|
|
|
type: ListModel,
|
|
|
|
required: true,
|
2021-02-14 20:18:51 +01:00
|
|
|
},
|
2022-01-30 13:40:14 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
const subscription = ref<SubscriptionModel>()
|
|
|
|
watchEffect(() => {
|
|
|
|
if (props.list.subscription) {
|
|
|
|
subscription.value = props.list.subscription
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
const store = useStore()
|
|
|
|
const backgroundsEnabled = computed(() => store.state.config.enabledBackgroundProviders?.length > 0)
|
|
|
|
const isSavedFilter = computed(() => getSavedFilterIdFromListId(props.list.id) > 0)
|
2021-01-30 17:17:04 +01:00
|
|
|
</script>
|