Small UI improvements and fixes to project edition

This commit is contained in:
2024-11-28 00:01:57 +01:00
parent 20ab51a66c
commit d71e8b7910
10 changed files with 98 additions and 35 deletions

View File

@@ -26,6 +26,10 @@ export default defineEventHandler(async (e) => {
order: explorerContentTable.order,
}).from(explorerContentTable).prepare().all();
content.sort((a, b) => {
return a.path.split('/').length - b.path.split('/').length;
});
if(content.length > 0)
{
const project: Project = {

View File

@@ -28,7 +28,7 @@ export default defineEventHandler(async (e) => {
for(let i = full.length - 1; i >= 0; i--)
{
if(items.find(e => (e.path === '' ? [e.parent, parsePath(e.title)].filter(e => !!e).join('/') : e.path) === full[i].path))
if(items.find(e => (e.path === '' ? [e.parent, parsePath(e.name === '' ? e.title : e.name)].filter(e => !!e).join('/') : e.path) === full[i].path))
full.splice(i, 1);
}
@@ -48,7 +48,7 @@ export default defineEventHandler(async (e) => {
content: null,
}).onConflictDoUpdate({
set: {
path: [item.parent, parsePath(item.title)].filter(e => !!e).join('/'),
path: [item.parent, parsePath(item.name === '' ? item.title : item.name)].filter(e => !!e).join('/'),
title: item.title,
type: item.type,
navigable: item.navigable,