diff options
Diffstat (limited to 'apps/files_sharing/src/components/SharingEntryQuickShareSelect.vue')
-rw-r--r-- | apps/files_sharing/src/components/SharingEntryQuickShareSelect.vue | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/apps/files_sharing/src/components/SharingEntryQuickShareSelect.vue b/apps/files_sharing/src/components/SharingEntryQuickShareSelect.vue index 79302ec6fbe..102eea63cb6 100644 --- a/apps/files_sharing/src/components/SharingEntryQuickShareSelect.vue +++ b/apps/files_sharing/src/components/SharingEntryQuickShareSelect.vue @@ -1,9 +1,14 @@ +<!-- + - SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors + - SPDX-License-Identifier: AGPL-3.0-or-later +--> <template> <NcActions ref="quickShareActions" class="share-select" :menu-name="selectedOption" :aria-label="ariaLabel" type="tertiary-no-background" + :disabled="!share.canEdit" force-name> <template #icon> <DropdownIcon :size="15" /> @@ -23,14 +28,15 @@ </template> <script> +import { ShareType } from '@nextcloud/sharing' +import { subscribe, unsubscribe } from '@nextcloud/event-bus' import DropdownIcon from 'vue-material-design-icons/TriangleSmallDown.vue' import SharesMixin from '../mixins/SharesMixin.js' import ShareDetails from '../mixins/ShareDetails.js' -import ShareTypes from '../mixins/ShareTypes.js' -import NcActions from '@nextcloud/vue/dist/Components/NcActions.js' -import NcActionButton from '@nextcloud/vue/dist/Components/NcActionButton.js' +import NcActions from '@nextcloud/vue/components/NcActions' +import NcActionButton from '@nextcloud/vue/components/NcActionButton' import IconEyeOutline from 'vue-material-design-icons/EyeOutline.vue' -import IconPencil from 'vue-material-design-icons/Pencil.vue' +import IconPencil from 'vue-material-design-icons/PencilOutline.vue' import IconFileUpload from 'vue-material-design-icons/FileUpload.vue' import IconTune from 'vue-material-design-icons/Tune.vue' @@ -48,7 +54,7 @@ export default { NcActionButton, }, - mixins: [SharesMixin, ShareDetails, ShareTypes], + mixins: [SharesMixin, ShareDetails], props: { share: { @@ -76,7 +82,7 @@ export default { return t('files_sharing', 'Can edit') }, fileDropText() { - return t('files_sharing', 'File drop') + return t('files_sharing', 'File request') }, customPermissionsText() { return t('files_sharing', 'Custom permissions') @@ -118,7 +124,7 @@ export default { supportsFileDrop() { if (this.isFolder && this.config.isPublicUploadEnabled) { const shareType = this.share.type ?? this.share.shareType - return [this.SHARE_TYPES.SHARE_TYPE_LINK, this.SHARE_TYPES.SHARE_TYPE_EMAIL].includes(shareType) + return [ShareType.Link, ShareType.Email].includes(shareType) } return false }, @@ -140,7 +146,17 @@ export default { created() { this.selectedOption = this.preSelectedOption }, - + mounted() { + subscribe('update:share', (share) => { + if (share.id === this.share.id) { + this.share.permissions = share.permissions + this.selectedOption = this.preSelectedOption + } + }) + }, + unmounted() { + unsubscribe('update:share') + }, methods: { selectOption(optionLabel) { this.selectedOption = optionLabel |