diff --git a/changelog/unreleased/enhancement-introduce-quicklink b/changelog/unreleased/enhancement-introduce-quicklink new file mode 100644 index 00000000000..b305107365d --- /dev/null +++ b/changelog/unreleased/enhancement-introduce-quicklink @@ -0,0 +1,6 @@ +Enhancement: Introduce quicklinks + +We have added quicklinks to the link share section in the right sidebar. Clicking the link quickaction and the link menu item in the files table contextmenu now always copy the quick link instead of creating a new link (and create it first, if it didn't exist before). + +https://github.com/owncloud/web/pull/6820 +https://github.com/owncloud/web/issues/6605 diff --git a/changelog/unreleased/enhancement-update-sdk b/changelog/unreleased/enhancement-update-sdk new file mode 100644 index 00000000000..428fe4b6c7b --- /dev/null +++ b/changelog/unreleased/enhancement-update-sdk @@ -0,0 +1,15 @@ +Enhancement: Update SDK + +We've updated the ownCloud SDK to version 3.0.0-alpha.7. + +- Change - Pass full trash bin path to methods of FilesTrash class: https://github.com/owncloud/owncloud-sdk/pull/1021 +- Enhancement - Enforce share_type guest if applies: https://github.com/owncloud/owncloud-sdk/pull/1046 +- Enhancement - Create quicklink: https://github.com/owncloud/owncloud-sdk/pull/1041 +- Enhancement - Replace deprecated String.prototype.substr(): https://github.com/owncloud/owncloud-sdk/pull/1035 +- Enhancement - Add blob resolveType: https://github.com/owncloud/owncloud-sdk/pull/1028 +- Enhancement - Adjust share management to properly work with spaces: https://github.com/owncloud/owncloud-sdk/pull/1013 +- Bugfix - Always add X-Request-ID: https://github.com/owncloud/owncloud-sdk/pull/1016 +- Bugfix - Always add X-Requested-With header: https://github.com/owncloud/owncloud-sdk/pull/1020 + +https://github.com/owncloud/web/pull/6820 +https://github.com/owncloud/owncloud-sdk/releases/tag/v3.0.0-alpha.7 diff --git a/dev/docker/oc10.config.php b/dev/docker/oc10.config.php index 5edf59fc444..2eeaa57ca8b 100644 --- a/dev/docker/oc10.config.php +++ b/dev/docker/oc10.config.php @@ -2,5 +2,6 @@ $CONFIG = [ 'web.baseUrl' => 'http://host.docker.internal:8080/index.php/apps/web', 'web.rewriteLinks' => true, + 'sharing.showPublicLinkQuickAction' => true, ]; diff --git a/dev/docker/oc10.web.config.json b/dev/docker/oc10.web.config.json index 7e5874139ce..74159323c36 100644 --- a/dev/docker/oc10.web.config.json +++ b/dev/docker/oc10.web.config.json @@ -14,7 +14,12 @@ ], "options": { "disablePreviews": true, - "displayResourcesLazy": false + "displayResourcesLazy": false, + "sidebar": { + "shares": { + "showAllOnLoad": true + } + } }, "applications": [ { diff --git a/dev/docker/ocis.web.config.json b/dev/docker/ocis.web.config.json index 1ec9b4d0de7..46f29d2d070 100644 --- a/dev/docker/ocis.web.config.json +++ b/dev/docker/ocis.web.config.json @@ -11,7 +11,12 @@ }, "options": { "disablePreviews": true, - "displayResourcesLazy": false + "displayResourcesLazy": false, + "sidebar": { + "shares": { + "showAllOnLoad": true + } + } }, "apps": [ "files", diff --git a/packages/web-app-files/src/components/FilesList/ContextActions.vue b/packages/web-app-files/src/components/FilesList/ContextActions.vue index 7d495715445..9ec6eb533e2 100644 --- a/packages/web-app-files/src/components/FilesList/ContextActions.vue +++ b/packages/web-app-files/src/components/FilesList/ContextActions.vue @@ -8,7 +8,7 @@ import ContextActionMenu from '../ContextActionMenu.vue' import FileActions from '../../mixins/fileActions' import AcceptShare from '../../mixins/actions/acceptShare' import Copy from '../../mixins/actions/copy' -import CreatePublicLink from '../../mixins/actions/createPublicLink' +import CreateQuicklink from '../../mixins/actions/createQuicklink' import DeclineShare from '../../mixins/actions/declineShare' import Delete from '../../mixins/actions/delete' import DownloadArchive from '../../mixins/actions/downloadArchive' @@ -35,7 +35,7 @@ export default { FileActions, AcceptShare, Copy, - CreatePublicLink, + CreateQuicklink, DeclineShare, Delete, DownloadArchive, @@ -134,7 +134,7 @@ export default { }, menuItemsShare() { - return [...this.$_showShares_items, ...this.$_createPublicLink_items].filter((item) => + return [...this.$_showShares_items, ...this.$_createQuicklink_items].filter((item) => item.isEnabled(this.filterParams) ) }, diff --git a/packages/web-app-files/src/components/SideBar/PrivateLinkItem.vue b/packages/web-app-files/src/components/SideBar/PrivateLinkItem.vue index 7fd6a68f084..b9a1924f4cd 100644 --- a/packages/web-app-files/src/components/SideBar/PrivateLinkItem.vue +++ b/packages/web-app-files/src/components/SideBar/PrivateLinkItem.vue @@ -1,36 +1,58 @@ - - 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 b8fc42fd62c..cfc8cd0e0c3 100644 --- a/packages/web-app-files/src/components/SideBar/Shares/FileLinks.vue +++ b/packages/web-app-files/src/components/SideBar/Shares/FileLinks.vue @@ -12,8 +12,26 @@
- - + + + +
  • +
    + +
    link.quicklink === true) + }, + globalExpirationDate() { const expireDate = this.capabilities.files_sharing.public.expire_date @@ -223,7 +261,11 @@ export default defineComponent({ }, links() { - return [...this.currentFileOutgoingLinks, ...this.indirectLinks] + const nonQuickLinkOutgoingLinks = this.currentFileOutgoingLinks.filter( + (link) => !link.quicklink + ) + + return [...nonQuickLinkOutgoingLinks, ...this.indirectLinks] .sort(this.linksComparator) .map((share) => { share.key = 'direct-link-' + share.id @@ -231,6 +273,13 @@ export default defineComponent({ }) }, + displayLinks() { + if (this.links.length > 3 && this.linkListCollapsed) { + return this.links.slice(0, 3) + } + return this.links + }, + indirectLinks() { const allShares = [] const parentPaths = getParentPaths(this.highlightedFile.path, false) @@ -288,6 +337,10 @@ export default defineComponent({ ]), ...mapActions(['showMessage', 'createModal', 'hideModal']), + toggleLinkListCollapsed() { + this.linkListCollapsed = !this.linkListCollapsed + }, + reloadLinks() { this.loadCurrentFileOutgoingShares({ client: this.$client, @@ -370,6 +423,7 @@ export default defineComponent({ expireDate, password, permissions: link.permissions, + quicklink: link.quicklink, name: link.name, ...(this.currentStorageId && { spaceRef: `${this.currentStorageId}${this.highlightedFile.path}` @@ -459,3 +513,9 @@ export default defineComponent({ } }) + diff --git a/packages/web-app-files/src/components/SideBar/Shares/FileShares.vue b/packages/web-app-files/src/components/SideBar/Shares/FileShares.vue index 21b8ca223d5..9315f9d39be 100644 --- a/packages/web-app-files/src/components/SideBar/Shares/FileShares.vue +++ b/packages/web-app-files/src/components/SideBar/Shares/FileShares.vue @@ -12,31 +12,15 @@ />

    - - - -

    -
    diff --git a/packages/web-app-files/src/components/SideBar/Shares/Links/DetailsAndEdit.vue b/packages/web-app-files/src/components/SideBar/Shares/Links/DetailsAndEdit.vue index 9ba4674b5e6..95d982b6841 100644 --- a/packages/web-app-files/src/components/SideBar/Shares/Links/DetailsAndEdit.vue +++ b/packages/web-app-files/src/components/SideBar/Shares/Links/DetailsAndEdit.vue @@ -154,6 +154,10 @@ export default { type: Array, required: true }, + canRename: { + type: Boolean, + default: false + }, expirationDate: { type: Object, default: () => ({}), @@ -209,8 +213,7 @@ export default { editOptions() { const result = [] - // renaming not allowed for (future) quick links - if (this.link) { + if (this.canRename) { result.push({ id: 'rename', title: this.$gettext('Rename'), diff --git a/packages/web-app-files/src/components/SideBar/Shares/Links/NameAndCopy.vue b/packages/web-app-files/src/components/SideBar/Shares/Links/NameAndCopy.vue index bbe82bbc163..088228c7641 100644 --- a/packages/web-app-files/src/components/SideBar/Shares/Links/NameAndCopy.vue +++ b/packages/web-app-files/src/components/SideBar/Shares/Links/NameAndCopy.vue @@ -2,63 +2,86 @@
    `; @@ -45,9 +43,6 @@ exports[`FileShares if there are collaborators present renders sharedWithLabel a

    Shared with

    - - -
    + `; diff --git a/packages/web-app-files/tests/unit/components/SideBar/__snapshots__/PrivateLinkItem.spec.js.snap b/packages/web-app-files/tests/unit/components/SideBar/__snapshots__/PrivateLinkItem.spec.js.snap new file mode 100644 index 00000000000..2b1ba9ed963 --- /dev/null +++ b/packages/web-app-files/tests/unit/components/SideBar/__snapshots__/PrivateLinkItem.spec.js.snap @@ -0,0 +1,7 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`PrivateLinkItem should render a button 1`] = ``; + +exports[`PrivateLinkItem upon clicking it should copy the private link to the clipboard button, render a success message and change icon for half a second 1`] = ``; + +exports[`PrivateLinkItem upon clicking it should copy the private link to the clipboard button, render a success message and change icon for half a second 2`] = ``; diff --git a/packages/web-app-files/tests/unit/store/mutations.spec.js b/packages/web-app-files/tests/unit/store/mutations.spec.js index 7bb2c91b436..99b2e23cf62 100644 --- a/packages/web-app-files/tests/unit/store/mutations.spec.js +++ b/packages/web-app-files/tests/unit/store/mutations.spec.js @@ -127,12 +127,12 @@ describe('vuex store mutations', () => { }) }) - describe('CURRENT_FILE_OUTGOING_SHARES_UPDATE', () => { + describe('CURRENT_FILE_OUTGOING_SHARES_UPSERT', () => { it('updates an outgoing user share', () => { const share = { id: 1, shareType: ShareTypes.user.value, permissions: 1 } const state = { currentFileOutgoingShares: [share] } const updatedShare = { ...share, permissions: 31 } - mutations.CURRENT_FILE_OUTGOING_SHARES_UPDATE(state, updatedShare) + mutations.CURRENT_FILE_OUTGOING_SHARES_UPSERT(state, updatedShare) expect(state.currentFileOutgoingShares[0]).toEqual(updatedShare) }) @@ -145,7 +145,7 @@ describe('vuex store mutations', () => { } const state = { currentFileOutgoingShares: [share] } const updatedShare = { ...share, permissions: 31 } - mutations.CURRENT_FILE_OUTGOING_SHARES_UPDATE(state, updatedShare) + mutations.CURRENT_FILE_OUTGOING_SHARES_UPSERT(state, updatedShare) expect(state.currentFileOutgoingShares[0]).toEqual(updatedShare) }) diff --git a/packages/web-runtime/src/store/config.js b/packages/web-runtime/src/store/config.js index 98ff7961ef3..036ae090bad 100644 --- a/packages/web-runtime/src/store/config.js +++ b/packages/web-runtime/src/store/config.js @@ -39,9 +39,14 @@ const state = { }, options: { defaultExtension: 'files', - homeFolder: '', disablePreviews: false, displayResourcesLazy: true, + homeFolder: '', + sidebar: { + shares: { + showAllOnLoad: false + } + }, previewFileExtensions: [], sharingRecipientsPerPage: 200 } diff --git a/tests/acceptance/features/webUIFilesList/fileList.feature b/tests/acceptance/features/webUIFilesList/fileList.feature index 24d8b0b6fdf..f77533e169e 100644 --- a/tests/acceptance/features/webUIFilesList/fileList.feature +++ b/tests/acceptance/features/webUIFilesList/fileList.feature @@ -25,9 +25,9 @@ Feature: User can view files inside a folder Then there should be no resources listed on the webUI - Scenario: All files list displays public link quick action + Scenario: All files list displays quicklink quick action When the user browses to the files page - Then quick action "public link" should be displayed on the webUI + Then quick action "quicklink" should be displayed on the webUI And the sidebar should match the default baseline Scenario: files are not selected when the user logs in diff --git a/tests/acceptance/features/webUISharingPublicBasic/publicLinkCreate.feature b/tests/acceptance/features/webUISharingPublicBasic/publicLinkCreate.feature index 9e00619845f..61c1717c4e0 100644 --- a/tests/acceptance/features/webUISharingPublicBasic/publicLinkCreate.feature +++ b/tests/acceptance/features/webUISharingPublicBasic/publicLinkCreate.feature @@ -179,11 +179,10 @@ Feature: Create public link shares | uid_owner | Alice | | permissions | read | | path | /simple-folder | - | name | Quick action link | + | name | Quicklink | And the following success message should be displayed on the webUI """ - Public link created - Public link was created successfully and copied into your clipboard. + Quicklink copied into your clipboard """ # This test is skipped in OCIS as it's starting to fail frequently diff --git a/tests/acceptance/stepDefinitions/publicLinkContext.js b/tests/acceptance/stepDefinitions/publicLinkContext.js index 5e39a27d3af..72a69e1524a 100644 --- a/tests/acceptance/stepDefinitions/publicLinkContext.js +++ b/tests/acceptance/stepDefinitions/publicLinkContext.js @@ -306,6 +306,6 @@ Then( When( 'the user creates a public link via quick action for resource {string} using the webUI', function (resource) { - return client.page.FilesPageElement.filesList().useQuickAction(resource, 'public link') + return client.page.FilesPageElement.filesList().useQuickAction(resource, 'quicklink') } ) diff --git a/tests/drone/config-oc10-integration-app-oauth.json b/tests/drone/config-oc10-integration-app-oauth.json index ebbdef476f5..aedf035a6ee 100644 --- a/tests/drone/config-oc10-integration-app-oauth.json +++ b/tests/drone/config-oc10-integration-app-oauth.json @@ -15,7 +15,12 @@ ], "options": { "disablePreviews": true, - "displayResourcesLazy": false + "displayResourcesLazy": false, + "sidebar": { + "shares": { + "showAllOnLoad": true + } + } }, "applications": [ { diff --git a/tests/drone/config-oc10-oauth.json b/tests/drone/config-oc10-oauth.json index 283c47abac8..0b31295d186 100644 --- a/tests/drone/config-oc10-oauth.json +++ b/tests/drone/config-oc10-oauth.json @@ -8,7 +8,12 @@ "authUrl": "http://owncloud/index.php/apps/oauth2/authorize" }, "options": { - "displayResourcesLazy": false + "displayResourcesLazy": false, + "sidebar": { + "shares": { + "showAllOnLoad": true + } + } }, "apps": [ "files", diff --git a/tests/drone/config-oc10-openid.json b/tests/drone/config-oc10-openid.json index fc8a6458127..06dd85e7d3f 100644 --- a/tests/drone/config-oc10-openid.json +++ b/tests/drone/config-oc10-openid.json @@ -10,7 +10,12 @@ "scope": "openid profile email" }, "options": { - "displayResourcesLazy": false + "displayResourcesLazy": false, + "sidebar": { + "shares": { + "showAllOnLoad": true + } + } }, "apps": [ "files", diff --git a/tests/drone/config-ocis.json b/tests/drone/config-ocis.json index 006c3c247af..aa427496855 100644 --- a/tests/drone/config-ocis.json +++ b/tests/drone/config-ocis.json @@ -11,7 +11,12 @@ }, "options": { "disablePreviews": true, - "displayResourcesLazy": false + "displayResourcesLazy": false, + "sidebar": { + "shares": { + "showAllOnLoad": true + } + } }, "apps": [ "files", diff --git a/yarn.lock b/yarn.lock index a38066ed745..5ad5b910ccd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2279,17 +2279,7 @@ __metadata: languageName: node linkType: hard -"@types/glob@npm:^7.1.1": - version: 7.1.3 - resolution: "@types/glob@npm:7.1.3" - dependencies: - "@types/minimatch": "*" - "@types/node": "*" - checksum: e0eef12285f548f15d887145590594a04ccce7f7e645fb047cbac18cb093f25d507ffbcc725312294c224bb78cf980fce33e5807de8d6f8a868b4186253499d4 - languageName: node - linkType: hard - -"@types/glob@npm:^7.1.3, @types/glob@npm:^7.2.0": +"@types/glob@npm:^7.1.1, @types/glob@npm:^7.1.3, @types/glob@npm:^7.2.0": version: 7.2.0 resolution: "@types/glob@npm:7.2.0" dependencies: @@ -6640,21 +6630,7 @@ __metadata: languageName: node linkType: hard -"glob@npm:^7.1.1, glob@npm:^7.1.2, glob@npm:^7.1.3, glob@npm:^7.1.4, glob@npm:^7.1.6": - version: 7.1.7 - resolution: "glob@npm:7.1.7" - dependencies: - fs.realpath: ^1.0.0 - inflight: ^1.0.4 - inherits: 2 - minimatch: ^3.0.4 - once: ^1.3.0 - path-is-absolute: ^1.0.0 - checksum: b61f48973bbdcf5159997b0874a2165db572b368b931135832599875919c237fc05c12984e38fe828e69aa8a921eb0e8a4997266211c517c9cfaae8a93988bb8 - languageName: node - linkType: hard - -"glob@npm:^7.2.0": +"glob@npm:^7.1.1, glob@npm:^7.1.2, glob@npm:^7.1.3, glob@npm:^7.1.4, glob@npm:^7.1.6, glob@npm:^7.2.0": version: 7.2.0 resolution: "glob@npm:7.2.0" dependencies: