refactor: directory
This commit is contained in:
@@ -121,10 +121,14 @@ export function ScriptExplorer({
|
||||
role_code: null,
|
||||
is_system_admin: false,
|
||||
} as AuthUser);
|
||||
const inferred = inferredDirectories(groupScripts);
|
||||
groups.push({
|
||||
user: groupUser,
|
||||
scripts: groupScripts,
|
||||
directories: inferredDirectories(groupScripts),
|
||||
directories:
|
||||
ownerUserId === user?.user_id
|
||||
? mergeDirectories(directories, inferred)
|
||||
: inferred,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -189,6 +189,11 @@ export default function ScriptsPage() {
|
||||
void submitPublish(publish.releaseNote, publish.visibility);
|
||||
};
|
||||
|
||||
const triggerUpload = (parentPath?: string) => {
|
||||
chooseUpload(parentPath);
|
||||
uploadInputRef.current?.click();
|
||||
};
|
||||
|
||||
return (
|
||||
<section className="workspace-layout">
|
||||
<ScriptExplorer
|
||||
@@ -203,11 +208,11 @@ export default function ScriptsPage() {
|
||||
keyword={keyword}
|
||||
onKeywordChange={setKeyword}
|
||||
onRefresh={() => void load(true)}
|
||||
onUpload={() => chooseUpload("")}
|
||||
onUpload={() => triggerUpload("")}
|
||||
onOpenCreateDialog={(parentPath, scriptType) =>
|
||||
openCreateDialog(parentPath, scriptType)}
|
||||
onOpenFolderDialog={(parentPath) => openFolderDialog(parentPath)}
|
||||
onChooseUpload={(parentPath) => chooseUpload(parentPath)}
|
||||
onChooseUpload={(parentPath) => triggerUpload(parentPath)}
|
||||
onContextMenu={showContextMenu}
|
||||
onSelect={openTab}
|
||||
uploadInputRef={uploadInputRef}
|
||||
|
||||
Reference in New Issue
Block a user