Skip to content

Commit 72cccaf

Browse files
authored
Merge pull request #2181 from JohnDuprey/dev
Table fixes
2 parents 9489fbb + 249f119 commit 72cccaf

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/components/tables/CippDatatable.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ import { CippTablePropTypes } from 'src/components/tables/CippTable'
66
import { CCallout } from '@coreui/react'
77

88
export default function CippDatatable({ path, params, ...rest }) {
9-
const [refreshGuid, setRefreshGuid] = React.useState('')
109
const [graphFilter, setGraphFilter] = React.useState(params?.Parameters?.$filter)
1110
const {
1211
data = [],
1312
isFetching,
1413
error,
15-
} = useListDatatableQuery({ path, params: { refreshGuid, $filter: graphFilter, ...params } })
14+
refetch,
15+
} = useListDatatableQuery({ path, params: { $filter: graphFilter, ...params } })
1616

1717
var defaultFilterText = ''
1818
if (params?.Parameters?.$filter) {
@@ -28,7 +28,7 @@ export default function CippDatatable({ path, params, ...rest }) {
2828
isFetching={isFetching}
2929
error={error}
3030
defaultFilterText={defaultFilterText}
31-
refreshFunction={setRefreshGuid}
31+
refreshFunction={() => refetch()}
3232
graphFilterFunction={setGraphFilter}
3333
/>
3434
</>

src/components/tables/CippTable.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,9 @@ export default function CippTable({
204204

205205
// eslint-disable-next-line react-hooks/exhaustive-deps
206206
const addColumn = (columnname) => {
207-
let alreadyInArray = updatedColumns.some((o) => o.exportSelector === columnname)
207+
let alreadyInArray = updatedColumns.some(
208+
(o) => o.exportSelector === columnname && o?.omit !== true,
209+
)
208210
let newColumns = [...updatedColumns]
209211
const actionsColumn = newColumns.length > 0 ? newColumns.pop() : null
210212

0 commit comments

Comments
 (0)