Skip to content

Commit

Permalink
Merge pull request #6543 from owncloud/spaces-add-sharepanel-watcher
Browse files Browse the repository at this point in the history
Add a watcher for the share panel of a space
  • Loading branch information
kulmann authored Mar 7, 2022
2 parents 19a9d57 + 8f961e0 commit ae37883
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Enhancement: Add a watcher for the share panel of a space

We've added a watcher for the share panel of a space to ensure seamless navigation via the share indicator.

https://github.com/owncloud/web/pull/6543
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,15 @@ export default {
return currentUserCollaborator?.role?.name === spaceRoleManager.name
}
},
mounted() {
this.loadSharesTask.perform(this)
watch: {
highlightedFile: {
handler: function (newItem, oldItem) {
if (oldItem !== newItem) {
this.loadSharesTask.perform(this)
}
},
immediate: true
}
},
methods: {
...mapActions('Files', ['loadCurrentFileOutgoingShares', 'deleteShare']),
Expand Down
6 changes: 2 additions & 4 deletions packages/web-app-files/src/views/spaces/Project.vue
Original file line number Diff line number Diff line change
Expand Up @@ -447,8 +447,7 @@ export default {
methods: {
...mapActions('Files', ['loadIndicators', 'loadPreview', 'loadCurrentFileOutgoingShares']),
...mapActions('Files/sidebar', {
openSidebarWithPanel: 'openWithPanel',
closeSidebar: 'close'
openSidebarWithPanel: 'openWithPanel'
}),
...mapMutations('Files', [
'SET_CURRENT_FOLDER',
Expand Down Expand Up @@ -521,8 +520,7 @@ export default {
closeQuotaModal() {
this.$_editQuota_closeModal()
},
async openSidebarSharePanel() {
await this.closeSidebar()
openSidebarSharePanel() {
this.SET_FILE_SELECTION([this.space])
this.openSidebarWithPanel('space-share-item')
},
Expand Down
6 changes: 2 additions & 4 deletions packages/web-app-files/src/views/spaces/Projects.vue
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,7 @@ export default {
methods: {
...mapActions(['createModal', 'hideModal', 'setModalInputErrorMessage']),
...mapActions('Files/sidebar', {
openSidebarWithPanel: 'openWithPanel',
closeSidebar: 'close'
openSidebarWithPanel: 'openWithPanel'
}),
...mapMutations('Files', [
'SET_CURRENT_FOLDER',
Expand Down Expand Up @@ -379,8 +378,7 @@ export default {
}
return ''
},
async openSidebarSharePanel(space) {
await this.closeSidebar()
openSidebarSharePanel(space) {
this.SET_FILE_SELECTION([space])
this.openSidebarWithPanel('space-share-item')
}
Expand Down

0 comments on commit ae37883

Please sign in to comment.