Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix(ExternalSharing): Handle template share from external sources
The new sharing flow requires or implies that users should edit share before creating.
External sources should not created the share IF we would upon sharing details tab on first request.

Signed-off-by: fenn-cs <[email protected]>
  • Loading branch information
nfebe committed Jul 3, 2024
commit c998f5ebba6c05c49d723272deb7aa80603dd21c
11 changes: 6 additions & 5 deletions apps/files_sharing/src/mixins/ShareDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ export default {
// TODO : Better name/interface for handler required
// For example `externalAppCreateShareHook` with proper documentation
if (shareRequestObject.handler) {
const handlerInput = {}
if (this.suggestions) {
shareRequestObject.suggestions = this.suggestions
shareRequestObject.fileInfo = this.fileInfo
shareRequestObject.query = this.query
handlerInput.suggestions = this.suggestions
handlerInput.fileInfo = this.fileInfo
handlerInput.query = this.query
}
share = await shareRequestObject.handler(shareRequestObject)
share = new Share(share)
const externalShareRequestObject = await shareRequestObject.handler(handlerInput)
share = this.mapShareRequestToShareObject(externalShareRequestObject)
} else {
share = this.mapShareRequestToShareObject(shareRequestObject)
}
Expand Down
6 changes: 6 additions & 0 deletions apps/files_sharing/src/views/SharingDetailsTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,8 @@ import ShareTypes from '../mixins/ShareTypes.js'
import SharesMixin from '../mixins/SharesMixin.js'
import logger from '../services/logger.ts'

import { subscribe } from '@nextcloud/event-bus'

import {
ATOMIC_PERMISSIONS,
BUNDLED_PERMISSIONS,
Expand Down Expand Up @@ -735,6 +737,7 @@ export default {

mounted() {
this.$refs.quickPermissions?.querySelector('input:checked')?.focus()
subscribe('files_sharing:external:add-share', this.handleExistingShareFromExternalSource)
},

methods: {
Expand Down Expand Up @@ -1007,6 +1010,9 @@ export default {
return null // Or a default icon component if needed
}
},
handleExistingShareFromExternalSource(share) {
logger.info('Existing share from external source/app', { share })
},
},
}
</script>
Expand Down