Skip to content

Commit

Permalink
Merge pull request #851 from VEuPathDB/allow-html-in-table-column-too…
Browse files Browse the repository at this point in the history
…ltips

Allow html in result table column tooltips
  • Loading branch information
jernestmyers authored Feb 15, 2024
2 parents 3cf63c0 + 2e85bf9 commit 78e36f1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
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

0 comments on commit 78e36f1

Please sign in to comment.