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

Allow html in result table column tooltips #851

Merged
merged 2 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
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
5 changes: 3 additions & 2 deletions packages/libs/coreui/src/components/Mesa/Ui/HeadingCell.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,13 @@ class HeadingCell extends React.PureComponent {
const { top, left, height } = offset ? offset : {};
const position = { top: top + height, left };

if (!column.helpText) return null;
if (!column.helpText && !column.htmlHelp) return null;
return (
<Tooltip
position={position}
className="Trigger HelpTrigger"
content={column.helpText}
content={column.htmlHelp ?? column.helpText}
renderHtml={!!column.htmlHelp}
>
<Icon fa="question-circle" />
</Tooltip>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const attributeFieldDecoder: Decode.Decoder<AttributeField> =
Decode.combine(
namedModelEntityDecoder,
Decode.field('help', Decode.optional(Decode.string)),
Decode.field('htmlHelp', Decode.optional(Decode.string)),
Decode.field('align', Decode.optional(Decode.string)),
Decode.field('isSortable', Decode.boolean),
Decode.field('isRemovable', Decode.boolean),
Expand Down
1 change: 1 addition & 0 deletions packages/libs/wdk-client/src/Utils/WdkModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ export type ParamUIState =

export interface AttributeField extends NamedModelEntity {
help?: string;
htmlHelp?: string;
align?: string;
isSortable: boolean;
isRemovable: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ function getColumns({
attribute.name !== recordClass.recordIdAttributeName &&
attribute.isRemovable,
helpText: attribute.help,
htmlHelp: attribute.htmlHelp,
name: attribute.displayName,
renderCell: ({ row, key }: { row: RecordInstance; key: string }) =>
key === recordClass.recordIdAttributeName ? (
Expand Down
Loading