diff --git a/optuna_dashboard/ts/action.ts b/optuna_dashboard/ts/action.ts index 67210906..96fde064 100644 --- a/optuna_dashboard/ts/action.ts +++ b/optuna_dashboard/ts/action.ts @@ -34,6 +34,7 @@ type LocalStorageReloadInterval = { reloadInterval?: number } +// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types export const actionCreator = () => { const { enqueueSnackbar } = useSnackbar() const [studySummaries, setStudySummaries] = @@ -432,8 +433,13 @@ export const actionCreator = () => { const reader = new FileReader() setUploading(true) reader.readAsDataURL(file) - reader.onload = (upload: any) => { - uploadArtifactAPI(studyId, trialId, file.name, upload.target.result) + reader.onload = (upload: ProgressEvent) => { + uploadArtifactAPI( + studyId, + trialId, + file.name, + upload.target?.result as string + ) .then((res) => { setUploading(false) const index = studyDetails[studyId].trials.findIndex( diff --git a/optuna_dashboard/ts/components/DataGrid.tsx b/optuna_dashboard/ts/components/DataGrid.tsx index 22b63e53..2d6a5670 100644 --- a/optuna_dashboard/ts/components/DataGrid.tsx +++ b/optuna_dashboard/ts/components/DataGrid.tsx @@ -19,6 +19,9 @@ import { Clear } from "@mui/icons-material" type Order = "asc" | "desc" +// eslint-disable-next-line @typescript-eslint/no-explicit-any +type Value = any + const defaultRowsPerPageOption = [10, 50, 100, { label: "All", value: -1 }] interface DataGridColumn { @@ -33,7 +36,7 @@ interface DataGridColumn { interface RowFilter { columnIdx: number - value: any + value: Value } function DataGrid(props: { @@ -45,7 +48,7 @@ function DataGrid(props: { initialRowsPerPage?: number rowsPerPageOption?: Array defaultFilter?: (row: T) => boolean -}) { +}): React.ReactElement { const { columns, rows, keyField, dense, collapseBody, defaultFilter } = props let { initialRowsPerPage, rowsPerPageOption } = props const [order, setOrder] = React.useState("asc") @@ -81,7 +84,7 @@ function DataGrid(props: { const fieldAlreadyFiltered = (columnIdx: number): boolean => filters.some((f) => f.columnIdx === columnIdx) - const handleClickFilterCell = (columnIdx: number, value: any) => { + const handleClickFilterCell = (columnIdx: number, value: Value) => { if (fieldAlreadyFiltered(columnIdx)) { return } @@ -242,7 +245,7 @@ function DataGridRow(props: { row: T keyField: keyof T collapseBody?: (rowIndex: number) => React.ReactNode - handleClickFilterCell: (columnIdx: number, value: any) => void + handleClickFilterCell: (columnIdx: number, value: Value) => void }) { const { columns,