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

COM-1263 Prevent import of mui tooltip #2833

Open
wants to merge 3 commits into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/lucky-doors-raise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@comet/eslint-config": major
---

Prevent `@mui/material` tooltip imports

Tooltips used in Comet DXP applications should match the Comet CI.
Use tooltips from `@comet/admin` instead.
1 change: 1 addition & 0 deletions packages/admin/admin/src/common/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
ComponentsOverrides,
Popper as MuiPopper,
Theme,
// eslint-disable-next-line no-restricted-imports
Tooltip as MuiTooltip,
tooltipClasses,
TooltipClassKey as MuiTooltipClassKey,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Button, ButtonProps, ComponentsOverrides, IconButton, Tooltip } from "@mui/material";
import { Button, ButtonProps, ComponentsOverrides, IconButton } from "@mui/material";
import { css, Theme, useTheme, useThemeProps } from "@mui/material/styles";

import { Tooltip } from "../../../common/Tooltip";
import { createComponentSlot } from "../../../helpers/createComponentSlot";
import { ThemedComponentBaseProps } from "../../../helpers/ThemedComponentBaseProps";
import { useWindowSize } from "../../../helpers/useWindowSize";
Expand Down
3 changes: 2 additions & 1 deletion packages/admin/admin/src/form/FinalFormInput.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { Translate } from "@comet/admin-icons";
import { IconButton, InputBase, InputBaseProps, Tooltip } from "@mui/material";
import { IconButton, InputBase, InputBaseProps } from "@mui/material";
import { useState } from "react";
import { FieldRenderProps } from "react-final-form";
import { FormattedMessage } from "react-intl";

import { ClearInputAdornment } from "../common/ClearInputAdornment";
import { Tooltip } from "../common/Tooltip";
import { PlainTextTranslationDialog } from "../translator/PlainTextTranslationDialog";
import { useContentTranslationService } from "../translator/useContentTranslationService";

Expand Down
3 changes: 2 additions & 1 deletion packages/admin/admin/src/rowActions/RowActionsIconItem.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { IconButton, IconButtonProps, Tooltip, TooltipProps } from "@mui/material";
import { IconButton, IconButtonProps, TooltipProps } from "@mui/material";
import { forwardRef, ReactNode } from "react";

import { Tooltip } from "../common/Tooltip";
import { CommonRowActionItemProps } from "./RowActionsItem";

export interface RowActionsIconItemComponentsProps {
Expand Down
5 changes: 5 additions & 0 deletions packages/eslint-config/react.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ module.exports = {
importNames: ["GridColDef"],
message: "Please use GridColDef from @comet/admin instead",
},
{
name: "@mui/material",
importNames: ["Tooltip"],
message: "Please use Tooltip from @comet/admin instead",
},
],
},
],
Expand Down