From af90c55a01c9fe5afed14b1d74bc4c9549cfc89b Mon Sep 17 00:00:00 2001 From: minhtuevo Date: Mon, 18 Nov 2024 15:55:57 -0800 Subject: [PATCH 1/3] Added tooltip to actions --- .../plugins/SchemaIO/components/ActionsMenu.tsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/app/packages/core/src/plugins/SchemaIO/components/ActionsMenu.tsx b/app/packages/core/src/plugins/SchemaIO/components/ActionsMenu.tsx index b75c4991f6..08c41781e3 100644 --- a/app/packages/core/src/plugins/SchemaIO/components/ActionsMenu.tsx +++ b/app/packages/core/src/plugins/SchemaIO/components/ActionsMenu.tsx @@ -9,6 +9,7 @@ import { Menu, MenuItem, Stack, + Tooltip } from "@mui/material"; import React, { useCallback } from "react"; import { getColorByCode } from "../utils"; @@ -73,7 +74,7 @@ function ActionsOverflowMenu(props: ActionsPropsType) { } function Action(props: ActionPropsType) { - const { label, name, onClick, icon, variant, mode, color, size } = props; + const { label, name, onClick, icon, variant, mode, color, size, tooltip } = props; const resolvedColor = color ? getColorByCode(color) : undefined; const Icon = icon ? ( @@ -87,7 +88,7 @@ function Action(props: ActionPropsType) { [onClick, props] ); - return mode === "inline" ? ( + const content = mode === "inline" ? ( - ) : ( - - {Icon && {Icon}} - {label || name} - - ); + const content = + mode === "inline" ? ( + + ) : ( + + {Icon && {Icon}} + + {label || name} + + + ); return tooltip ? ( - {content} {/* Use to wrap the child to avoid DOM issues */} + {content}{" "} + {/* Use to wrap the child to avoid DOM issues */} ) : ( content diff --git a/app/packages/core/src/plugins/SchemaIO/components/TableView.tsx b/app/packages/core/src/plugins/SchemaIO/components/TableView.tsx index 7deb8e852e..8567db0760 100644 --- a/app/packages/core/src/plugins/SchemaIO/components/TableView.tsx +++ b/app/packages/core/src/plugins/SchemaIO/components/TableView.tsx @@ -141,8 +141,9 @@ export default function TableView(props: ViewPropsType) { {hasRowActions && ( { handleCellClick(-1, -1); }}