Skip to content

Commit

Permalink
fix tenant view
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnDuprey committed Jan 2, 2024
1 parent 8978477 commit 362961d
Showing 1 changed file with 13 additions and 13 deletions.
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

0 comments on commit 362961d

Please sign in to comment.