Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Add tooltip for weight column #1433

Merged
merged 2 commits into from
Oct 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 36 additions & 2 deletions client/src/app/components/answer-table/answer-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import spacing from "@patternfly/react-styles/css/utilities/Spacing/spacing";
import { IconedStatus } from "@app/components/IconedStatus";
import { TimesCircleIcon } from "@patternfly/react-icons";
import { WarningTriangleIcon } from "@patternfly/react-icons";

import { List, ListItem } from "@patternfly/react-core";
export interface IAnswerTableProps {
answers: Answer[];
hideAnswerKey?: boolean;
Expand Down Expand Up @@ -66,7 +66,41 @@ const AnswerTable: React.FC<IAnswerTableProps> = ({
<Tr>
<TableHeaderContentWithControls {...tableControls}>
<Th {...getThProps({ columnKey: "choice" })} />
<Th {...getThProps({ columnKey: "weight" })} />
<Th
{...getThProps({ columnKey: "weight" })}
info={{
tooltip: (
<>
<Text>
This column shows the associated risk weight of an
answered question.
</Text>
<List isPlain className={spacing.mtLg}>
<ListItem>
<IconedStatus
icon={<TimesCircleIcon />}
status="danger"
label="is High risk"
/>
</ListItem>
<ListItem>
<IconedStatus
icon={<WarningTriangleIcon />}
status="warning"
label="is Medium risk"
/>
</ListItem>
<ListItem>
<IconedStatus
preset="Ok"
label="is Low risk"
></IconedStatus>
</ListItem>
</List>
</>
),
}}
/>
</TableHeaderContentWithControls>
</Tr>
</Thead>
Expand Down
Loading