diff --git a/changelog/unreleased/enhancement-split-sidebar-direct-indirect-linkshares b/changelog/unreleased/enhancement-split-sidebar-direct-indirect-linkshares new file mode 100644 index 00000000000..f1f9b3b8e2b --- /dev/null +++ b/changelog/unreleased/enhancement-split-sidebar-direct-indirect-linkshares @@ -0,0 +1,6 @@ +Enhancement: Separate direct and indirect link shares in sidebar + +We have split the list of link shares into two lists, one with direct (and editable) and another one with read-only indirect link shares of parent folders for better structure in the sidebar. + +https://github.com/owncloud/web/pull/7140 +https://github.com/owncloud/web/issues/7132 diff --git a/packages/web-app-files/src/components/SideBar/Shares/FileLinks.vue b/packages/web-app-files/src/components/SideBar/Shares/FileLinks.vue index 01447697cfb..a32c84dcaea 100644 --- a/packages/web-app-files/src/components/SideBar/Shares/FileLinks.vue +++ b/packages/web-app-files/src/components/SideBar/Shares/FileLinks.vue @@ -53,8 +53,8 @@ :available-role-options="availableRoleOptions" :can-rename="true" :expiration-date="expirationDate" - :is-folder-share="link.indirect || highlightedFile.isFolder" - :is-modifiable="canEdit && !link.indirect" + :is-folder-share="highlightedFile.isFolder" + :is-modifiable="canEdit" :is-password-enforced="isPasswordEnforcedFor(link)" :link="link" @updateLink="checkLinkToUpdate" @@ -63,7 +63,44 @@
- + + + + +
+ @@ -76,7 +113,7 @@ import { mapGetters, mapActions, mapState } from 'vuex' import { useStore, useCapabilitySpacesEnabled } from 'web-pkg/src/composables' import { clientService } from 'web-pkg/src/services' import mixins from '../../../mixins' -import { shareViaLinkHelp } from '../../../helpers/contextualHelpers' +import { shareViaLinkHelp, shareViaIndirectLinkHelp } from '../../../helpers/contextualHelpers' import { getParentPaths } from '../../../helpers/path' import { ShareTypes, LinkShareRoles, SharePermissions } from '../../../helpers/share' import { cloneStateObject } from '../../../helpers/store' @@ -101,10 +138,13 @@ export default defineComponent({ ) const linkListCollapsed = !store.getters.configuration.options.sidebar.shares.showAllOnLoad + const indirectLinkListCollapsed = + !store.getters.configuration.options.sidebar.shares.showAllOnLoad return { graphClient, hasSpaces: useCapabilitySpacesEnabled(), + indirectLinkListCollapsed, linkListCollapsed } }, @@ -124,7 +164,16 @@ export default defineComponent({ }, collapseButtonTitle() { - return this.linkListCollapsed ? this.$gettext('Show more') : this.$gettext('Show less') + return this.linkListCollapsed ? this.$gettext('Show all') : this.$gettext('Show less') + }, + collapseButtonIcon() { + return this.linkListCollapsed ? 'arrow-down-s' : 'arrow-up-s' + }, + indirectCollapseButtonTitle() { + return this.indirectLinkListCollapsed ? this.$gettext('Show') : this.$gettext('Hide') + }, + indirectCollapseButtonIcon() { + return this.indirectLinkListCollapsed ? 'arrow-down-s' : 'arrow-up-s' }, quicklink() { @@ -190,6 +239,9 @@ export default defineComponent({ viaLinkHelp() { return shareViaLinkHelp }, + indirectLinkHelp() { + return shareViaIndirectLinkHelp + }, canCreatePublicLinks() { return this.highlightedFile.canShare({ user: this.user }) @@ -216,8 +268,13 @@ export default defineComponent({ return this.$gettext('Share via public link') }, + indirectLinksHeading() { + const translated = this.$gettext('Indirect links (%{ count })') + return this.$gettextInterpolate(translated, { count: this.indirectLinks.length }) + }, + links() { - const nonQuickLinkOutgoingLinks = this.currentFileOutgoingLinks + return this.currentFileOutgoingLinks .filter((link) => !link.quicklink) .map((share) => { share.key = 'direct-link-' + share.id @@ -226,8 +283,6 @@ export default defineComponent({ .sort((a, b) => { return b.stime - a.stime }) - - return [...nonQuickLinkOutgoingLinks, ...this.indirectLinks] }, displayLinks() { @@ -237,6 +292,13 @@ export default defineComponent({ return this.links }, + displayIndirectLinks() { + if (this.indirectLinkListCollapsed) { + return [] + } + return this.indirectLinks + }, + indirectLinks() { const allShares = [] const parentPaths = getParentPaths(this.highlightedFile.path, false) @@ -299,6 +361,10 @@ export default defineComponent({ this.linkListCollapsed = !this.linkListCollapsed }, + toggleIndirectLinkListCollapsed() { + this.indirectLinkListCollapsed = !this.indirectLinkListCollapsed + }, + reloadLinks() { this.loadCurrentFileOutgoingShares({ client: this.$client, diff --git a/packages/web-app-files/src/components/SideBar/Shares/Links/CreateQuickLink.vue b/packages/web-app-files/src/components/SideBar/Shares/Links/CreateQuickLink.vue index ae8ed5e343b..00433beeff5 100644 --- a/packages/web-app-files/src/components/SideBar/Shares/Links/CreateQuickLink.vue +++ b/packages/web-app-files/src/components/SideBar/Shares/Links/CreateQuickLink.vue @@ -1,6 +1,6 @@