Skip to content

Commit

Permalink
Merge pull request KelvinTegelaar#1971 from johnduprey/dev
Browse files Browse the repository at this point in the history
celltable bugfix
  • Loading branch information
KelvinTegelaar authored Jan 2, 2024
2 parents f815810 + 362961d commit 4a676bb
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion public/version_latest.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.9.0
4.9.1
2 changes: 1 addition & 1 deletion src/components/tables/CellTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default function cellTable(
columnProp = Object.entries(columnProp).map((row) => {
return { Name: row[0], Value: row[1] }
})
} else if (Array.isArray(columnProp) && Object.entries(columnProp).length === 1) {
} else if (Array.isArray(columnProp) && typeof Object.entries(columnProp)[0][1] !== 'object') {
columnProp = columnProp.map((row) => {
return {
Value: row,
Expand Down
26 changes: 13 additions & 13 deletions src/views/tenant/standards/BestPracticeAnalyser.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ RefreshAction.propTypes = {
const getsubcolumns = (data) => {
const flatObj = data && data.length > 0 ? data : [{ data: 'No Data Found' }]
const QueryColumns = []

if (flatObj[0]) {
Object.keys(flatObj[0]).map((key) => {
QueryColumns.push({
Expand Down Expand Up @@ -226,7 +227,6 @@ const BestPracticeAnalyser = () => {
tenant.customerId,
SearchNow,
])

return (
<>
<CRow>
Expand Down Expand Up @@ -342,40 +342,40 @@ const BestPracticeAnalyser = () => {
<CCardText>
{info.formatter === 'bool' && (
<CBadge
color={graphrequest.data.Data[info.value] ? 'info' : 'danger'}
color={graphrequest.data.Data[0][info.value] ? 'info' : 'danger'}
>
<FontAwesomeIcon
icon={graphrequest.data.Data[info.value] ? faCheck : faTimes}
icon={graphrequest.data.Data[0][info.value] ? faCheck : faTimes}
size="lg"
className="me-1"
/>
{graphrequest.data.Data[info.value] ? 'Yes' : 'No'}
{graphrequest.data.Data[0][info.value] ? 'Yes' : 'No'}
</CBadge>
)}
{info.formatter === 'reverseBool' && (
<CBadge
color={graphrequest.data.Data[info.value] ? 'danger' : 'info'}
color={graphrequest.data.Data[0][info.value] ? 'danger' : 'info'}
>
<FontAwesomeIcon
icon={graphrequest.data.Data[info.value] ? faTimes : faCheck}
icon={graphrequest.data.Data[0][info.value] ? faTimes : faCheck}
size="lg"
className="me-1"
/>
{graphrequest.data.Data[info.value] ? 'No' : 'Yes'}
{graphrequest.data.Data[0][info.value] ? 'No' : 'Yes'}
</CBadge>
)}
{info.formatter === 'warnBool' && (
<CBadge
color={graphrequest.data.Data[info.value] ? 'info' : 'warning'}
color={graphrequest.data.Data[0][info.value] ? 'info' : 'warning'}
>
<FontAwesomeIcon
icon={
graphrequest.data.Data[info.value] ? faCheck : faExclamation
graphrequest.data.Data[0][info.value] ? faCheck : faExclamation
}
size="lg"
className="me-1"
/>
{graphrequest.data.Data[info.value] ? 'Yes' : 'No'}
{graphrequest.data.Data[0][info.value] ? 'Yes' : 'No'}
</CBadge>
)}

Expand All @@ -384,15 +384,15 @@ const BestPracticeAnalyser = () => {
key={QueryColumns.data}
reportName="BestPracticeAnalyser"
dynamicColumns={false}
columns={getsubcolumns(graphrequest.data.Data[info.value])}
data={graphrequest.data.Data[info.value]}
columns={getsubcolumns(graphrequest.data.Data[0][info.value])}
data={graphrequest.data.Data[0][info.value]}
isFetching={graphrequest.isFetching}
/>
)}

{info.formatter === 'number' && (
<p className="fs-1 text-center">
{getNestedValue(graphrequest.data.Data, info.value)}
{getNestedValue(graphrequest.data.Data[0], info.value)}
</p>
)}
</CCardText>
Expand Down
2 changes: 1 addition & 1 deletion version_latest.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.9.0
4.9.1

0 comments on commit 4a676bb

Please sign in to comment.