File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,12 +2,29 @@ import Share from '../models/Share.js'
22
33export 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
Original file line number Diff line number Diff line change @@ -774,6 +774,7 @@ export default {
774774 shareWith: this .share .shareWith ,
775775 attributes: this .share .attributes ,
776776 note: this .share .note ,
777+ fileInfo: this .fileInfo ,
777778 }
778779
779780 if (this .hasExpirationDate ) {
@@ -800,15 +801,6 @@ export default {
800801 * @param {object} fileInfo file data
801802 */
802803 async addShare (share , fileInfo ) {
803-
804- // handle externalResults from OCA.Sharing.ShareSearch
805- if (share .handler ) {
806- const shareFromHandler = await share .handler (this )
807- this .$emit (' add:share' , new Share (shareFromHandler))
808- return true
809- }
810-
811- // this.loading = true // Are we adding loaders the new share flow?
812804 console .debug (' Adding a new share from the input for' , share)
813805 try {
814806 const path = (fileInfo .path + ' /' + fileInfo .name ).replace (' //' , ' /' )
You can’t perform that action at this time.
0 commit comments