Skip to content

Commit

Permalink
fix: warnings in the CI
Browse files Browse the repository at this point in the history
  • Loading branch information
aldbr committed Mar 20, 2024
1 parent 6efbb83 commit ddfbb2d
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 31 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/components/layout/OIDCProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export function OIDCProvider(props: OIDCProviderProps) {
redirect_uri: `${diracxUrl}/#authentication-callback`,
});
}
}, [diracxUrl, configuration]);
}, [diracxUrl, configuration, setConfiguration]);

const withCustomHistory = () => {
return {
Expand Down
50 changes: 25 additions & 25 deletions src/components/ui/DataTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,31 @@ function FilterToolbar(props: FilterToolbarProps) {
);
const addFilterButtonRef = React.useRef<HTMLButtonElement>(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
Expand All @@ -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) {
Expand Down
1 change: 0 additions & 1 deletion src/components/ui/JobDataTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import {
import {
Alert,
AlertColor,
Button,
Dialog,
DialogContent,
DialogTitle,
Expand Down

0 comments on commit ddfbb2d

Please sign in to comment.