@samitouri / QOSami-HFS / commits / 7c97e492

admin/shared: new items are directly inserted in the tree in order, and without toast-message

Massimo Melina committed Mar 11, 2026 at 21:21 UTC 7c97e492f0d805d2b901aa09d74c314eac1cf0e8
2 files changed +1 -4
admin/src/addFiles.ts
+1 -2
@@ -43,7 +43,7 @@ function addNodes(parent: VfsNodeAdmin, nodes: VfsNodeAdmin[]) {
43 }
44 prepareVfsUndo()
45 addToChildrenOf(parent, nodes)
46 - reindexVfs({ select: nodes })
46 + reindexVfs({ select: nodes, sortChildren: true })
47 }
48
49 function getFreeName(parent: VfsNodeAdmin, name: string) {
@@ -73,7 +73,6 @@ export async function addVirtual() {
73 name = getFreeName(parent, name)
74 if (!name) return
75 addNodes(parent, [{ name, id: '', type: 'folder' }])
76 - toast(`Folder "${name}" created`, 'success') // the name may have a number appended
76 }
77 catch(e) {
78 await alertDialog(e as Error)
e2e/frontend.spec.ts
-2
@@ -306,8 +306,6 @@ test('anew', async ({ page, browserName }) => {
306 await adminPage.getByRole('menuitem', { name: 'virtual folder' }).click()
307 await adminPage.getByRole('textbox').fill('folder1')
308 await adminPage.getByRole('textbox').press('Enter')
309 - await adminPage.getByRole('dialog').locator('div').nth(1).click()
310 - await adminPage.locator('.MuiDialog-container').press('Escape')
309 await adminPage.locator('#vfs').click()
310 await adminPage.getByText('folder1', { exact: true }).click()
311 await clickIconBtn('Cut', adminPage)