mirror of
https://github.com/nextcloud/server.git
synced 2026-06-11 09:42:09 -04:00
Merge pull request #42437 from nextcloud/fix/s27-reference-picker
fix(files): Fix reference picker not working
This commit is contained in:
commit
51e3bff2fd
4 changed files with 32 additions and 6 deletions
|
|
@ -31,6 +31,8 @@
|
|||
<script>
|
||||
import { FilePickerVue } from '@nextcloud/dialogs'
|
||||
import { generateUrl } from '@nextcloud/router'
|
||||
import logger from '../logger.js'
|
||||
|
||||
export default {
|
||||
name: 'FileReferencePickerElement',
|
||||
components: {
|
||||
|
|
@ -52,15 +54,17 @@ export default {
|
|||
{
|
||||
label: t('files', 'Choose'),
|
||||
type: 'primary',
|
||||
callback: (node) => this.submit(node.fileid),
|
||||
callback: (nodes) => {
|
||||
logger.debug('FileReferencePicker - Nodes picked', { nodes })
|
||||
this.submit(nodes[0].fileid)
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
submit(fileId) {
|
||||
const fileLink = window.location.protocol + '//' + window.location.host
|
||||
+ generateUrl('/f/{fileId}', { fileId })
|
||||
const fileLink = `${window.location.protocol}//${window.location.host}${generateUrl('/f/{fileId}', { fileId })}`
|
||||
this.$emit('submit', fileLink)
|
||||
},
|
||||
},
|
||||
|
|
|
|||
4
dist/files-reference-files.js
vendored
4
dist/files-reference-files.js
vendored
File diff suppressed because one or more lines are too long
22
dist/files-reference-files.js.LICENSE.txt
vendored
22
dist/files-reference-files.js.LICENSE.txt
vendored
|
|
@ -1,3 +1,25 @@
|
|||
/**
|
||||
* @copyright Copyright (c) 2022 John Molakvoæ <skjnldsv@protonmail.com>
|
||||
*
|
||||
* @author John Molakvoæ <skjnldsv@protonmail.com>
|
||||
*
|
||||
* @license AGPL-3.0-or-later
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @copyright Copyright (c) 2022 Julius Härtl <jus@bitgrid.net>
|
||||
*
|
||||
|
|
|
|||
2
dist/files-reference-files.js.map
vendored
2
dist/files-reference-files.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue