diff --git a/package.json b/package.json index d949f0b4..0cd06377 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,6 @@ "bulma-css-variables": "0.9.33", "camel-case": "4.1.2", "codemirror": "5.65.3", - "copy-to-clipboard": "3.3.1", "date-fns": "2.28.0", "dompurify": "2.3.6", "easymde": "2.16.1", diff --git a/src/components/sharing/linkSharing.vue b/src/components/sharing/linkSharing.vue index eb28c2d9..285c35fb 100644 --- a/src/components/sharing/linkSharing.vue +++ b/src/components/sharing/linkSharing.vue @@ -183,8 +183,8 @@ import rights from '../../models/constants/rights' import LinkShareService from '../../services/linkShare' import LinkShareModel from '../../models/linkShare' -import copy from 'copy-to-clipboard' import {mapState} from 'vuex' +import { useCopyToClipboard } from '@/composables/useCopyToClipboard' export default defineComponent({ name: 'linkSharing', @@ -207,6 +207,11 @@ export default defineComponent({ showNewForm: false, } }, + setup() { + return { + copy: useCopyToClipboard(), + } + }, watch: { listId: { handler: 'load', @@ -253,7 +258,6 @@ export default defineComponent({ this.showDeleteModal = false } }, - copy, getShareLink(hash) { return this.frontendUrl + 'share/' + hash + '/auth' }, diff --git a/src/components/tasks/partials/attachments.vue b/src/components/tasks/partials/attachments.vue index afab9031..e38e8dc6 100644 --- a/src/components/tasks/partials/attachments.vue +++ b/src/components/tasks/partials/attachments.vue @@ -142,8 +142,8 @@ import AttachmentService from '../../../services/attachment' import AttachmentModel from '../../../models/attachment' import User from '../../misc/user' import {mapState} from 'vuex' -import copy from 'copy-to-clipboard' +import { useCopyToClipboard } from '@/composables/useCopyToClipboard' import { uploadFiles, generateAttachmentUrl } from '@/helpers/attachments' export default defineComponent({ @@ -175,6 +175,17 @@ export default defineComponent({ default: true, }, }, + + setup(props) { + const copy = useCopyToClipboard() + + function copyUrl(attachment: AttachmentModel) { + copy(generateAttachmentUrl(props.taskId, attachment.id)) + } + + return { copyUrl } + }, + computed: mapState({ attachments: (state) => state.attachments.attachments, }), @@ -245,9 +256,6 @@ export default defineComponent({ this.downloadAttachment(attachment) } }, - copyUrl(attachment) { - copy(generateAttachmentUrl(this.taskId, attachment.id)) - }, }, }) diff --git a/src/components/tasks/partials/heading.vue b/src/components/tasks/partials/heading.vue index 4b2c3701..a5026962 100644 --- a/src/components/tasks/partials/heading.vue +++ b/src/components/tasks/partials/heading.vue @@ -1,23 +1,29 @@ - {{ textIdentifier }} + {{ textIdentifier }} {{ task.title.trim() }} - + {{ $t('misc.saving') }} - + {{ $t('misc.saved') }} @@ -25,75 +31,73 @@ -