Skip to content

Commit

Permalink
Merge pull request #40415 from nextcloud/artonge/backport/stable27/40389
Browse files Browse the repository at this point in the history
[stable27] Fix invite guest for new sharing flow
  • Loading branch information
AndyScherzinger authored Sep 14, 2023
2 parents 87b7c91 + 15dd2e8 commit 1ac6c92
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 16 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 @@ -769,6 +769,7 @@ export default {
shareWith: this.share.shareWith,
attributes: this.share.attributes,
note: this.share.note,
fileInfo: this.fileInfo,
}
if (this.hasExpirationDate) {
Expand All @@ -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('//', '/')
Expand Down
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 1ac6c92

Please sign in to comment.