Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

Remove forceActiveStyle prop from ActionButton (#63869)

Kamil Mielnik19f279610b2a
diff --git a/frontend/src/metabase/common/components/ActionButton/ActionButton.tsx b/frontend/src/metabase/common/components/ActionButton/ActionButton.tsx
index 9d53ee93c37..244229c26c4 100644
--- a/frontend/src/metabase/common/components/ActionButton/ActionButton.tsx
+++ b/frontend/src/metabase/common/components/ActionButton/ActionButton.tsx
@@ -14,7 +14,7 @@ import ButtonsS from "metabase/css/components/buttons.module.css";
import CS from "metabase/css/core/index.css";
import type { CancellablePromise } from "metabase/lib/promise";
import { cancelable } from "metabase/lib/promise";
-import { Center, Icon, Loader } from "metabase/ui";
+import { Center, Group, Icon, Loader } from "metabase/ui";
export interface ActionButtonProps extends Omit<ButtonProps, "onClick"> {
// need to expose this ref to allow Tooltip to bind to the correct element
@@ -28,7 +28,6 @@ export interface ActionButtonProps extends Omit<ButtonProps, "onClick"> {
className?: string;
successClassName?: string;
failedClassName?: string;
- forceActiveStyle?: boolean;
children?: React.ReactNode;
}
@@ -48,7 +47,6 @@ const ActionButton = forwardRef<ActionButtonHandle, ActionButtonProps>(
className = ButtonsS.Button,
successClassName = ButtonsS.ButtonSuccess, // not used
failedClassName = ButtonsS.ButtonDanger, // not used
- forceActiveStyle = false,
children,
innerRef,
...buttonProps
@@ -122,15 +120,11 @@ const ActionButton = forwardRef<ActionButtonHandle, ActionButtonProps>(
{...buttonProps}
ref={innerRef}
data-action-status={actionStatus}
- className={
- forceActiveStyle
- ? ButtonsS.Button
- : cx(className, {
- [successClassName]: result === "success",
- [failedClassName]: result === "failed",
- [CS.pointerEventsNone]: isActionDisabled,
- })
- }
+ className={cx(className, {
+ [successClassName]: result === "success",
+ [failedClassName]: result === "failed",
+ [CS.pointerEventsNone]: isActionDisabled,
+ })}
onClick={handleClick}
>
{active ? (
@@ -142,10 +136,10 @@ const ActionButton = forwardRef<ActionButtonHandle, ActionButtonProps>(
activeText
)
) : result === "success" ? (
- <span>
- {forceActiveStyle ? null : <Icon name="check" size={12} />}
- <span className={CS.ml1}>{successText}</span>
- </span>
+ <Group align="center" gap="sm">
+ <Icon name="check" />
+ <span>{successText}</span>
+ </Group>
) : result === "failed" ? (
failedText
) : (
diff --git a/frontend/src/metabase/common/components/SendTestPulse/SendTestPulse.jsx b/frontend/src/metabase/common/components/SendTestPulse/SendTestPulse.jsx
index 4a044b6ed90..2902c76e655 100644
--- a/frontend/src/metabase/common/components/SendTestPulse/SendTestPulse.jsx
+++ b/frontend/src/metabase/common/components/SendTestPulse/SendTestPulse.jsx
@@ -36,7 +36,6 @@ export default class SendTestPulse extends Component {
activeText={t`Sending…`}
failedText={t`Sending failed`}
successText={successText}
- forceActiveStyle={true}
/>
);
}