Skip to content

Commit 00fdea4

Browse files
committed
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>
1 parent 80f3e46 commit 00fdea4

File tree

8 files changed

+29
-20
lines changed

8 files changed

+29
-20
lines changed

apps/files_sharing/src/mixins/ShareDetails.js

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,29 @@ import Share from '../models/Share.js'
22

33
export default {
44
methods: {
5-
openSharingDetails(share) {
6-
const shareRequestObject = {
5+
async openSharingDetails(shareRequestObject) {
6+
let share = {}
7+
// handle externalResults from OCA.Sharing.ShareSearch
8+
// TODO : Better name/interface for handler required
9+
// For example `externalAppCreateShareHook` with proper documentation
10+
if (shareRequestObject.handler) {
11+
if (this.suggestions) {
12+
shareRequestObject.suggestions = this.suggestions
13+
shareRequestObject.fileInfo = this.fileInfo
14+
shareRequestObject.query = this.query
15+
}
16+
share = await shareRequestObject.handler(shareRequestObject)
17+
share = new Share(share)
18+
} else {
19+
share = this.mapShareRequestToShareObject(shareRequestObject)
20+
}
21+
22+
const shareDetails = {
723
fileInfo: this.fileInfo,
8-
share: this.mapShareRequestToShareObject(share),
24+
share,
925
}
10-
this.$emit('open-sharing-details', shareRequestObject)
26+
27+
this.$emit('open-sharing-details', shareDetails)
1128
},
1229
openShareDetailsForCustomSettings(share) {
1330
share.setCustomPermissions = true

apps/files_sharing/src/views/SharingDetailsTab.vue

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,7 @@ export default {
777777
shareWith: this.share.shareWith,
778778
attributes: this.share.attributes,
779779
note: this.share.note,
780+
fileInfo: this.fileInfo,
780781
}
781782
782783
if (this.hasExpirationDate) {
@@ -803,15 +804,6 @@ export default {
803804
* @param {object} fileInfo file data
804805
*/
805806
async addShare(share, fileInfo) {
806-
807-
// handle externalResults from OCA.Sharing.ShareSearch
808-
if (share.handler) {
809-
const shareFromHandler = await share.handler(this)
810-
this.$emit('add:share', new Share(shareFromHandler))
811-
return true
812-
}
813-
814-
// this.loading = true // Are we adding loaders the new share flow?
815807
console.debug('Adding a new share from the input for', share)
816808
try {
817809
const path = (fileInfo.path + '/' + fileInfo.name).replace('//', '/')
Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/6001-6001.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/6547-6547.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

dist/files_sharing-files_sharing_tab.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/files_sharing-files_sharing_tab.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)