Skip to content

Conversation

@Marianaguardian
Copy link
Contributor

What does this change?

I'm handling the API call through the feature flag, and the feature flag is being passed from the frontend repo via the config.

Why?

We will look to add a feature flag to toggle to identity api call.

Reference PR
Ticket link

Reference Ticket link: #14889

Reference Subtask ticket link : #14890

Screenshots

Before After
before after

@Marianaguardian Marianaguardian linked an issue Dec 17, 2025 that may be closed by this pull request
3 tasks
@github-actions
Copy link

Hello 👋! When you're ready to run Chromatic, please apply the run_chromatic label to this PR.

You will need to reapply the label each time you want to run Chromatic.

Click here to see the Chromatic project.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a feature flag (hideNewsletterForSubscribers) to control whether the newsletter subscription check is performed, allowing the newsletter signup component to be shown regardless of a user's subscription status when the flag is disabled.

  • Added enableCheck parameter to useNewsletterSubscription hook with a default value of true
  • Connected the feature flag from the frontend config through the component chain
  • Added comprehensive test coverage for the new feature flag behavior

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
dotcom-rendering/src/lib/useNewsletterSubscription.ts Added enableCheck parameter to hook that skips API call and returns false when disabled
dotcom-rendering/src/lib/useNewsletterSubscription.test.ts Added test coverage for feature flag enabled, disabled, and default behavior scenarios
dotcom-rendering/src/lib/renderElement.tsx Passes the hideNewsletterForSubscribers switch to the newsletter component
dotcom-rendering/src/components/EmailSignUpWrapper.stories.tsx Added story demonstrating the feature flag disabled state
dotcom-rendering/src/components/EmailSignUpWrapper.importable.tsx Added hideNewsletterForSubscribers prop and passes it to the subscription hook

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link

github-actions bot commented Dec 17, 2025

Copy link

@mgosz-guardian mgosz-guardian left a comment

Choose a reason for hiding this comment

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

LGTM. One question in the comment.

@Marianaguardian Marianaguardian added the run_chromatic Runs chromatic when label is applied label Dec 22, 2025
@github-actions github-actions bot removed the run_chromatic Runs chromatic when label is applied label Dec 22, 2025
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.

Add feature flag toggle for sign-up component

4 participants