|
156 | 156 | :share="share" /> |
157 | 157 |
|
158 | 158 | <!-- external legacy sharing via url (social...) --> |
159 | | - <NcActionLink v-for="({ icon, url, name }, index) in externalLegacyLinkActions" |
160 | | - :key="index" |
| 159 | + <NcActionLink v-for="({ icon, url, name }, actionIndex) in externalLegacyLinkActions" |
| 160 | + :key="actionIndex" |
161 | 161 | :href="url(shareLink)" |
162 | 162 | :icon="icon" |
163 | 163 | target="_blank"> |
|
213 | 213 |
|
214 | 214 | <script> |
215 | 215 | import { emit } from '@nextcloud/event-bus' |
216 | | -import { generateUrl } from '@nextcloud/router' |
| 216 | +import { generateUrl, getBaseUrl } from '@nextcloud/router' |
217 | 217 | import { showError, showSuccess } from '@nextcloud/dialogs' |
218 | | -import { Type as ShareTypes } from '@nextcloud/sharing' |
219 | | -import Vue from 'vue' |
| 218 | +import { ShareType } from '@nextcloud/sharing' |
220 | 219 | import VueQrcode from '@chenfengyuan/vue-qrcode' |
| 220 | +import moment from '@nextcloud/moment' |
| 221 | +import Vue from 'vue' |
221 | 222 |
|
222 | 223 | import NcActionButton from '@nextcloud/vue/dist/Components/NcActionButton.js' |
223 | 224 | import NcActionInput from '@nextcloud/vue/dist/Components/NcActionInput.js' |
@@ -510,7 +511,7 @@ export default { |
510 | 511 | * @return {string} |
511 | 512 | */ |
512 | 513 | shareLink() { |
513 | | - return window.location.protocol + '//' + window.location.host + generateUrl('/s/') + this.share.token |
| 514 | + return generateUrl('/s/{toen}', { token: this.share.token }, { baseURL: getBaseUrl() }) |
514 | 515 | }, |
515 | 516 |
|
516 | 517 | /** |
@@ -553,7 +554,7 @@ export default { |
553 | 554 | * @return {Array} |
554 | 555 | */ |
555 | 556 | externalLinkActions() { |
556 | | - const filterValidAction = (action) => (action.shareType.includes(ShareTypes.SHARE_TYPE_LINK) || action.shareType.includes(ShareTypes.SHARE_TYPE_EMAIL)) && !action.advanced |
| 557 | + const filterValidAction = (action) => (action.shareType.includes(ShareType.Link) || action.shareType.includes(ShareType.Email)) && !action.advanced |
557 | 558 | // filter only the registered actions for said link |
558 | 559 | return this.ExternalShareActions.actions |
559 | 560 | .filter(filterValidAction) |
@@ -585,7 +586,7 @@ export default { |
585 | 586 | } |
586 | 587 |
|
587 | 588 | const shareDefaults = { |
588 | | - share_type: ShareTypes.SHARE_TYPE_LINK, |
| 589 | + share_type: ShareType.Link, |
589 | 590 | } |
590 | 591 | if (this.config.isDefaultExpireDateEnforced) { |
591 | 592 | // default is empty string if not set |
@@ -671,7 +672,7 @@ export default { |
671 | 672 | const path = (this.fileInfo.path + '/' + this.fileInfo.name).replace('//', '/') |
672 | 673 | const options = { |
673 | 674 | path, |
674 | | - shareType: ShareTypes.SHARE_TYPE_LINK, |
| 675 | + shareType: ShareType.Link, |
675 | 676 | password: share.password, |
676 | 677 | expireDate: share.expireDate, |
677 | 678 | attributes: JSON.stringify(this.fileInfo.shareAttributes), |
|
0 commit comments