admin: editable source for non-root items

Massimo Melina committed Dec 30, 2022 at 18:05 UTC 9734f3bc092b0d2f8b7bb877b4596b27070937fd
1 file changed +1 -3
admin/src/FileForm.ts
+1 -3
@@ -66,8 +66,6 @@ export default function FileForm({ file }: { file: VfsNode }) {
66 const props = { ...values }
67 if (!props.masks)
68 props.masks = null // undefined cannot be serialized
69 - if (!isRoot)
70 - delete props.source
69 await apiCall('set_vfs', {
70 uri: values.id,
71 props,
@@ -81,7 +79,7 @@ export default function FileForm({ file }: { file: VfsNode }) {
79 isRoot ? h(Alert,{ severity: 'info' }, "This is Home, the root of your shared files. Options set here will be applied to all files.")
80 : { k: 'name', required: true, helperText: source && "You can decide a name that's different from the one on your disk" },
81 isRoot ? { k: 'source', comp: FileField, files: false, helperText: "If you specify a folder here, its files will be listed in the home" }
84 - : (hasSource && { k: 'source', comp: DisplayField, multiline: true }),
82 + : (hasSource && { k: 'source', comp: FileField, folders: true, multiline: true }),
83 { k: 'can_read', label:"Who can download", xl: showCanSee && 6, comp: WhoField, parent, accounts, inherit: inheritedPerms.can_read,
84 helperText: "Note: who can't download won't see it in the list"
85 },