Skip to content

Commit 3633ccb

Browse files
Merge pull request #2068 from johnduprey/dev
Fix graph explorer all tenants reports
2 parents 27305d1 + 488e747 commit 3633ccb

File tree

1 file changed

+30
-18
lines changed

1 file changed

+30
-18
lines changed

src/views/tenant/administration/GraphExplorer.jsx

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -56,20 +56,26 @@ const GraphExplorer = () => {
5656
const QueryColumns = { set: false, data: [] }
5757

5858
if (graphrequest.isSuccess) {
59-
if (graphrequest.data.Results.length === 0) {
60-
graphrequest.data = [{ data: 'No Data Found' }]
61-
}
62-
63-
//set columns
64-
Object.keys(graphrequest.data.Results[0]).map((value) =>
59+
if (graphrequest.data?.Results?.length > 0) {
60+
//set columns
61+
Object.keys(graphrequest.data?.Results[0]).map((value) =>
62+
QueryColumns.data.push({
63+
name: value,
64+
selector: (row) => row[`${value.toString()}`],
65+
sortable: true,
66+
exportSelector: value,
67+
cell: cellGenericFormatter(),
68+
}),
69+
)
70+
} else {
6571
QueryColumns.data.push({
66-
name: value,
67-
selector: (row) => row[`${value.toString()}`],
72+
name: 'data',
73+
selector: (row) => row['data'],
6874
sortable: true,
69-
exportSelector: value,
75+
exportSelector: 'data',
7076
cell: cellGenericFormatter(),
71-
}),
72-
)
77+
})
78+
}
7379
QueryColumns.set = true
7480
}
7581

@@ -253,6 +259,7 @@ const GraphExplorer = () => {
253259
field: PropTypes.node,
254260
set: PropTypes.string,
255261
}
262+
console.log(graphrequest.data)
256263

257264
return (
258265
<>
@@ -467,13 +474,18 @@ const GraphExplorer = () => {
467474
<CCardTitle>Results</CCardTitle>
468475
</CCardHeader>
469476
<CCardBody>
470-
<CippTable
471-
reportName="GraphExplorer"
472-
dynamicColumns={false}
473-
columns={QueryColumns.data}
474-
data={graphrequest.data.Results}
475-
isFetching={graphrequest.isFetching}
476-
/>
477+
<>
478+
{graphrequest?.data?.Metadata?.Queued && (
479+
<CCallout color="info">{graphrequest?.data?.Metadata?.QueueMessage}</CCallout>
480+
)}
481+
<CippTable
482+
reportName="GraphExplorer"
483+
dynamicColumns={false}
484+
columns={QueryColumns.data}
485+
data={graphrequest?.data?.Results}
486+
isFetching={graphrequest.isFetching}
487+
/>
488+
</>
477489
</CCardBody>
478490
</CCard>
479491
)}

0 commit comments

Comments
 (0)