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/SideBar/Shares/FileLinks.vue b/packages/web-app-files/src/components/SideBar/Shares/FileLinks.vue index 3c2b6c6c4cc..cfc8cd0e0c3 100644 --- a/packages/web-app-files/src/components/SideBar/Shares/FileLinks.vue +++ b/packages/web-app-files/src/components/SideBar/Shares/FileLinks.vue @@ -130,7 +130,7 @@ export default defineComponent({ store.getters.getToken ) - const linkListCollapsed = !store.getters.configuration.sidebar.shares.showAllOnLoad + const linkListCollapsed = !store.getters.configuration.options.sidebar.shares.showAllOnLoad return { graphClient, hasSpaces: useCapabilitySpacesEnabled(), linkListCollapsed } }, 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 000d4dce400..9315f9d39be 100644 --- a/packages/web-app-files/src/components/SideBar/Shares/FileShares.vue +++ b/packages/web-app-files/src/components/SideBar/Shares/FileShares.vue @@ -131,7 +131,7 @@ export default { }) }) - const sharesListCollapsed = !store.getters.configuration.sidebar.shares.showAllOnLoad + const sharesListCollapsed = !store.getters.configuration.options.sidebar.shares.showAllOnLoad return { loadSpaceTask, diff --git a/packages/web-app-files/src/components/SideBar/Shares/Links/CreateForm.vue b/packages/web-app-files/src/components/SideBar/Shares/Links/CreateForm.vue index 7aa0058ffe9..71a2698fb31 100644 --- a/packages/web-app-files/src/components/SideBar/Shares/Links/CreateForm.vue +++ b/packages/web-app-files/src/components/SideBar/Shares/Links/CreateForm.vue @@ -182,7 +182,7 @@ export default { passwordEnforcedForRole() { const currentRole = this.availableRoleOptions.find(({ role }) => { - return this.link.role.label === role.label + return this.link.role.name === role.name }) const canRead = currentRole.role.hasPermission(SharePermissions.read) diff --git a/packages/web-app-files/src/helpers/resources.ts b/packages/web-app-files/src/helpers/resources.ts index 83a0b45b3f9..27f39db9d7b 100644 --- a/packages/web-app-files/src/helpers/resources.ts +++ b/packages/web-app-files/src/helpers/resources.ts @@ -444,13 +444,18 @@ function _buildLink(link): Share { description = role.label } - let oc10QuickLink = false - if (link.attributes) { - const attributes = JSON.parse(link.attributes) || [] - oc10QuickLink = attributes.find((attr) => attr.key === 'isQuickLink')?.enabled - } - const ocisQuickLink = link.quicklink === 'true' - const quicklink = oc10QuickLink || ocisQuickLink + const quicklinkOc10 = ((): boolean => { + if (typeof link.attributes !== 'string') { + return false + } + + return ( + JSON.parse(link.attributes || '[]').find((attr) => attr.key === 'isQuickLink')?.enabled === + 'true' + ) + })() + const quicklinkOcis = link.quicklink === 'true' + const quicklink = quicklinkOc10 || quicklinkOcis return { shareType: parseInt(link.share_type), diff --git a/packages/web-app-files/tests/unit/components/SideBar/Shares/FileShares.spec.js b/packages/web-app-files/tests/unit/components/SideBar/Shares/FileShares.spec.js index 9e9d087de95..b0f82a90f48 100644 --- a/packages/web-app-files/tests/unit/components/SideBar/Shares/FileShares.spec.js +++ b/packages/web-app-files/tests/unit/components/SideBar/Shares/FileShares.spec.js @@ -26,7 +26,6 @@ const user = Users.alice const collaborators = [Collaborators[0], Collaborators[1]] const selectors = { - showCollaboratorButton: 'button[data-testid="collaborators-show-people"]', firstCollaboratorListItem: `div[data-testid="collaborator-user-item-${Collaborators[0].collaborator.name}"]` } @@ -78,19 +77,6 @@ describe('FileShares', () => { expect(wrapper).toMatchSnapshot() }) - it('can toggle the collaborators list by clicking the avatar wrapper button', async () => { - const wrapper = getMountedWrapper({ - user, - outgoingCollaborators: collaborators - }) - const button = wrapper.find(selectors.showCollaboratorButton) - expect(wrapper.vm.showShareesList).toBe(true) - await button.trigger('click') - expect(wrapper.vm.showShareesList).toBe(false) - await button.trigger('click') - expect(wrapper.vm.showShareesList).toBe(true) - }) - it('reacts on delete events by collaborator list items', async () => { const spyOnCollaboratorDeleteTrigger = jest .spyOn(FileShares.methods, '$_ocCollaborators_deleteShare_trigger') 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 df14c9806e6..61c1717c4e0 100644 --- a/tests/acceptance/features/webUISharingPublicBasic/publicLinkCreate.feature +++ b/tests/acceptance/features/webUISharingPublicBasic/publicLinkCreate.feature @@ -179,7 +179,7 @@ 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 """ Quicklink copied into your clipboard 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: