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]>
Signed-off-by: nextcloud-command <[email protected]>
  • Loading branch information
nfebe authored and artonge committed Sep 14, 2023
1 parent 30a7eab commit 419eb0d
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 21 deletions.
2 changes: 1 addition & 1 deletion 3rdparty
Submodule 3rdparty updated 3421 files
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/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 419eb0d

Please sign in to comment.