Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI: huge refactor #1384

Open
wants to merge 64 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
c1a43c0
UI(huge refactor): initial
DimaAmega Nov 25, 2024
9a9cf5f
wip
DimaAmega Nov 25, 2024
1df4e86
support Lazy
DimaAmega Nov 25, 2024
577ffd0
better
DimaAmega Nov 25, 2024
1151f44
wip
DimaAmega Nov 25, 2024
d76c4f6
wip
DimaAmega Nov 25, 2024
d081e66
wip
DimaAmega Nov 26, 2024
0c17922
wip
DimaAmega Nov 26, 2024
1b3409d
wip
DimaAmega Nov 26, 2024
56084e1
wip
DimaAmega Nov 27, 2024
84fad23
WIP
DimaAmega Dec 2, 2024
f7c5e46
wip
DimaAmega Dec 3, 2024
af9276f
wip
DimaAmega Dec 4, 2024
228d96c
WIP
DimaAmega Dec 5, 2024
72dc7bc
wip
DimaAmega Dec 5, 2024
d364393
wip
DimaAmega Dec 5, 2024
892b353
wip
DimaAmega Dec 5, 2024
7be2daa
wip
DimaAmega Dec 5, 2024
407df50
wip
DimaAmega Dec 5, 2024
0576e97
wip
DimaAmega Dec 5, 2024
8ce9ab4
wip
DimaAmega Dec 5, 2024
770b989
WIP
DimaAmega Dec 5, 2024
1c280fe
wip
DimaAmega Dec 5, 2024
984fc66
wip
DimaAmega Dec 5, 2024
b1be9f7
wip
DimaAmega Dec 5, 2024
f57712b
wip
DimaAmega Dec 5, 2024
95b7aee
wip
DimaAmega Dec 5, 2024
4d0e477
better
DimaAmega Dec 5, 2024
ec2f816
wip
DimaAmega Dec 5, 2024
832ce34
wip
DimaAmega Dec 5, 2024
0aed65d
wip
DimaAmega Dec 6, 2024
12225f2
wip
DimaAmega Dec 6, 2024
5953778
Merge branch 'main' into ui/refactor-huge
DimaAmega Dec 6, 2024
dc4bedf
wip
DimaAmega Dec 6, 2024
1faf7e2
wip
DimaAmega Dec 6, 2024
7b41c13
better
DimaAmega Dec 7, 2024
a8e3d80
wip
DimaAmega Dec 7, 2024
2c838ec
Merge branch 'main' into ui/refactor-huge
DimaAmega Dec 14, 2024
4b39e46
wip
DimaAmega Dec 16, 2024
8b95a41
Merge branch 'main' into ui/refactor-huge
DimaAmega Dec 18, 2024
dcd3f61
wip
DimaAmega Dec 18, 2024
706db44
wip
DimaAmega Dec 19, 2024
8d17a08
remove `special` text
DimaAmega Dec 19, 2024
0940d65
wip
DimaAmega Dec 19, 2024
69572a3
wip
DimaAmega Dec 19, 2024
b7a10c1
wip
DimaAmega Dec 19, 2024
367ce69
wip
DimaAmega Dec 23, 2024
f06344f
wip: better `useFetcher`
DimaAmega Dec 25, 2024
4eaaeb7
better
DimaAmega Dec 30, 2024
0aa2a0b
better
DimaAmega Jan 3, 2025
2d763d1
wip
DimaAmega Jan 3, 2025
b752a1f
replace `/:projectId/*` to `/projects/:projectId/*`
DimaAmega Jan 3, 2025
f7017e7
WIP
DimaAmega Jan 6, 2025
df92462
wip
DimaAmega Jan 6, 2025
39f16c6
fix bug
DimaAmega Jan 7, 2025
78ff163
WIP
DimaAmega Jan 8, 2025
8b628f8
WIP
DimaAmega Jan 8, 2025
cd65fa7
Merge branch 'main' into ui/refactor-huge
DimaAmega Jan 10, 2025
a9f4252
Merge branch 'main' into ui/refactor-huge
DimaAmega Jan 15, 2025
dbcaefe
better
DimaAmega Jan 15, 2025
3480bf3
wip
DimaAmega Jan 15, 2025
4ab4415
wip
DimaAmega Jan 15, 2025
5af2a63
wip
DimaAmega Jan 15, 2025
b4bdc98
better home link
DimaAmega Jan 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/evidently/ui/storage/local/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ async def load_test_results(
filter.filter(report)
and isinstance(report, TestSuite)
and (timestamp_start is None or report.timestamp >= timestamp_start)
and (timestamp_end is None or report.timestamp < timestamp_end)
and (timestamp_end is None or report.timestamp <= timestamp_end)
):
continue

