aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
authorfenn-cs <fenn25.fn@gmail.com>2024-06-24 14:50:27 +0100
committerfenn-cs <fenn25.fn@gmail.com>2024-07-03 13:44:20 +0100
commitd505449e457d76ebd7c702c4ae4634f63b9d6f39 (patch)
tree308c49b6942d6057e2c1eb5c24c478598e7cc37d /apps/files_sharing
parent37a55357b979373ce200b08507b186a463317b59 (diff)
downloadnextcloud-server-d505449e457d76ebd7c702c4ae4634f63b9d6f39.tar.gz
nextcloud-server-d505449e457d76ebd7c702c4ae4634f63b9d6f39.zip
refactor(SharingInput): Remove unused addShare
The new sharing flow since NC27 requires that users open the sharing details tab and customize their share before creating it. In https://github.com/nextcloud/server/pull/39472 the work of `addShare` was handed down to `openSharingDetails` that opens the sharing details tab for the user to customize and manually creat their share. Signed-off-by: fenn-cs <fenn25.fn@gmail.com>
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/src/components/SharingInput.vue75
-rw-r--r--apps/files_sharing/src/views/SharingDetailsTab.vue6
2 files changed, 0 insertions, 81 deletions
diff --git a/apps/files_sharing/src/components/SharingInput.vue b/apps/files_sharing/src/components/SharingInput.vue
index b8559dd0972..7dbce6f8493 100644
--- a/apps/files_sharing/src/components/SharingInput.vue
+++ b/apps/files_sharing/src/components/SharingInput.vue
@@ -462,81 +462,6 @@ export default {
...this.shareTypeToIcon(result.value.shareType),
}
},
-
- /**
- * Process the new share request
- *
- * @param {object} value the multiselect option
- */
- async addShare(value) {
- // Clear the displayed selection
- this.value = null
-
- if (value.lookup) {
- await this.getSuggestions(this.query, true)
-
- this.$nextTick(() => {
- // open the dropdown again
- this.$refs.select.$children[0].open = true
- })
- return true
- }
-
- // handle externalResults from OCA.Sharing.ShareSearch
- if (value.handler) {
- const share = await value.handler(this)
- this.$emit('add:share', new Share(share))
- return true
- }
-
- this.loading = true
- console.debug('Adding a new share from the input for', value)
- try {
- let password = null
-
- if (this.config.enforcePasswordForPublicLink
- && value.shareType === this.SHARE_TYPES.SHARE_TYPE_EMAIL) {
- password = await GeneratePassword()
- }
-
- const path = (this.fileInfo.path + '/' + this.fileInfo.name).replace('//', '/')
- const share = await this.createShare({
- path,
- shareType: value.shareType,
- shareWith: value.shareWith,
- password,
- permissions: this.fileInfo.sharePermissions & getCapabilities().files_sharing.default_permissions,
- attributes: JSON.stringify(this.fileInfo.shareAttributes),
- })
-
- // If we had a password, we need to show it to the user as it was generated
- if (password) {
- share.newPassword = password
- // Wait for the newly added share
- const component = await new Promise(resolve => {
- this.$emit('add:share', share, resolve)
- })
-
- // open the menu on the
- // freshly created share component
- component.open = true
- } else {
- // Else we just add it normally
- this.$emit('add:share', share)
- }
-
- await this.getRecommendations()
- } catch (error) {
- this.$nextTick(() => {
- // open the dropdown again on error
- this.$refs.select.$children[0].open = true
- })
- this.query = value.shareWith
- console.error('Error while adding new share', error)
- } finally {
- this.loading = false
- }
- },
},
}
</script>
diff --git a/apps/files_sharing/src/views/SharingDetailsTab.vue b/apps/files_sharing/src/views/SharingDetailsTab.vue
index 74eada0c396..6f6a6d60002 100644
--- a/apps/files_sharing/src/views/SharingDetailsTab.vue
+++ b/apps/files_sharing/src/views/SharingDetailsTab.vue
@@ -244,8 +244,6 @@ import ShareRequests from '../mixins/ShareRequests.js'
import ShareTypes from '../mixins/ShareTypes.js'
import SharesMixin from '../mixins/SharesMixin.js'
-import { subscribe } from '@nextcloud/event-bus'
-
import {
ATOMIC_PERMISSIONS,
BUNDLED_PERMISSIONS,
@@ -687,7 +685,6 @@ export default {
mounted() {
this.$refs.quickPermissions?.querySelector('input:checked')?.focus()
- subscribe('files_sharing:external:add-share', this.handleExistingShareFromExternalSource)
},
methods: {
@@ -947,9 +944,6 @@ export default {
return null // Or a default icon component if needed
}
},
- handleExistingShareFromExternalSource(share) {
- logger.info('Existing share from external source/app', { share })
- },
},
}
</script>