Skip to content

Commit

Permalink
simpleColumns update handling
Browse files Browse the repository at this point in the history
also remove more console.log to appease gary
  • Loading branch information
JohnDuprey committed Feb 10, 2025
1 parent 7fa788c commit b024c96
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/components/CippComponents/CippAutocomplete.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ export const CippAutoComplete = (props) => {
options.some(
(option) => params.inputValue === option.value || params.inputValue === option.label
);
console.log(removeOptions);
if (params.inputValue !== "" && creatable && !isExisting) {
filtered.push({
label: `Add option: "${params.inputValue}"`,
Expand Down
6 changes: 5 additions & 1 deletion src/components/CippTable/CIPPTableToptoolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ export const CIPPTableToptoolbar = ({
}
}, [settings?.columnDefaults?.[pageName], router, usedColumns]);

useEffect(() => {
setOriginalSimpleColumns(simpleColumns);
}, [simpleColumns]);

const presetList = ApiGetCall({
url: "/api/ListGraphExplorerPresets",
queryKey: `ListGraphExplorerPresets${api?.data?.Endpoint ?? ""}`,
Expand Down Expand Up @@ -254,7 +258,7 @@ export const CIPPTableToptoolbar = ({
// update filters to include graph explorer presets
setFilterList([...filters, ...graphPresetList]);
}
}, [presetList?.isSuccess]);
}, [presetList?.isSuccess, simpleColumns]);

return (
<>
Expand Down
4 changes: 4 additions & 0 deletions src/components/CippTable/CippDataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,10 @@ export const CippDataTable = (props) => {
}
}, [table.getSelectedRowModel().rows]);

useEffect(() => {
setConfiguredSimpleColumns(simpleColumns);
}, [simpleColumns]);

return (
<>
{noCard ? (
Expand Down

0 comments on commit b024c96

Please sign in to comment.