From 33bd303217054f8e69963cd201c9a6962a853d4a Mon Sep 17 00:00:00 2001 From: Eric Nguyen Date: Fri, 9 Feb 2024 10:27:36 +0100 Subject: [PATCH] chore: do aliased paths when useful --- .../src/components/CreateNodeDialogContent.tsx | 2 +- .../src/components/ResponsiveAppBar.tsx | 2 +- .../src/pages/editentry/AccumulateAllComponents.tsx | 2 +- .../src/pages/editentry/ListAllNonEntryInfo.tsx | 4 ++-- .../src/pages/editentry/ListEntryChildren.tsx | 6 +++--- .../src/pages/editentry/ListEntryParents.tsx | 4 ++-- .../src/pages/editentry/index.tsx | 6 +++--- taxonomy-editor-frontend/src/pages/errors/index.tsx | 6 +++--- .../src/pages/go-to-project/index.tsx | 8 ++++---- taxonomy-editor-frontend/src/pages/home/index.tsx | 4 ++-- .../src/pages/root-nodes/index.tsx | 12 ++++++------ .../src/pages/search/SearchResults.tsx | 12 ++++++------ taxonomy-editor-frontend/src/pages/search/index.tsx | 8 ++++---- .../src/pages/startproject/index.tsx | 4 ++-- 14 files changed, 40 insertions(+), 40 deletions(-) diff --git a/taxonomy-editor-frontend/src/components/CreateNodeDialogContent.tsx b/taxonomy-editor-frontend/src/components/CreateNodeDialogContent.tsx index c8e74ae6..b3b68095 100644 --- a/taxonomy-editor-frontend/src/components/CreateNodeDialogContent.tsx +++ b/taxonomy-editor-frontend/src/components/CreateNodeDialogContent.tsx @@ -9,7 +9,7 @@ import MenuItem from "@mui/material/MenuItem"; import Alert from "@mui/material/Alert"; import DialogTitle from "@mui/material/DialogTitle"; -import { createBaseURL } from "../utils"; +import { createBaseURL } from "@/utils"; type Props = { onCloseDialog: () => void; diff --git a/taxonomy-editor-frontend/src/components/ResponsiveAppBar.tsx b/taxonomy-editor-frontend/src/components/ResponsiveAppBar.tsx index 1d548120..791b0111 100644 --- a/taxonomy-editor-frontend/src/components/ResponsiveAppBar.tsx +++ b/taxonomy-editor-frontend/src/components/ResponsiveAppBar.tsx @@ -15,7 +15,7 @@ import ListSubheader from "@mui/material/ListSubheader"; import MuiLink from "@mui/material/Link"; import SettingsIcon from "@mui/icons-material/Settings"; import { useTranslation } from "react-i18next"; -import logoUrl from "../assets/logosmall.jpg"; +import logoUrl from "@/assets/logosmall.jpg"; type ResponsiveAppBarProps = { displayedPages: Array<{ translationKey: string; url: string }>; diff --git a/taxonomy-editor-frontend/src/pages/editentry/AccumulateAllComponents.tsx b/taxonomy-editor-frontend/src/pages/editentry/AccumulateAllComponents.tsx index 5387f4f0..24fc52c9 100644 --- a/taxonomy-editor-frontend/src/pages/editentry/AccumulateAllComponents.tsx +++ b/taxonomy-editor-frontend/src/pages/editentry/AccumulateAllComponents.tsx @@ -8,7 +8,7 @@ import { ListTranslations } from "./ListTranslations"; import ListAllEntryProperties from "./ListAllEntryProperties"; import ListAllNonEntryInfo from "./ListAllNonEntryInfo"; import equal from "fast-deep-equal"; -import { createURL, getNodeType, toSnakeCase } from "../../utils"; +import { createURL, getNodeType, toSnakeCase } from "@/utils"; import { useNavigate } from "react-router-dom"; import { useQuery } from "@tanstack/react-query"; diff --git a/taxonomy-editor-frontend/src/pages/editentry/ListAllNonEntryInfo.tsx b/taxonomy-editor-frontend/src/pages/editentry/ListAllNonEntryInfo.tsx index d5a33119..e2b65037 100644 --- a/taxonomy-editor-frontend/src/pages/editentry/ListAllNonEntryInfo.tsx +++ b/taxonomy-editor-frontend/src/pages/editentry/ListAllNonEntryInfo.tsx @@ -7,11 +7,11 @@ import { Button, } from "@mui/material"; import { useState, useEffect } from "react"; -import { getNodeType } from "../../utils"; +import { getNodeType } from "@/utils"; import AddBoxIcon from "@mui/icons-material/AddBox"; import DeleteOutlineIcon from "@mui/icons-material/DeleteOutline"; import ISO6391 from "iso-639-1"; -import { greyHexCode } from "../../constants"; +import { greyHexCode } from "@/constants"; /** * Parent component used for rendering info on a stopword, synonym, header or footer diff --git a/taxonomy-editor-frontend/src/pages/editentry/ListEntryChildren.tsx b/taxonomy-editor-frontend/src/pages/editentry/ListEntryChildren.tsx index 7a0d9ae4..dbf8224a 100644 --- a/taxonomy-editor-frontend/src/pages/editentry/ListEntryChildren.tsx +++ b/taxonomy-editor-frontend/src/pages/editentry/ListEntryChildren.tsx @@ -1,4 +1,4 @@ -import useFetch from "../../components/useFetch"; +import useFetch from "@/components/useFetch"; import { Typography, TextField, @@ -18,8 +18,8 @@ import AddBoxIcon from "@mui/icons-material/AddBox"; import DeleteOutlineIcon from "@mui/icons-material/DeleteOutline"; import CircularProgress from "@mui/material/CircularProgress"; import ISO6391 from "iso-639-1"; -import { ENTER_KEYCODE } from "../../constants"; -import { greyHexCode } from "../../constants"; +import { ENTER_KEYCODE } from "@/constants"; +import { greyHexCode } from "@/constants"; interface Relations { index: string; diff --git a/taxonomy-editor-frontend/src/pages/editentry/ListEntryParents.tsx b/taxonomy-editor-frontend/src/pages/editentry/ListEntryParents.tsx index 8ab9a030..38e62bd0 100644 --- a/taxonomy-editor-frontend/src/pages/editentry/ListEntryParents.tsx +++ b/taxonomy-editor-frontend/src/pages/editentry/ListEntryParents.tsx @@ -3,8 +3,8 @@ import { Link } from "react-router-dom"; import { Box, Stack, Typography } from "@mui/material"; import CircularProgress from "@mui/material/CircularProgress"; -import useFetch from "../../components/useFetch"; -import type { ParentsAPIResponse } from "../../backend-types/types"; +import useFetch from "@/components/useFetch"; +import type { ParentsAPIResponse } from "@/backend-types/types"; type Props = { fetchUrl: string; diff --git a/taxonomy-editor-frontend/src/pages/editentry/index.tsx b/taxonomy-editor-frontend/src/pages/editentry/index.tsx index 7444e001..2399358d 100644 --- a/taxonomy-editor-frontend/src/pages/editentry/index.tsx +++ b/taxonomy-editor-frontend/src/pages/editentry/index.tsx @@ -10,9 +10,9 @@ import DialogTitle from "@mui/material/DialogTitle"; import DeleteOutlineIcon from "@mui/icons-material/DeleteOutline"; import AccumulateAllComponents from "./AccumulateAllComponents"; -import { createBaseURL } from "../../utils"; -import { greyHexCode } from "../../constants"; -import WarningParsingErrors from "../../components/WarningParsingErrors"; +import { createBaseURL } from "@/utils"; +import { greyHexCode } from "@/constants"; +import WarningParsingErrors from "@/components/WarningParsingErrors"; type EditEntryProps = { addNavLinks: ({ diff --git a/taxonomy-editor-frontend/src/pages/errors/index.tsx b/taxonomy-editor-frontend/src/pages/errors/index.tsx index d641541e..06a5f7e8 100644 --- a/taxonomy-editor-frontend/src/pages/errors/index.tsx +++ b/taxonomy-editor-frontend/src/pages/errors/index.tsx @@ -1,6 +1,6 @@ -import useFetch from "../../components/useFetch"; -import { toTitleCase } from "../../utils"; -import { createBaseURL } from "../../utils"; +import useFetch from "@/components/useFetch"; +import { toTitleCase } from "@/utils"; +import { createBaseURL } from "@/utils"; import { useParams } from "react-router-dom"; import { Box, diff --git a/taxonomy-editor-frontend/src/pages/go-to-project/index.tsx b/taxonomy-editor-frontend/src/pages/go-to-project/index.tsx index 93045ccd..735f7d96 100644 --- a/taxonomy-editor-frontend/src/pages/go-to-project/index.tsx +++ b/taxonomy-editor-frontend/src/pages/go-to-project/index.tsx @@ -6,10 +6,10 @@ import MaterialTable from "@material-table/core"; import EditIcon from "@mui/icons-material/Edit"; import CircularProgress from "@mui/material/CircularProgress"; -import useFetch from "../../components/useFetch"; -import { API_URL } from "../../constants"; -import { toSnakeCase, toTitleCase } from "../../utils"; -import type { ProjectsAPIResponse } from "../../backend-types/types"; +import useFetch from "@/components/useFetch"; +import { API_URL } from "@/constants"; +import { toSnakeCase, toTitleCase } from "@/utils"; +import type { ProjectsAPIResponse } from "@/backend-types/types"; type ProjectType = { id: string; diff --git a/taxonomy-editor-frontend/src/pages/home/index.tsx b/taxonomy-editor-frontend/src/pages/home/index.tsx index ce2cab88..7bb2bd6a 100644 --- a/taxonomy-editor-frontend/src/pages/home/index.tsx +++ b/taxonomy-editor-frontend/src/pages/home/index.tsx @@ -7,8 +7,8 @@ import Box from "@mui/material/Box"; import Typography from "@mui/material/Typography"; import Stack from "@mui/material/Stack"; import Container from "@mui/material/Container"; -import logoUrl from "../../assets/logo.png"; -import classificationImgUrl from "../../assets/classification.png"; +import logoUrl from "@/assets/logo.png"; +import classificationImgUrl from "@/assets/classification.png"; type Props = { clearNavBarLinks: () => void; diff --git a/taxonomy-editor-frontend/src/pages/root-nodes/index.tsx b/taxonomy-editor-frontend/src/pages/root-nodes/index.tsx index 2a250c67..0bd16e56 100644 --- a/taxonomy-editor-frontend/src/pages/root-nodes/index.tsx +++ b/taxonomy-editor-frontend/src/pages/root-nodes/index.tsx @@ -19,16 +19,16 @@ import AddBoxIcon from "@mui/icons-material/AddBox"; import Dialog from "@mui/material/Dialog"; import CircularProgress from "@mui/material/CircularProgress"; -import CreateNodeDialogContent from "../../components/CreateNodeDialogContent"; -import { toTitleCase, createBaseURL } from "../../utils"; -import { greyHexCode } from "../../constants"; +import CreateNodeDialogContent from "@/components/CreateNodeDialogContent"; +import { toTitleCase, createBaseURL } from "@/utils"; +import { greyHexCode } from "@/constants"; import { type ProjectInfoAPIResponse, type RootEntriesAPIResponse, ProjectStatus, -} from "../../backend-types/types"; -import NodesTableBody from "../../components/NodesTableBody"; -import WarningParsingErrors from "../../components/WarningParsingErrors"; +} from "@/backend-types/types"; +import NodesTableBody from "@/components/NodesTableBody"; +import WarningParsingErrors from "@/components/WarningParsingErrors"; import { useQuery } from "@tanstack/react-query"; type RootNodesProps = { diff --git a/taxonomy-editor-frontend/src/pages/search/SearchResults.tsx b/taxonomy-editor-frontend/src/pages/search/SearchResults.tsx index c10ea624..ed79d27d 100644 --- a/taxonomy-editor-frontend/src/pages/search/SearchResults.tsx +++ b/taxonomy-editor-frontend/src/pages/search/SearchResults.tsx @@ -20,12 +20,12 @@ import TableRow from "@mui/material/TableRow"; import AddBoxIcon from "@mui/icons-material/AddBox"; import Dialog from "@mui/material/Dialog"; -import useFetch from "../../components/useFetch"; -import { createBaseURL } from "../../utils"; -import { greyHexCode } from "../../constants"; -import type { SearchAPIResponse } from "../../backend-types/types"; -import CreateNodeDialogContent from "../../components/CreateNodeDialogContent"; -import NodesTableBody from "../../components/NodesTableBody"; +import useFetch from "@/components/useFetch"; +import { createBaseURL } from "@/utils"; +import { greyHexCode } from "@/constants"; +import type { SearchAPIResponse } from "@/backend-types/types"; +import CreateNodeDialogContent from "@/components/CreateNodeDialogContent"; +import NodesTableBody from "@/components/NodesTableBody"; type Props = { query: string; diff --git a/taxonomy-editor-frontend/src/pages/search/index.tsx b/taxonomy-editor-frontend/src/pages/search/index.tsx index da5f3d6e..b15f1cef 100644 --- a/taxonomy-editor-frontend/src/pages/search/index.tsx +++ b/taxonomy-editor-frontend/src/pages/search/index.tsx @@ -12,10 +12,10 @@ import { import SearchIcon from "@mui/icons-material/Search"; import SearchResults from "./SearchResults"; -import { ENTER_KEYCODE } from "../../constants"; -import WarningParsingErrors from "../../components/WarningParsingErrors"; -import { createBaseURL } from "../../utils"; -import classificationImgUrl from "../../assets/classification.png"; +import { ENTER_KEYCODE } from "@/constants"; +import WarningParsingErrors from "@/components/WarningParsingErrors"; +import { createBaseURL } from "@/utils"; +import classificationImgUrl from "@/assets/classification.png"; type SearchNodeProps = { addNavLinks: ({ diff --git a/taxonomy-editor-frontend/src/pages/startproject/index.tsx b/taxonomy-editor-frontend/src/pages/startproject/index.tsx index 62a7dafd..b655386d 100644 --- a/taxonomy-editor-frontend/src/pages/startproject/index.tsx +++ b/taxonomy-editor-frontend/src/pages/startproject/index.tsx @@ -16,8 +16,8 @@ import { MenuItem, } from "@mui/material"; -import { TAXONOMY_NAMES } from "../../constants"; -import { createBaseURL, toSnakeCase } from "../../utils"; +import { TAXONOMY_NAMES } from "@/constants"; +import { createBaseURL, toSnakeCase } from "@/utils"; const branchNameRegEx = /[^a-z0-9_]+/;