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 @@ -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 (' //' , ' /' )
You can’t perform that action at this time.
0 commit comments