diff --git a/package-lock.json b/package-lock.json index 75ac9c90..186954e1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -55,9 +55,9 @@ } }, "node_modules/@adobe/css-tools": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.3.1.tgz", - "integrity": "sha512-/62yikz7NLScCGAAST5SHdnjaDJQBDq0M2muyRTpf2VQhw6StBg2ALiu73zSJQ4fMVLA+0uBhBHAle7Wg+2kSg==", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.3.3.tgz", + "integrity": "sha512-rE0Pygv0sEZ4vBWHlAgJLGDU7Pm8xoO6p3wsEceb7GYAjScrOHpEo8KK/eVkAcnSM+slAEtXjA2JpdjLp4fJQQ==", "dev": true }, "node_modules/@ampproject/remapping": { diff --git a/package.json b/package.json index 47a32097..bbe551f5 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "ts-lint": "tsc -noEmit -incremental", "test": "jest --ci", "postinstall": "node ./node_modules/@axa-fr/react-oidc/bin/copy-service-worker-files.mjs public", - "prepare": "husky install" + "prepare": "husky" }, "dependencies": { "@axa-fr/react-oidc": "^7.7.3", diff --git a/src/components/layout/OIDCProvider.tsx b/src/components/layout/OIDCProvider.tsx index d5da3960..62bc7893 100644 --- a/src/components/layout/OIDCProvider.tsx +++ b/src/components/layout/OIDCProvider.tsx @@ -35,7 +35,7 @@ export function OIDCProvider(props: OIDCProviderProps) { redirect_uri: `${diracxUrl}/#authentication-callback`, }); } - }, [diracxUrl, configuration]); + }, [diracxUrl, configuration, setConfiguration]); const withCustomHistory = () => { return { diff --git a/src/components/ui/DataTable.tsx b/src/components/ui/DataTable.tsx index 3e98af5f..b39e0af8 100644 --- a/src/components/ui/DataTable.tsx +++ b/src/components/ui/DataTable.tsx @@ -366,6 +366,31 @@ function FilterToolbar(props: FilterToolbarProps) { ); const addFilterButtonRef = React.useRef(null); + // Filter actions + const handleAddFilter = React.useCallback(() => { + // Create a new filter: it will not be used + // It is just a placeholder to open the filter form + const newFilter = { + id: Date.now(), + column: "", + operator: "eq", + value: "", + }; + setSelectedFilter(newFilter); + setAnchorEl(addFilterButtonRef.current); + }, [setSelectedFilter, setAnchorEl]); + + const handleRemoveAllFilters = React.useCallback(() => { + setFilters([]); + }, [setFilters]); + + const handleFilterChange = (index: number, newFilter: Filter) => { + const updatedFilters = filters.map((filter, i) => + i === index ? newFilter : filter, + ); + setFilters(updatedFilters); + }; + const open = Boolean(anchorEl); // Filter menu @@ -384,35 +409,10 @@ function FilterToolbar(props: FilterToolbarProps) { setAnchorEl(null); }; - // Filter actions - const handleAddFilter = () => { - // Create a new filter: it will not be used - // It is just a placeholder to open the filter form - const newFilter = { - id: Date.now(), - column: "", - operator: "eq", - value: "", - }; - setSelectedFilter(newFilter); - setAnchorEl(addFilterButtonRef.current); - }; - const handleRemoveFilter = (index: number) => { setFilters(filters.filter((_, i) => i !== index)); }; - const handleRemoveAllFilters = () => { - setFilters([]); - }; - - const handleFilterChange = (index: number, newFilter: Filter) => { - const updatedFilters = filters.map((filter, i) => - i === index ? newFilter : filter, - ); - setFilters(updatedFilters); - }; - // Keyboard shortcuts React.useEffect(() => { function debounce(func: (...args: any[]) => void, wait: number) { diff --git a/src/components/ui/JobDataTable.tsx b/src/components/ui/JobDataTable.tsx index 7c030919..c92385b5 100644 --- a/src/components/ui/JobDataTable.tsx +++ b/src/components/ui/JobDataTable.tsx @@ -17,7 +17,6 @@ import { import { Alert, AlertColor, - Button, Dialog, DialogContent, DialogTitle,