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
fix npm lint
Anis SMAIL committed Jan 30, 2025
commit 037cbb797ec13ce14747b030f9d15208d47ec530
5 changes: 3 additions & 2 deletions webapp/src/components/App/Studies/StudyTree/index.tsx
Original file line number Diff line number Diff line change
@@ -20,7 +20,8 @@
import { SimpleTreeView } from "@mui/x-tree-view/SimpleTreeView";
import { getParentPaths } from "../../../../utils/pathUtils";
import * as R from "ramda";
import { useState, type SyntheticEvent } from "react";
import { useState } from "react";
import React from "react";

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

GitHub Actions / npm-lint

'react' import is duplicated
import useEnqueueErrorSnackbar from "@/hooks/useEnqueueErrorSnackbar";
import useUpdateEffectOnce from "@/hooks/useUpdateEffectOnce";
import { fetchAndInsertSubfolders, fetchAndInsertWorkspaces } from "./utils";
@@ -116,7 +117,7 @@
////////////////////////////////////////////////////////////////

const handleItemExpansionToggle = async (
event: SyntheticEvent<Element, Event>,
event: React.SyntheticEvent<Element, Event>,
itemId: string,
isExpanded: boolean,
) => {

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);
};