aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorfenn-cs <fenn25.fn@gmail.com>2023-09-12 23:02:05 +0100
committerLouis Chemineau <louis@chmn.me>2023-09-14 12:04:16 +0200
commit15dd2e85e1f82044062cb9b330e55f94e15a326f (patch)
tree1dce42f8c215b87fde227e68333347a1430cb3f4 /apps
parentfb76e03345498032f8afc583fd30bfb4c4180003 (diff)
downloadnextcloud-server-15dd2e85e1f82044062cb9b330e55f94e15a326f.tar.gz
nextcloud-server-15dd2e85e1f82044062cb9b330e55f94e15a326f.zip
Fix invite guest for new sharing flow
Call external handlers such as the one in the guess app https://github.com/nextcloud/guests/blob/master/src/main.js#L30 if present. Signed-off-by: fenn-cs <fenn25.fn@gmail.com> Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
Diffstat (limited to 'apps')
-rw-r--r--apps/files_sharing/src/mixins/ShareDetails.js25
-rw-r--r--apps/files_sharing/src/views/SharingDetailsTab.vue10
2 files changed, 22 insertions, 13 deletions
diff --git a/apps/files_sharing/src/mixins/ShareDetails.js b/apps/files_sharing/src/mixins/ShareDetails.js
index 53ec8bfe16a..3884d22dae6 100644
--- a/apps/files_sharing/src/mixins/ShareDetails.js
+++ b/apps/files_sharing/src/mixins/ShareDetails.js
@@ -2,12 +2,29 @@ import Share from '../models/Share.js'
export default {
methods: {
- openSharingDetails(share) {
- const shareRequestObject = {
+ async openSharingDetails(shareRequestObject) {
+ let share = {}
+ // handle externalResults from OCA.Sharing.ShareSearch
+ // TODO : Better name/interface for handler required
+ // For example `externalAppCreateShareHook` with proper documentation
+ if (shareRequestObject.handler) {
+ if (this.suggestions) {
+ shareRequestObject.suggestions = this.suggestions
+ shareRequestObject.fileInfo = this.fileInfo
+ shareRequestObject.query = this.query
+ }
+ share = await shareRequestObject.handler(shareRequestObject)
+ share = new Share(share)
+ } else {
+ share = this.mapShareRequestToShareObject(shareRequestObject)
+ }
+
+ const shareDetails = {
fileInfo: this.fileInfo,
- share: this.mapShareRequestToShareObject(share),
+ share,
}
- this.$emit('open-sharing-details', shareRequestObject)
+
+ this.$emit('open-sharing-details', shareDetails)
},
openShareDetailsForCustomSettings(share) {
share.setCustomPermissions = true
diff --git a/apps/files_sharing/src/views/SharingDetailsTab.vue b/apps/files_sharing/src/views/SharingDetailsTab.vue
index 7cee14c9d99..e62a1ab94d7 100644
--- a/apps/files_sharing/src/views/SharingDetailsTab.vue
+++ b/apps/files_sharing/src/views/SharingDetailsTab.vue
@@ -769,6 +769,7 @@ export default {
shareWith: this.share.shareWith,
attributes: this.share.attributes,
note: this.share.note,
+ fileInfo: this.fileInfo,
}
if (this.hasExpirationDate) {
@@ -795,15 +796,6 @@ export default {
* @param {object} fileInfo file data
*/
async addShare(share, fileInfo) {
-
- // handle externalResults from OCA.Sharing.ShareSearch
- if (share.handler) {
- const shareFromHandler = await share.handler(this)
- this.$emit('add:share', new Share(shareFromHandler))
- return true
- }
-
- // this.loading = true // Are we adding loaders the new share flow?
console.debug('Adding a new share from the input for', share)
try {
const path = (fileInfo.path + '/' + fileInfo.name).replace('//', '/')