diff --git a/src/components/sharing/linkSharing.vue b/src/components/sharing/linkSharing.vue index 51f3b34f..e0b3bade 100644 --- a/src/components/sharing/linkSharing.vue +++ b/src/components/sharing/linkSharing.vue @@ -79,30 +79,59 @@ > - {{ $t('list.share.attributes.link') }} - {{ $t('list.share.attributes.name') }} - {{ $t('list.share.attributes.sharedBy') }} - {{ $t('list.share.attributes.right') }} + + {{ $t('list.share.links.view') }} {{ $t('list.share.attributes.delete') }} +

+ {{ s.name }} +

+ +

+ + {{ s.sharedBy.getDisplayName() }} + +

+ +

+ + + +

+
@@ -112,33 +141,16 @@
- - {{ $t('list.share.links.noName') }} - - - {{ s.sharedBy.getDisplayName() }} - - - - - +
+ +
{{ $t('list.share.links.remove') }} - + @@ -190,6 +202,8 @@ import LinkShareService from '@/services/linkShare' import {useCopyToClipboard} from '@/composables/useCopyToClipboard' import {success} from '@/message' +import type {ListView} from '@/types/ListView' +import {LIST_VIEWS} from '@/types/ListView' const props = defineProps({ listId: { @@ -209,6 +223,17 @@ const showDeleteModal = ref(false) const linkIdToDelete = ref(0) const showNewForm = ref(false) +type SelectedViewMapper = Record + +const selectedView = ref({}) + +const availableViews = computed>(() => ({ + list: t('list.list.title'), + gantt: t('list.gantt.title'), + table: t('list.table.title'), + kanban: t('list.kanban.title'), +})) + const copy = useCopyToClipboard() watch( () => props.listId, @@ -225,7 +250,11 @@ async function load(listId: IList['id']) { return } - linkShares.value = await linkShareService.getAll({listId}) + const links = await linkShareService.getAll({listId}) + links.forEach((l: ILinkShare) => { + selectedView.value[l.id] = 'list' + }) + linkShares.value = links } async function add(listId: IList['id']) { @@ -257,15 +286,15 @@ async function remove(listId: IList['id']) { } } -function getShareLink(hash: string) { - return frontendUrl.value + 'share/' + hash + '/auth' +function getShareLink(hash: string, view: ListView = LIST_VIEWS.LIST) { + return frontendUrl.value + 'share/' + hash + '/auth?view=' + view }