diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-08-27 23:06:00 +0200 |
---|---|---|
committer | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-09-20 03:30:20 +0200 |
commit | 085aab24ffd920df2f3610c9f6c2fa1e71a6d294 (patch) | |
tree | 0536be9d78feeba507bbe76d4c745158ab63005b /apps/files_sharing/src/components/SharingEntryLink.vue | |
parent | 4ba3d4a31a5a27a7fad6b8928d899ec7247289ca (diff) | |
download | nextcloud-server-085aab24ffd920df2f3610c9f6c2fa1e71a6d294.tar.gz nextcloud-server-085aab24ffd920df2f3610c9f6c2fa1e71a6d294.zip |
chore: fix usage of deprecated functions and adjust code style
This solves 57 ESLint warnings by replacing deprecated code with `@nextcloud/` libraries,
as well as adding missing type information, importing jQuery instead of relying on global one,
and the same with Moment.js.
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'apps/files_sharing/src/components/SharingEntryLink.vue')
-rw-r--r-- | apps/files_sharing/src/components/SharingEntryLink.vue | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/apps/files_sharing/src/components/SharingEntryLink.vue b/apps/files_sharing/src/components/SharingEntryLink.vue index 8dfe85b4f05..d95027d82d2 100644 --- a/apps/files_sharing/src/components/SharingEntryLink.vue +++ b/apps/files_sharing/src/components/SharingEntryLink.vue @@ -150,8 +150,8 @@ :share="share" /> <!-- external legacy sharing via url (social...) --> - <NcActionLink v-for="({ icon, url, name }, index) in externalLegacyLinkActions" - :key="index" + <NcActionLink v-for="({ icon, url, name }, actionIndex) in externalLegacyLinkActions" + :key="actionIndex" :href="url(shareLink)" :icon="icon" target="_blank"> @@ -207,11 +207,12 @@ <script> import { emit } from '@nextcloud/event-bus' -import { generateUrl } from '@nextcloud/router' +import { generateUrl, getBaseUrl } from '@nextcloud/router' import { showError, showSuccess } from '@nextcloud/dialogs' -import { Type as ShareTypes } from '@nextcloud/sharing' -import Vue from 'vue' +import { ShareType } from '@nextcloud/sharing' import VueQrcode from '@chenfengyuan/vue-qrcode' +import moment from '@nextcloud/moment' +import Vue from 'vue' import NcActionButton from '@nextcloud/vue/dist/Components/NcActionButton.js' import NcActionCheckbox from '@nextcloud/vue/dist/Components/NcActionCheckbox.js' @@ -508,7 +509,7 @@ export default { * @return {string} */ shareLink() { - return window.location.protocol + '//' + window.location.host + generateUrl('/s/') + this.share.token + return generateUrl('/s/{toen}', { token: this.share.token }, { baseURL: getBaseUrl() }) }, /** @@ -551,7 +552,7 @@ export default { * @return {Array} */ externalLinkActions() { - const filterValidAction = (action) => (action.shareType.includes(ShareTypes.SHARE_TYPE_LINK) || action.shareType.includes(ShareTypes.SHARE_TYPE_EMAIL)) && !action.advanced + const filterValidAction = (action) => (action.shareType.includes(ShareType.Link) || action.shareType.includes(ShareType.Email)) && !action.advanced // filter only the registered actions for said link return this.ExternalShareActions.actions .filter(filterValidAction) @@ -583,7 +584,7 @@ export default { } const shareDefaults = { - share_type: ShareTypes.SHARE_TYPE_LINK, + share_type: ShareType.Link, } if (this.config.isDefaultExpireDateEnforced) { // default is empty string if not set @@ -669,7 +670,7 @@ export default { const path = (this.fileInfo.path + '/' + this.fileInfo.name).replace('//', '/') const options = { path, - shareType: ShareTypes.SHARE_TYPE_LINK, + shareType: ShareType.Link, password: share.password, expireDate: share.expireDate, attributes: JSON.stringify(this.fileInfo.shareAttributes), |