diff --git a/client/src/app/components/IconedStatus.tsx b/client/src/app/components/IconedStatus.tsx index ff347cb3ac..fb82edfe2a 100644 --- a/client/src/app/components/IconedStatus.tsx +++ b/client/src/app/components/IconedStatus.tsx @@ -6,7 +6,7 @@ import TimesCircleIcon from "@patternfly/react-icons/dist/esm/icons/times-circle import InProgressIcon from "@patternfly/react-icons/dist/esm/icons/in-progress-icon"; import ExclamationCircleIcon from "@patternfly/react-icons/dist/esm/icons/exclamation-circle-icon"; import UnknownIcon from "@patternfly/react-icons/dist/esm/icons/unknown-icon"; -import QuestionCircleIcon from "@patternfly/react-icons/dist/esm/icons/question-circle-icon"; +import TopologyIcon from "@patternfly/react-icons/dist/esm/icons/topology-icon"; export type IconedStatusPreset = | "InheritedReviews" @@ -53,17 +53,17 @@ export const IconedStatus: React.FC = ({ const { t } = useTranslation(); const presets: IconedStatusPresetType = { InheritedReviews: { - icon: , - status: "info", - label: t("terms.inherited"), + icon: , + status: "success", + label: t("terms.completed"), tooltipMessage: t("message.inheritedReviewTooltip", { count: tooltipCount, }), }, InheritedAssessments: { - icon: , - status: "info", - label: t("terms.inherited"), + icon: , + status: "success", + label: t("terms.completed"), tooltipMessage: t("message.inheritedAssessmentTooltip", { count: tooltipCount, }), @@ -120,6 +120,22 @@ export const IconedStatus: React.FC = ({ <>{children} ); + const getTooltipContent = () => { + switch (preset) { + case "InheritedReviews": + return t("message.inheritedReviewTooltip", { + count: tooltipCount, + }); + + case "InheritedAssessments": + return t("message.inheritedAssessmentTooltip", { + count: tooltipCount, + }); + default: + return ""; + } + }; + return ( = ({ {label || presetProps?.label} + {(preset === "InheritedReviews" || preset === "InheritedAssessments") && ( + + + + + + )} ); }; diff --git a/client/src/app/components/questions-table/questions-table.tsx b/client/src/app/components/questions-table/questions-table.tsx index 40f8e7da54..4d417dec68 100644 --- a/client/src/app/components/questions-table/questions-table.tsx +++ b/client/src/app/components/questions-table/questions-table.tsx @@ -17,7 +17,7 @@ import { useTranslation } from "react-i18next"; import spacing from "@patternfly/react-styles/css/utilities/Spacing/spacing"; import { Assessment, Question, Questionnaire } from "@app/api/models"; import { useLocalTableControls } from "@app/hooks/table-controls"; -import { Label, Tooltip } from "@patternfly/react-core"; +import { Label, List, ListItem, Tooltip } from "@patternfly/react-core"; import { NoDataEmptyState } from "@app/components/NoDataEmptyState"; import AnswerTable from "@app/components/answer-table/answer-table"; import { AxiosError } from "axios"; @@ -101,28 +101,39 @@ const QuestionsTable: React.FC<{ )?.name || ""; const getConditionalTooltipContent = (question: Question) => { - const includeTags = question?.includeFor - ?.map((tag) => tag.tag) - .join(", "); - const excludeTags = question?.excludeFor - ?.map((tag) => tag.tag) - .join(", "); - return (
{t("message.dependentQuestionTooltip")}
- {includeTags && ( -
- {t("terms.include")}: {includeTags} -
+ {!!question.includeFor?.length && ( + <> +
{t("terms.include")}:
+ + {question.includeFor.map((tag, index) => ( + + + + ))} + + )} - {excludeTags && ( -
- {t("terms.exclude")}: {excludeTags} -
+ {!!question.excludeFor?.length && ( + <> +
{t("terms.exclude")}:
+ + {question.excludeFor.map((tag, index) => ( + + + + ))} + + )}
);