Skip to content

Commit

Permalink
refactor(ui-imports): sort all imports
Browse files Browse the repository at this point in the history
  • Loading branch information
hdinia committed Nov 4, 2024
1 parent 1bb2a2d commit 7c26066
Show file tree
Hide file tree
Showing 375 changed files with 2,652 additions and 1,844 deletions.
1 change: 0 additions & 1 deletion webapp/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,5 @@ module.exports = {
],
},
],
"simple-import-sort/exports": "error",
},
};
1 change: 1 addition & 0 deletions webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"coverage": "vitest run --coverage",
"dev": "vite",
"lint": "tsc --noEmit && eslint . --ext ts,tsx --report-unused-disable-directives",
"lint:fix": "eslint . --fix",
"preview": "vite preview",
"test": "vitest",
"test:ui": "vitest --ui"
Expand Down
7 changes: 5 additions & 2 deletions webapp/src/components/App/Api.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@
* This file is part of the Antares project.
*/

import { Box } from "@mui/material";
import SwaggerUI from "swagger-ui-react";
import "swagger-ui-react/swagger-ui.css";

import { Box } from "@mui/material";

import { getConfig } from "@/services/config";

import "swagger-ui-react/swagger-ui.css";

function Api() {
return (
<Box
Expand Down
6 changes: 4 additions & 2 deletions webapp/src/components/App/Data/DataListing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
*/

import { memo } from "react";
import { Typography, Box, styled } from "@mui/material";
import AutoSizer from "react-virtualized-auto-sizer";
import { FixedSizeList, areEqual, ListChildComponentProps } from "react-window";
import { areEqual, FixedSizeList, ListChildComponentProps } from "react-window";

import ArrowRightIcon from "@mui/icons-material/ArrowRight";
import { Box, styled, Typography } from "@mui/material";

import { MatrixDataSetDTO } from "@/common/types";

const ROW_ITEM_SIZE = 45;
Expand Down
4 changes: 3 additions & 1 deletion webapp/src/components/App/Data/DataPropsView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
*/

import { useState } from "react";

import { MatrixDataSetDTO, MatrixInfoDTO } from "@/common/types";
import PropertiesView from "@/components/common/PropertiesView";

import DataListing from "./DataListing";
import { StyledListingBox } from "./styles";
import PropertiesView from "@/components/common/PropertiesView";

interface PropTypes {
dataset: MatrixDataSetDTO[];
Expand Down
25 changes: 14 additions & 11 deletions webapp/src/components/App/Data/DatasetCreationDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,30 @@
* This file is part of the Antares project.
*/

import { useState, useEffect, forwardRef, ChangeEvent } from "react";
import { ChangeEvent, forwardRef, useEffect, useState } from "react";
import axios, { AxiosError } from "axios";
import { useSnackbar } from "notistack";
import { useTranslation } from "react-i18next";

import HelpIcon from "@mui/icons-material/Help";
import {
Box,
TextField,
Typography,
Button,
Checkbox,
Chip,
TextField,
Tooltip,
Typography,
} from "@mui/material";
import { useSnackbar } from "notistack";
import { useTranslation } from "react-i18next";
import axios, { AxiosError } from "axios";
import HelpIcon from "@mui/icons-material/Help";
import { getGroups } from "@/services/api/user";

import { GroupDTO, MatrixDataSetDTO } from "@/common/types";
import { saveMatrix } from "./utils";
import useEnqueueErrorSnackbar from "@/hooks/useEnqueueErrorSnackbar";
import { BoxParamHeader, BoxParam, ParamTitle } from "./styles";
import BasicDialog from "@/components/common/dialogs/BasicDialog";
import SimpleLoader from "@/components/common/loaders/SimpleLoader";
import useEnqueueErrorSnackbar from "@/hooks/useEnqueueErrorSnackbar";
import { getGroups } from "@/services/api/user";

import { BoxParam, BoxParamHeader, ParamTitle } from "./styles";
import { saveMatrix } from "./utils";

interface PropTypes {
open: boolean;
Expand Down
7 changes: 4 additions & 3 deletions webapp/src/components/App/Data/MatrixDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@
* This file is part of the Antares project.
*/

import { useState, useEffect } from "react";
import { useEffect, useState } from "react";
import { AxiosError } from "axios";
import { useTranslation } from "react-i18next";

import { MatrixInfoDTO, MatrixType } from "@/common/types";
import { getMatrix } from "@/services/api/matrix";
import useEnqueueErrorSnackbar from "@/hooks/useEnqueueErrorSnackbar";
import DataViewerDialog from "@/components/common/dialogs/DataViewerDialog";
import useEnqueueErrorSnackbar from "@/hooks/useEnqueueErrorSnackbar";
import { getMatrix } from "@/services/api/matrix";

interface PropTypes {
matrixInfo: MatrixInfoDTO;
Expand Down
33 changes: 18 additions & 15 deletions webapp/src/components/App/Data/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,33 +12,36 @@
* This file is part of the Antares project.
*/

import { useState, useEffect } from "react";
import { useEffect, useState } from "react";
import { AxiosError } from "axios";
import { useSnackbar } from "notistack";
import { useTranslation } from "react-i18next";

import DeleteIcon from "@mui/icons-material/Delete";
import StorageIcon from "@mui/icons-material/Storage";
import { Box, Typography, IconButton, Tooltip } from "@mui/material";
import EditIcon from "@mui/icons-material/Edit";
import DownloadIcon from "@mui/icons-material/Download";
import DataPropsView from "./DataPropsView";
import EditIcon from "@mui/icons-material/Edit";
import StorageIcon from "@mui/icons-material/Storage";
import { Box, IconButton, Tooltip, Typography } from "@mui/material";

import { MatrixDataSetDTO, MatrixInfoDTO } from "@/common/types";
import ConfirmationDialog from "@/components/common/dialogs/ConfirmationDialog";
import FileTable from "@/components/common/FileTable";
import SimpleLoader from "@/components/common/loaders/SimpleLoader";
import RootPage from "@/components/common/page/RootPage";
import SplitView from "@/components/common/SplitView";
import useEnqueueErrorSnackbar from "@/hooks/useEnqueueErrorSnackbar";
import useAppSelector from "@/redux/hooks/useAppSelector";
import { getAuthUser } from "@/redux/selectors";
import {
deleteDataSet,
exportMatrixDataset,
getMatrixList,
getExportMatrixUrl,
getMatrixList,
} from "@/services/api/matrix";
import { MatrixInfoDTO, MatrixDataSetDTO } from "@/common/types";

import DataPropsView from "./DataPropsView";
import DatasetCreationDialog from "./DatasetCreationDialog";
import MatrixDialog from "./MatrixDialog";
import useEnqueueErrorSnackbar from "@/hooks/useEnqueueErrorSnackbar";
import { getAuthUser } from "@/redux/selectors";
import useAppSelector from "@/redux/hooks/useAppSelector";
import ConfirmationDialog from "@/components/common/dialogs/ConfirmationDialog";
import FileTable from "@/components/common/FileTable";
import SimpleLoader from "@/components/common/loaders/SimpleLoader";
import RootPage from "@/components/common/page/RootPage";
import SplitView from "@/components/common/SplitView";

function Data() {
const [t] = useTranslation();
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/components/App/Data/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* This file is part of the Antares project.
*/

import { styled, Box, Typography } from "@mui/material";
import DownloadIcon from "@mui/icons-material/Download";
import { Box, styled, Typography } from "@mui/material";

export const BoxParamHeader = styled(Box)({
width: "100%",
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/components/App/Data/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import {
MatrixInfoDTO,
} from "@/common/types";
import {
createDataSet,
createMatrixByImportation,
updateDataSet,
createDataSet,
} from "@/services/api/matrix";

const updateMatrix = async (
Expand Down
15 changes: 9 additions & 6 deletions webapp/src/components/App/Settings/Groups/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,18 @@
* This file is part of the Antares project.
*/

import { Box, Button } from "@mui/material";
import GroupAddIcon from "@mui/icons-material/GroupAdd";
import { useTranslation } from "react-i18next";
import { useState } from "react";
import { useTranslation } from "react-i18next";

import GroupAddIcon from "@mui/icons-material/GroupAdd";
import { Box, Button } from "@mui/material";

import { GroupDetailsDTO } from "@/common/types";
import CreateGroupDialog from "./dialog/CreateGroupDialog";
import { isAuthUserAdmin } from "@/redux/selectors";
import useAppSelector from "@/redux/hooks/useAppSelector";
import SearchFE from "@/components/common/fieldEditors/SearchFE";
import useAppSelector from "@/redux/hooks/useAppSelector";
import { isAuthUserAdmin } from "@/redux/selectors";

import CreateGroupDialog from "./dialog/CreateGroupDialog";

interface Props {
setSearchValue: (v: string) => void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,23 @@
* This file is part of the Antares project.
*/

import GroupAddIcon from "@mui/icons-material/GroupAdd";
import { useSnackbar } from "notistack";
import { useTranslation } from "react-i18next";
import { usePromise as usePromiseWrapper } from "react-use";

import GroupAddIcon from "@mui/icons-material/GroupAdd";

import {
GroupDetailsDTO,
GroupDTO,
RoleDetailsDTO,
UserDTO,
} from "@/common/types";
import { SubmitHandlerPlus } from "@/components/common/Form/types";
import useEnqueueErrorSnackbar from "@/hooks/useEnqueueErrorSnackbar";
import { createGroup, createRole } from "@/services/api/user";

import GroupFormDialog, { GroupFormDialogProps } from "./GroupFormDialog";
import { SubmitHandlerPlus } from "@/components/common/Form/types";

type InheritPropsToOmit = "title" | "titleIcon" | "onSubmit" | "onCancel";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,44 +12,46 @@
* This file is part of the Antares project.
*/

import { useTranslation } from "react-i18next";
import { useMemo, useRef, useState } from "react";
import { Controller, useFieldArray } from "react-hook-form";
import { useTranslation } from "react-i18next";
import { v4 as uuidv4 } from "uuid";

import DeleteIcon from "@mui/icons-material/Delete";
import GroupIcon from "@mui/icons-material/Group";
import {
TextField,
Typography,
Paper,
Select,
MenuItem,
Box,
Button,
InputLabel,
CircularProgress,
FormControl,
ListItem,
IconButton,
InputLabel,
List,
ListItem,
ListItemButton,
ListItemIcon,
ListItemText,
CircularProgress,
MenuItem,
Paper,
Select,
SelectChangeEvent,
TextField,
Typography,
} from "@mui/material";
import { Controller, useFieldArray } from "react-hook-form";
import { v4 as uuidv4 } from "uuid";
import DeleteIcon from "@mui/icons-material/Delete";
import GroupIcon from "@mui/icons-material/Group";
import { RoleType, UserDTO } from "@/common/types";
import { roleToString, sortByName } from "@/services/utils";
import usePromise from "@/hooks/usePromise";
import { getGroups, getUsers } from "@/services/api/user";
import { getAuthUser } from "@/redux/selectors";
import useAppSelector from "@/redux/hooks/useAppSelector";
import { validateString } from "@/utils/validation/string";
import { UseFormReturnPlus } from "@/components/common/Form/types";

import {
RESERVED_GROUP_NAMES,
RESERVED_USER_NAMES,
ROLE_TYPE_KEYS,
} from "@/common/contants";
import { RoleType, UserDTO } from "@/common/types";
import { UseFormReturnPlus } from "@/components/common/Form/types";
import usePromise from "@/hooks/usePromise";
import useAppSelector from "@/redux/hooks/useAppSelector";
import { getAuthUser } from "@/redux/selectors";
import { getGroups, getUsers } from "@/services/api/user";
import { roleToString, sortByName } from "@/services/utils";
import { validateString } from "@/utils/validation/string";

function GroupForm(props: UseFormReturnPlus) {
const {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
* This file is part of the Antares project.
*/

import { RoleType, UserDTO } from "@/common/types";
import FormDialog, {
FormDialogProps,
} from "@/components/common/dialogs/FormDialog";
import { RoleType, UserDTO } from "@/common/types";

import GroupForm from "./GroupForm";

export interface GroupFormDialogProps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,27 @@
* This file is part of the Antares project.
*/

import EditIcon from "@mui/icons-material/Edit";
import { useMemo } from "react";
import { useTranslation } from "react-i18next";
import { usePromise as usePromiseWrapper } from "react-use";
import { useSnackbar } from "notistack";
import * as R from "ramda";
import { useTranslation } from "react-i18next";
import { usePromise as usePromiseWrapper } from "react-use";

import EditIcon from "@mui/icons-material/Edit";

import { GroupDetailsDTO } from "@/common/types";
import { SubmitHandlerPlus } from "@/components/common/Form/types";
import useEnqueueErrorSnackbar from "@/hooks/useEnqueueErrorSnackbar";
import {
createRole,
deleteUserRole,
getRolesForGroup,
updateGroup,
} from "@/services/api/user";
import useEnqueueErrorSnackbar from "@/hooks/useEnqueueErrorSnackbar";
import GroupFormDialog, { GroupFormDialogProps } from "./GroupFormDialog";

import { GroupEdit } from "..";
import { SubmitHandlerPlus } from "@/components/common/Form/types";

import GroupFormDialog, { GroupFormDialogProps } from "./GroupFormDialog";

type InheritPropsToOmit =
| "title"
Expand Down
Loading

0 comments on commit 7c26066

Please sign in to comment.