Skip to content

Commit 42b5f1e

Browse files
authored
fix: BROS-304: Image tag is not loading on playground (#8122)
1 parent f51805d commit 42b5f1e

File tree

4 files changed

+9
-33
lines changed

4 files changed

+9
-33
lines changed

web/libs/core/src/lib/utils/feature-flags/flags.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,3 @@ export const FF_NEW_STORAGES = "fflag_feat_bros_193_new_cloud_storage_providers_
105105
* Datamanager filter members
106106
*/
107107
export const FF_DM_FILTER_MEMBERS = "fflag_feat_fit_449_datamanager_filter_members_short";
108-
109-
/**
110-
* Allow tooltip working with the disabled button
111-
*
112-
* @link https://app.launchdarkly.com/projects/default/flags/fflag_feat_front_fit_418_tooltip_enhancements_short
113-
*/
114-
export const FF_TOOLTIP_ENHANCEMENT = "fflag_feat_front_fit_418_tooltip_enhancements_short";

web/libs/ui/src/lib/Tooltip/Tooltip.tsx

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { ff } from "@humansignal/core";
21
import {
32
Children,
43
cloneElement,
@@ -19,8 +18,6 @@ import { setRef } from "@humansignal/core/lib/utils/unwrapRef";
1918
import styles from "./Tooltip.module.scss";
2019
import clsx from "clsx";
2120

22-
const isEnhancedTooltip = ff.isActive(ff.FF_TOOLTIP_ENHANCEMENT);
23-
2421
export type TooltipProps = PropsWithChildren<{
2522
title: React.ReactNode;
2623
alignment?: Align;
@@ -189,16 +186,15 @@ const TooltipInner = forwardRef(
189186
setRef(triggerElement, el);
190187
setRef(ref, el);
191188
},
192-
...(!isEnhancedTooltip || !needFallback ? { onMouseEnter, onMouseLeave } : {}),
189+
...(!needFallback ? { onMouseEnter, onMouseLeave } : {}),
193190
});
194-
const element =
195-
isEnhancedTooltip && needFallback ? (
196-
<span className={styles.wrapper} onMouseEnter={onMouseEnter} onMouseLeave={onMouseLeave}>
197-
{clone}
198-
</span>
199-
) : (
200-
clone
201-
);
191+
const element = needFallback ? (
192+
<span className={styles.wrapper} onMouseEnter={onMouseEnter} onMouseLeave={onMouseLeave}>
193+
{clone}
194+
</span>
195+
) : (
196+
clone
197+
);
202198

203199
useEffect(() => {
204200
if (injected) performAnimation(true);

web/libs/ui/src/lib/Tooltip/tooltip.stories.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
import { ff } from "@humansignal/core";
21
import type { Meta, StoryObj } from "@storybook/react";
32
import { Tooltip } from "./Tooltip";
43
import { Button } from "../button/button";
54

6-
const isEnhancedTooltip = ff.isActive(ff.FF_TOOLTIP_ENHANCEMENT);
7-
85
const meta: Meta<typeof Tooltip> = {
96
component: Tooltip,
107
title: "UI/Tooltip",
@@ -79,7 +76,7 @@ export const WithDisabledButton: Story = {
7976
return (
8077
<div className="flex items-center gap-tight">
8178
<Tooltip {...props} title="This button is disabled for the reason that it is disabled">
82-
<Button disabled>{isEnhancedTooltip ? "hover over me" : "Do not work without related feature flag"}</Button>
79+
<Button disabled>hover over me</Button>
8380
</Tooltip>
8481
</div>
8582
);

web/libs/ui/src/lib/button/button.tsx

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
import { ff } from "@humansignal/core";
21
import { cn } from "../../utils/utils";
32
import { forwardRef, type MouseEvent, type ButtonHTMLAttributes, type PropsWithChildren, type ReactNode } from "react";
43
import styles from "./button.module.scss";
54
import { setRef } from "@humansignal/core/lib/utils/unwrapRef";
65
import { Tooltip } from "../Tooltip/Tooltip";
76

8-
const isEnhancedTooltip = ff.isActive(ff.FF_TOOLTIP_ENHANCEMENT);
9-
107
const variants = {
118
primary: styles["variant-primary"],
129
neutral: styles["variant-neutral"],
@@ -186,13 +183,6 @@ const Button = forwardRef(
186183

187184
if (tooltip) {
188185
// For disabled buttons, wrap in a container that can receive hover events
189-
if (!isEnhancedTooltip && isDisabled) {
190-
return (
191-
<Tooltip title={tooltip}>
192-
<span style={{ display: "inline-flex" }}>{buttonBody}</span>
193-
</Tooltip>
194-
);
195-
}
196186
return <Tooltip title={tooltip}>{buttonBody}</Tooltip>;
197187
}
198188

0 commit comments

Comments
 (0)