瀏覽代碼

Merge pull request #44803 from nextcloud/fix/smartpicker-file-picker

tags/v27.1.9rc1
Benjamin Gaussorgues 1 月之前
父節點
當前提交
75935b83da
沒有連結到貢獻者的電子郵件帳戶。

+ 25
- 16
apps/files/src/views/FileReferencePickerElement.vue 查看文件

@@ -21,11 +21,12 @@
-->

<template>
<FilePicker :buttons="buttons"
<FilePicker allow-pick-directory
:buttons="buttons"
:container="null"
:name="t('files', 'Select file or folder to link to')"
:multiselect="false"
@close="$emit('cancel')" />
@close="onClose" />
</template>

<script>
@@ -48,24 +49,32 @@ export default {
default: false,
},
},
data() {
return {
buttons: [
{
label: t('files', 'Choose'),
type: 'primary',
callback: (nodes) => {
logger.debug('FileReferencePicker - Nodes picked', { nodes })
this.submit(nodes[0].fileid)
},

setup() {
// Buttons to show
const buttons = [
{
label: t('files', 'Choose'),
type: 'primary',
callback: (nodes) => {
logger.debug('FileReferencePicker - Nodes picked', { nodes })
},
],
},
]

return {
buttons,
}
},

methods: {
submit(fileId) {
const fileLink = `${window.location.protocol}//${window.location.host}${generateUrl('/f/{fileId}', { fileId })}`
this.$emit('submit', fileLink)
onClose(selectedNodes) {
if (!selectedNodes || selectedNodes.length === 0) {
this.$emit('cancel')
} else {
const fileLink = `${window.location.protocol}//${window.location.host}${generateUrl('/f/{fileId}', { fileId: selectedNodes[0].fileid })}`
this.$emit('submit', fileLink)
}
},
},
}

+ 1
- 1
core/css/server.css
文件差異過大導致無法顯示
查看文件


+ 2
- 2
dist/core-common.js
文件差異過大導致無法顯示
查看文件


+ 1
- 1
dist/core-common.js.map
文件差異過大導致無法顯示
查看文件


+ 2
- 2
dist/files-reference-files.js
文件差異過大導致無法顯示
查看文件


+ 1
- 1
dist/files-reference-files.js.map
文件差異過大導致無法顯示
查看文件


+ 7
- 7
package-lock.json 查看文件

@@ -17,7 +17,7 @@
"@nextcloud/browserslist-config": "^2.3.0",
"@nextcloud/calendar-availability-vue": "^0.6.0-alpha1",
"@nextcloud/capabilities": "^1.0.4",
"@nextcloud/dialogs": "^4.2.6",
"@nextcloud/dialogs": "^4.2.7",
"@nextcloud/event-bus": "^3.0.2",
"@nextcloud/files": "3.0.0-beta.8",
"@nextcloud/initial-state": "^2.0.0",
@@ -3743,9 +3743,9 @@
}
},
"node_modules/@nextcloud/dialogs": {
"version": "4.2.6",
"resolved": "https://registry.npmjs.org/@nextcloud/dialogs/-/dialogs-4.2.6.tgz",
"integrity": "sha512-y3hXga9l2swlAcopj77uPcgGX6zm+OW2RGM9urdDUTn8KH5cid4JldgqH6rzpt/5CSsyUQAKWNTwHX4pFoeA1w==",
"version": "4.2.7",
"resolved": "https://registry.npmjs.org/@nextcloud/dialogs/-/dialogs-4.2.7.tgz",
"integrity": "sha512-20211P3F+Kg/Cy56pd19hneluIQm54nZtrM5OP5Sjxw15LkZhIfkNcMKepJV8vvPK3p9sCv6wOWe0uu+GtZW2Q==",
"dependencies": {
"@mdi/svg": "^7.4.47",
"@nextcloud/files": "3.0.0-beta.21",
@@ -29446,9 +29446,9 @@
"requires": {}
},
"@nextcloud/dialogs": {
"version": "4.2.6",
"resolved": "https://registry.npmjs.org/@nextcloud/dialogs/-/dialogs-4.2.6.tgz",
"integrity": "sha512-y3hXga9l2swlAcopj77uPcgGX6zm+OW2RGM9urdDUTn8KH5cid4JldgqH6rzpt/5CSsyUQAKWNTwHX4pFoeA1w==",
"version": "4.2.7",
"resolved": "https://registry.npmjs.org/@nextcloud/dialogs/-/dialogs-4.2.7.tgz",
"integrity": "sha512-20211P3F+Kg/Cy56pd19hneluIQm54nZtrM5OP5Sjxw15LkZhIfkNcMKepJV8vvPK3p9sCv6wOWe0uu+GtZW2Q==",
"requires": {
"@mdi/svg": "^7.4.47",
"@nextcloud/files": "3.0.0-beta.21",

+ 1
- 1
package.json 查看文件

@@ -42,7 +42,7 @@
"@nextcloud/browserslist-config": "^2.3.0",
"@nextcloud/calendar-availability-vue": "^0.6.0-alpha1",
"@nextcloud/capabilities": "^1.0.4",
"@nextcloud/dialogs": "^4.2.6",
"@nextcloud/dialogs": "^4.2.7",
"@nextcloud/event-bus": "^3.0.2",
"@nextcloud/files": "3.0.0-beta.8",
"@nextcloud/initial-state": "^2.0.0",

Loading…
取消
儲存