From b1be9f72f5622c2c28d3e5320d4599a2420e7f98 Mon Sep 17 00:00:00 2001 From: DimaAmega Date: Fri, 6 Dec 2024 02:32:43 +0400 Subject: [PATCH] wip --- ui/service/src/_routes/src/dashboard/import.tsx | 5 ----- ui/service/src/_routes/src/home/import.tsx | 4 ---- ui/service/src/_routes/src/project/import.tsx | 4 ---- ui/service/src/_routes/src/projects-list/import.tsx | 4 ---- ui/service/src/_routes/src/reports-list/import.tsx | 4 ---- ui/service/src/_routes/src/snapshot-view/import.tsx | 5 ----- ui/service/src/_routes/src/test-suites-list/import.tsx | 4 ---- ui/service/src/main.tsx | 2 +- ui/service/src/{_routes => routes}/components.tsx | 0 ui/service/src/{_routes => routes}/fetchers.tsx | 0 ui/service/src/{_routes => routes}/router.tsx | 2 +- .../{_routes => routes}/src/dashboard/dashboard-main.tsx | 2 +- ui/service/src/routes/src/dashboard/import.tsx | 5 +++++ ui/service/src/{_routes => routes}/src/home/home-main.tsx | 2 +- ui/service/src/routes/src/home/import.tsx | 4 ++++ ui/service/src/routes/src/project/import.tsx | 4 ++++ .../src/{_routes => routes}/src/project/project-main.tsx | 4 ++-- .../{_routes => routes}/src/projects-list/components.tsx | 4 ++-- ui/service/src/routes/src/projects-list/import.tsx | 4 ++++ .../src/projects-list/projects-list-main.tsx | 2 +- ui/service/src/routes/src/reports-list/import.tsx | 4 ++++ .../src/reports-list/reports-list-main.tsx | 6 +++--- ui/service/src/routes/src/snapshot-view/import.tsx | 5 +++++ .../src/snapshot-view/snapshot-view-main.tsx | 2 +- ui/service/src/routes/src/test-suites-list/import.tsx | 4 ++++ .../src/test-suites-list/test-suites-list-main.tsx | 6 +++--- ui/service/src/{_routes => routes}/types.tsx | 2 +- 27 files changed, 47 insertions(+), 47 deletions(-) delete mode 100644 ui/service/src/_routes/src/dashboard/import.tsx delete mode 100644 ui/service/src/_routes/src/home/import.tsx delete mode 100644 ui/service/src/_routes/src/project/import.tsx delete mode 100644 ui/service/src/_routes/src/projects-list/import.tsx delete mode 100644 ui/service/src/_routes/src/reports-list/import.tsx delete mode 100644 ui/service/src/_routes/src/snapshot-view/import.tsx delete mode 100644 ui/service/src/_routes/src/test-suites-list/import.tsx rename ui/service/src/{_routes => routes}/components.tsx (100%) rename ui/service/src/{_routes => routes}/fetchers.tsx (100%) rename ui/service/src/{_routes => routes}/router.tsx (97%) rename ui/service/src/{_routes => routes}/src/dashboard/dashboard-main.tsx (97%) create mode 100644 ui/service/src/routes/src/dashboard/import.tsx rename ui/service/src/{_routes => routes}/src/home/home-main.tsx (96%) create mode 100644 ui/service/src/routes/src/home/import.tsx create mode 100644 ui/service/src/routes/src/project/import.tsx rename ui/service/src/{_routes => routes}/src/project/project-main.tsx (96%) rename ui/service/src/{_routes => routes}/src/projects-list/components.tsx (95%) create mode 100644 ui/service/src/routes/src/projects-list/import.tsx rename ui/service/src/{_routes => routes}/src/projects-list/projects-list-main.tsx (96%) create mode 100644 ui/service/src/routes/src/reports-list/import.tsx rename ui/service/src/{_routes => routes}/src/reports-list/reports-list-main.tsx (92%) create mode 100644 ui/service/src/routes/src/snapshot-view/import.tsx rename ui/service/src/{_routes => routes}/src/snapshot-view/snapshot-view-main.tsx (95%) create mode 100644 ui/service/src/routes/src/test-suites-list/import.tsx rename ui/service/src/{_routes => routes}/src/test-suites-list/test-suites-list-main.tsx (93%) rename ui/service/src/{_routes => routes}/types.tsx (81%) diff --git a/ui/service/src/_routes/src/dashboard/import.tsx b/ui/service/src/_routes/src/dashboard/import.tsx deleted file mode 100644 index d705425f41..0000000000 --- a/ui/service/src/_routes/src/dashboard/import.tsx +++ /dev/null @@ -1,5 +0,0 @@ -// export * as Dashboard from '~/_routes/src/dashboard/dashboard-main' - -// we export it lazy because of ~2.6 MB chunk size :) plotly.js is too big :3 -const lazy = () => import('~/_routes/src/dashboard/dashboard-main') -export const DashboardLazy = { lazy } as const diff --git a/ui/service/src/_routes/src/home/import.tsx b/ui/service/src/_routes/src/home/import.tsx deleted file mode 100644 index 110bfa7c41..0000000000 --- a/ui/service/src/_routes/src/home/import.tsx +++ /dev/null @@ -1,4 +0,0 @@ -export * as Home from '~/_routes/src/home/home-main' - -// const lazy = () => import('~/_routes/src/home/home-main') -// export const Home = { lazy } as const diff --git a/ui/service/src/_routes/src/project/import.tsx b/ui/service/src/_routes/src/project/import.tsx deleted file mode 100644 index 9567daad94..0000000000 --- a/ui/service/src/_routes/src/project/import.tsx +++ /dev/null @@ -1,4 +0,0 @@ -export * as Project from '~/_routes/src/project/project-main' - -// const lazy = () => import('~/_routes/src/project/project-main') -// export const Project = { lazy } as const diff --git a/ui/service/src/_routes/src/projects-list/import.tsx b/ui/service/src/_routes/src/projects-list/import.tsx deleted file mode 100644 index 2946a22a38..0000000000 --- a/ui/service/src/_routes/src/projects-list/import.tsx +++ /dev/null @@ -1,4 +0,0 @@ -export * as ProjectsList from '~/_routes/src/projects-list/projects-list-main' - -// const lazy = () => import('~/_routes/src/projects-list/projects-list-main') -// export const ProjectsList = { lazy } as const diff --git a/ui/service/src/_routes/src/reports-list/import.tsx b/ui/service/src/_routes/src/reports-list/import.tsx deleted file mode 100644 index b2ff9ea407..0000000000 --- a/ui/service/src/_routes/src/reports-list/import.tsx +++ /dev/null @@ -1,4 +0,0 @@ -export * as ReportsList from '~/_routes/src/reports-list/reports-list-main' - -// const lazy = () => import('~/_routes/src/projects-list/projects-list-main') -// export const Reports = { lazy } as const diff --git a/ui/service/src/_routes/src/snapshot-view/import.tsx b/ui/service/src/_routes/src/snapshot-view/import.tsx deleted file mode 100644 index d7d429475b..0000000000 --- a/ui/service/src/_routes/src/snapshot-view/import.tsx +++ /dev/null @@ -1,5 +0,0 @@ -// export * as SnapshotId from '~/_routes/src/snapshot-view/snapshot-view-main' - -// we export it lazy because of ~2.6 MB chunk size :) plotly.js is too big :3 -const lazy = () => import('~/_routes/src/snapshot-view/snapshot-view-main') -export const SnapshotIdLazy = { lazy } as const diff --git a/ui/service/src/_routes/src/test-suites-list/import.tsx b/ui/service/src/_routes/src/test-suites-list/import.tsx deleted file mode 100644 index 7e7d5b7282..0000000000 --- a/ui/service/src/_routes/src/test-suites-list/import.tsx +++ /dev/null @@ -1,4 +0,0 @@ -export * as TestSuitesList from '~/_routes/src/test-suites-list/test-suites-list-main' - -// const lazy = () => import('~/_routes/src/projects-list/projects-list-main') -// export const Reports = { lazy } as const diff --git a/ui/service/src/main.tsx b/ui/service/src/main.tsx index d494e01b5b..5e1b64992d 100644 --- a/ui/service/src/main.tsx +++ b/ui/service/src/main.tsx @@ -5,7 +5,7 @@ import { CssBaseline, ThemeProvider } from 'evidently-ui-lib/shared-dependencies import { RouterProvider } from 'evidently-ui-lib/shared-dependencies/react-router-dom' import { theme } from 'evidently-ui-lib/theme/index' // import { router } from './Routes' -import { _router as router } from './_routes/router' +import { router } from './routes/router' import './index.css' diff --git a/ui/service/src/_routes/components.tsx b/ui/service/src/routes/components.tsx similarity index 100% rename from ui/service/src/_routes/components.tsx rename to ui/service/src/routes/components.tsx diff --git a/ui/service/src/_routes/fetchers.tsx b/ui/service/src/routes/fetchers.tsx similarity index 100% rename from ui/service/src/_routes/fetchers.tsx rename to ui/service/src/routes/fetchers.tsx diff --git a/ui/service/src/_routes/router.tsx b/ui/service/src/routes/router.tsx similarity index 97% rename from ui/service/src/_routes/router.tsx rename to ui/service/src/routes/router.tsx index 4a6b7e91f9..b78ff4f2e5 100644 --- a/ui/service/src/_routes/router.tsx +++ b/ui/service/src/routes/router.tsx @@ -49,6 +49,6 @@ export const routes = [ } ] as const satisfies RouteExtended[] -export const _router = createBrowserRouter( +export const router = createBrowserRouter( routes.map(decorateTopLevelRoutes).map((r) => decorateAllRoutes(r)) ) diff --git a/ui/service/src/_routes/src/dashboard/dashboard-main.tsx b/ui/service/src/routes/src/dashboard/dashboard-main.tsx similarity index 97% rename from ui/service/src/_routes/src/dashboard/dashboard-main.tsx rename to ui/service/src/routes/src/dashboard/dashboard-main.tsx index 68929ba3d2..5f97f34ed7 100644 --- a/ui/service/src/_routes/src/dashboard/dashboard-main.tsx +++ b/ui/service/src/routes/src/dashboard/dashboard-main.tsx @@ -1,7 +1,7 @@ import type { GetParams, LoaderSpecialArgs } from 'evidently-ui-lib/router-utils/types' import type { CrumbDefinition } from 'evidently-ui-lib/router-utils/utils' -import type { GetRouteByPath } from '~/_routes/types' +import type { GetRouteByPath } from '~/routes/types' import { useRouteParams } from 'evidently-ui-lib/router-utils/hooks' import { diff --git a/ui/service/src/routes/src/dashboard/import.tsx b/ui/service/src/routes/src/dashboard/import.tsx new file mode 100644 index 0000000000..2ada96c654 --- /dev/null +++ b/ui/service/src/routes/src/dashboard/import.tsx @@ -0,0 +1,5 @@ +// export * as Dashboard from '~/routes/src/dashboard/dashboard-main' + +// we export it lazy because of ~2.6 MB chunk size :) plotly.js is too big :3 +const lazy = () => import('~/routes/src/dashboard/dashboard-main') +export const DashboardLazy = { lazy } as const diff --git a/ui/service/src/_routes/src/home/home-main.tsx b/ui/service/src/routes/src/home/home-main.tsx similarity index 96% rename from ui/service/src/_routes/src/home/home-main.tsx rename to ui/service/src/routes/src/home/home-main.tsx index 05c9711eae..a14032e76a 100644 --- a/ui/service/src/_routes/src/home/home-main.tsx +++ b/ui/service/src/routes/src/home/home-main.tsx @@ -6,7 +6,7 @@ import { getVersion } from 'evidently-ui-lib/routes-components/home/data' import { Box } from 'evidently-ui-lib/shared-dependencies/mui-material' import { Outlet, ScrollRestoration } from 'evidently-ui-lib/shared-dependencies/react-router-dom' -import type { GetRouteByPath } from '~/_routes/types' +import type { GetRouteByPath } from '~/routes/types' import { useCrumbsFromHandle, useRouteParams } from 'evidently-ui-lib/router-utils/hooks' import type { CrumbDefinition } from 'evidently-ui-lib/router-utils/utils' diff --git a/ui/service/src/routes/src/home/import.tsx b/ui/service/src/routes/src/home/import.tsx new file mode 100644 index 0000000000..bdacec00fd --- /dev/null +++ b/ui/service/src/routes/src/home/import.tsx @@ -0,0 +1,4 @@ +export * as Home from '~/routes/src/home/home-main' + +// const lazy = () => import('~/routes/src/home/home-main') +// export const Home = { lazy } as const diff --git a/ui/service/src/routes/src/project/import.tsx b/ui/service/src/routes/src/project/import.tsx new file mode 100644 index 0000000000..9142da02ba --- /dev/null +++ b/ui/service/src/routes/src/project/import.tsx @@ -0,0 +1,4 @@ +export * as Project from '~/routes/src/project/project-main' + +// const lazy = () => import('~/routes/src/project/project-main') +// export const Project = { lazy } as const diff --git a/ui/service/src/_routes/src/project/project-main.tsx b/ui/service/src/routes/src/project/project-main.tsx similarity index 96% rename from ui/service/src/_routes/src/project/project-main.tsx rename to ui/service/src/routes/src/project/project-main.tsx index 11d435b4c0..6f7d1a6203 100644 --- a/ui/service/src/_routes/src/project/project-main.tsx +++ b/ui/service/src/routes/src/project/project-main.tsx @@ -13,11 +13,11 @@ import { Outlet } from 'evidently-ui-lib/shared-dependencies/react-router-dom' import { ContentCopy as ContentCopyIcon } from 'evidently-ui-lib/shared-dependencies/mui-icons-material' -import type { GetRouteByPath } from '~/_routes/types' +import type { GetRouteByPath } from '~/routes/types' import { useRouteParams } from 'evidently-ui-lib/router-utils/hooks' -import { RouterLink, useMatchRouter } from '~/_routes/components' import { clientAPI } from '~/api' +import { RouterLink, useMatchRouter } from '~/routes/components' /////////////////// // ROUTE diff --git a/ui/service/src/_routes/src/projects-list/components.tsx b/ui/service/src/routes/src/projects-list/components.tsx similarity index 95% rename from ui/service/src/_routes/src/projects-list/components.tsx rename to ui/service/src/routes/src/projects-list/components.tsx index 78eab279f5..867617d7ba 100644 --- a/ui/service/src/_routes/src/projects-list/components.tsx +++ b/ui/service/src/routes/src/projects-list/components.tsx @@ -2,10 +2,10 @@ import type { ProjectModel } from 'evidently-ui-lib/api/types' import type { StrictID } from 'evidently-ui-lib/api/types/utils' import { AddNewProjectButton, ProjectCard } from 'evidently-ui-lib/components/ProjectCard' import { useState } from 'react' -import { useSubmitFetcher } from '~/_routes/fetchers' +import { useSubmitFetcher } from '~/routes/fetchers' import { useOnSubmitEnd } from 'evidently-ui-lib/router-utils/hooks' -import { RouterLink } from '~/_routes/components' +import { RouterLink } from '~/routes/components' import type { CurrentRoute } from './projects-list-main' export const ProjectCardWrapper = ({ project }: { project: StrictID }) => { diff --git a/ui/service/src/routes/src/projects-list/import.tsx b/ui/service/src/routes/src/projects-list/import.tsx new file mode 100644 index 0000000000..52d2ed0d51 --- /dev/null +++ b/ui/service/src/routes/src/projects-list/import.tsx @@ -0,0 +1,4 @@ +export * as ProjectsList from '~/routes/src/projects-list/projects-list-main' + +// const lazy = () => import('~/routes/src/projects-list/projects-list-main') +// export const ProjectsList = { lazy } as const diff --git a/ui/service/src/_routes/src/projects-list/projects-list-main.tsx b/ui/service/src/routes/src/projects-list/projects-list-main.tsx similarity index 96% rename from ui/service/src/_routes/src/projects-list/projects-list-main.tsx rename to ui/service/src/routes/src/projects-list/projects-list-main.tsx index 920da5496d..bcf1f73f86 100644 --- a/ui/service/src/_routes/src/projects-list/projects-list-main.tsx +++ b/ui/service/src/routes/src/projects-list/projects-list-main.tsx @@ -5,7 +5,7 @@ import { } from 'evidently-ui-lib/routes-components/projectsList/data' import { Box, Grid, Typography } from 'evidently-ui-lib/shared-dependencies/mui-material' -import type { GetRouteByPath } from '~/_routes/types' +import type { GetRouteByPath } from '~/routes/types' import { clientAPI } from '~/api' diff --git a/ui/service/src/routes/src/reports-list/import.tsx b/ui/service/src/routes/src/reports-list/import.tsx new file mode 100644 index 0000000000..6630a97e7f --- /dev/null +++ b/ui/service/src/routes/src/reports-list/import.tsx @@ -0,0 +1,4 @@ +export * as ReportsList from '~/routes/src/reports-list/reports-list-main' + +// const lazy = () => import('~/routes/src/projects-list/projects-list-main') +// export const Reports = { lazy } as const diff --git a/ui/service/src/_routes/src/reports-list/reports-list-main.tsx b/ui/service/src/routes/src/reports-list/reports-list-main.tsx similarity index 92% rename from ui/service/src/_routes/src/reports-list/reports-list-main.tsx rename to ui/service/src/routes/src/reports-list/reports-list-main.tsx index 76352a2ad5..c693569339 100644 --- a/ui/service/src/_routes/src/reports-list/reports-list-main.tsx +++ b/ui/service/src/routes/src/reports-list/reports-list-main.tsx @@ -1,6 +1,6 @@ import type { GetParams, LoaderSpecialArgs } from 'evidently-ui-lib/router-utils/types' -import type { GetRouteByPath } from '~/_routes/types' +import type { GetRouteByPath } from '~/routes/types' import { clientAPI } from '~/api' @@ -10,8 +10,8 @@ import { getReports, getSnapshotsActionSpecial } from 'evidently-ui-lib/routes-components/snapshots/data' -import { RouterLink } from '~/_routes/components' -import { useSubmitFetcher } from '~/_routes/fetchers' +import { RouterLink } from '~/routes/components' +import { useSubmitFetcher } from '~/routes/fetchers' /////////////////// // ROUTE diff --git a/ui/service/src/routes/src/snapshot-view/import.tsx b/ui/service/src/routes/src/snapshot-view/import.tsx new file mode 100644 index 0000000000..10634bf95f --- /dev/null +++ b/ui/service/src/routes/src/snapshot-view/import.tsx @@ -0,0 +1,5 @@ +// export * as SnapshotId from '~/routes/src/snapshot-view/snapshot-view-main' + +// we export it lazy because of ~2.6 MB chunk size :) plotly.js is too big :3 +const lazy = () => import('~/routes/src/snapshot-view/snapshot-view-main') +export const SnapshotIdLazy = { lazy } as const diff --git a/ui/service/src/_routes/src/snapshot-view/snapshot-view-main.tsx b/ui/service/src/routes/src/snapshot-view/snapshot-view-main.tsx similarity index 95% rename from ui/service/src/_routes/src/snapshot-view/snapshot-view-main.tsx rename to ui/service/src/routes/src/snapshot-view/snapshot-view-main.tsx index 037ba46246..55871a46f4 100644 --- a/ui/service/src/_routes/src/snapshot-view/snapshot-view-main.tsx +++ b/ui/service/src/routes/src/snapshot-view/snapshot-view-main.tsx @@ -1,4 +1,4 @@ -import type { GetRouteByPath } from '~/_routes/types' +import type { GetRouteByPath } from '~/routes/types' import { useRouteParams } from 'evidently-ui-lib/router-utils/hooks' import type { GetParams, LoaderSpecialArgs } from 'evidently-ui-lib/router-utils/types' diff --git a/ui/service/src/routes/src/test-suites-list/import.tsx b/ui/service/src/routes/src/test-suites-list/import.tsx new file mode 100644 index 0000000000..0ae143e379 --- /dev/null +++ b/ui/service/src/routes/src/test-suites-list/import.tsx @@ -0,0 +1,4 @@ +export * as TestSuitesList from '~/routes/src/test-suites-list/test-suites-list-main' + +// const lazy = () => import('~/routes/src/projects-list/projects-list-main') +// export const Reports = { lazy } as const diff --git a/ui/service/src/_routes/src/test-suites-list/test-suites-list-main.tsx b/ui/service/src/routes/src/test-suites-list/test-suites-list-main.tsx similarity index 93% rename from ui/service/src/_routes/src/test-suites-list/test-suites-list-main.tsx rename to ui/service/src/routes/src/test-suites-list/test-suites-list-main.tsx index ff1c8482c8..634794c741 100644 --- a/ui/service/src/_routes/src/test-suites-list/test-suites-list-main.tsx +++ b/ui/service/src/routes/src/test-suites-list/test-suites-list-main.tsx @@ -1,6 +1,6 @@ import type { GetParams, LoaderSpecialArgs } from 'evidently-ui-lib/router-utils/types' -import type { GetRouteByPath } from '~/_routes/types' +import type { GetRouteByPath } from '~/routes/types' import { clientAPI } from '~/api' @@ -10,8 +10,8 @@ import { getSnapshotsActionSpecial, getTestSuites } from 'evidently-ui-lib/routes-components/snapshots/data' -import { RouterLink } from '~/_routes/components' -import { useSubmitFetcher } from '~/_routes/fetchers' +import { RouterLink } from '~/routes/components' +import { useSubmitFetcher } from '~/routes/fetchers' /////////////////// // ROUTE diff --git a/ui/service/src/_routes/types.tsx b/ui/service/src/routes/types.tsx similarity index 81% rename from ui/service/src/_routes/types.tsx rename to ui/service/src/routes/types.tsx index 0bfdb39b2a..a944eaf78b 100644 --- a/ui/service/src/_routes/types.tsx +++ b/ui/service/src/routes/types.tsx @@ -1,5 +1,5 @@ import type { GetMatches } from 'evidently-ui-lib/router-utils/types' -import type { routes } from '~/_routes/router' +import type { routes } from '~/routes/router' export type Routes = GetMatches