Skip to content
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

Don't ignore allowlist on "Welcome to Plus" page, remove "HowItWorksPage" flag #4897

Merged
merged 3 commits into from
Aug 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ export const FlagEditor = (props: { flag: FeatureFlagRow }) => {
{(props.flag.allow_list?.length ?? 0) -
unAllowlistedAddresses.length ===
0 && newAllowlistedAddresses.length === 0 ? (
<>Enabled for everyone</>
<>
{props.flag.is_enabled
? "Enabled for everyone"
: "Would be enabled for everyone"}
</>
) : (
<>Only enable for:</>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ const DashboardWrapper = (props: DashboardWrapperProps) => {
session={mockedSession}
nonce=""
countryCode={props.countryCode}
howItWorksFlagEnabled
>
<DashboardEl
user={user}
Expand All @@ -214,7 +213,6 @@ const DashboardWrapper = (props: DashboardWrapperProps) => {
}
enabledFeatureFlags={[
...(props.enabledFeatureFlags ?? []),
"HowItWorksPage",
"SetExpectationsForUsers",
]}
experimentData={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,22 +264,20 @@ export const DashboardTopBannerContent = (props: DashboardTopBannerProps) => {
</>
)}
</div>
{enabledFeatureFlags.includes("HowItWorksPage") && (
<Link
data-testid="learn-more-link-to-how-it-works"
href="/how-it-works"
target="_blank"
onClick={() =>
recordTelemetry("link", "click", {
link_id: "learn_more",
})
}
>
{l10n.getString(
"dashboard-top-banner-monitor-protects-your-even-more-learn-more",
)}
</Link>
)}
<Link
data-testid="learn-more-link-to-how-it-works"
href="/how-it-works"
target="_blank"
onClick={() =>
recordTelemetry("link", "click", {
link_id: "learn_more",
})
}
>
{l10n.getString(
"dashboard-top-banner-monitor-protects-your-even-more-learn-more",
)}
</Link>
</>
);
case "UsUserNonPremiumNoExposures":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,7 @@ export const AutomaticRemoveViewStory: Story = {
name: "1d. Automatically resolve brokers",
render: () => {
return (
<Shell
l10n={getL10n()}
session={mockedSession}
nonce=""
countryCode="us"
howItWorksFlagEnabled
>
<Shell l10n={getL10n()} session={mockedSession} nonce="" countryCode="us">
<AutomaticRemoveView
data={{
countryCode: "us",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,7 @@ export const ManualRemoveViewStory: Story = {
name: "1c. Manually resolve brokers",
render: () => {
return (
<Shell
l10n={getL10n()}
session={mockedSession}
nonce=""
countryCode="us"
howItWorksFlagEnabled
>
<Shell l10n={getL10n()} session={mockedSession} nonce="" countryCode="us">
<ManualRemoveView
scanData={mockedScanData}
breaches={mockedBreaches}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,7 @@ export const StartFreeScanViewStory: Story = {
name: "1a. Free scan",
render: () => {
return (
<Shell
l10n={getL10n()}
session={mockedSession}
nonce=""
countryCode="us"
howItWorksFlagEnabled
>
<Shell l10n={getL10n()} session={mockedSession} nonce="" countryCode="us">
<StartFreeScanView
data={{
countryCode: "us",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,7 @@ const ViewWrapper = (props: ViewWrapperProps) => {
const l10n = getL10n();

return (
<Shell
l10n={l10n}
session={mockedSession}
nonce=""
countryCode="us"
howItWorksFlagEnabled
>
<Shell l10n={l10n} session={mockedSession} nonce="" countryCode="us">
<ViewDataBrokersView
data={{
latestScanData: scanData,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,7 @@ const mockedSession = {

const WelcomeToPlusViewWrapper = (props: { brokerScanCount: number }) => {
return (
<Shell
l10n={l10n}
session={mockedSession}
nonce=""
countryCode="us"
howItWorksFlagEnabled
>
<Shell l10n={l10n} session={mockedSession} nonce="" countryCode="us">
<WelcomeToPlusView
data={{
countryCode: "us",
Expand All @@ -77,7 +71,7 @@ const WelcomeToPlusViewWrapper = (props: { brokerScanCount: number }) => {
}}
l10n={l10n}
subscriberEmails={[]}
enabledFeatureFlags={["HowItWorksPage", "SetExpectationsForUsers"]}
enabledFeatureFlags={["SetExpectationsForUsers"]}
/>
</Shell>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ export function WelcomeToPlusView(props: Props) {
)}
</p>
<p>
{hasRelevantScanResults &&
props.enabledFeatureFlags.includes("HowItWorksPage")
{hasRelevantScanResults
? /* c8 ignore next 23 */
// As the `SetExpectationsForUsers` feature flag is removed, the
// branch will be covered again:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ export default async function WelcomeToPlusPage() {
};

const enabledFeatureFlags = await getEnabledFeatureFlags({
ignoreAllowlist: true,
ignoreAllowlist: false,
email: session.user.email,
});

// If the current user is a subscriber and their OneRep profile is not
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ const HighRiskBreachWrapper = (props: {
session={mockedSession}
nonce=""
countryCode={data.countryCode}
howItWorksFlagEnabled
>
<HighRiskBreachLayout
subscriberEmails={[]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,7 @@ const LeakedPasswordsWrapper = (props: {
}

return (
<Shell
l10n={getL10n()}
session={mockedSession}
nonce=""
countryCode="nl"
howItWorksFlagEnabled
>
<Shell l10n={getL10n()} session={mockedSession} nonce="" countryCode="nl">
<LeakedPasswordsLayout
subscriberEmails={[]}
type={props.type}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,7 @@ const SecurityRecommendationsWrapper = (props: {
type: SecurityRecommendationTypes;
}) => {
return (
<Shell
l10n={getL10n()}
session={mockedSession}
nonce=""
countryCode="nl"
howItWorksFlagEnabled
>
<Shell l10n={getL10n()} session={mockedSession} nonce="" countryCode="nl">
<SecurityRecommendationsLayout
subscriberEmails={[]}
type={props.type}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,13 @@ import { Shell } from "../../../Shell";
import { headers } from "next/headers";
import { AutoSignIn } from "../../../../../components/client/AutoSignIn";
import { getCountryCode } from "../../../../../functions/server/getCountryCode";
import { getEnabledFeatureFlags } from "../../../../../../db/tables/featureFlags";

export default async function Layout({ children }: { children: ReactNode }) {
const l10nBundles = getL10nBundles();
const l10n = getL10n(l10nBundles);
const session = await getServerSession();
const headersList = headers();
const countryCode = getCountryCode(headersList);
const enabledFeatureFlags = await getEnabledFeatureFlags({
ignoreAllowlist: true,
});
const howItWorksFlagEnabled = enabledFeatureFlags.includes("HowItWorksPage");

if (!session) {
return <AutoSignIn />;
Expand All @@ -37,7 +32,6 @@ export default async function Layout({ children }: { children: ReactNode }) {
session={session}
nonce={nonce}
countryCode={countryCode}
howItWorksFlagEnabled={howItWorksFlagEnabled}
>
{children}
</Shell>
Expand Down
6 changes: 1 addition & 5 deletions src/app/(proper_react)/(redesign)/(public)/PublicShell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,7 @@ export const PublicShell = (props: Props) => {
</nav>
</header>
<div className={styles.content}>{props.children}</div>
<Footer
l10n={props.l10n}
countryCode={props.countryCode}
howItWorksFlagEnabled
/>
<Footer l10n={props.l10n} countryCode={props.countryCode} />
</div>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
monthlySubscribersQuota,
} from "../../../../functions/server/onerep";
import { CONST_DAY_MILLISECONDS } from "../../../../../constants";
import { getEnabledFeatureFlags } from "../../../../../db/tables/featureFlags";

export default async function Page() {
const headersList = headers();
Expand All @@ -30,11 +29,7 @@ export default async function Page() {
typeof oneRepActivations === "undefined" ||
oneRepActivations > monthlySubscribersQuota;

const featureFlags = await getEnabledFeatureFlags({
ignoreAllowlist: true,
});

if (countryCode !== "us" || !featureFlags.includes("HowItWorksPage")) {
if (countryCode !== "us") {
return redirect("/");
}

Expand Down
4 changes: 1 addition & 3 deletions src/app/(proper_react)/(redesign)/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,10 @@ export const Footer = ({
l10n,
session,
countryCode,
howItWorksFlagEnabled,
}: {
l10n: ExtendedReactLocalization;
session?: Session;
countryCode: string;
howItWorksFlagEnabled: boolean;
}) => {
return (
<footer className={styles.footer}>
Expand All @@ -47,7 +45,7 @@ export const Footer = ({
{l10n.getString("footer-nav-all-breaches")}
</TelemetryLink>
</li>
{countryCode === "us" && !session && howItWorksFlagEnabled && (
{countryCode === "us" && !session && (
<li>
<TelemetryLink
href="/how-it-works"
Expand Down
3 changes: 1 addition & 2 deletions src/app/(proper_react)/(redesign)/MobileShell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export type Props = {
};
fxaSettingsUrl: string;
children: ReactNode;
howItWorksFlagEnabled: boolean;
};

export const MobileShell = (props: Props) => {
Expand Down Expand Up @@ -144,7 +143,7 @@ export const MobileShell = (props: Props) => {
{l10n.getString("main-nav-link-settings-label")}
</PageLink>
</li>
{props.countryCode === "us" && props.howItWorksFlagEnabled && (
{props.countryCode === "us" && (
<li key="how-it-works">
<PageLink
href="/how-it-works"
Expand Down
5 changes: 1 addition & 4 deletions src/app/(proper_react)/(redesign)/Shell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export type Props = {
children: ReactNode;
nonce: string;
countryCode: string;
howItWorksFlagEnabled: boolean;
};

export const Shell = (props: Props) => {
Expand All @@ -45,7 +44,6 @@ export const Shell = (props: Props) => {
yearlySubscriptionUrl={yearlySubscriptionUrl}
fxaSettingsUrl={process.env.FXA_SETTINGS_URL!}
subscriptionBillingAmount={getSubscriptionBillingAmount()}
howItWorksFlagEnabled={props.howItWorksFlagEnabled}
>
<div className={styles.wrapper}>
<nav
Expand Down Expand Up @@ -79,7 +77,7 @@ export const Shell = (props: Props) => {
{l10n.getString("main-nav-link-settings-label")}
</PageLink>
</li>
{props.countryCode === "us" && props.howItWorksFlagEnabled && (
{props.countryCode === "us" && (
<li key="how-it-works">
<PageLink
href="/how-it-works"
Expand Down Expand Up @@ -109,7 +107,6 @@ export const Shell = (props: Props) => {
l10n={props.l10n}
session={props.session}
countryCode={props.countryCode}
howItWorksFlagEnabled={props.howItWorksFlagEnabled}
/>
</div>
</div>
Expand Down
1 change: 0 additions & 1 deletion src/db/tables/featureFlags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ export type FeatureFlagName =
| "DiscountCouponNextThreeMonths"
| "LatestScanDateCsatSurvey"
| "AutomaticRemovalCsatSurvey"
| "HowItWorksPage"
| "AdditionalRemovalStatuses"
| "PetitionBannerCsatSurvey"
/** Set clear expectations about auto-removal finishing in time for *most*, not *all* data brokers: */
Expand Down
Loading