Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(study-tree-ui): fix folder loading #2325

Open
wants to merge 15 commits into
base: dev
Choose a base branch
from
Prev Previous commit
Next Next commit
diable scan for default folder
Anis SMAIL committed Jan 30, 2025
commit 907bb73f18284e878e3c173b283ec9afd8f9f6b0
3 changes: 2 additions & 1 deletion webapp/src/components/App/Studies/StudiesList/index.tsx
Original file line number Diff line number Diff line change
@@ -87,6 +87,7 @@ function StudiesList(props: StudiesListProps) {
const [selectionMode, setSelectionMode] = useState(false);
const [confirmFolderScan, setConfirmFolderScan] = useState(false);
const [isRecursiveScan, setIsRecursiveScan] = useState(false);
const scanDisabled: boolean = !!folder && folder.startsWith("root/default");

useEffect(() => {
setFolderList(folder.split("/"));
@@ -267,7 +268,7 @@ function StudiesList(props: StudiesListProps) {

{folder !== "root" && (
<Tooltip title={t("studies.scanFolder") as string}>
<IconButton onClick={() => setConfirmFolderScan(true)}>
<IconButton onClick={() => setConfirmFolderScan(true)} disabled={scanDisabled}>
<RadarIcon />
</IconButton>
</Tooltip>

Unchanged files with check annotations Beta

);
};
const onChange = async (currentName: string) => {

Check warning on line 40 in webapp/src/components/App/Data/DataPropsView.tsx

GitHub Actions / npm-lint

Async arrow function has no 'await' expression
if (currentName !== "") {
const f = filter(currentName);
setFilteredDatas(f);
setOpenModal(true);
};
const handleDelete = async (id: string) => {

Check warning on line 70 in webapp/src/components/App/Data/index.tsx

GitHub Actions / npm-lint

Async arrow function has no 'await' expression
setIdForDeletion(id);
setOpenConfirmationModal(true);
};
}
};
const onMatrixClick = async (id: string) => {

Check warning on line 109 in webapp/src/components/App/Data/index.tsx

GitHub Actions / npm-lint

Async arrow function has no 'await' expression
if (selectedItem) {
const tmp = dataList.find((o) => o.id === selectedItem);
if (tmp) {
message: initialValues.message,
});
}
}, [initialValues]);

Check warning on line 74 in webapp/src/components/App/Settings/Maintenance/index.tsx

GitHub Actions / npm-lint

React Hook useUpdateEffect has a missing dependency: 'reset'. Either include it or remove the dependency array
////////////////////////////////////////////////////////////////
// Event Handlers
}
};
const handleChange = async (e: React.ChangeEvent<HTMLInputElement>) => {

Check warning on line 44 in webapp/src/components/App/Singlestudy/Commands/Edition/DraggableCommands/CommandImportButton.tsx

GitHub Actions / npm-lint

Async arrow function has no 'await' expression
e.preventDefault();
const reader = new FileReader();
reader.onload = async (ev: ProgressEvent<FileReader>) => {

Check warning on line 47 in webapp/src/components/App/Singlestudy/Commands/Edition/DraggableCommands/CommandImportButton.tsx

GitHub Actions / npm-lint

Async arrow function has no 'await' expression
try {
if (ev.target) {
const text = ev.target.result;
}
};
const onDelete = async (index: number) => {

Check warning on line 125 in webapp/src/components/App/Singlestudy/Commands/Edition/index.tsx

GitHub Actions / npm-lint

Async arrow function has no 'await' expression
setOpenDeleteCommandDialog(index);
};
import DigestDialog from "../../../../../common/dialogs/DigestDialog";
import type { EmptyObject } from "../../../../../../utils/tsUtils";
export const ColorStatus = {

Check warning on line 46 in webapp/src/components/App/Singlestudy/HomeView/InformationView/LauncherHistory/JobStepper.tsx

GitHub Actions / npm-lint

Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components
running: "warning.main",
pending: "grey.400",
success: "success.main",
return nodeDatum;
};
const buildTree = async (node: StudyTree, childrenTree: VariantTree): Promise<void> => {

Check warning on line 62 in webapp/src/components/App/Singlestudy/HomeView/StudyTreeView/utils.ts

GitHub Actions / npm-lint

Async arrow function has no 'await' expression
if ((childrenTree.children || []).length === 0) {
node.drawOptions.depth = 1;
node.drawOptions.nbAllChildrens = 0;
// Event handlers
////////////////////////////////////////////////////////////////
const handleSubmit = async (data: SubmitHandlerPlus<typeof defaultValues>) => {

Check warning on line 54 in webapp/src/components/App/Singlestudy/UpgradeDialog.tsx

GitHub Actions / npm-lint

Async arrow function has no 'await' expression
return upgradeStudy(study.id, data.values.version).then(onClose);
};
import { SimpleTreeView } from "@mui/x-tree-view/SimpleTreeView";
import { getParentPaths } from "../../../../utils/pathUtils";
import * as R from "ramda";
import { useState, type SyntheticEvent } from "react";

Check failure on line 23 in webapp/src/components/App/Studies/StudyTree/index.tsx

GitHub Actions / npm-lint

'SyntheticEvent' import from 'react' is restricted from being used by a pattern. Use `React.[TYPE]` (e.g. `React.ReactNode`) instead of importing it directly from "react"
import useEnqueueErrorSnackbar from "@/hooks/useEnqueueErrorSnackbar";
import useUpdateEffectOnce from "@/hooks/useUpdateEffectOnce";
import { fetchAndInsertSubfolders, fetchAndInsertWorkspaces } from "./utils";