import classnames from "classnames"; import { uniqueId } from "lodash"; import { ITooltipWrapper } from "components/TooltipWrapper/TooltipWrapper"; import useGitOpsMode from "hooks/useGitOpsMode"; import { IGitOpsExceptions } from "interfaces/config"; import React, { useLayoutEffect, useMemo, useRef, useState } from "react"; import { Tooltip as ReactTooltip5 } from "react-tooltip-5"; import { getGitOpsModeTipContent } from "utilities/helpers"; interface IGitOpsModeTooltipWrapper { renderChildren: (disableChildren?: boolean) => React.ReactNode; /** Position left is used for forms partially disabled by gitops mode (e.g. settings/organization/advanced) */ position?: ITooltipWrapper["position"]; tipOffset?: ITooltipWrapper["tipOffset"]; fixedPositionStrategy?: ITooltipWrapper["fixedPositionStrategy"]; // When specified, the wrapper checks the exception for this entity type. // If the entity is excepted, children remain enabled even in GitOps mode. entityType?: keyof IGitOpsExceptions; /** Set to true when wrapping an input/dropdown or a group of them that must stretch to the * full form width. By default the wrapper hugs its content so the tooltip centers on the * control; inputs opt back into full width. */ isInputField?: boolean; } const baseClass = "gitops-mode-tooltip-wrapper"; // The label/control row of a wrapped FormField. FormField renders the label as a // direct-child