Skip to content

Commit

Permalink
[TM-1589] add correct reference for tooltip in dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarLima1 committed Dec 27, 2024
1 parent 2d6f02d commit 0a3bf1e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/pages/dashboard/charts/DoughnutChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Cell, Legend, Pie, PieChart, ResponsiveContainer, Tooltip } from "recha
import { calculateTotalsVolunteers, ChartDataVolunteers, COLORS_VOLUNTEERS } from "@/utils/dashboardUtils";

import { CustomLegendVolunteers } from "./CustomLegendVolunteers";
import { CustomTooltip } from "./CustomTooltip";
import { CustomTooltip } from "./CustomTooltipJobsCreated";

const DoughnutChart: React.FC<{ data: ChartDataVolunteers }> = ({ data }) => {
const { chartData, total } = data;
Expand Down
2 changes: 1 addition & 1 deletion src/pages/dashboard/charts/GroupedBarChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { calculateTotals, GroupedBarChartData } from "@/utils/dashboardUtils";

import { CustomBar } from "./CustomBarJobsCreated";
import { CustomLegend } from "./CustomLegendJobsCreated";
import { CustomTooltip } from "./CustomTooltip";
import { CustomTooltip } from "./CustomTooltipJobsCreated";
import { CustomXAxisTick } from "./CustomXAxisTickJobsCreated";
import { CustomYAxisTick } from "./CustomYAxisTickJobsCreated";

Expand Down
2 changes: 1 addition & 1 deletion src/pages/dashboard/components/ContentOverview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ const ContentOverview = (props: ContentOverviewProps<RowData>) => {
data={{}}
classNameBody="ml-[-40px] lg:ml-[-35px]"
chartType={CHART_TYPES.simpleBarChart}
dataForChart={dataHectaresUnderRestoration.restorationStrategiesRepresented}
dataForChart={dataHectaresUnderRestoration}
tooltip={t(RESTORATION_STRATEGIES_REPRESENTED_TOOLTIP)}
isUserAllowed={isUserAllowed}
isLoading={isLoadingHectaresUnderRestoration}
Expand Down
9 changes: 6 additions & 3 deletions src/pages/dashboard/components/SecDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -225,17 +225,20 @@ const SecDashboard = ({
<When condition={chartType === CHART_TYPES.simpleBarChart}>
<BlurContainer
isBlur={
(isUserAllowed ?? false) && !isLoading && isEmptyChartData(CHART_TYPES.simpleBarChart, dataForChart)
(isUserAllowed ?? false) &&
!isLoading &&
isEmptyChartData(CHART_TYPES.simpleBarChart, dataForChart?.restorationStrategiesRepresented)
}
textInformation={noDataInformation}
className="ml-[40px] lg:ml-[35px]"
>
<SimpleBarChart
data={
isEmptyChartData(CHART_TYPES.simpleBarChart, dataForChart)
isEmptyChartData(CHART_TYPES.simpleBarChart, dataForChart?.restorationStrategiesRepresented)
? DUMMY_DATA_FOR_CHART_SIMPLE_BAR_CHART
: dataForChart
: dataForChart?.restorationStrategiesRepresented
}
total={dataForChart?.totalSection?.totalHectaresRestored}
/>
</BlurContainer>
</When>
Expand Down

0 comments on commit 0a3bf1e

Please sign in to comment.