Skip to content

Commit

Permalink
Merge pull request #38 from projectsveltos/ui-fixes
Browse files Browse the repository at this point in the history
fix error messages display
  • Loading branch information
Safouene1 authored Oct 12, 2024
2 parents 8cd7d76 + c40dad7 commit 8370f7f
Showing 1 changed file with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
import { Button } from "@/components/ui/button";
import {
Check,
Copy,
ExternalLink,
ImageOff,
MoreHorizontal,
Expand All @@ -38,6 +39,11 @@ import {
resourceColumns,
} from "@/modules/clusters/cluster-information/components/AddonsTable/Columns";
import { AddonColumn, AddonTableTypes } from "@/types/addonTable.types";
import {
Tooltip,
TooltipContent,
TooltipTrigger,
} from "@/components/ui/tooltip";

export const AddonsTable = ({
data,
Expand Down Expand Up @@ -194,6 +200,34 @@ export const AddonsTable = ({
},
)}
</TableCell>
) : column.keys == AddonTableTypes.FAILURE_MESSAGE ? (
<Tooltip>
<TooltipTrigger>
{row.failureMessage && (
<TableCell>
<Button
variant="ghost"
size="icon"
onClick={() =>
navigator.clipboard.writeText(
row.failureMessage,
)
}
className="ml-2"
>
<Copy className="h-4 w-4" />
<span className="sr-only">Copy</span>
</Button>
<span className=" break-words whitespace-normal">
{row.failureMessage}
</span>
</TableCell>
)}
<TooltipContent>
<p>{row.failureMessage}</p>
</TooltipContent>
</TooltipTrigger>
</Tooltip>
) : column.keys == AddonTableTypes.STATUS ? (
<TableCell>
<Badge className={colorFromStatus(row.status)}>
Expand Down

0 comments on commit 8370f7f

Please sign in to comment.