Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/aws-sdk-aafc82905b
Browse files Browse the repository at this point in the history
  • Loading branch information
rhelmer authored Apr 29, 2024
2 parents 76a7dca + 1219fe4 commit 7d4e49a
Show file tree
Hide file tree
Showing 71 changed files with 553 additions and 604 deletions.
4 changes: 2 additions & 2 deletions src/TestComponentWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import { L10nProvider } from "./contextProviders/localization";
import { PublicEnvProvider } from "./contextProviders/public-env";
import { SessionProvider } from "next-auth/react";
import { ReactAriaI18nProvider } from "./contextProviders/react-aria";
import { getSpecificL10nBundlesSync } from "./app/functions/server/mockL10n";
import { getL10nBundles } from "./app/functions/l10n/storybookAndJest";

const l10nBundles = getSpecificL10nBundlesSync();
const l10nBundles = getL10nBundles();

export const TestComponentWrapper = (props: { children: ReactNode }) => {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { renderEmail } from "../../../../../../emails/renderEmail";
import { VerifyEmailAddressEmail } from "../../../../../../emails/templates/verifyEmailAddress/VerifyEmailAddressEmail";
import { sanitizeSubscriberRow } from "../../../../../functions/server/sanitize";
import { getServerSession } from "../../../../../functions/server/getServerSession";
import { getL10n } from "../../../../../functions/server/l10n";
import { getL10n } from "../../../../../functions/l10n/serverComponents";
import { getSubscriberByFxaUid } from "../../../../../../db/tables/subscribers";
import { ReactNode } from "react";
import { SubscriberRow } from "knex/types/tables";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type { Meta, StoryObj } from "@storybook/react";
import { OnerepScanResultRow, OnerepScanRow } from "knex/types/tables";
import { View as DashboardEl } from "./View";
import { Shell } from "../../../../Shell";
import { getSpecificL10nSync } from "../../../../../../functions/server/mockL10n";
import { getL10n } from "../../../../../../functions/l10n/storybookAndJest";
import {
createRandomScanResult,
createRandomBreach,
Expand Down Expand Up @@ -175,7 +175,7 @@ const DashboardWrapper = (props: DashboardWrapperProps) => {
return (
<SessionProvider session={mockedSession}>
<CountryCodeProvider countryCode={props.countryCode}>
<Shell l10n={getSpecificL10nSync()} session={mockedSession} nonce="">
<Shell l10n={getL10n()} session={mockedSession} nonce="">
<DashboardEl
user={user}
userBreaches={breaches}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
createUserWithPremiumSubscription,
} from "../../../../../../../../../../apiMocks/mockData";
import { Shell } from "../../../../../../../Shell";
import { getSpecificL10nSync } from "../../../../../../../../../functions/server/mockL10n";
import { getL10n } from "../../../../../../../../../functions/l10n/storybookAndJest";
import { LatestOnerepScanData } from "../../../../../../../../../../db/tables/onerep_scans";

const mockedScan: OnerepScanRow = {
Expand Down Expand Up @@ -50,7 +50,7 @@ export const AutomaticRemoveViewStory: Story = {
name: "1d. Automatically resolve brokers",
render: () => {
return (
<Shell l10n={getSpecificL10nSync()} session={mockedSession} nonce="">
<Shell l10n={getL10n()} session={mockedSession} nonce="">
<AutomaticRemoveView
data={{
countryCode: "us",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
createUserWithPremiumSubscription,
} from "../../../../../../../../../../apiMocks/mockData";
import { Shell } from "../../../../../../../Shell";
import { getSpecificL10nSync } from "../../../../../../../../../functions/server/mockL10n";
import { getL10n } from "../../../../../../../../../functions/l10n/storybookAndJest";
import { LatestOnerepScanData } from "../../../../../../../../../../db/tables/onerep_scans";
import { hasPremium } from "../../../../../../../../../functions/universal/user";

Expand Down Expand Up @@ -51,7 +51,7 @@ export const ManualRemoveViewStory: Story = {
name: "1c. Manually resolve brokers",
render: () => {
return (
<Shell l10n={getSpecificL10nSync()} session={mockedSession} nonce="">
<Shell l10n={getL10n()} session={mockedSession} nonce="">
<ManualRemoveView
scanData={mockedScanData}
breaches={mockedBreaches}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ jest.mock("next/navigation", () => {
usePathname: jest.fn(),
};
});
jest.mock("../../../../../../../../../functions/server/l10n");

import Meta, { ManualRemoveViewStory } from "./ManualRemove.stories";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
createUserWithPremiumSubscription,
} from "../../../../../../../../../../apiMocks/mockData";
import { Shell } from "../../../../../../../Shell";
import { getSpecificL10nSync } from "../../../../../../../../../functions/server/mockL10n";
import { getL10n } from "../../../../../../../../../functions/l10n/storybookAndJest";
import { LatestOnerepScanData } from "../../../../../../../../../../db/tables/onerep_scans";

const mockedScan: OnerepScanRow = {
Expand Down Expand Up @@ -50,7 +50,7 @@ export const StartFreeScanViewStory: Story = {
name: "1a. Free scan",
render: () => {
return (
<Shell l10n={getSpecificL10nSync()} session={mockedSession} nonce="">
<Shell l10n={getL10n()} session={mockedSession} nonce="">
<StartFreeScanView
data={{
countryCode: "us",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
StepDeterminationData,
getNextGuidedStep,
} from "../../../../../../../../../functions/server/getRelevantGuidedSteps";
import { ExtendedReactLocalization } from "../../../../../../../../../hooks/l10n";
import { ExtendedReactLocalization } from "../../../../../../../../../functions/l10n";
import { TelemetryButton } from "../../../../../../../../../components/client/TelemetryButton";

export type Props = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
createUserWithPremiumSubscription,
} from "../../../../../../../../../../apiMocks/mockData";
import { Shell } from "../../../../../../../Shell";
import { getSpecificL10nSync } from "../../../../../../../../../functions/server/mockL10n";
import { getL10n } from "../../../../../../../../../functions/l10n/storybookAndJest";
import { LatestOnerepScanData } from "../../../../../../../../../../db/tables/onerep_scans";

const brokerOptions = {
Expand Down Expand Up @@ -91,7 +91,7 @@ const ViewWrapper = (props: ViewWrapperProps) => {
expires: new Date().toISOString(),
user: user,
};
const l10n = getSpecificL10nSync();
const l10n = getL10n();

return (
<Shell l10n={l10n} session={mockedSession} nonce="">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { StepDeterminationData } from "../../../../../../../../../functions/serv
import { getCountryCode } from "../../../../../../../../../functions/server/getCountryCode";
import { getSubscriberBreaches } from "../../../../../../../../../functions/server/getSubscriberBreaches";
import { getSubscriberEmails } from "../../../../../../../../../functions/server/getSubscriberEmails";
import { getL10n } from "../../../../../../../../../functions/server/l10n";
import { getL10n } from "../../../../../../../../../functions/l10n/serverComponents";

export default async function ViewDataBrokers() {
const session = await getServerSession();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
createUserWithPremiumSubscription,
} from "../../../../../../../../../../apiMocks/mockData";
import { Shell } from "../../../../../../../Shell";
import { getSpecificL10nSync } from "../../../../../../../../../functions/server/mockL10n";
import { getL10n } from "../../../../../../../../../functions/l10n/storybookAndJest";
import { LatestOnerepScanData } from "../../../../../../../../../../db/tables/onerep_scans";

const mockedScan: OnerepScanRow = {
Expand Down Expand Up @@ -88,7 +88,7 @@ const meta: Meta<typeof WelcomeToPlusViewWrapper> = {
export default meta;
type Story = StoryObj<typeof WelcomeToPlusViewWrapper>;

const l10n = getSpecificL10nSync();
const l10n = getL10n();

export const WelcomeToPlusViewNoResultsStory: Story = {
name: "No broker results in-progress",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
getNextGuidedStep,
} from "../../../../../../../../../functions/server/getRelevantGuidedSteps";
import { FixView } from "../../FixView";
import { ExtendedReactLocalization } from "../../../../../../../../../hooks/l10n";
import { ExtendedReactLocalization } from "../../../../../../../../../functions/l10n";
import { TelemetryButton } from "../../../../../../../../../components/client/TelemetryButton";
import noBreachesIllustration from "../../images/high-risk-breaches-none.svg";
import { CONST_ONEREP_DATA_BROKER_COUNT } from "../../../../../../../../../../constants";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { StepDeterminationData } from "../../../../../../../../../functions/serv
import { getCountryCode } from "../../../../../../../../../functions/server/getCountryCode";
import { activateAndOptoutProfile } from "../../../../../../../../../functions/server/onerep";
import { logger } from "../../../../../../../../../functions/server/logging";
import { getL10n } from "../../../../../../../../../functions/server/l10n";
import { getL10n } from "../../../../../../../../../functions/l10n/serverComponents";
import { refreshStoredScanResults } from "../../../../../../../../../functions/server/refreshStoredScanResults";
import { checkSession } from "../../../../../../../../../functions/server/checkSession";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
createUserWithPremiumSubscription,
} from "../../../../../../../../../../apiMocks/mockData";
import { Shell } from "../../../../../../../Shell";
import { getSpecificL10nSync } from "../../../../../../../../../functions/server/mockL10n";
import { getL10n } from "../../../../../../../../../functions/l10n/storybookAndJest";
import { HighRiskBreachLayout } from "../HighRiskBreachLayout";
import {
HighRiskBreachTypes,
Expand Down Expand Up @@ -102,7 +102,7 @@ const HighRiskBreachWrapper = (props: {
};

return (
<Shell l10n={getSpecificL10nSync()} session={mockedSession} nonce="">
<Shell l10n={getL10n()} session={mockedSession} nonce="">
<HighRiskBreachLayout
subscriberEmails={[]}
type={props.type}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import noBreachesIllustration from "../images/high-risk-breaches-none.svg";
import { GuidedExperienceBreaches } from "../../../../../../../../functions/server/getUserBreaches";
import { FraudAlertModal } from "./FraudAlertModal";
import { getLocale } from "../../../../../../../../functions/universal/getLocale";
import { ExtendedReactLocalization } from "../../../../../../../../hooks/l10n";
import { ExtendedReactLocalization } from "../../../../../../../../functions/l10n";
import { StepLink } from "../../../../../../../../functions/server/getRelevantGuidedSteps";
import { TelemetryLink } from "../../../../../../../../components/client/TelemetryLink";
import { TelemetryButton } from "../../../../../../../../components/client/TelemetryButton";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
createUserWithPremiumSubscription,
} from "../../../../../../../../../../apiMocks/mockData";
import { Shell } from "../../../../../../../Shell";
import { getSpecificL10nSync } from "../../../../../../../../../functions/server/mockL10n";
import { getL10n } from "../../../../../../../../../functions/l10n/storybookAndJest";
import { LeakedPasswordsLayout } from "../LeakedPasswordsLayout";
import {
LeakedPasswordsTypes,
Expand Down Expand Up @@ -64,7 +64,7 @@ const LeakedPasswordsWrapper = (props: {
}

return (
<Shell l10n={getSpecificL10nSync()} session={mockedSession} nonce="">
<Shell l10n={getL10n()} session={mockedSession} nonce="">
<LeakedPasswordsLayout
subscriberEmails={[]}
type={props.type}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import passwordIllustration from "../images/leaked-passwords.svg";
import securityQuestionsIllustration from "../images/security-questions.svg";
import { SubscriberBreach } from "../../../../../../../../../utils/subscriberBreaches";
import { GuidedExperienceBreaches } from "../../../../../../../../functions/server/getUserBreaches";
import { ExtendedReactLocalization } from "../../../../../../../../hooks/l10n";
import { ExtendedReactLocalization } from "../../../../../../../../functions/l10n";
import { Button } from "../../../../../../../../components/client/Button";
import { StepLink } from "../../../../../../../../functions/server/getRelevantGuidedSteps";
import { getLocale } from "../../../../../../../../functions/universal/getLocale";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
createUserWithPremiumSubscription,
} from "../../../../../../../../../../apiMocks/mockData";
import { Shell } from "../../../../../../../Shell";
import { getSpecificL10nSync } from "../../../../../../../../../functions/server/mockL10n";
import { getL10n } from "../../../../../../../../../functions/l10n/storybookAndJest";
import { SecurityRecommendationsLayout } from "../SecurityRecommendationsLayout";
import {
SecurityRecommendationTypes,
Expand Down Expand Up @@ -42,7 +42,7 @@ const SecurityRecommendationsWrapper = (props: {
type: SecurityRecommendationTypes;
}) => {
return (
<Shell l10n={getSpecificL10nSync()} session={mockedSession} nonce="">
<Shell l10n={getL10n()} session={mockedSession} nonce="">
<SecurityRecommendationsLayout
subscriberEmails={[]}
type={props.type}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import phoneIllustration from "../images/security-recommendations-phone.svg";
import ipIllustration from "../images/security-recommendations-ip.svg";
import { GuidedExperienceBreaches } from "../../../../../../../../functions/server/getUserBreaches";
import { SubscriberBreach } from "../../../../../../../../../utils/subscriberBreaches";
import { ExtendedReactLocalization } from "../../../../../../../../hooks/l10n";
import { ExtendedReactLocalization } from "../../../../../../../../functions/l10n";
import { Button } from "../../../../../../../../components/client/Button";
import { StepLink } from "../../../../../../../../functions/server/getRelevantGuidedSteps";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@

import { ReactNode } from "react";
import { getServerSession } from "../../../../../functions/server/getServerSession";
import { getL10n, getL10nBundles } from "../../../../../functions/server/l10n";
import {
getL10n,
getL10nBundles,
} from "../../../../../functions/l10n/serverComponents";
import { Shell } from "../../../Shell";
import { headers } from "next/headers";
import { AutoSignIn } from "../../../../../components/client/AutoSignIn";
Expand Down
Loading

0 comments on commit 7d4e49a

Please sign in to comment.