Merge pull request #42437 from nextcloud/fix/s27-reference-picker

fix(files): Fix reference picker not working
This commit is contained in:
Ferdinand Thiessen 2024-01-16 15:29:22 +01:00 committed by GitHub
commit 51e3bff2fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 32 additions and 6 deletions

View file

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

File diff suppressed because one or more lines are too long

View file

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

File diff suppressed because one or more lines are too long