chore!(files_sharing): remove deprecated `OCA.Sharing.ExternalLinkActions`

This API was deprecated in Nextcloud 23.
It was replaced with `OCA.Sharing.ExternalShareAction` which now have a proper API
by using `registerSidebarAction` from `@nextcloud/sharing` instead.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
pull/55718/head
Ferdinand Thiessen 2025-10-13 15:19:11 +07:00
parent 8659002d7a
commit 23be816568
3 changed files with 0 additions and 73 deletions

@ -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
*

@ -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() })

@ -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
}
}