Skip to content

Commit 4a676bb

Browse files
Merge pull request #1971 from johnduprey/dev
celltable bugfix
2 parents f815810 + 362961d commit 4a676bb

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

public/version_latest.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.9.0
1+
4.9.1

src/components/tables/CellTable.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export default function cellTable(
2424
columnProp = Object.entries(columnProp).map((row) => {
2525
return { Name: row[0], Value: row[1] }
2626
})
27-
} else if (Array.isArray(columnProp) && Object.entries(columnProp).length === 1) {
27+
} else if (Array.isArray(columnProp) && typeof Object.entries(columnProp)[0][1] !== 'object') {
2828
columnProp = columnProp.map((row) => {
2929
return {
3030
Value: row,

src/views/tenant/standards/BestPracticeAnalyser.jsx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ RefreshAction.propTypes = {
9595
const getsubcolumns = (data) => {
9696
const flatObj = data && data.length > 0 ? data : [{ data: 'No Data Found' }]
9797
const QueryColumns = []
98+
9899
if (flatObj[0]) {
99100
Object.keys(flatObj[0]).map((key) => {
100101
QueryColumns.push({
@@ -226,7 +227,6 @@ const BestPracticeAnalyser = () => {
226227
tenant.customerId,
227228
SearchNow,
228229
])
229-
230230
return (
231231
<>
232232
<CRow>
@@ -342,40 +342,40 @@ const BestPracticeAnalyser = () => {
342342
<CCardText>
343343
{info.formatter === 'bool' && (
344344
<CBadge
345-
color={graphrequest.data.Data[info.value] ? 'info' : 'danger'}
345+
color={graphrequest.data.Data[0][info.value] ? 'info' : 'danger'}
346346
>
347347
<FontAwesomeIcon
348-
icon={graphrequest.data.Data[info.value] ? faCheck : faTimes}
348+
icon={graphrequest.data.Data[0][info.value] ? faCheck : faTimes}
349349
size="lg"
350350
className="me-1"
351351
/>
352-
{graphrequest.data.Data[info.value] ? 'Yes' : 'No'}
352+
{graphrequest.data.Data[0][info.value] ? 'Yes' : 'No'}
353353
</CBadge>
354354
)}
355355
{info.formatter === 'reverseBool' && (
356356
<CBadge
357-
color={graphrequest.data.Data[info.value] ? 'danger' : 'info'}
357+
color={graphrequest.data.Data[0][info.value] ? 'danger' : 'info'}
358358
>
359359
<FontAwesomeIcon
360-
icon={graphrequest.data.Data[info.value] ? faTimes : faCheck}
360+
icon={graphrequest.data.Data[0][info.value] ? faTimes : faCheck}
361361
size="lg"
362362
className="me-1"
363363
/>
364-
{graphrequest.data.Data[info.value] ? 'No' : 'Yes'}
364+
{graphrequest.data.Data[0][info.value] ? 'No' : 'Yes'}
365365
</CBadge>
366366
)}
367367
{info.formatter === 'warnBool' && (
368368
<CBadge
369-
color={graphrequest.data.Data[info.value] ? 'info' : 'warning'}
369+
color={graphrequest.data.Data[0][info.value] ? 'info' : 'warning'}
370370
>
371371
<FontAwesomeIcon
372372
icon={
373-
graphrequest.data.Data[info.value] ? faCheck : faExclamation
373+
graphrequest.data.Data[0][info.value] ? faCheck : faExclamation
374374
}
375375
size="lg"
376376
className="me-1"
377377
/>
378-
{graphrequest.data.Data[info.value] ? 'Yes' : 'No'}
378+
{graphrequest.data.Data[0][info.value] ? 'Yes' : 'No'}
379379
</CBadge>
380380
)}
381381

@@ -384,15 +384,15 @@ const BestPracticeAnalyser = () => {
384384
key={QueryColumns.data}
385385
reportName="BestPracticeAnalyser"
386386
dynamicColumns={false}
387-
columns={getsubcolumns(graphrequest.data.Data[info.value])}
388-
data={graphrequest.data.Data[info.value]}
387+
columns={getsubcolumns(graphrequest.data.Data[0][info.value])}
388+
data={graphrequest.data.Data[0][info.value]}
389389
isFetching={graphrequest.isFetching}
390390
/>
391391
)}
392392

393393
{info.formatter === 'number' && (
394394
<p className="fs-1 text-center">
395-
{getNestedValue(graphrequest.data.Data, info.value)}
395+
{getNestedValue(graphrequest.data.Data[0], info.value)}
396396
</p>
397397
)}
398398
</CCardText>

version_latest.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.9.0
1+
4.9.1

0 commit comments

Comments
 (0)