Skip to content

Commit

Permalink
Fix invite guest for new sharing flow
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Fenn-CS committed Sep 14, 2023
1 parent 30a7eab commit 1f74c88
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 23 deletions.
25 changes: 21 additions & 4 deletions apps/files_sharing/src/mixins/ShareDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 1 addition & 9 deletions apps/files_sharing/src/views/SharingDetailsTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,7 @@ export default {
shareWith: this.share.shareWith,
attributes: this.share.attributes,
note: this.share.note,
fileInfo: this.fileInfo,
}
if (this.hasExpirationDate) {
Expand All @@ -803,15 +804,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('//', '/')
Expand Down
3 changes: 3 additions & 0 deletions dist/1012-1012.js

Large diffs are not rendered by default.

File renamed without changes.
1 change: 1 addition & 0 deletions dist/1012-1012.js.map

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions dist/9193-9193.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/9193-9193.js.map

This file was deleted.

4 changes: 2 additions & 2 deletions dist/core-common.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-common.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/files_sharing-files_sharing_tab.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files_sharing-files_sharing_tab.js.map

Large diffs are not rendered by default.

0 comments on commit 1f74c88

Please sign in to comment.