Skip to content

Commit a020ae9

Browse files
committed
feat: data table performances/clarity improvements and beyond
1 parent 27a6b8d commit a020ae9

69 files changed

Lines changed: 3823 additions & 2529 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

package-lock.json

Lines changed: 28 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/diracx-web-components/eslint.config.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,19 @@ export default [
7979
ignoreRestSiblings: true,
8080
},
8181
],
82+
"@typescript-eslint/no-restricted-imports": [
83+
"error",
84+
{
85+
paths: [
86+
{
87+
name: "@mui/icons-material",
88+
message:
89+
"Import icons individually: import Icon from '@mui/icons-material/Icon'",
90+
allowTypeImports: true,
91+
},
92+
],
93+
},
94+
],
8295
"no-restricted-properties": [
8396
"error",
8497
{

packages/diracx-web-components/jest.setup.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,21 @@ if (typeof globalThis.PointerEvent === "undefined") {
2020
};
2121
}
2222

23+
// Mock layout measurements for @tanstack/react-virtual (jsdom has no layout engine).
24+
// Only override offsetHeight/offsetWidth — these are the properties the virtualizer
25+
// uses to determine container size. We do NOT override getBoundingClientRect globally
26+
// because MUI Popover relies on the native implementation.
27+
Object.defineProperty(HTMLElement.prototype, "offsetHeight", {
28+
configurable: true,
29+
get() {
30+
return 600;
31+
},
32+
});
33+
Object.defineProperty(HTMLElement.prototype, "offsetWidth", {
34+
configurable: true,
35+
get() {
36+
return 800;
37+
},
38+
});
39+
2340
jest.mock("@axa-fr/react-oidc");

packages/diracx-web-components/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@
3232
"@mui/x-charts": "^8.0.0",
3333
"@mui/x-date-pickers": "^8.0.0",
3434
"@tanstack/react-table": "^8.20.5",
35+
"@tanstack/react-virtual": "^3.13.23",
3536
"@types/node": "^24.0.0",
3637
"@types/react": "^19.0.0",
3738
"@types/react-dom": "^19.0.0",
3839
"dayjs": "^1.11.13",
3940
"react": "^19.0.0",
4041
"react-dom": "^19.0.0",
41-
"react-virtuoso": "^4.12.3",
4242
"swr": "^2.2.5"
4343
},
4444
"devDependencies": {
@@ -99,6 +99,10 @@
9999
"./types": {
100100
"import": "./dist/types/index.js",
101101
"types": "./dist/types/index.d.ts"
102+
},
103+
"./services": {
104+
"import": "./dist/services/index.js",
105+
"types": "./dist/services/index.d.ts"
102106
}
103107
},
104108
"files": [

packages/diracx-web-components/src/components/DashboardLayout/ApplicationDialog.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import {
1111
Icon,
1212
IconButton,
1313
} from "@mui/material";
14-
import { Close } from "@mui/icons-material";
15-
import { ApplicationsContext } from "../../contexts/ApplicationsProvider";
14+
import Close from "@mui/icons-material/Close";
15+
import { AppListContext } from "../../contexts/ApplicationsProvider";
1616

1717
interface AppDialogProps {
1818
/** Determines whether the dialog is open or not. */
@@ -34,7 +34,7 @@ export default function AppDialog({
3434
setAppDialogOpen,
3535
handleCreateApp,
3636
}: AppDialogProps) {
37-
const applicationList = use(ApplicationsContext)[2];
37+
const { appList: applicationList } = use(AppListContext);
3838
return (
3939
<Dialog
4040
open={appDialogOpen}

packages/diracx-web-components/src/components/DashboardLayout/Dashboard.tsx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,11 @@ import { useState } from "react";
44
import AppBar from "@mui/material/AppBar";
55
import Box from "@mui/material/Box";
66
import IconButton from "@mui/material/IconButton";
7-
import { Menu } from "@mui/icons-material";
7+
import Menu from "@mui/icons-material/Menu";
88
import Toolbar from "@mui/material/Toolbar";
99
import Stack from "@mui/material/Stack";
1010
import { Typography, useMediaQuery, useTheme } from "@mui/material";
11-
import {
12-
useApplicationTitle,
13-
useApplicationType,
14-
} from "../../hooks/application";
11+
import { useCurrentApplication } from "../../hooks/application";
1512
import { ProfileButton } from "./ProfileButton";
1613
import { ThemeToggleButton } from "./ThemeToggleButton";
1714
import DashboardDrawer from "./DashboardDrawer";
@@ -42,8 +39,9 @@ export default function Dashboard({
4239
logoURL,
4340
documentationURL,
4441
}: DashboardProps) {
45-
const appTitle = useApplicationTitle();
46-
const appType = useApplicationType();
42+
const currentApp = useCurrentApplication();
43+
const appTitle = currentApp?.title ?? null;
44+
const appType = currentApp?.type ?? null;
4745

4846
/** Theme and media query */
4947
const theme = useTheme();
@@ -92,7 +90,6 @@ export default function Dashboard({
9290
}}
9391
>
9492
<Typography
95-
color="text.primary"
9693
variant={isMobile ? "h6" : "h4"}
9794
fontWeight={"bold"}
9895
width={"fit-content"}
@@ -101,6 +98,9 @@ export default function Dashboard({
10198
whiteSpace: "nowrap",
10299
textOverflow: "ellipsis",
103100
paddingLeft: 2,
101+
background: `linear-gradient(90deg, ${theme.palette.primary.main}, ${theme.palette.secondary.main})`,
102+
WebkitBackgroundClip: "text",
103+
WebkitTextFillColor: "transparent",
104104
}}
105105
>
106106
{appTitle}
@@ -154,7 +154,8 @@ export default function Dashboard({
154154
flexGrow: 1,
155155
display: "flex",
156156
flexDirection: "column",
157-
width: { sm: `${drawerWidth}px` },
157+
width: { sm: `calc(100% - ${drawerWidth}px)` },
158+
minWidth: 0,
158159
}}
159160
>
160161
<Toolbar />

0 commit comments

Comments
 (0)