Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
39 changes: 28 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions packages/diracx-web-components/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,19 @@ export default [
ignoreRestSiblings: true,
},
],
"@typescript-eslint/no-restricted-imports": [
"error",
{
paths: [
{
name: "@mui/icons-material",
message:
"Import icons individually: import Icon from '@mui/icons-material/Icon'",
allowTypeImports: true,
},
],
},
],
"no-restricted-properties": [
"error",
{
Expand Down
17 changes: 17 additions & 0 deletions packages/diracx-web-components/jest.setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,21 @@ if (typeof globalThis.PointerEvent === "undefined") {
};
}

// Mock layout measurements for @tanstack/react-virtual (jsdom has no layout engine).
// Only override offsetHeight/offsetWidth — these are the properties the virtualizer
// uses to determine container size. We do NOT override getBoundingClientRect globally
// because MUI Popover relies on the native implementation.
Object.defineProperty(HTMLElement.prototype, "offsetHeight", {
configurable: true,
get() {
return 600;
},
});
Object.defineProperty(HTMLElement.prototype, "offsetWidth", {
configurable: true,
get() {
return 800;
},
});

jest.mock("@axa-fr/react-oidc");
6 changes: 5 additions & 1 deletion packages/diracx-web-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@
"@mui/x-charts": "^8.0.0",
"@mui/x-date-pickers": "^8.0.0",
"@tanstack/react-table": "^8.20.5",
"@tanstack/react-virtual": "^3.13.23",
"@types/node": "^24.0.0",
"@types/react": "^19.0.0",
"@types/react-dom": "^19.0.0",
"dayjs": "^1.11.13",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-virtuoso": "^4.12.3",
"swr": "^2.2.5"
},
"devDependencies": {
Expand Down Expand Up @@ -99,6 +99,10 @@
"./types": {
"import": "./dist/types/index.js",
"types": "./dist/types/index.d.ts"
},
"./services": {
"import": "./dist/services/index.js",
"types": "./dist/services/index.d.ts"
}
},
"files": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import {
Icon,
IconButton,
} from "@mui/material";
import { Close } from "@mui/icons-material";
import { ApplicationsContext } from "../../contexts/ApplicationsProvider";
import Close from "@mui/icons-material/Close";
import { AppListContext } from "../../contexts/ApplicationsProvider";

interface AppDialogProps {
/** Determines whether the dialog is open or not. */
Expand All @@ -34,7 +34,7 @@ export default function AppDialog({
setAppDialogOpen,
handleCreateApp,
}: AppDialogProps) {
const applicationList = use(ApplicationsContext)[2];
const { appList: applicationList } = use(AppListContext);
return (
<Dialog
open={appDialogOpen}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,11 @@ import { useState } from "react";
import AppBar from "@mui/material/AppBar";
import Box from "@mui/material/Box";
import IconButton from "@mui/material/IconButton";
import { Menu } from "@mui/icons-material";
import Menu from "@mui/icons-material/Menu";
import Toolbar from "@mui/material/Toolbar";
import Stack from "@mui/material/Stack";
import { Typography, useMediaQuery, useTheme } from "@mui/material";
import {
useApplicationTitle,
useApplicationType,
} from "../../hooks/application";
import { useCurrentApplication } from "../../hooks/application";
import { ProfileButton } from "./ProfileButton";
import { ThemeToggleButton } from "./ThemeToggleButton";
import DashboardDrawer from "./DashboardDrawer";
Expand Down Expand Up @@ -42,8 +39,9 @@ export default function Dashboard({
logoURL,
documentationURL,
}: DashboardProps) {
const appTitle = useApplicationTitle();
const appType = useApplicationType();
const currentApp = useCurrentApplication();
const appTitle = currentApp?.title ?? null;
const appType = currentApp?.type ?? null;

/** Theme and media query */
const theme = useTheme();
Expand Down Expand Up @@ -92,7 +90,6 @@ export default function Dashboard({
}}
>
<Typography
color="text.primary"
variant={isMobile ? "h6" : "h4"}
fontWeight={"bold"}
width={"fit-content"}
Expand All @@ -101,6 +98,9 @@ export default function Dashboard({
whiteSpace: "nowrap",
textOverflow: "ellipsis",
paddingLeft: 2,
background: `linear-gradient(90deg, ${theme.palette.primary.main}, ${theme.palette.secondary.main})`,
WebkitBackgroundClip: "text",
WebkitTextFillColor: "transparent",
}}
>
{appTitle}
Expand Down Expand Up @@ -154,7 +154,8 @@ export default function Dashboard({
flexGrow: 1,
display: "flex",
flexDirection: "column",
width: { sm: `${drawerWidth}px` },
width: { sm: `calc(100% - ${drawerWidth}px)` },
minWidth: 0,
}}
>
<Toolbar />
Expand Down
Loading
Loading