Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

feat(frontend): tag the settings-billing paying surfaces for DataFast (#14187)

Nicholas Tindle3c13eb497361
diff --git a/autogpt_platform/frontend/src/app/(platform)/settings/billing/components/AutomationCreditsTab/BalanceCard/BalanceCard.tsx b/autogpt_platform/frontend/src/app/(platform)/settings/billing/components/AutomationCreditsTab/BalanceCard/BalanceCard.tsx
index 8edbf34649..ba06a55ec3 100644
--- a/autogpt_platform/frontend/src/app/(platform)/settings/billing/components/AutomationCreditsTab/BalanceCard/BalanceCard.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/settings/billing/components/AutomationCreditsTab/BalanceCard/BalanceCard.tsx
@@ -112,6 +112,8 @@ export function BalanceCard({ index = 0 }: Props) {
disabled={!isValid || isAdding}
loading={isAdding}
onClick={handleSubmit}
+ data-fast-goal="credit_topup_checkout"
+ data-fast-goal-surface="settings_billing"
>
Continue to checkout
</Button>
diff --git a/autogpt_platform/frontend/src/app/(platform)/settings/billing/components/SubscriptionTab/PaymentMethodCard/PaymentMethodCard.tsx b/autogpt_platform/frontend/src/app/(platform)/settings/billing/components/SubscriptionTab/PaymentMethodCard/PaymentMethodCard.tsx
index e3672f68ed..935dc68359 100644
--- a/autogpt_platform/frontend/src/app/(platform)/settings/billing/components/SubscriptionTab/PaymentMethodCard/PaymentMethodCard.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/settings/billing/components/SubscriptionTab/PaymentMethodCard/PaymentMethodCard.tsx
@@ -47,6 +47,8 @@ export function PaymentMethodCard({ index = 0 }: Props) {
variant="secondary"
size="small"
onClick={onManage}
+ data-fast-goal="billing_portal_open"
+ data-fast-goal-surface="settings_payment_method"
disabled={!canManage}
loading={isOpening}
>
diff --git a/autogpt_platform/frontend/src/app/(platform)/settings/billing/components/SubscriptionTab/YourPlanCard/SwitchCycleDialog.tsx b/autogpt_platform/frontend/src/app/(platform)/settings/billing/components/SubscriptionTab/YourPlanCard/SwitchCycleDialog.tsx
index 465209d6c7..f7f8dcd0b2 100644
--- a/autogpt_platform/frontend/src/app/(platform)/settings/billing/components/SubscriptionTab/YourPlanCard/SwitchCycleDialog.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/settings/billing/components/SubscriptionTab/YourPlanCard/SwitchCycleDialog.tsx
@@ -69,6 +69,8 @@ export function SwitchCycleDialog({
variant="primary"
size="small"
onClick={onConfirm}
+ data-fast-goal="subscription_cycle_confirm"
+ data-fast-goal-surface="settings_billing"
disabled={isSaving}
loading={isSaving}
>
diff --git a/autogpt_platform/frontend/src/app/(platform)/settings/billing/components/SubscriptionTab/YourPlanCard/SwitchTierDialog.tsx b/autogpt_platform/frontend/src/app/(platform)/settings/billing/components/SubscriptionTab/YourPlanCard/SwitchTierDialog.tsx
index 25bc765898..1907bbae87 100644
--- a/autogpt_platform/frontend/src/app/(platform)/settings/billing/components/SubscriptionTab/YourPlanCard/SwitchTierDialog.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/settings/billing/components/SubscriptionTab/YourPlanCard/SwitchTierDialog.tsx
@@ -55,6 +55,8 @@ export function SwitchTierDialog({
onClick={onConfirm}
disabled={isSaving}
loading={isSaving}
+ data-fast-goal="subscription_change_confirm"
+ data-fast-goal-surface="settings_billing"
>
{confirmLabel ?? `Upgrade to ${targetTierLabel}`}
</Button>
diff --git a/autogpt_platform/frontend/src/app/(platform)/settings/billing/components/SubscriptionTab/YourPlanCard/YourPlanCard.tsx b/autogpt_platform/frontend/src/app/(platform)/settings/billing/components/SubscriptionTab/YourPlanCard/YourPlanCard.tsx
index 6f3e9a330c..9ef0403df3 100644
--- a/autogpt_platform/frontend/src/app/(platform)/settings/billing/components/SubscriptionTab/YourPlanCard/YourPlanCard.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/settings/billing/components/SubscriptionTab/YourPlanCard/YourPlanCard.tsx
@@ -172,6 +172,8 @@ export function YourPlanCard({ index = 0 }: Props) {
size="small"
onClick={onManage}
disabled={!canManagePortal}
+ data-fast-goal="billing_portal_open"
+ data-fast-goal-surface="settings_billing"
>
Manage subscription
</Button>
@@ -183,6 +185,10 @@ export function YourPlanCard({ index = 0 }: Props) {
onClick={onUpgrade}
disabled={isUpdatingTier}
loading={isUpdatingTier && !plan.nextTierIsTeamLink}
+ data-fast-goal="subscription_upgrade_click"
+ data-fast-goal-from={plan.label}
+ data-fast-goal-to={plan.nextTierLabel}
+ data-fast-goal-surface="settings_billing"
rightIcon={
plan.nextTierIsTeamLink ? (
<Icon icon={LinkSquare01Icon} size={14} aria-hidden="true" />
diff --git a/autogpt_platform/frontend/src/components/atoms/Button/Button.tsx b/autogpt_platform/frontend/src/components/atoms/Button/Button.tsx
index 5e4bc953a3..99b9ac45da 100644
--- a/autogpt_platform/frontend/src/components/atoms/Button/Button.tsx
+++ b/autogpt_platform/frontend/src/components/atoms/Button/Button.tsx
@@ -112,8 +112,16 @@ export function Button(props: ButtonProps) {
);
}
+ // Spread first so `className` and `disabled` below still win. Without this
+ // the loading branch silently drops every extra prop the caller passed —
+ // aria-label, data-testid, analytics data-* — the moment a click flips it
+ // into loading, which is exactly when a click listener needs to read them.
const loadingButton = (
- <button className={loadingClassName} disabled>
+ <button
+ {...(restProps as React.ButtonHTMLAttributes<HTMLButtonElement>)}
+ className={loadingClassName}
+ disabled
+ >
<Icon icon={Loading03Icon} className="h-4 w-4 animate-spin" />
{children}
</button>