diff options
Diffstat (limited to 'apps/files_sharing/src')
-rw-r--r-- | apps/files_sharing/src/components/SharingEntryInternal.vue | 20 | ||||
-rw-r--r-- | apps/files_sharing/src/components/SharingEntryLink.vue | 48 | ||||
-rw-r--r-- | apps/files_sharing/src/files_sharing_tab.js | 15 | ||||
-rw-r--r-- | apps/files_sharing/src/mixins/SharesMixin.js | 6 |
4 files changed, 57 insertions, 32 deletions
diff --git a/apps/files_sharing/src/components/SharingEntryInternal.vue b/apps/files_sharing/src/components/SharingEntryInternal.vue index 03a1ba87b71..9912648357c 100644 --- a/apps/files_sharing/src/components/SharingEntryInternal.vue +++ b/apps/files_sharing/src/components/SharingEntryInternal.vue @@ -9,27 +9,33 @@ <div class="avatar-external icon-external-white" /> </template> - <NcActionLink :href="internalLink" - :aria-label="t('files_sharing', 'Copy internal link to clipboard')" - target="_blank" - :icon="copied && copySuccess ? 'icon-checkmark-color' : 'icon-clippy'" + <NcActionButton :aria-label="t('files_sharing', 'Copy internal link to clipboard')" @click.prevent="copyLink"> + <template #icon> + <Check v-if="copied && copySuccess" :size="20" /> + <ClipboardTextMultipleOutline v-else :size="20" /> + </template> {{ clipboardTooltip }} - </NcActionLink> + </NcActionButton> </SharingEntrySimple> </ul> </template> <script> import { generateUrl } from '@nextcloud/router' -import NcActionLink from '@nextcloud/vue/dist/Components/NcActionLink' +import { NcActionButton } from '@nextcloud/vue' import SharingEntrySimple from './SharingEntrySimple' +import Check from 'vue-material-design-icons/Check.vue' +import ClipboardTextMultipleOutline from 'vue-material-design-icons/ClipboardTextMultipleOutline.vue' + export default { name: 'SharingEntryInternal', components: { - NcActionLink, + Check, + ClipboardTextMultipleOutline, + NcActionButton, SharingEntrySimple, }, diff --git a/apps/files_sharing/src/components/SharingEntryLink.vue b/apps/files_sharing/src/components/SharingEntryLink.vue index 207db7d8514..930bae849c2 100644 --- a/apps/files_sharing/src/components/SharingEntryLink.vue +++ b/apps/files_sharing/src/components/SharingEntryLink.vue @@ -38,13 +38,14 @@ <NcActions v-if="share && !isEmailShareType && share.token" ref="copyButton" class="sharing-entry__copy"> - <NcActionLink :href="shareLink" - target="_blank" - :aria-label="t('files_sharing', 'Copy public link to clipboard')" - :icon="copied && copySuccess ? 'icon-checkmark-color' : 'icon-clippy'" + <NcActionButton :aria-label="t('files_sharing', 'Copy public link to clipboard')" @click.stop.prevent="copyLink"> + <template #icon> + <Check v-if="copied && copySuccess" :size="20" /> + <ClipboardTextMultipleOutline v-else :size="20" /> + </template> {{ clipboardTooltip }} - </NcActionLink> + </NcActionButton> </NcActions> <!-- pending actions --> @@ -299,20 +300,22 @@ <script> import { generateUrl } from '@nextcloud/router' -import { showError } from '@nextcloud/dialogs' +import { showError, showSuccess } from '@nextcloud/dialogs' import { Type as ShareTypes } from '@nextcloud/sharing' import Vue from 'vue' -import NcActionButton from '@nextcloud/vue/dist/Components/NcActionButton' -import NcActionCheckbox from '@nextcloud/vue/dist/Components/NcActionCheckbox' -import NcActionInput from '@nextcloud/vue/dist/Components/NcActionInput' -import NcActionLink from '@nextcloud/vue/dist/Components/NcActionLink' -import NcActionText from '@nextcloud/vue/dist/Components/NcActionText' -import NcActionSeparator from '@nextcloud/vue/dist/Components/NcActionSeparator' -import NcActionTextEditable from '@nextcloud/vue/dist/Components/NcActionTextEditable' -import NcActions from '@nextcloud/vue/dist/Components/NcActions' -import NcAvatar from '@nextcloud/vue/dist/Components/NcAvatar' -import Tooltip from '@nextcloud/vue/dist/Directives/Tooltip' +import { + NcActionButton, + NcActionCheckbox, + NcActionInput, + NcActionLink, + NcActions, + NcActionSeparator, + NcActionText, + NcActionTextEditable, + NcAvatar, + Tooltip, +} from '@nextcloud/vue' import ExternalShareAction from './ExternalShareAction.vue' import SharePermissionsEditor from './SharePermissionsEditor.vue' @@ -320,20 +323,25 @@ import GeneratePassword from '../utils/GeneratePassword.js' import Share from '../models/Share.js' import SharesMixin from '../mixins/SharesMixin.js' +import Check from 'vue-material-design-icons/Check.vue' +import ClipboardTextMultipleOutline from 'vue-material-design-icons/ClipboardTextMultipleOutline.vue' + export default { name: 'SharingEntryLink', components: { - NcActions, + Check, + ClipboardTextMultipleOutline, + ExternalShareAction, NcActionButton, NcActionCheckbox, NcActionInput, NcActionLink, + NcActions, + NcActionSeparator, NcActionText, NcActionTextEditable, - NcActionSeparator, NcAvatar, - ExternalShareAction, SharePermissionsEditor, }, @@ -766,6 +774,7 @@ export default { if (typeof this.share.newLabel === 'string') { this.share.label = this.share.newLabel this.$delete(this.share, 'newLabel') + showSuccess(t('files_sharing', 'Share label saved')) this.queueUpdate('label') } }, @@ -832,6 +841,7 @@ export default { onPasswordSubmit() { if (this.hasUnsavedPassword) { this.share.password = this.share.newPassword.trim() + showSuccess(t('files_sharing', 'Share password saved')) this.queueUpdate('password') } }, diff --git a/apps/files_sharing/src/files_sharing_tab.js b/apps/files_sharing/src/files_sharing_tab.js index c06ec051c4e..85bbd869932 100644 --- a/apps/files_sharing/src/files_sharing_tab.js +++ b/apps/files_sharing/src/files_sharing_tab.js @@ -25,11 +25,14 @@ import Vue from 'vue' import VueClipboard from 'vue-clipboard2' import { translate as t, translatePlural as n } from '@nextcloud/l10n' -import SharingTab from './views/SharingTab' -import ShareSearch from './services/ShareSearch' -import ExternalLinkActions from './services/ExternalLinkActions' -import ExternalShareActions from './services/ExternalShareActions' -import TabSections from './services/TabSections' +import SharingTab from './views/SharingTab.vue' +import ShareSearch from './services/ShareSearch.js' +import ExternalLinkActions from './services/ExternalLinkActions.js' +import ExternalShareActions from './services/ExternalShareActions.js' +import TabSections from './services/TabSections.js' + +// eslint-disable-next-line node/no-missing-import, import/no-unresolved +import ShareVariant from '@mdi/svg/svg/share-variant.svg?raw' // Init Sharing Tab Service if (!window.OCA.Sharing) { @@ -53,7 +56,7 @@ window.addEventListener('DOMContentLoaded', function() { OCA.Files.Sidebar.registerTab(new OCA.Files.Sidebar.Tab({ id: 'sharing', name: t('files_sharing', 'Sharing'), - icon: 'icon-share', + iconSvg: ShareVariant, async mount(el, fileInfo, context) { if (TabInstance) { diff --git a/apps/files_sharing/src/mixins/SharesMixin.js b/apps/files_sharing/src/mixins/SharesMixin.js index 68468d76de4..e5fb141e127 100644 --- a/apps/files_sharing/src/mixins/SharesMixin.js +++ b/apps/files_sharing/src/mixins/SharesMixin.js @@ -25,6 +25,7 @@ * */ +import { showSuccess } from '@nextcloud/dialogs' import { getCurrentUser } from '@nextcloud/auth' // eslint-disable-next-line import/no-unresolved, node/no-missing-import import PQueue from 'p-queue' @@ -211,6 +212,7 @@ export default { if (this.share.newNote) { this.share.note = this.share.newNote this.$delete(this.share, 'newNote') + showSuccess(t('files_sharing', 'Share note saved')) this.queueUpdate('note') } }, @@ -224,6 +226,10 @@ export default { this.open = false await this.deleteShare(this.share.id) console.debug('Share deleted', this.share.id) + const message = this.share.itemType === 'file' + ? t('files_sharing', 'File "{path}" has been unshared', { path: this.share.path }) + : t('files_sharing', 'Folder "{path}" has been unshared', { path: this.share.path }) + showSuccess(message) this.$emit('remove:share', this.share) } catch (error) { // re-open menu if error |