diff --git a/apps/web/src/app/applications/[address]/error.tsx b/apps/web/src/app/applications/[address]/error.tsx index ede79c49..a4e13046 100644 --- a/apps/web/src/app/applications/[address]/error.tsx +++ b/apps/web/src/app/applications/[address]/error.tsx @@ -1,7 +1,7 @@ "use client"; import type { FC } from "react"; -import PageError from "../../../components/pageError"; +import PageError from "../../../components/layout/pageError"; interface PageErrorProps { reset: () => void; diff --git a/apps/web/src/app/applications/[address]/loading.tsx b/apps/web/src/app/applications/[address]/loading.tsx index 76624334..5250a8e9 100644 --- a/apps/web/src/app/applications/[address]/loading.tsx +++ b/apps/web/src/app/applications/[address]/loading.tsx @@ -1,4 +1,4 @@ -import PageLoader from "../../../components/pageLoader"; +import PageLoader from "../../../components/layout/pageLoader"; export default function Loading() { return ; diff --git a/apps/web/src/app/applications/[address]/page.tsx b/apps/web/src/app/applications/[address]/page.tsx index a4e29f55..71aa1220 100644 --- a/apps/web/src/app/applications/[address]/page.tsx +++ b/apps/web/src/app/applications/[address]/page.tsx @@ -3,8 +3,8 @@ import { Metadata } from "next"; import { FC } from "react"; import { TbInbox } from "react-icons/tb"; import Address from "../../../components/address"; +import Inputs from "../../../components/inputs/inputs"; import Breadcrumbs from "../../../components/breadcrumbs"; -import Inputs from "../../../components/inputs"; export type ApplicationPageProps = { params: { address: string }; diff --git a/apps/web/src/app/applications/error.tsx b/apps/web/src/app/applications/error.tsx index 6bb417f7..5bcc28e0 100644 --- a/apps/web/src/app/applications/error.tsx +++ b/apps/web/src/app/applications/error.tsx @@ -1,7 +1,7 @@ "use client"; import type { FC } from "react"; -import PageError from "../../components/pageError"; +import PageError from "../../components/layout/pageError"; interface PageErrorProps { reset: () => void; diff --git a/apps/web/src/app/applications/loading.tsx b/apps/web/src/app/applications/loading.tsx index 7e3a661c..a8884a54 100644 --- a/apps/web/src/app/applications/loading.tsx +++ b/apps/web/src/app/applications/loading.tsx @@ -1,4 +1,4 @@ -import PageLoader from "../../components/pageLoader"; +import PageLoader from "../../components/layout/pageLoader"; export default function Loading() { return ; diff --git a/apps/web/src/app/applications/page.tsx b/apps/web/src/app/applications/page.tsx index 492653e1..06ced6eb 100644 --- a/apps/web/src/app/applications/page.tsx +++ b/apps/web/src/app/applications/page.tsx @@ -1,7 +1,7 @@ import { Group, Stack, Title } from "@mantine/core"; import { Metadata } from "next"; import { TbApps } from "react-icons/tb"; -import Applications from "../../components/applications"; +import Applications from "../../components/applications/applications"; import Breadcrumbs from "../../components/breadcrumbs"; export const metadata: Metadata = { diff --git a/apps/web/src/app/error.tsx b/apps/web/src/app/error.tsx index 1543b587..10a76121 100644 --- a/apps/web/src/app/error.tsx +++ b/apps/web/src/app/error.tsx @@ -1,7 +1,7 @@ "use client"; import type { FC } from "react"; -import PageError from "../components/pageError"; +import PageError from "../components/layout/pageError"; interface PageErrorProps { reset: () => void; diff --git a/apps/web/src/app/inputs/error.tsx b/apps/web/src/app/inputs/error.tsx index 6bb417f7..5bcc28e0 100644 --- a/apps/web/src/app/inputs/error.tsx +++ b/apps/web/src/app/inputs/error.tsx @@ -1,7 +1,7 @@ "use client"; import type { FC } from "react"; -import PageError from "../../components/pageError"; +import PageError from "../../components/layout/pageError"; interface PageErrorProps { reset: () => void; diff --git a/apps/web/src/app/inputs/loading.tsx b/apps/web/src/app/inputs/loading.tsx index 7e3a661c..a8884a54 100644 --- a/apps/web/src/app/inputs/loading.tsx +++ b/apps/web/src/app/inputs/loading.tsx @@ -1,4 +1,4 @@ -import PageLoader from "../../components/pageLoader"; +import PageLoader from "../../components/layout/pageLoader"; export default function Loading() { return ; diff --git a/apps/web/src/app/inputs/page.tsx b/apps/web/src/app/inputs/page.tsx index c0f38dbb..2084d556 100644 --- a/apps/web/src/app/inputs/page.tsx +++ b/apps/web/src/app/inputs/page.tsx @@ -1,7 +1,7 @@ import { Group, Stack, Title } from "@mantine/core"; import { TbInbox } from "react-icons/tb"; import { Metadata } from "next"; -import Inputs from "../../components/inputs"; +import Inputs from "../../components/inputs/inputs"; import Breadcrumbs from "../../components/breadcrumbs"; export const metadata: Metadata = { diff --git a/apps/web/src/app/layout.tsx b/apps/web/src/app/layout.tsx index 427ecbf6..27437cff 100644 --- a/apps/web/src/app/layout.tsx +++ b/apps/web/src/app/layout.tsx @@ -4,7 +4,7 @@ import type { FC, ReactNode } from "react"; import { Metadata } from "next"; import { ColorSchemeScript } from "@mantine/core"; import { Providers } from "../providers/providers"; -import Shell from "../components/shell"; +import Shell from "../components/layout/shell"; export const metadata: Metadata = { title: { diff --git a/apps/web/src/app/loading.tsx b/apps/web/src/app/loading.tsx index bf6abacf..5900c4d7 100644 --- a/apps/web/src/app/loading.tsx +++ b/apps/web/src/app/loading.tsx @@ -1,4 +1,4 @@ -import PageLoader from "../components/pageLoader"; +import PageLoader from "../components/layout/pageLoader"; export default function Loading() { return ; diff --git a/apps/web/src/components/applicationRow.tsx b/apps/web/src/components/applications/applicationRow.tsx similarity index 94% rename from apps/web/src/components/applicationRow.tsx rename to apps/web/src/components/applications/applicationRow.tsx index f5d79228..ca640b57 100644 --- a/apps/web/src/components/applicationRow.tsx +++ b/apps/web/src/components/applications/applicationRow.tsx @@ -1,10 +1,10 @@ import React, { FC } from "react"; import { ActionIcon, Table, Tooltip } from "@mantine/core"; -import Address from "./address"; +import Address from "../address"; import Link from "next/link"; import { TbInbox, TbPlugConnected, TbPlugConnectedX } from "react-icons/tb"; -import { Application } from "../graphql"; -import { useConnectionConfig } from "../providers/connectionConfig/hooks"; +import { Application } from "../../graphql"; +import { useConnectionConfig } from "../../providers/connectionConfig/hooks"; export interface ApplicationRowProps { application: Omit; diff --git a/apps/web/src/components/applications.tsx b/apps/web/src/components/applications/applications.tsx similarity index 62% rename from apps/web/src/components/applications.tsx rename to apps/web/src/components/applications/applications.tsx index 8d18f4f8..be61beb3 100644 --- a/apps/web/src/components/applications.tsx +++ b/apps/web/src/components/applications/applications.tsx @@ -1,24 +1,18 @@ "use client"; -import { - Group, - Loader, - Pagination, - Select, - Stack, - Table, - Text, -} from "@mantine/core"; +import { Group, Pagination, Select, Stack, Text } from "@mantine/core"; import { useScrollIntoView } from "@mantine/hooks"; import { pathOr } from "ramda"; import { FC, useEffect, useState } from "react"; import { - Application, ApplicationOrderByInput, useApplicationsConnectionQuery, -} from "../graphql"; -import { limitBounds, usePaginationParams } from "../hooks/usePaginationParams"; -import ApplicationRow from "../components/applicationRow"; +} from "../../graphql"; +import { + limitBounds, + usePaginationParams, +} from "../../hooks/usePaginationParams"; +import ApplicationsTable from "./applicationsTable"; const Applications: FC = () => { const [{ limit, page }, updateParams] = usePaginationParams(); @@ -31,7 +25,8 @@ const Applications: FC = () => { const [activePage, setActivePage] = useState( page > totalPages ? totalPages : page, ); - + const applications = + query.data?.applicationsConnection.edges.map((edge) => edge.node) ?? []; const { scrollIntoView } = useScrollIntoView({ duration: 700, offset: 150, @@ -60,41 +55,12 @@ const Applications: FC = () => { updateParams(pageN, limit); }} /> - - - - Id - Owner - URL - - - - {query.fetching && ( - - - - - - )} - {query.data?.applicationsConnection.totalCount === 0 && ( - - - No applications - - - )} - {query.data?.applicationsConnection.edges.map( - ({ node }) => ( - - } - /> - ), - )} - -
+ + diff --git a/apps/web/src/components/applications/applicationsTable.tsx b/apps/web/src/components/applications/applicationsTable.tsx new file mode 100644 index 00000000..05a9b8f6 --- /dev/null +++ b/apps/web/src/components/applications/applicationsTable.tsx @@ -0,0 +1,54 @@ +"use client"; + +import { Loader, Table } from "@mantine/core"; +import { FC } from "react"; +import ApplicationRow from "./applicationRow"; +import type { ApplicationItemFragment } from "../../graphql"; +import { Application } from "../../graphql"; + +export interface ApplicationsTableProps { + applications: ApplicationItemFragment[]; + fetching: boolean; + totalCount: number; +} + +const ApplicationsTable: FC = (props) => { + const { applications, fetching, totalCount } = props; + + return ( + + + + Id + Owner + URL + + + + {fetching ? ( + + + + + + ) : ( + totalCount === 0 && ( + + + No applications + + + ) + )} + {applications.map((application) => ( + } + /> + ))} + +
+ ); +}; + +export default ApplicationsTable; diff --git a/apps/web/src/components/connectionForm.tsx b/apps/web/src/components/connection/connectionForm.tsx similarity index 98% rename from apps/web/src/components/connectionForm.tsx rename to apps/web/src/components/connection/connectionForm.tsx index cc9fee0c..73e2e98d 100644 --- a/apps/web/src/components/connectionForm.tsx +++ b/apps/web/src/components/connection/connectionForm.tsx @@ -27,13 +27,13 @@ import { ApplicationsDocument, ApplicationsQuery, ApplicationsQueryVariables, -} from "../graphql"; +} from "../../graphql"; import { CheckStatusDocument, CheckStatusQuery, CheckStatusQueryVariables, -} from "../graphql/rollups/operations"; -import { useConnectionConfig } from "../providers/connectionConfig/hooks"; +} from "../../graphql/rollups/operations"; +import { useConnectionConfig } from "../../providers/connectionConfig/hooks"; interface AppConnectionFormProps { application?: Address; diff --git a/apps/web/src/components/connectionInfo.tsx b/apps/web/src/components/connection/connectionInfo.tsx similarity index 90% rename from apps/web/src/components/connectionInfo.tsx rename to apps/web/src/components/connection/connectionInfo.tsx index 3df27f5d..6bc3aec1 100644 --- a/apps/web/src/components/connectionInfo.tsx +++ b/apps/web/src/components/connection/connectionInfo.tsx @@ -9,9 +9,9 @@ import { } from "@mantine/core"; import { FC } from "react"; import { TbNetwork, TbTrash } from "react-icons/tb"; -import { useConnectionConfig } from "../providers/connectionConfig/hooks"; -import { Connection } from "../providers/connectionConfig/types"; -import Address from "./address"; +import { useConnectionConfig } from "../../providers/connectionConfig/hooks"; +import { Connection } from "../../providers/connectionConfig/types"; +import Address from "../address"; interface ConnectionInfoProps { connection: Connection; diff --git a/apps/web/src/components/connectionView.tsx b/apps/web/src/components/connection/connectionView.tsx similarity index 97% rename from apps/web/src/components/connectionView.tsx rename to apps/web/src/components/connection/connectionView.tsx index 6cfd6427..2152a0ef 100644 --- a/apps/web/src/components/connectionView.tsx +++ b/apps/web/src/components/connection/connectionView.tsx @@ -11,7 +11,7 @@ import { } from "@mantine/core"; import { useDisclosure, useViewportSize } from "@mantine/hooks"; import { TbChevronDown, TbChevronUp, TbPlus } from "react-icons/tb"; -import { useConnectionConfig } from "../providers/connectionConfig/hooks"; +import { useConnectionConfig } from "../../providers/connectionConfig/hooks"; import ConnectionInfo from "./connectionInfo"; const ConnectionView = () => { diff --git a/apps/web/src/components/inputCard.tsx b/apps/web/src/components/inputs/inputCard.tsx similarity index 96% rename from apps/web/src/components/inputCard.tsx rename to apps/web/src/components/inputs/inputCard.tsx index 2174e2dd..608fb6e9 100644 --- a/apps/web/src/components/inputCard.tsx +++ b/apps/web/src/components/inputs/inputCard.tsx @@ -2,8 +2,7 @@ import { Group, Paper, Stack, Text } from "@mantine/core"; import { FC } from "react"; import prettyMilliseconds from "pretty-ms"; import Jazzicon, { jsNumberForAddress } from "react-jazzicon"; - -import { InputItemFragment } from "../graphql"; +import { InputItemFragment } from "../../graphql"; export type InputCardProps = { input: InputItemFragment; diff --git a/apps/web/src/components/inputDetailsView.tsx b/apps/web/src/components/inputs/inputDetailsView.tsx similarity index 98% rename from apps/web/src/components/inputDetailsView.tsx rename to apps/web/src/components/inputs/inputDetailsView.tsx index c1e6b769..3d998017 100644 --- a/apps/web/src/components/inputDetailsView.tsx +++ b/apps/web/src/components/inputs/inputDetailsView.tsx @@ -5,13 +5,13 @@ import { omit, pathOr } from "ramda"; import { FC, useEffect, useState } from "react"; import { useQuery } from "urql"; import { Address } from "viem"; -import { InputItemFragment } from "../graphql"; +import { InputItemFragment } from "../../graphql"; import { InputDetailsDocument, InputDetailsQuery, InputDetailsQueryVariables, -} from "../graphql/rollups/operations"; -import { useConnectionConfig } from "../providers/connectionConfig/hooks"; +} from "../../graphql/rollups/operations"; +import { useConnectionConfig } from "../../providers/connectionConfig/hooks"; interface ApplicationInputDataProps { input: InputItemFragment; diff --git a/apps/web/src/components/inputRow.tsx b/apps/web/src/components/inputs/inputRow.tsx similarity index 98% rename from apps/web/src/components/inputRow.tsx rename to apps/web/src/components/inputs/inputRow.tsx index 56cebb2c..5dce4aff 100644 --- a/apps/web/src/components/inputRow.tsx +++ b/apps/web/src/components/inputs/inputRow.tsx @@ -15,8 +15,8 @@ import prettyMilliseconds from "pretty-ms"; import { FC } from "react"; import { TbArrowRight, TbFileText, TbX } from "react-icons/tb"; import { Address as AddressType, formatUnits, getAddress } from "viem"; -import { InputItemFragment } from "../graphql"; -import Address from "./address"; +import { InputItemFragment } from "../../graphql"; +import Address from "../address"; import InputDetailsView from "./inputDetailsView"; export type InputRowProps = { diff --git a/apps/web/src/components/inputs.tsx b/apps/web/src/components/inputs/inputs.tsx similarity index 94% rename from apps/web/src/components/inputs.tsx rename to apps/web/src/components/inputs/inputs.tsx index cb71de59..32c0008a 100644 --- a/apps/web/src/components/inputs.tsx +++ b/apps/web/src/components/inputs/inputs.tsx @@ -4,9 +4,12 @@ import { Group, Pagination, Select, Stack, Text } from "@mantine/core"; import { useScrollIntoView } from "@mantine/hooks"; import { pathOr } from "ramda"; import { FC, useEffect, useState } from "react"; -import { InputOrderByInput, useInputsQuery } from "../graphql"; -import { limitBounds, usePaginationParams } from "../hooks/usePaginationParams"; -import InputsTable from "../components/inputsTable"; +import { InputOrderByInput, useInputsQuery } from "../../graphql"; +import { + limitBounds, + usePaginationParams, +} from "../../hooks/usePaginationParams"; +import InputsTable from "./inputsTable"; export type InputsProps = { orderBy?: InputOrderByInput; diff --git a/apps/web/src/components/inputsTable.tsx b/apps/web/src/components/inputs/inputsTable.tsx similarity index 94% rename from apps/web/src/components/inputsTable.tsx rename to apps/web/src/components/inputs/inputsTable.tsx index c6267e0d..b0ce9ba4 100644 --- a/apps/web/src/components/inputsTable.tsx +++ b/apps/web/src/components/inputs/inputsTable.tsx @@ -8,10 +8,10 @@ import { useMantineTheme, } from "@mantine/core"; import { FC, useCallback, useRef, useState } from "react"; -import InputRow from "../components/inputRow"; -import type { InputItemFragment } from "../graphql"; -import { useElementVisibility } from "../hooks/useElementVisibility"; -import { TableResponsiveWrapper } from "./tableResponsiveWrapper"; +import InputRow from "./inputRow"; +import type { InputItemFragment } from "../../graphql"; +import { useElementVisibility } from "../../hooks/useElementVisibility"; +import { TableResponsiveWrapper } from "../tableResponsiveWrapper"; export interface InputsTableProps { inputs: InputItemFragment[]; diff --git a/apps/web/src/components/footer.tsx b/apps/web/src/components/layout/footer.tsx similarity index 99% rename from apps/web/src/components/footer.tsx rename to apps/web/src/components/layout/footer.tsx index 14f7cb8f..73432e64 100644 --- a/apps/web/src/components/footer.tsx +++ b/apps/web/src/components/layout/footer.tsx @@ -16,7 +16,7 @@ import { TbBug, TbMessage2Code, } from "react-icons/tb"; -import CartesiLogo from "./cartesiLogo"; +import CartesiLogo from "../cartesiLogo"; interface FooterLinkProps { children: ReactNode; diff --git a/apps/web/src/components/pageError.tsx b/apps/web/src/components/layout/pageError.tsx similarity index 100% rename from apps/web/src/components/pageError.tsx rename to apps/web/src/components/layout/pageError.tsx diff --git a/apps/web/src/components/pageLoader.tsx b/apps/web/src/components/layout/pageLoader.tsx similarity index 100% rename from apps/web/src/components/pageLoader.tsx rename to apps/web/src/components/layout/pageLoader.tsx diff --git a/apps/web/src/components/shell.tsx b/apps/web/src/components/layout/shell.tsx similarity index 95% rename from apps/web/src/components/shell.tsx rename to apps/web/src/components/layout/shell.tsx index 3b5f0eeb..1a6c54a9 100644 --- a/apps/web/src/components/shell.tsx +++ b/apps/web/src/components/layout/shell.tsx @@ -25,10 +25,10 @@ import { TbSun, } from "react-icons/tb"; import { useAccount } from "wagmi"; -import CartesiLogo from "../components/cartesiLogo"; -import ConnectionView from "../components/connectionView"; -import Footer from "../components/footer"; -import SendTransaction from "../components/sendTransaction"; +import CartesiLogo from "../../components/cartesiLogo"; +import ConnectionView from "../../components/connection/connectionView"; +import Footer from "../../components/layout/footer"; +import SendTransaction from "../../components/sendTransaction"; const Shell: FC<{ children: ReactNode }> = ({ children }) => { const [opened, { toggle }] = useDisclosure(); @@ -45,7 +45,6 @@ const Shell: FC<{ children: ReactNode }> = ({ children }) => { const isSmallDevice = useMediaQuery(`(max-width:${theme.breakpoints.sm})`); const { isConnected } = useAccount(); const { colorScheme, toggleColorScheme } = useMantineColorScheme(); - const themeDefaultProps = theme.components?.AppShell?.defaultProps ?? {}; return ( diff --git a/apps/web/src/providers/connectionConfig/connectionConfigProvider.tsx b/apps/web/src/providers/connectionConfig/connectionConfigProvider.tsx index c08204b6..405746fc 100644 --- a/apps/web/src/providers/connectionConfig/connectionConfigProvider.tsx +++ b/apps/web/src/providers/connectionConfig/connectionConfigProvider.tsx @@ -1,7 +1,7 @@ "use client"; import { Modal } from "@mantine/core"; import React, { FC, useEffect, useReducer } from "react"; -import AppConnectionForm from "../../components/connectionForm"; +import AppConnectionForm from "../../components/connection/connectionForm"; import { ConnectionConfigContext } from "./connectionConfigContext"; import { useConnectionConfig, useConnectionConfigActions } from "./hooks"; import localRepository from "./localRepository"; diff --git a/apps/web/test/components/applicationRow.test.tsx b/apps/web/test/components/applications/applicationRow.test.tsx similarity index 94% rename from apps/web/test/components/applicationRow.test.tsx rename to apps/web/test/components/applications/applicationRow.test.tsx index ce325195..3ce8394d 100644 --- a/apps/web/test/components/applicationRow.test.tsx +++ b/apps/web/test/components/applications/applicationRow.test.tsx @@ -3,12 +3,12 @@ import type { FC } from "react"; import { cleanup, fireEvent, render, screen } from "@testing-library/react"; import ApplicationRow, { ApplicationRowProps, -} from "../../src/components/applicationRow"; -import { withMantineTheme } from "../utils/WithMantineTheme"; +} from "../../../src/components/applications/applicationRow"; +import { withMantineTheme } from "../../utils/WithMantineTheme"; import { Table } from "@mantine/core"; -import { useConnectionConfig } from "../../src/providers/connectionConfig/hooks"; +import { useConnectionConfig } from "../../../src/providers/connectionConfig/hooks"; -vi.mock("../../src/providers/connectionConfig/hooks"); +vi.mock("../../../src/providers/connectionConfig/hooks"); const useConnectionConfigMock = vi.mocked(useConnectionConfig, true); const TableComponent: FC = (props) => ( @@ -25,11 +25,11 @@ const defaultProps: ApplicationRowProps = { application: { id: "0x028367fe226cd9e5699f4288d512fe3a4a4a0012", owner: "0x74d093f6911ac080897c3145441103dabb869307", + timestamp: Math.floor(new Date().getTime() / 1000), factory: { id: "0x7122cd1221c20892234186facfe8615e6743ab02", applications: [], }, - timestamp: 1700593992, }, }; diff --git a/apps/web/test/components/connectionForm.test.tsx b/apps/web/test/components/connection/connectionForm.test.tsx similarity index 95% rename from apps/web/test/components/connectionForm.test.tsx rename to apps/web/test/components/connection/connectionForm.test.tsx index a83b1080..00379fa3 100644 --- a/apps/web/test/components/connectionForm.test.tsx +++ b/apps/web/test/components/connection/connectionForm.test.tsx @@ -9,15 +9,15 @@ import { } from "@testing-library/react"; import { useQuery } from "urql"; import { afterEach, beforeEach, describe, it } from "vitest"; -import AppConnectionForm from "../../src/components/connectionForm"; -import { useConnectionConfig } from "../../src/providers/connectionConfig/hooks"; -import withMantineTheme from "../utils/WithMantineTheme"; -import { checkStatusSample } from "../utils/dataSamples"; -import { queryMockImplBuilder } from "../utils/useQueryMock"; +import AppConnectionForm from "../../../src/components/connection/connectionForm"; +import { useConnectionConfig } from "../../../src/providers/connectionConfig/hooks"; +import withMantineTheme from "../../utils/WithMantineTheme"; +import { checkStatusSample } from "../../utils/dataSamples"; +import { queryMockImplBuilder } from "../../utils/useQueryMock"; vi.mock("urql"); -vi.mock("../../src/graphql"); -vi.mock("../../src/providers/connectionConfig/hooks"); +vi.mock("../../../src/graphql"); +vi.mock("../../../src/providers/connectionConfig/hooks"); vi.mock("@mantine/notifications"); const AppConnectionFormE = withMantineTheme(AppConnectionForm); diff --git a/apps/web/test/components/connectionInfo.test.tsx b/apps/web/test/components/connection/connectionInfo.test.tsx similarity index 82% rename from apps/web/test/components/connectionInfo.test.tsx rename to apps/web/test/components/connection/connectionInfo.test.tsx index 37fa23a2..74a77d6a 100644 --- a/apps/web/test/components/connectionInfo.test.tsx +++ b/apps/web/test/components/connection/connectionInfo.test.tsx @@ -1,11 +1,11 @@ import { cleanup, fireEvent, render, screen } from "@testing-library/react"; import { describe, it } from "vitest"; -import ConnectionInfo from "../../src/components/connectionInfo"; -import { useConnectionConfig } from "../../src/providers/connectionConfig/hooks"; -import StyleProvider from "../../src/providers/styleProvider"; -import { connections } from "../providers/connectionConfig/mocks"; +import ConnectionInfo from "../../../src/components/connection/connectionInfo"; +import { useConnectionConfig } from "../../../src/providers/connectionConfig/hooks"; +import StyleProvider from "../../../src/providers/styleProvider"; +import { connections } from "../../providers/connectionConfig/mocks"; -vi.mock("../../src/providers/connectionConfig/hooks"); +vi.mock("../../../src/providers/connectionConfig/hooks"); const useConnMock = vi.mocked(useConnectionConfig, true); diff --git a/apps/web/test/components/connectionView.test.tsx b/apps/web/test/components/connection/connectionView.test.tsx similarity index 89% rename from apps/web/test/components/connectionView.test.tsx rename to apps/web/test/components/connection/connectionView.test.tsx index 8102de93..6d786407 100644 --- a/apps/web/test/components/connectionView.test.tsx +++ b/apps/web/test/components/connection/connectionView.test.tsx @@ -1,12 +1,12 @@ import { cleanup, fireEvent, render, screen } from "@testing-library/react"; import { afterEach, beforeEach, describe, it } from "vitest"; -import ConnectionView from "../../src/components/connectionView"; -import { useConnectionConfig } from "../../src/providers/connectionConfig/hooks"; -import { connections } from "../providers/connectionConfig/mocks"; -import withMantineTheme from "../utils/WithMantineTheme"; -import { useConnectionConfigReturnStub } from "../utils/connectionHelpers"; +import ConnectionView from "../../../src/components/connection/connectionView"; +import { useConnectionConfig } from "../../../src/providers/connectionConfig/hooks"; +import { connections } from "../../providers/connectionConfig/mocks"; +import withMantineTheme from "../../utils/WithMantineTheme"; +import { useConnectionConfigReturnStub } from "../../utils/connectionHelpers"; -vi.mock("../../src/providers/connectionConfig/hooks"); +vi.mock("../../../src/providers/connectionConfig/hooks"); const View = withMantineTheme(ConnectionView); const useConnectionConfigMock = vi.mocked(useConnectionConfig, true); diff --git a/apps/web/test/components/inputDetailsView.test.tsx b/apps/web/test/components/inputs/inputDetailsView.test.tsx similarity index 95% rename from apps/web/test/components/inputDetailsView.test.tsx rename to apps/web/test/components/inputs/inputDetailsView.test.tsx index d4cb0341..7a58ecca 100644 --- a/apps/web/test/components/inputDetailsView.test.tsx +++ b/apps/web/test/components/inputs/inputDetailsView.test.tsx @@ -8,18 +8,18 @@ import { import { useQuery } from "urql"; import { Address } from "viem"; import { afterEach, beforeEach, describe, it } from "vitest"; -import InputDetailsView from "../../src/components/inputDetailsView"; -import { useConnectionConfig } from "../../src/providers/connectionConfig/hooks"; -import withMantineTheme from "../utils/WithMantineTheme"; -import { useConnectionConfigReturnStub } from "../utils/connectionHelpers"; +import InputDetailsView from "../../../src/components/inputs/inputDetailsView"; +import { useConnectionConfig } from "../../../src/providers/connectionConfig/hooks"; +import withMantineTheme from "../../utils/WithMantineTheme"; +import { useConnectionConfigReturnStub } from "../../utils/connectionHelpers"; import { inputDetailsSample, inputDetailsSampleForPaging, inputSample, -} from "../utils/dataSamples"; -import { queryMockImplBuilder } from "../utils/useQueryMock"; +} from "../../utils/dataSamples"; +import { queryMockImplBuilder } from "../../utils/useQueryMock"; -vi.mock("../../src/providers/connectionConfig/hooks"); +vi.mock("../../../src/providers/connectionConfig/hooks"); vi.mock("urql"); const useConnectionConfigMock = vi.mocked(useConnectionConfig, true); diff --git a/apps/web/test/components/inputRow.test.tsx b/apps/web/test/components/inputs/inputRow.test.tsx similarity index 91% rename from apps/web/test/components/inputRow.test.tsx rename to apps/web/test/components/inputs/inputRow.test.tsx index 86d5c5d8..1dcd9dfe 100644 --- a/apps/web/test/components/inputRow.test.tsx +++ b/apps/web/test/components/inputs/inputRow.test.tsx @@ -1,8 +1,10 @@ import { describe, it } from "vitest"; import type { FC } from "react"; import { render, screen } from "@testing-library/react"; -import InputRow, { InputRowProps } from "../../src/components/inputRow"; -import { withMantineTheme } from "../utils/WithMantineTheme"; +import InputRow, { + InputRowProps, +} from "../../../src/components/inputs/inputRow"; +import { withMantineTheme } from "../../utils/WithMantineTheme"; import { Table } from "@mantine/core"; import prettyMilliseconds from "pretty-ms"; diff --git a/apps/web/test/components/inputsTable.test.tsx b/apps/web/test/components/inputs/inputsTable.test.tsx similarity index 94% rename from apps/web/test/components/inputsTable.test.tsx rename to apps/web/test/components/inputs/inputsTable.test.tsx index 95f8168a..49d4a523 100644 --- a/apps/web/test/components/inputsTable.test.tsx +++ b/apps/web/test/components/inputs/inputsTable.test.tsx @@ -2,8 +2,8 @@ import { fireEvent, render, screen } from "@testing-library/react"; import { describe, it } from "vitest"; import InputsTable, { InputsTableProps, -} from "../../src/components/inputsTable"; -import { withMantineTheme } from "../utils/WithMantineTheme"; +} from "../../../src/components/inputs/inputsTable"; +import { withMantineTheme } from "../../utils/WithMantineTheme"; const Component = withMantineTheme(InputsTable); diff --git a/apps/web/test/components/footer.test.tsx b/apps/web/test/components/layout/footer.test.tsx similarity index 96% rename from apps/web/test/components/footer.test.tsx rename to apps/web/test/components/layout/footer.test.tsx index e927580c..3e5e5352 100644 --- a/apps/web/test/components/footer.test.tsx +++ b/apps/web/test/components/layout/footer.test.tsx @@ -1,7 +1,7 @@ import { describe, it } from "vitest"; import { render, screen } from "@testing-library/react"; -import { withMantineTheme } from "../utils/WithMantineTheme"; -import Footer from "../../src/components/footer"; +import { withMantineTheme } from "../../utils/WithMantineTheme"; +import Footer from "../../../src/components/layout/footer"; const Component = withMantineTheme(Footer); diff --git a/apps/web/test/components/pageError.test.tsx b/apps/web/test/components/layout/pageError.test.tsx similarity index 87% rename from apps/web/test/components/pageError.test.tsx rename to apps/web/test/components/layout/pageError.test.tsx index 8edfa93e..25d2ca61 100644 --- a/apps/web/test/components/pageError.test.tsx +++ b/apps/web/test/components/layout/pageError.test.tsx @@ -1,7 +1,7 @@ import { describe, it } from "vitest"; import { render, screen, fireEvent } from "@testing-library/react"; -import { withMantineTheme } from "../utils/WithMantineTheme"; -import PageError from "../../src/components/pageError"; +import { withMantineTheme } from "../../utils/WithMantineTheme"; +import PageError from "../../../src/components/layout/pageError"; const Component = withMantineTheme(PageError); const props = { diff --git a/apps/web/test/components/pageLoader.test.tsx b/apps/web/test/components/layout/pageLoader.test.tsx similarity index 72% rename from apps/web/test/components/pageLoader.test.tsx rename to apps/web/test/components/layout/pageLoader.test.tsx index 61fa1cc3..9bb5056c 100644 --- a/apps/web/test/components/pageLoader.test.tsx +++ b/apps/web/test/components/layout/pageLoader.test.tsx @@ -1,7 +1,7 @@ import { describe, it } from "vitest"; import { render, screen } from "@testing-library/react"; -import { withMantineTheme } from "../utils/WithMantineTheme"; -import PageLoader from "../../src/components/pageLoader"; +import { withMantineTheme } from "../../utils/WithMantineTheme"; +import PageLoader from "../../../src/components/layout/pageLoader"; const Component = withMantineTheme(PageLoader); diff --git a/apps/web/test/components/shell.test.tsx b/apps/web/test/components/layout/shell.test.tsx similarity index 96% rename from apps/web/test/components/shell.test.tsx rename to apps/web/test/components/layout/shell.test.tsx index 2812f44f..92bb2f50 100644 --- a/apps/web/test/components/shell.test.tsx +++ b/apps/web/test/components/layout/shell.test.tsx @@ -1,11 +1,11 @@ import { render, screen, within } from "@testing-library/react"; import { afterAll, describe, it } from "vitest"; -import withMantineTheme from "../utils/WithMantineTheme"; -import Shell from "../../src/components/shell"; +import withMantineTheme from "../../utils/WithMantineTheme"; +import Shell from "../../../src/components/layout/shell"; const Component = withMantineTheme(Shell); -vi.mock("../../src/graphql", async () => { +vi.mock("../../../src/graphql", async () => { return { useApplicationsQuery: () => [{ data: {}, fetching: false }], useTokensQuery: () => [{ data: {}, fetching: false }],