Feat UI improve troubleshooting profile messaging (#16590)

related to #16417

Improve the error messages for windows mdm profile errors.

This will now format the errors in the UI tooltip


![image](https://github.com/fleetdm/fleet/assets/1153709/a3f69d84-639f-47e9-b361-1cd7be238235)
This commit is contained in:
Gabriel Hernandez
2024-02-08 13:28:26 -03:00
committed by GitHub
parent ab55bd7bfd
commit f0cb1017b6
4 changed files with 65 additions and 7 deletions
@@ -7,7 +7,10 @@ import { DEFAULT_EMPTY_CELL_VALUE } from "utilities/constants";
import { COLORS } from "styles/var/colors";
interface ITooltipTruncatedTextCellProps {
value: string | number | boolean;
value: React.ReactNode;
/** Tooltip to dispay. If this is provided then this will be rendered as the tooltip content. If
* not the value will be displayed as the tooltip content. Defaults to `undefined` */
tooltip?: React.ReactNode;
/** If set to `true` the text inside the tooltip will break on words instead of any character.
* By default the tooltip text breaks on any character.
* Default is `false`.
@@ -20,6 +23,7 @@ const baseClass = "tooltip-truncated-cell";
const TooltipTruncatedTextCell = ({
value,
tooltip,
tooltipBreakOnWord = false,
classes = "w250",
}: ITooltipTruncatedTextCellProps): JSX.Element => {
@@ -56,7 +60,7 @@ const TooltipTruncatedTextCell = ({
delayHide={200} // need delay set to hover using clickable
>
<>
{value}
{tooltip ?? value}
<div className="safari-hack">&nbsp;</div>
{/* Fixes triple click selecting next element in Safari */}
</>