Skip to content

Commit

Permalink
🐛 Fix donut tooltip (#1604)
Browse files Browse the repository at this point in the history
Resolves https://issues.redhat.com/browse/MTA-1860 
<img width="409" alt="Screenshot 2023-12-11 at 10 40 32 AM"
src="https://github.com/konveyor/tackle2-ui/assets/11218376/e7753285-9b71-4c1f-b5b8-5b071feb18bc">

Signed-off-by: ibolton336 <[email protected]>
  • Loading branch information
ibolton336 authored Dec 11, 2023
1 parent 0c1d91a commit 1f99dd0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ export const ApplicationLandscape: React.FC<IApplicationLandscapeProps> = ({
riskLabel={
<Link to={getRisksUrl(["red"])}>{t("terms.highRisk")}</Link>
}
riskTitle={t("terms.highRisk")}
riskDescription={questionnaire?.riskMessages?.red ?? ""}
/>
</FlexItem>
Expand All @@ -163,6 +164,7 @@ export const ApplicationLandscape: React.FC<IApplicationLandscapeProps> = ({
{t("terms.mediumRisk")}
</Link>
}
riskTitle={t("terms.mediumRisk")}
riskDescription={questionnaire?.riskMessages?.yellow ?? ""}
/>
</FlexItem>
Expand All @@ -176,6 +178,7 @@ export const ApplicationLandscape: React.FC<IApplicationLandscapeProps> = ({
riskLabel={
<Link to={getRisksUrl(["green"])}>{t("terms.lowRisk")}</Link>
}
riskTitle={t("terms.lowRisk")}
riskDescription={questionnaire?.riskMessages?.green ?? ""}
/>
</FlexItem>
Expand All @@ -191,6 +194,7 @@ export const ApplicationLandscape: React.FC<IApplicationLandscapeProps> = ({
{`${t("terms.unassessed")}/${t("terms.unknown")}`}
</Link>
}
riskTitle={t("terms.unassessed")}
/>
</FlexItem>
</Flex>
Expand Down
6 changes: 4 additions & 2 deletions client/src/app/pages/reports/components/donut/donut.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ export interface IDonutProps {
total: number;
color: string;
riskLabel: string | React.ReactElement;
riskDescription?: string | React.ReactElement;
riskDescription?: string;
riskTitle: string;
isAssessment: boolean;
}

Expand All @@ -29,6 +30,7 @@ export const Donut: React.FC<IDonutProps> = ({
color,
riskLabel,
isAssessment,
riskTitle,
}) => {
const { t } = useTranslation();

Expand All @@ -50,7 +52,7 @@ export const Donut: React.FC<IDonutProps> = ({
}
constrainToVisibleArea={true}
data={[
{ x: riskLabel, y: value },
{ x: riskTitle, y: value },
{ x: t("terms.other"), y: total - value },
]}
labels={({ datum }) => `${datum.x}: ${datum.y}`}
Expand Down

0 comments on commit 1f99dd0

Please sign in to comment.