Skip to content

MNTOR-4592 + MNTOR-4530 - Add feature flag to UpsellBadge #5981

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

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

codemist
Copy link
Collaborator

References:

Jira: MNTOR-4592 and MNTOR-4530
Figma:

Description

Screenshot (if applicable)

Not applicable.

How to test

Checklist (Definition of Done)

  • Localization strings (if needed) have been added.
  • Commits in this PR are minimal and have descriptive commit messages.
  • I've added or updated the relevant sections in readme and/or code comments
  • I've added a unit test to test for potential regressions of this bug.
  • If this PR implements a feature flag or experimentation, I've checked that it still works with the flag both on, and with the flag off.
  • If this PR implements a feature flag or experimentation, the Ship Behind Feature Flag status in Jira has been set
  • Product Owner accepted the User Story (demo of functionality completed) or waived the privilege.
  • All acceptance criteria are met.
  • Jira ticket has been updated (if needed) to match changes made during the development process.
  • Jira ticket has been updated (if needed) with suggestions for QA when this PR is deployed to stage.

@codemist codemist requested review from flozia and Vinnl June 24, 2025 15:09
flozia
flozia previously approved these changes Jun 25, 2025
Copy link
Collaborator

@flozia flozia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: Would the UpsellDialog not need to show only when dialogState.isOpen && !props.enabledFeatureFlags.includes("DisableOneRepScans")?

@flozia flozia self-requested a review June 25, 2025 15:34
@@ -309,6 +309,7 @@ export const DashboardTopBannerContent = (props: DashboardTopBannerProps) => {
monthlySubscriptionUrl={monthlySubscriptionUrl}
yearlySubscriptionUrl={yearlySubscriptionUrl}
subscriptionBillingAmount={subscriptionBillingAmount}
enabledFeatureFlags={props.enabledFeatureFlags}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like we also need to add the prop enabledFeatureFlags to the story in UpsellCta.stories.tsx as it seems to break at the moment due to this change.

@flozia flozia dismissed their stale review June 25, 2025 15:45

Found breaking changes.

@@ -53,6 +53,7 @@ const UpsellCtaWrapper = (props: UpsellCtaWrapperProps) => {
monthlySubscriptionUrl={monthlySubscriptionUrl}
yearlySubscriptionUrl={yearlySubscriptionUrl}
subscriptionBillingAmount={subscriptionBillingAmount}
enabledFeatureFlags={props.enabledFeatureFlags}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@flozia Didn't I already add it here?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m seeing the following error in the Story:
image

@codemist
Copy link
Collaborator Author

codemist commented Jun 25, 2025

@flozia The upsell badge can still be visible, but if the flag is enabled it should show the waitlist popup instead.

@codemist codemist requested a review from flozia June 25, 2025 18:23
@@ -53,6 +53,7 @@ const UpsellCtaWrapper = (props: UpsellCtaWrapperProps) => {
monthlySubscriptionUrl={monthlySubscriptionUrl}
yearlySubscriptionUrl={yearlySubscriptionUrl}
subscriptionBillingAmount={subscriptionBillingAmount}
enabledFeatureFlags={props.enabledFeatureFlags}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m seeing the following error in the Story:
image

Comment on lines +73 to +74
{dialogState.isOpen &&
(props.enabledFeatureFlags.includes("DisableOneRepScans") ? (
Copy link
Collaborator

@flozia flozia Jun 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@flozia The upsell badge can still be visible, but if the flag is enabled it should show the waitlist popup instead.

@codemist The newly introduced condition now says: “If the dialog is open AND the feature flag DisableOneRepScans is enabled, show the WaitlistDialog. Otherwise, show the UpsellDialog”. Doesn’t that mean that if dialogState.isOpen === false we show the UpsellDialog, which seems like it is not the intended behaviour?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dialog (Upsell or Waitlist) is only shown when dialogState.isOpen is true. If the dialog is closed, nothing is rendered. The && in JSX ensures that neither dialog appears unless the dialog is open, so there’s no risk of the UpsellDialog showing when it shouldn’t.

@codemist
Copy link
Collaborator Author

I don't think the failing test here has anything to do with the changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants