|
150 | 150 | :share="share" /> |
151 | 151 |
|
152 | 152 | <!-- external legacy sharing via url (social...) --> |
153 | | - <NcActionLink v-for="({ icon, url, name }, index) in externalLegacyLinkActions" |
154 | | - :key="index" |
| 153 | + <NcActionLink v-for="({ icon, url, name }, actionIndex) in externalLegacyLinkActions" |
| 154 | + :key="actionIndex" |
155 | 155 | :href="url(shareLink)" |
156 | 156 | :icon="icon" |
157 | 157 | target="_blank"> |
|
207 | 207 |
|
208 | 208 | <script> |
209 | 209 | import { emit } from '@nextcloud/event-bus' |
210 | | -import { generateUrl } from '@nextcloud/router' |
| 210 | +import { generateUrl, getBaseUrl } from '@nextcloud/router' |
211 | 211 | import { showError, showSuccess } from '@nextcloud/dialogs' |
212 | | -import { Type as ShareTypes } from '@nextcloud/sharing' |
213 | | -import Vue from 'vue' |
| 212 | +import { ShareType } from '@nextcloud/sharing' |
214 | 213 | import VueQrcode from '@chenfengyuan/vue-qrcode' |
| 214 | +import moment from '@nextcloud/moment' |
| 215 | +import Vue from 'vue' |
215 | 216 |
|
216 | 217 | import NcActionButton from '@nextcloud/vue/dist/Components/NcActionButton.js' |
217 | 218 | import NcActionCheckbox from '@nextcloud/vue/dist/Components/NcActionCheckbox.js' |
@@ -508,7 +509,7 @@ export default { |
508 | 509 | * @return {string} |
509 | 510 | */ |
510 | 511 | shareLink() { |
511 | | - return window.location.protocol + '//' + window.location.host + generateUrl('/s/') + this.share.token |
| 512 | + return generateUrl('/s/{toen}', { token: this.share.token }, { baseURL: getBaseUrl() }) |
512 | 513 | }, |
513 | 514 |
|
514 | 515 | /** |
@@ -551,7 +552,7 @@ export default { |
551 | 552 | * @return {Array} |
552 | 553 | */ |
553 | 554 | externalLinkActions() { |
554 | | - const filterValidAction = (action) => (action.shareType.includes(ShareTypes.SHARE_TYPE_LINK) || action.shareType.includes(ShareTypes.SHARE_TYPE_EMAIL)) && !action.advanced |
| 555 | + const filterValidAction = (action) => (action.shareType.includes(ShareType.Link) || action.shareType.includes(ShareType.Email)) && !action.advanced |
555 | 556 | // filter only the registered actions for said link |
556 | 557 | return this.ExternalShareActions.actions |
557 | 558 | .filter(filterValidAction) |
@@ -583,7 +584,7 @@ export default { |
583 | 584 | } |
584 | 585 |
|
585 | 586 | const shareDefaults = { |
586 | | - share_type: ShareTypes.SHARE_TYPE_LINK, |
| 587 | + share_type: ShareType.Link, |
587 | 588 | } |
588 | 589 | if (this.config.isDefaultExpireDateEnforced) { |
589 | 590 | // default is empty string if not set |
@@ -669,7 +670,7 @@ export default { |
669 | 670 | const path = (this.fileInfo.path + '/' + this.fileInfo.name).replace('//', '/') |
670 | 671 | const options = { |
671 | 672 | path, |
672 | | - shareType: ShareTypes.SHARE_TYPE_LINK, |
| 673 | + shareType: ShareType.Link, |
673 | 674 | password: share.password, |
674 | 675 | expireDate: share.expireDate, |
675 | 676 | attributes: JSON.stringify(this.fileInfo.shareAttributes), |
|
0 commit comments