Expand All @@ -336,7 +336,7 @@ async def load_points_as_type(
if not (
filter.filter(report)
and (timestamp_start is None or report.timestamp >= timestamp_start)
and (timestamp_end is None or report.timestamp < timestamp_end)
and (timestamp_end is None or report.timestamp <= timestamp_end)
):
continue

Expand Down
1 change: 1 addition & 0 deletions ui/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ node_modules
playwright-report
test-results
vite-bundle-report
tsconfig.tsbuildinfo
2 changes: 1 addition & 1 deletion ui/packages/evidently-ui-lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@
"@types/react": "^18.2.0",
"@types/react-dom": "^18.2.0",
"@types/react-plotly.js": "^2.6.1",
"typescript": "^5.0.2"
"typescript": "^5.7.2"
}
}
1 change: 1 addition & 0 deletions ui/packages/evidently-ui-lib/src/api/client-heplers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import type { ErrorData, ErrorResponse } from '~/api/types/utils'
import type { BackendPaths } from '~/api/types'

export type API_CLIENT_TYPE = ReturnType<typeof createClient<BackendPaths>>
export type API = { api: API_CLIENT_TYPE }

// biome-ignore lint: <explanation>
type ClientGenericResponse<D = any> =
Expand Down
11 changes: 11 additions & 0 deletions ui/packages/evidently-ui-lib/src/api/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ export type BackendPaths = paths
///////////////////////////////
type Schemas = components['schemas']

type OmitNever<T> = { [K in keyof T as T[K] extends never ? never : K]: T[K] }

export type GetSearchParamsAPIs<T extends 'get' | 'post'> = OmitNever<{
[P in keyof paths]: paths[P] extends Record<T, { parameters: { query?: infer Z } }> ? Z : never
}>

export type ProjectModel = Schemas['Project']
export type ReportModel = Schemas['ReportModel']
export type TestSuiteModel = Schemas['TestSuiteModel']
Expand All @@ -25,6 +31,11 @@ export type DashboardInfoModel = Omit<Schemas['DashboardInfoModel'], 'widgets'>
export type VersionModel = Schemas['Version']
export type MetadataModel = ReportModel['metadata']

export type DownloadSnapshotURL = Extract<
keyof BackendPaths,
'/api/projects/{project_id}/{snapshot_id}/download'
>

///////////////////////////////
/// EXTENDED TYPES FOR UI
///////////////////////////////
Expand Down
18 changes: 6 additions & 12 deletions ui/packages/evidently-ui-lib/src/api/utils.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
import type { ActionFunction, LoaderFunctionArgs } from 'react-router-dom'
import type { OptionalID, StrictID } from '~/api/types/utils'

export type ILoaderAction<LoaderData> = {
loader: (args: LoaderFunctionArgs) => Promise<LoaderData>
action: ActionFunction
}

export type GetLoaderAction<Provider, LoaderData> = ({
api
}: {
api: Provider
}) => Partial<ILoaderAction<LoaderData>>

export const ensureID: <Entity extends OptionalID>(e: Entity) => StrictID<Entity> = (e) => {
if (e.id) {
return { ...e, id: e.id }
Expand All @@ -20,6 +8,12 @@ export const ensureID: <Entity extends OptionalID>(e: Entity) => StrictID<Entity
throw `"id" is missing in object: ${JSON.stringify(e)}`
}

export const ensureIDInArray: <Entity extends OptionalID>(e: Entity[]) => StrictID<Entity>[] = (
e
) => {
return e.map(ensureID)
}

export const expectJsonRequest = (request: Request) => {
if (request.headers.get('Content-type') !== 'application/json') {
throw new Response('Unsupported Media Type', { status: 415 })
Expand Down
44 changes: 0 additions & 44 deletions ui/packages/evidently-ui-lib/src/components/BreadCrumbs.tsx

This file was deleted.

Loading
Loading