Handle files without stored paths
All checks were successful
Build and Push Docker Images / build-frontend (push) Successful in 1m54s
Build and Push Docker Images / build-website (push) Successful in 37s
Build and Push Docker Images / build-backend (push) Successful in 36s
Build and Push Docker Images / build-central-services-api (push) Successful in 35s
Build and Push Docker Images / build-central-services-admin (push) Successful in 34s
Build and Push Docker Images / build-docs (push) Successful in 34s
All checks were successful
Build and Push Docker Images / build-frontend (push) Successful in 1m54s
Build and Push Docker Images / build-website (push) Successful in 37s
Build and Push Docker Images / build-backend (push) Successful in 36s
Build and Push Docker Images / build-central-services-api (push) Successful in 35s
Build and Push Docker Images / build-central-services-admin (push) Successful in 34s
Build and Push Docker Images / build-docs (push) Successful in 34s
This commit is contained in:
@@ -152,7 +152,7 @@ setup()
|
|||||||
<div class="flex flex-row">
|
<div class="flex flex-row">
|
||||||
<div class="w-1/3">
|
<div class="w-1/3">
|
||||||
<PDFViewer
|
<PDFViewer
|
||||||
v-if="props.documentData.id && props.documentData.path.toLowerCase().includes('pdf')"
|
v-if="props.documentData.id && String(props.documentData.path || '').toLowerCase().includes('pdf')"
|
||||||
:file-id="props.documentData.id" />
|
:file-id="props.documentData.id" />
|
||||||
|
|
||||||
<img
|
<img
|
||||||
|
|||||||
@@ -235,6 +235,11 @@ const breadcrumbItems = computed(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// --- Data Mapping ---
|
// --- Data Mapping ---
|
||||||
|
const getFileName = (file) => {
|
||||||
|
const path = String(file?.path || '').trim()
|
||||||
|
return path ? path.split('/').pop() : `Datei ${file?.id || ''}`.trim()
|
||||||
|
}
|
||||||
|
|
||||||
const renderedFileList = computed(() => {
|
const renderedFileList = computed(() => {
|
||||||
const folderList = folders.value
|
const folderList = folders.value
|
||||||
.filter(i => currentFolder.value ? i.parent === currentFolder.value.id : !i.parent)
|
.filter(i => currentFolder.value ? i.parent === currentFolder.value.id : !i.parent)
|
||||||
@@ -243,7 +248,7 @@ const renderedFileList = computed(() => {
|
|||||||
|
|
||||||
const fileList = documents.value
|
const fileList = documents.value
|
||||||
.filter(i => currentFolder.value ? i.folder === currentFolder.value.id : !i.folder)
|
.filter(i => currentFolder.value ? i.folder === currentFolder.value.id : !i.folder)
|
||||||
.map(i => ({...i, label: i.path.split("/").pop(), type: "file"}))
|
.map(i => ({...i, label: getFileName(i), type: "file"}))
|
||||||
.sort((a, b) => a.label.localeCompare(b.label))
|
.sort((a, b) => a.label.localeCompare(b.label))
|
||||||
|
|
||||||
let combined = [...folderList, ...fileList]
|
let combined = [...folderList, ...fileList]
|
||||||
@@ -315,7 +320,7 @@ const updateName = async () => {
|
|||||||
await useEntities("folders").update(renameData.value.id, {name: renameData.value.name})
|
await useEntities("folders").update(renameData.value.id, {name: renameData.value.name})
|
||||||
} else {
|
} else {
|
||||||
const file = documents.value.find(d => d.id === renameData.value.id)
|
const file = documents.value.find(d => d.id === renameData.value.id)
|
||||||
const pathParts = file.path.split('/')
|
const pathParts = String(file?.path || '').split('/')
|
||||||
pathParts[pathParts.length - 1] = renameData.value.name
|
pathParts[pathParts.length - 1] = renameData.value.name
|
||||||
await useEntities("files").update(renameData.value.id, {path: pathParts.join('/')})
|
await useEntities("files").update(renameData.value.id, {path: pathParts.join('/')})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user