Merge pull request #55718 from nextcloud/chore/remove-oca-sharing-external-link-actions

chore!(files_sharing): remove deprecated `OCA.Sharing.ExternalLinkActions`
This commit is contained in:
Ferdinand Thiessen 2025-10-14 14:25:53 +02:00 committed by GitHub
commit 5aa1f5bb84
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 10 additions and 83 deletions

View file

@ -192,16 +192,6 @@
:file-info="fileInfo"
:share="share" />
<!-- external legacy sharing via url (social...) -->
<NcActionLink
v-for="({ icon, url, name }, actionIndex) in externalLegacyLinkActions"
:key="actionIndex"
:href="url(shareLink)"
:icon="icon"
target="_blank">
{{ name }}
</NcActionLink>
<NcActionButton
v-if="!isEmailShareType && canReshare"
class="new-share-link"
@ -268,7 +258,6 @@ import { toRaw } from 'vue'
import NcActionButton from '@nextcloud/vue/components/NcActionButton'
import NcActionCheckbox from '@nextcloud/vue/components/NcActionCheckbox'
import NcActionInput from '@nextcloud/vue/components/NcActionInput'
import NcActionLink from '@nextcloud/vue/components/NcActionLink'
import NcActions from '@nextcloud/vue/components/NcActions'
import NcActionSeparator from '@nextcloud/vue/components/NcActionSeparator'
import NcActionText from '@nextcloud/vue/components/NcActionText'
@ -301,7 +290,6 @@ export default {
NcActionButton,
NcActionCheckbox,
NcActionInput,
NcActionLink,
NcActionText,
NcActionSeparator,
NcAvatar,
@ -352,7 +340,6 @@ export default {
// Are we waiting for password/expiration date
pending: false,
ExternalLegacyLinkActions: OCA.Sharing.ExternalLinkActions.state,
ExternalShareActions: OCA.Sharing.ExternalShareActions.state,
externalShareActions: getSidebarInlineActions(),
@ -593,16 +580,6 @@ export default {
return t('files_sharing', 'Copy public link of "{title}"', { title: this.title })
},
/**
* External additionnai actions for the menu
*
* @deprecated use OCA.Sharing.ExternalShareActions
* @return {Array}
*/
externalLegacyLinkActions() {
return this.ExternalLegacyLinkActions.actions
},
/**
* Additional actions for the menu
*

View file

@ -7,7 +7,6 @@ import ShareVariant from '@mdi/svg/svg/share-variant.svg?raw'
import { getCSPNonce } from '@nextcloud/auth'
import { n, t } from '@nextcloud/l10n'
import Vue from 'vue'
import ExternalLinkActions from './services/ExternalLinkActions.js'
import ExternalShareActions from './services/ExternalShareActions.js'
import ShareSearch from './services/ShareSearch.js'
import TabSections from './services/TabSections.js'
@ -19,7 +18,6 @@ if (!window.OCA.Sharing) {
window.OCA.Sharing = {}
}
Object.assign(window.OCA.Sharing, { ShareSearch: new ShareSearch() })
Object.assign(window.OCA.Sharing, { ExternalLinkActions: new ExternalLinkActions() })
Object.assign(window.OCA.Sharing, { ExternalShareActions: new ExternalShareActions() })
Object.assign(window.OCA.Sharing, { ShareTabSections: new TabSections() })

View file

@ -1,48 +0,0 @@
/**
* SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import logger from './logger.ts'
export default class ExternalLinkActions {
_state
constructor() {
// init empty state
this._state = {}
// init default values
this._state.actions = []
logger.debug('OCA.Sharing.ExternalLinkActions initialized')
}
/**
* Get the state
*
* @readonly
* @memberof ExternalLinkActions
* @return {object} the data state
*/
get state() {
return this._state
}
/**
* Register a new action for the link share
* Mostly used by the social sharing app.
*
* @param {object} action new action component to register
* @return {boolean}
*/
registerAction(action) {
logger.warn('OCA.Sharing.ExternalLinkActions is deprecated, use `registerSidebarAction` from `@nextcloud/sharing` instead')
if (typeof action === 'object' && action.icon && action.name && action.url) {
this._state.actions.push(action)
return true
}
logger.error('Invalid action provided', action)
return false
}
}

2
dist/1960-1960.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1 +0,0 @@
1960-1960.js.license

2
dist/4247-4247.js vendored Normal file

File diff suppressed because one or more lines are too long

1
dist/4247-4247.js.map vendored Normal file

File diff suppressed because one or more lines are too long

1
dist/4247-4247.js.map.license vendored Symbolic link
View file

@ -0,0 +1 @@
4247-4247.js.license

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long