Skip to content

Commit

Permalink
simplify usage of storageId
Browse files Browse the repository at this point in the history
make use of resharing composable
bump ocis commit id
cleanup changelog
  • Loading branch information
fschade committed Jul 6, 2022
1 parent c2fd64a commit b01d439
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .drone.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# The version of OCIS to use in pipelines that test against OCIS
OCIS_COMMITID=2e79be6bfd92d373eb63039e66354fe9d13aaae0
OCIS_COMMITID=ee97594742b23550d1f35a1002a3d83700950622
OCIS_BRANCH=master
1 change: 1 addition & 0 deletions changelog/unreleased/enhancement-ocis-resharing
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ We've enhanced web to be able to re-share resources when using an ownCloud infin
Besides that we also send roles, space-ref and path as separate values to the sharing api which simplifies the usage of it.

https://github.com/owncloud/web/pull/7086
https://github.com/owncloud/web/issues/6894
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,7 @@ export default defineComponent({
return {
sharedParentDir,
sharedParentRoute,
currentStorageId
sharedParentRoute
}
},
Expand Down
18 changes: 11 additions & 7 deletions packages/web-app-files/src/components/SideBar/Shares/FileLinks.vue
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ import { mapGetters, mapActions, mapState } from 'vuex'
import {
useStore,
useCapabilitySpacesEnabled,
useCapabilityShareJailEnabled
useCapabilityShareJailEnabled,
useCapabilityFilesSharingResharing
} from 'web-pkg/src/composables'
import { clientService } from 'web-pkg/src/services'
import mixins from '../../../mixins'
Expand Down Expand Up @@ -150,6 +151,7 @@ export default defineComponent({
graphClient,
hasSpaces: useCapabilitySpacesEnabled(),
hasShareJail: useCapabilityShareJailEnabled(),
hasResharing: useCapabilityFilesSharingResharing(),
indirectLinkListCollapsed,
linkListCollapsed
}
Expand Down Expand Up @@ -263,14 +265,15 @@ export default defineComponent({
},
canCreatePublicLinks() {
const reSharingEnabled = this.capabilities?.files_sharing?.resharing === true
if (this.highlightedFile.isReceivedShare() && !reSharingEnabled) {
if (this.highlightedFile.isReceivedShare() && !this.hasResharing) {
return false
}
const isShareJail = isLocationSpacesActive(this.$router, 'files-spaces-share')
if (isShareJail && !reSharingEnabled) {
if (isShareJail && !this.hasResharing) {
return false
}
return this.highlightedFile.canShare({ user: this.user })
},
Expand Down Expand Up @@ -358,8 +361,9 @@ export default defineComponent({
currentStorageId() {
if (this.resourceIsSpace) {
return this.highlightedFile.id
return this.highlightedFile.fileId || this.highlightedFile.id
}
return this.$route.params.storageId || null
}
},
Expand Down Expand Up @@ -512,7 +516,7 @@ export default defineComponent({
path,
client: this.$client,
$gettext: this.$gettext,
storageId: this.highlightedFile.fileId || this.highlightedFile.id,
...(this.currentStorageId && { storageId: this.currentStorageId }),
params
}).catch((e) => {
onError(e)
Expand Down Expand Up @@ -582,7 +586,7 @@ export default defineComponent({
client,
share,
path,
storageId: this.highlightedFile.fileId || this.highlightedFile.id
...(this.currentStorageId && { storageId: this.currentStorageId })
})
.then(
this.showMessage({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ import {
useDebouncedRef,
useRouteParam,
useCapabilityProjectSpacesEnabled,
useCapabilityShareJailEnabled
useCapabilityShareJailEnabled,
useCapabilityFilesSharingResharing
} from 'web-pkg/src/composables'
import { clientService } from 'web-pkg/src/services'
import { createLocationSpaces, isLocationSpacesActive } from '../../../router'
Expand Down Expand Up @@ -149,11 +150,11 @@ export default {
sharesListCollapsed,
sharesLoading,
hasProjectSpaces: useCapabilityProjectSpacesEnabled(),
hasShareJail: useCapabilityShareJailEnabled()
hasShareJail: useCapabilityShareJailEnabled(),
hasResharing: useCapabilityFilesSharingResharing()
}
},
computed: {
...mapGetters(['capabilities']),
...mapGetters('Files', ['highlightedFile', 'currentFileOutgoingCollaborators']),
...mapState('Files', ['incomingShares', 'sharesTree']),
...mapState(['user']),
Expand Down Expand Up @@ -264,12 +265,11 @@ export default {
},
currentUserCanShare() {
const reSharingEnabled = this.capabilities?.files_sharing?.resharing === true
if (this.highlightedFile.isReceivedShare() && !reSharingEnabled) {
if (this.highlightedFile.isReceivedShare() && !this.hasResharing) {
return false
}
const isShareJail = isLocationSpacesActive(this.$router, 'files-spaces-share')
if (isShareJail && !reSharingEnabled) {
if (isShareJail && !this.hasResharing) {
return false
}
Expand Down Expand Up @@ -372,7 +372,7 @@ export default {
client: this.$client,
share: share,
path,
storageId: this.highlightedFile.fileId || this.highlightedFile.id
...(this.currentStorageId && { storageId: this.currentStorageId })
})
.then(() => {
this.hideModal()
Expand Down

0 comments on commit b01d439

Please sign in to comment.