Skip to content

Commit

Permalink
bump sdk
Browse files Browse the repository at this point in the history
fix currentRole in createForm
add oc10 docker dev config to enable quicklinks
fix resource quicklink detection

Add SDK bump changelog && fix fault accessing of sidebar config option

get rid uf obsolete collaborator unit test

fix oc10 resource quicklink attribute detection

fix failing acceptance tests
  • Loading branch information
fschade authored and pascalwengerter committed May 4, 2022
1 parent 72fba44 commit 2e763c7
Show file tree
Hide file tree
Showing 17 changed files with 73 additions and 60 deletions.
15 changes: 15 additions & 0 deletions changelog/unreleased/enhancement-update-sdk
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions dev/docker/oc10.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
$CONFIG = [
'web.baseUrl' => 'http://host.docker.internal:8080/index.php/apps/web',
'web.rewriteLinks' => true,
'sharing.showPublicLinkQuickAction' => true,
];

7 changes: 6 additions & 1 deletion dev/docker/oc10.web.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@
],
"options": {
"disablePreviews": true,
"displayResourcesLazy": false
"displayResourcesLazy": false,
"sidebar": {
"shares": {
"showAllOnLoad": true
}
}
},
"applications": [
{
Expand Down
7 changes: 6 additions & 1 deletion dev/docker/ocis.web.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@
},
"options": {
"disablePreviews": true,
"displayResourcesLazy": false
"displayResourcesLazy": false,
"sidebar": {
"shares": {
"showAllOnLoad": true
}
}
},
"apps": [
"files",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
19 changes: 12 additions & 7 deletions packages/web-app-files/src/helpers/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}"]`
}

Expand Down Expand Up @@ -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')
Expand Down
4 changes: 2 additions & 2 deletions tests/acceptance/features/webUIFilesList/fileList.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/stepDefinitions/publicLinkContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
)
7 changes: 6 additions & 1 deletion tests/drone/config-oc10-integration-app-oauth.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@
],
"options": {
"disablePreviews": true,
"displayResourcesLazy": false
"displayResourcesLazy": false,
"sidebar": {
"shares": {
"showAllOnLoad": true
}
}
},
"applications": [
{
Expand Down
7 changes: 6 additions & 1 deletion tests/drone/config-oc10-oauth.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@
"authUrl": "http://owncloud/index.php/apps/oauth2/authorize"
},
"options": {
"displayResourcesLazy": false
"displayResourcesLazy": false,
"sidebar": {
"shares": {
"showAllOnLoad": true
}
}
},
"apps": [
"files",
Expand Down
7 changes: 6 additions & 1 deletion tests/drone/config-oc10-openid.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@
"scope": "openid profile email"
},
"options": {
"displayResourcesLazy": false
"displayResourcesLazy": false,
"sidebar": {
"shares": {
"showAllOnLoad": true
}
}
},
"apps": [
"files",
Expand Down
7 changes: 6 additions & 1 deletion tests/drone/config-ocis.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@
},
"options": {
"disablePreviews": true,
"displayResourcesLazy": false
"displayResourcesLazy": false,
"sidebar": {
"shares": {
"showAllOnLoad": true
}
}
},
"apps": [
"files",
Expand Down
28 changes: 2 additions & 26 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 2e763c7

Please sign in to comment.