diff options
Diffstat (limited to 'apps/files_sharing/src/views')
5 files changed, 49 insertions, 79 deletions
diff --git a/apps/files_sharing/src/views/CollaborationView.vue b/apps/files_sharing/src/views/CollaborationView.vue deleted file mode 100644 index b75ad53e1b8..00000000000 --- a/apps/files_sharing/src/views/CollaborationView.vue +++ /dev/null @@ -1,36 +0,0 @@ -<!-- - - SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors - - SPDX-License-Identifier: AGPL-3.0-or-later ---> - -<template> - <CollectionList v-if="fileId" - :id="fileId" - type="file" - :name="filename" /> -</template> - -<script> -import { CollectionList } from 'nextcloud-vue-collections' - -export default { - name: 'CollaborationView', - components: { - CollectionList, - }, - computed: { - fileId() { - if (this.$root.model && this.$root.model.id) { - return '' + this.$root.model.id - } - return null - }, - filename() { - if (this.$root.model && this.$root.model.name) { - return '' + this.$root.model.name - } - return '' - }, - }, -} -</script> diff --git a/apps/files_sharing/src/views/FilesViewFileDropEmptyContent.vue b/apps/files_sharing/src/views/FilesViewFileDropEmptyContent.vue index 33fec9af028..dac22748d8a 100644 --- a/apps/files_sharing/src/views/FilesViewFileDropEmptyContent.vue +++ b/apps/files_sharing/src/views/FilesViewFileDropEmptyContent.vue @@ -68,7 +68,7 @@ import NcDialog from '@nextcloud/vue/components/NcDialog' import NcEmptyContent from '@nextcloud/vue/components/NcEmptyContent' import NcIconSvgWrapper from '@nextcloud/vue/components/NcIconSvgWrapper' import NcNoteCard from '@nextcloud/vue/components/NcNoteCard' -import svgCloudUpload from '@mdi/svg/svg/cloud-upload.svg?raw' +import svgCloudUpload from '@mdi/svg/svg/cloud-upload-outline.svg?raw' defineProps<{ foldername: string diff --git a/apps/files_sharing/src/views/SharingDetailsTab.vue b/apps/files_sharing/src/views/SharingDetailsTab.vue index f1fb78e548b..b3a3b95d92e 100644 --- a/apps/files_sharing/src/views/SharingDetailsTab.vue +++ b/apps/files_sharing/src/views/SharingDetailsTab.vue @@ -128,7 +128,7 @@ </NcCheckboxRadioSwitch> <NcPasswordField v-if="isPasswordProtected" autocomplete="new-password" - :value="hasUnsavedPassword ? share.newPassword : ''" + :value="share.newPassword ?? ''" :error="passwordError" :helper-text="errorPasswordLabel || passwordHint" :required="isPasswordEnforced && isNewShare" @@ -281,7 +281,7 @@ import NcTextArea from '@nextcloud/vue/components/NcTextArea' import CircleIcon from 'vue-material-design-icons/CircleOutline.vue' import CloseIcon from 'vue-material-design-icons/Close.vue' -import EditIcon from 'vue-material-design-icons/Pencil.vue' +import EditIcon from 'vue-material-design-icons/PencilOutline.vue' import EmailIcon from 'vue-material-design-icons/Email.vue' import LinkIcon from 'vue-material-design-icons/Link.vue' import GroupIcon from 'vue-material-design-icons/AccountGroup.vue' @@ -373,7 +373,7 @@ export default { title() { switch (this.share.type) { case ShareType.User: - return t('files_sharing', 'Share with {userName}', { userName: this.share.shareWithDisplayName }) + return t('files_sharing', 'Share with {user}', { user: this.share.shareWithDisplayName }) case ShareType.Email: return t('files_sharing', 'Share with email {email}', { email: this.share.shareWith }) case ShareType.Link: @@ -384,6 +384,9 @@ export default { return t('files_sharing', 'Share in conversation') case ShareType.Remote: { const [user, server] = this.share.shareWith.split('@') + if (this.config.showFederatedSharesAsInternal) { + return t('files_sharing', 'Share with {user}', { user }) + } return t('files_sharing', 'Share with {user} on remote server {server}', { user, server }) } case ShareType.RemoteGroup: @@ -872,7 +875,6 @@ export default { if (this.isNewShare) { if ((this.config.enableLinkPasswordByDefault || this.isPasswordEnforced) && this.isPublicShare) { this.$set(this.share, 'newPassword', await GeneratePassword(true)) - this.$set(this.share, 'password', this.share.newPassword) this.advancedSectionAccordionExpanded = true } /* Set default expiration dates if configured */ @@ -973,10 +975,7 @@ export default { this.share.note = '' } if (this.isPasswordProtected) { - if (this.hasUnsavedPassword && this.isValidShareAttribute(this.share.newPassword)) { - this.share.password = this.share.newPassword - this.$delete(this.share, 'newPassword') - } else if (this.isPasswordEnforced && this.isNewShare && !this.isValidShareAttribute(this.share.password)) { + if (this.isPasswordEnforced && this.isNewShare && !this.isValidShareAttribute(this.share.password)) { this.passwordError = true } } else { @@ -1000,7 +999,7 @@ export default { incomingShare.expireDate = this.hasExpirationDate ? this.share.expireDate : '' if (this.isPasswordProtected) { - incomingShare.password = this.share.password + incomingShare.password = this.share.newPassword } let share @@ -1032,9 +1031,8 @@ export default { this.$emit('add:share', this.share) } else { // Let's update after creation as some attrs are only available after creation + await this.queueUpdate(...permissionsAndAttributes) this.$emit('update:share', this.share) - emit('update:share', this.share) - this.queueUpdate(...permissionsAndAttributes) } await this.getNode() @@ -1111,10 +1109,6 @@ export default { * "sendPasswordByTalk". */ onPasswordProtectedByTalkChange() { - if (this.hasUnsavedPassword) { - this.share.password = this.share.newPassword.trim() - } - this.queueUpdate('sendPasswordByTalk', 'password') }, isValidShareAttribute(value) { diff --git a/apps/files_sharing/src/views/SharingLinkList.vue b/apps/files_sharing/src/views/SharingLinkList.vue index 3dd6fdf317b..c3d9a7f83dc 100644 --- a/apps/files_sharing/src/views/SharingLinkList.vue +++ b/apps/files_sharing/src/views/SharingLinkList.vue @@ -7,12 +7,6 @@ <ul v-if="canLinkShare" :aria-label="t('files_sharing', 'Link shares')" class="sharing-link-list"> - <!-- If no link shares, show the add link default entry --> - <SharingEntryLink v-if="!hasLinkShares && canReshare" - :can-reshare="canReshare" - :file-info="fileInfo" - @add:share="addShare" /> - <!-- Else we display the list --> <template v-if="hasShares"> <!-- using shares[index] to work with .sync --> @@ -27,6 +21,12 @@ @remove:share="removeShare" @open-sharing-details="openSharingDetails(share)" /> </template> + + <!-- If no link shares, show the add link default entry --> + <SharingEntryLink v-if="!hasLinkShares && canReshare" + :can-reshare="canReshare" + :file-info="fileInfo" + @add:share="addShare" /> </ul> </template> diff --git a/apps/files_sharing/src/views/SharingTab.vue b/apps/files_sharing/src/views/SharingTab.vue index 82a11dea2e0..bba8f0b2edb 100644 --- a/apps/files_sharing/src/views/SharingTab.vue +++ b/apps/files_sharing/src/views/SharingTab.vue @@ -138,7 +138,7 @@ <div v-if="projectsEnabled" v-show="!showSharingDetailsView && fileInfo" class="sharingTab__additionalContent"> - <CollectionList :id="`${fileInfo.id}`" + <NcCollectionList :id="`${fileInfo.id}`" type="file" :name="fileInfo.name" /> </div> @@ -161,16 +161,16 @@ import { getCapabilities } from '@nextcloud/capabilities' import { orderBy } from '@nextcloud/files' import { loadState } from '@nextcloud/initial-state' import { generateOcsUrl } from '@nextcloud/router' -import { CollectionList } from 'nextcloud-vue-collections' import { ShareType } from '@nextcloud/sharing' -import InfoIcon from 'vue-material-design-icons/Information.vue' +import NcAvatar from '@nextcloud/vue/components/NcAvatar' +import NcButton from '@nextcloud/vue/components/NcButton' +import NcCollectionList from '@nextcloud/vue/components/NcCollectionList' import NcPopover from '@nextcloud/vue/components/NcPopover' +import InfoIcon from 'vue-material-design-icons/InformationOutline.vue' import axios from '@nextcloud/axios' import moment from '@nextcloud/moment' -import NcAvatar from '@nextcloud/vue/components/NcAvatar' -import NcButton from '@nextcloud/vue/components/NcButton' import { shareWithTitle } from '../utils/SharedWithMe.js' @@ -192,10 +192,10 @@ export default { name: 'SharingTab', components: { - CollectionList, InfoIcon, NcAvatar, NcButton, + NcCollectionList, NcPopover, SharingEntryInternal, SharingEntrySimple, @@ -230,9 +230,9 @@ export default { shareDetailsData: {}, returnFocusElement: null, - internalSharesHelpText: t('files_sharing', 'Use this method to share files with individuals or teams within your organization. If the recipient already has access to the share but cannot locate it, you can send them the internal share link for easy access.'), - externalSharesHelpText: t('files_sharing', 'Use this method to share files with individuals or organizations outside your organization. Files and folders can be shared via public share links and email addresses. You can also share to other Nextcloud accounts hosted on different instances using their federated cloud ID.'), - additionalSharesHelpText: t('files_sharing', 'Shares that are not part of the internal or external shares. This can be shares from apps or other sources.'), + internalSharesHelpText: t('files_sharing', 'Share files within your organization. Recipients who can already view the file can also use this link for easy access.'), + externalSharesHelpText: t('files_sharing', 'Share files with others outside your organization via public links and email addresses. You can also share to Nextcloud accounts on other instances using their federated cloud ID.'), + additionalSharesHelpText: t('files_sharing', 'Shares from apps or other sources which are not included in internal or external shares.'), } }, @@ -243,8 +243,7 @@ export default { * @return {boolean} */ isSharedWithMe() { - return this.sharedWithMe !== null - && this.sharedWithMe !== undefined + return !!this.sharedWithMe?.user }, /** @@ -269,21 +268,25 @@ export default { }, internalShareInputPlaceholder() { - return this.config.showFederatedSharesAsInternal - ? t('files_sharing', 'Share with accounts, teams, federated cloud IDs') - : t('files_sharing', 'Share with accounts and teams') + return this.config.showFederatedSharesAsInternal && this.config.isFederationEnabled + // TRANSLATORS: Type as in with a keyboard + ? t('files_sharing', 'Type names, teams, federated cloud IDs') + // TRANSLATORS: Type as in with a keyboard + : t('files_sharing', 'Type names or teams') }, externalShareInputPlaceholder() { if (!this.isLinkSharingAllowed) { - return t('files_sharing', 'Federated cloud ID') + // TRANSLATORS: Type as in with a keyboard + return this.config.isFederationEnabled ? t('files_sharing', 'Type a federated cloud ID') : '' } - return this.config.showFederatedSharesAsInternal - ? t('files_sharing', 'Email') - : t('files_sharing', 'Email, federated cloud ID') + return !this.config.showFederatedSharesAsInternal && !this.config.isFederationEnabled + // TRANSLATORS: Type as in with a keyboard + ? t('files_sharing', 'Type an email') + // TRANSLATORS: Type as in with a keyboard + : t('files_sharing', 'Type an email or federated cloud ID') }, }, - methods: { /** * Update current fileInfo and fetch new data @@ -295,7 +298,6 @@ export default { this.resetState() this.getShares() }, - /** * Get the existing shares infos */ @@ -402,7 +404,13 @@ export default { if ([ShareType.Link, ShareType.Email].includes(share.type)) { this.linkShares.push(share) } else if ([ShareType.Remote, ShareType.RemoteGroup].includes(share.type)) { - if (this.config.showFederatedSharesAsInternal) { + if (this.config.showFederatedSharesToTrustedServersAsInternal) { + if (share.isTrustedServer) { + this.shares.push(share) + } else { + this.externalShares.push(share) + } + } else if (this.config.showFederatedSharesAsInternal) { this.shares.push(share) } else { this.externalShares.push(share) @@ -478,6 +486,10 @@ export default { } else if ([ShareType.Remote, ShareType.RemoteGroup].includes(share.type)) { if (this.config.showFederatedSharesAsInternal) { this.shares.unshift(share) + } if (this.config.showFederatedSharesToTrustedServersAsInternal) { + if (share.isTrustedServer) { + this.shares.unshift(share) + } } else { this.externalShares.unshift(share) } |