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

551 tooltip component #615

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
3 changes: 3 additions & 0 deletions frontend/public/locales/en/translation.json
Original file line number Diff line number Diff line change
@@ -462,6 +462,9 @@
"original_text": "Original Text",
"inputs": "Inputs",
"outputs": "Outputs",
"profile" : "Profile",
"add_new_flow": "Add new flow",
"toggle_menu": "Toggle menu",
"any": "- Any -"
},
"placeholder": {
3 changes: 3 additions & 0 deletions frontend/public/locales/fr/translation.json
Original file line number Diff line number Diff line change
@@ -463,6 +463,9 @@
"original_text": "Texte par défaut",
"inputs": "Ports d'entrée",
"outputs": "Ports de sortie",
"profile": "Profil",
"add_new_flow": "Ajouter un nouveau flux",
"toggle_menu": "Basculer le menu",
"any": "- Toutes -"
},
"placeholder": {
22 changes: 22 additions & 0 deletions frontend/src/app-components/custom/MuiTooltipWrapper.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright © 2025 Hexastack. All rights reserved.
*
* Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
* 2. All derivative works must include clear attribution to the original creator and software, Hexastack and Hexabot, in a prominent location (e.g., in the software's "About" section, documentation, and README file).
*/

import { Tooltip as MuiTooltip, TooltipProps as MuiToolTipProps } from "@mui/material";
import React from "react";

export const MuiTooltipWrapper: React.FC<MuiToolTipProps> = ({
children,
placement = "top",
...props
}) => {
return (
<MuiTooltip {...props} placement={placement} arrow>
<div>{children}</div>
</MuiTooltip>
);
};
47 changes: 26 additions & 21 deletions frontend/src/components/visual-editor/v2/Diagrams.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
/*
* Copyright © 2024 Hexastack. All rights reserved.
* Copyright © 2025 Hexastack. All rights reserved.
*
* Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
* 2. All derivative works must include clear attribution to the original creator and software, Hexastack and Hexabot, in a prominent location (e.g., in the software's "About" section, documentation, and README file).
*/



import { Add, MoveUp } from "@mui/icons-material";
import DeleteIcon from "@mui/icons-material/Delete";
import EditIcon from "@mui/icons-material/Edit";
@@ -39,6 +41,7 @@ import {
} from "react";
import { useQueryClient } from "react-query";

import { MuiTooltipWrapper } from "@/app-components/custom/MuiTooltipWrapper";
import { DeleteDialog } from "@/app-components/dialogs";
import { MoveDialog } from "@/app-components/dialogs/MoveDialog";
import { CategoryDialog } from "@/components/categories/CategoryDialog";
@@ -612,26 +615,28 @@ const Diagrams = () => {
/>
))}
</Tabs>
<Button
sx={{
mt: "7px",
ml: "5px",
borderRadius: "0",
minHeight: "30px",

border: "1px solid #DDDDDD",
backgroundColor: "#F8F8F8",
borderBottom: "none",
width: "42px",
minWidth: "42px",
}}
onClick={(e) => {
addCategoryDialogCtl.openDialog();
e.preventDefault();
}}
>
<Add />
</Button>
<MuiTooltipWrapper title={t("label.add_new_flow")}>
<Button
sx={{
mt: "7px",
ml: "5px",
borderRadius: "0",
minHeight: "30px",

border: "1px solid #DDDDDD",
backgroundColor: "#F8F8F8",
borderBottom: "none",
width: "42px",
minWidth: "42px",
}}
onClick={(e) => {
addCategoryDialogCtl.openDialog();
e.preventDefault();
}}
>
<Add />
</Button>
</MuiTooltipWrapper>
</Grid>
<Grid container>
<Grid
23 changes: 15 additions & 8 deletions frontend/src/layout/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
/*
* Copyright © 2024 Hexastack. All rights reserved.
* Copyright © 2025 Hexastack. All rights reserved.
*
* Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
* 2. All derivative works must include clear attribution to the original creator and software, Hexastack and Hexabot, in a prominent location (e.g., in the software's "About" section, documentation, and README file).
*/



import MenuIcon from "@mui/icons-material/Menu";
import {
Avatar,
@@ -19,6 +21,7 @@ import {
import MuiAppBar, { AppBarProps as MuiAppBarProps } from "@mui/material/AppBar";
import { FC, useEffect, useRef, useState } from "react";

import { MuiTooltipWrapper } from "@/app-components/custom/MuiTooltipWrapper";
import { HexabotLogo } from "@/app-components/logos/HexabotLogo";
import { PopoverMenu } from "@/app-components/menus/PopoverMenu";
import { getAvatarSrc } from "@/components/inbox/helpers/mapMessages";
@@ -99,7 +102,9 @@ export const Header: FC<HeaderProps> = ({ isSideBarOpen, onToggleSidebar }) => {
onClick={onToggleSidebar}
isToggled={isSideBarOpen}
>
<MenuIcon />
<MuiTooltipWrapper title={t("label.toggle_menu")} placement="right">
<MenuIcon />
</MuiTooltipWrapper>
</StyledIconButton>
) : null}
</Toolbar>
@@ -158,12 +163,14 @@ export const Header: FC<HeaderProps> = ({ isSideBarOpen, onToggleSidebar }) => {
{user?.email}
</Typography>
</Box>
<Avatar
src={getAvatarSrc(apiUrl, EntityType.USER, user?.id).concat(
`?${randomSeed}`,
)}
color={theme.palette.text.secondary}
/>
<MuiTooltipWrapper title={t("label.profile")} placement="bottom">
<Avatar
src={getAvatarSrc(apiUrl, EntityType.USER, user?.id).concat(
`?${randomSeed}`,
)}
color={theme.palette.text.secondary}
/>
</MuiTooltipWrapper>
</Box>

{user ? (