diff --git a/.eslintrc.json b/.eslintrc.json index cebc0bf3b..9102782ed 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -129,7 +129,6 @@ "src/views/**/*.js", "src/middleware/**/*.js", "src/controllers/**/*.js", - "src/app/deprecated/**/*", "src/app/(migration_remnants)/**/*", "src/app/functions/server/breachResolution.ts" ], @@ -149,7 +148,6 @@ // to avoid a barrage of warnings for older code: "files": ["**/*.{ts,tsx}"], "excludedFiles": [ - "./src/app/deprecated/**/*", "./src/app/(migration_remnants)/**/*" ], "extends": [ diff --git a/.stylelintignore b/.stylelintignore index 5aaf7d3f9..dafb5e1bb 100644 --- a/.stylelintignore +++ b/.stylelintignore @@ -1,3 +1,2 @@ src/client/ src/app/(nextjs_migration)/ -src/app/deprecated/ diff --git a/src/app/(migration_remnants)/layout.tsx b/src/app/(migration_remnants)/layout.tsx index 20a36bcf4..6085ddf0f 100644 --- a/src/app/(migration_remnants)/layout.tsx +++ b/src/app/(migration_remnants)/layout.tsx @@ -10,7 +10,6 @@ import { HandleFalseDoorTest } from "../deprecated/components/client/FalseDoorBa import { getCountryCode } from "../functions/server/getCountryCode"; import { headers } from "next/headers"; import AppConstants from "../../appConstants"; -import { getNonce } from "../deprecated/functions/server/getNonce"; import { getEnabledFeatureFlags } from "../../db/tables/featureFlags"; export default async function MigrationLayout({ diff --git a/src/app/(proper_react)/(redesign)/(authenticated)/user/(dashboard)/dashboard/fix/high-risk-data-breaches/HighRiskBreachLayout.tsx b/src/app/(proper_react)/(redesign)/(authenticated)/user/(dashboard)/dashboard/fix/high-risk-data-breaches/HighRiskBreachLayout.tsx index ea8902fc7..4d3c57753 100644 --- a/src/app/(proper_react)/(redesign)/(authenticated)/user/(dashboard)/dashboard/fix/high-risk-data-breaches/HighRiskBreachLayout.tsx +++ b/src/app/(proper_react)/(redesign)/(authenticated)/user/(dashboard)/dashboard/fix/high-risk-data-breaches/HighRiskBreachLayout.tsx @@ -22,8 +22,10 @@ import { } from "../../../../../../../../functions/server/getRelevantGuidedSteps"; import { getGuidedExperienceBreaches } from "../../../../../../../../functions/universal/guidedExperienceBreaches"; import { hasPremium } from "../../../../../../../../functions/universal/user"; -import { HighRiskDataTypes } from "../../../../../../../../functions/universal/breach"; -import { BreachBulkResolutionRequest } from "../../../../../../../../deprecated/(authenticated)/user/breaches/breaches"; +import { + BreachBulkResolutionRequest, + HighRiskDataTypes, +} from "../../../../../../../../functions/universal/breach"; import { TelemetryButton } from "../../../../../../../../components/client/TelemetryButton"; import { TelemetryLink } from "../../../../../../../../components/client/TelemetryLink"; diff --git a/src/app/(proper_react)/(redesign)/(authenticated)/user/(dashboard)/dashboard/fix/leaked-passwords/leakedPasswordsData.tsx b/src/app/(proper_react)/(redesign)/(authenticated)/user/(dashboard)/dashboard/fix/leaked-passwords/leakedPasswordsData.tsx index 760294a28..4ac7e93ab 100644 --- a/src/app/(proper_react)/(redesign)/(authenticated)/user/(dashboard)/dashboard/fix/leaked-passwords/leakedPasswordsData.tsx +++ b/src/app/(proper_react)/(redesign)/(authenticated)/user/(dashboard)/dashboard/fix/leaked-passwords/leakedPasswordsData.tsx @@ -10,12 +10,12 @@ import { GuidedExperienceBreaches } from "../../../../../../../../functions/serv import { ExtendedReactLocalization } from "../../../../../../../../hooks/l10n"; import { Button } from "../../../../../../../../components/client/Button"; import { StepLink } from "../../../../../../../../functions/server/getRelevantGuidedSteps"; +import { getLocale } from "../../../../../../../../functions/universal/getLocale"; +import { TelemetryButton } from "../../../../../../../../components/client/TelemetryButton"; import { BreachResolutionRequest, HibpBreachDataTypes, -} from "../../../../../../../../deprecated/(authenticated)/user/breaches/breaches"; -import { getLocale } from "../../../../../../../../functions/universal/getLocale"; -import { TelemetryButton } from "../../../../../../../../components/client/TelemetryButton"; +} from "../../../../../../../../functions/universal/breach"; export const leakedPasswordTypes = [ "passwords", diff --git a/src/app/(proper_react)/(redesign)/(authenticated)/user/(dashboard)/dashboard/fix/security-recommendations/SecurityRecommendationsLayout.tsx b/src/app/(proper_react)/(redesign)/(authenticated)/user/(dashboard)/dashboard/fix/security-recommendations/SecurityRecommendationsLayout.tsx index fefb5d3ef..f70a32caf 100644 --- a/src/app/(proper_react)/(redesign)/(authenticated)/user/(dashboard)/dashboard/fix/security-recommendations/SecurityRecommendationsLayout.tsx +++ b/src/app/(proper_react)/(redesign)/(authenticated)/user/(dashboard)/dashboard/fix/security-recommendations/SecurityRecommendationsLayout.tsx @@ -23,8 +23,10 @@ import { } from "../../../../../../../../functions/server/getRelevantGuidedSteps"; import { getGuidedExperienceBreaches } from "../../../../../../../../functions/universal/guidedExperienceBreaches"; import { hasPremium } from "../../../../../../../../functions/universal/user"; -import { SecurityRecommendationDataTypes } from "../../../../../../../../functions/universal/breach"; -import { BreachBulkResolutionRequest } from "../../../../../../../../deprecated/(authenticated)/user/breaches/breaches"; +import { + BreachBulkResolutionRequest, + SecurityRecommendationDataTypes, +} from "../../../../../../../../functions/universal/breach"; export interface SecurityRecommendationsLayoutProps { type: SecurityRecommendationTypes; diff --git a/src/app/api/v1/scan/route.ts b/src/app/api/v1/scan/route.ts index 1291a47fd..7f5458a5a 100644 --- a/src/app/api/v1/scan/route.ts +++ b/src/app/api/v1/scan/route.ts @@ -9,7 +9,7 @@ import { getBreachesForEmail } from "../../../../utils/hibp"; import { getSha1 } from "../../../../utils/fxa"; import { getL10n } from "../../../functions/server/l10n"; import { getBreachLogo } from "../../../../utils/breachLogo"; -import { Breach } from "../../../deprecated/(authenticated)/user/breaches/breaches"; +import { Breach } from "../../../functions/universal/breach"; export interface RequestBreachScanErrorResponse { success: false; diff --git a/src/app/api/v1/user/breaches/bulk-resolve/route.ts b/src/app/api/v1/user/breaches/bulk-resolve/route.ts index 5bf9d5972..a8cea2cf7 100644 --- a/src/app/api/v1/user/breaches/bulk-resolve/route.ts +++ b/src/app/api/v1/user/breaches/bulk-resolve/route.ts @@ -5,13 +5,13 @@ import { NextRequest, NextResponse } from "next/server"; import { getServerSession } from "../../../../../functions/server/getServerSession"; import { logger } from "../../../../../functions/server/logging"; -import { BreachBulkResolutionRequest } from "../../../../../deprecated/(authenticated)/user/breaches/breaches.js"; import { getBreaches } from "../../../../../functions/server/getBreaches"; import { getAllEmailsAndBreaches } from "../../../../../../utils/breaches"; import { getSubscriberByFxaUid, setBreachResolution, } from "../../../../../../db/tables/subscribers"; +import { BreachBulkResolutionRequest } from "../../../../../functions/universal/breach"; export async function PUT(req: NextRequest): Promise { const session = await getServerSession(); diff --git a/src/app/api/v1/user/breaches/route.ts b/src/app/api/v1/user/breaches/route.ts index 88daf3493..9d02cd19d 100644 --- a/src/app/api/v1/user/breaches/route.ts +++ b/src/app/api/v1/user/breaches/route.ts @@ -6,7 +6,6 @@ import { NextRequest, NextResponse } from "next/server"; import { getToken } from "next-auth/jwt"; import { logger } from "../../../../functions/server/logging"; -import { BreachResolutionRequest } from "../../../../deprecated/(authenticated)/user/breaches/breaches.js"; import { getBreaches } from "../../../../functions/server/getBreaches"; import { getAllEmailsAndBreaches } from "../../../../../utils/breaches"; import { @@ -14,6 +13,7 @@ import { setBreachResolution, } from "../../../../../db/tables/subscribers"; import appConstants from "../../../../../appConstants"; +import { BreachResolutionRequest } from "../../../../functions/universal/breach"; // Get breaches data export async function GET(req: NextRequest) { diff --git a/src/app/components/client/exposure_card/ExposureCardDataClass.tsx b/src/app/components/client/exposure_card/ExposureCardDataClass.tsx index 4006aa6de..bb970ae7e 100644 --- a/src/app/components/client/exposure_card/ExposureCardDataClass.tsx +++ b/src/app/components/client/exposure_card/ExposureCardDataClass.tsx @@ -9,7 +9,7 @@ import { OnerepScanResultRow } from "knex/types/tables"; import styles from "./ExposureCard.module.scss"; import { useL10n } from "../../../hooks/l10n"; import { Exposure, isScanResult } from "./ExposureCard"; -import { HibpBreachDataTypes } from "../../../deprecated/(authenticated)/user/breaches/breaches"; +import { HibpBreachDataTypes } from "../../../functions/universal/breach"; type OnerepScanResultSerializedColumns = Extract< keyof OnerepScanResultRow, diff --git a/src/app/deprecated/(authenticated)/admin/emails/[template]/page.tsx b/src/app/deprecated/(authenticated)/admin/emails/[template]/page.tsx deleted file mode 100644 index ccdd5f406..000000000 --- a/src/app/deprecated/(authenticated)/admin/emails/[template]/page.tsx +++ /dev/null @@ -1,172 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -import { redirect } from "next/navigation"; -import Script from "next/script"; -import appConstants from "../../../../../../appConstants"; -import { - EmailTemplateType, - getMonthlyDummyData, - getNotificationDummyData, - getSignupReportDummyData, - getVerificationDummyData, -} from "../../../../../../utils/email"; -import { getPreviewTemplate } from "../../../../../../views/emails/email2022"; -import { verifyPartial } from "../../../../../../views/emails/emailVerify"; -import { breachAlertEmailPartial } from "../../../../../../views/emails/emailBreachAlert"; -import { monthlyUnresolvedEmailPartial } from "../../../../../../views/emails/emailMonthlyUnresolved"; -import { signupReportEmailPartial } from "../../../../../../views/emails/emailSignupReport"; -import { getL10n } from "../../../../../functions/server/l10n"; -import { ReactLocalization } from "@fluent/react"; -import { getNonce } from "../../../../functions/server/getNonce"; -import { getServerSession } from "../../../../../functions/server/getServerSession"; - -declare global { - // eslint-disable-next-line @typescript-eslint/no-namespace - namespace JSX { - interface IntrinsicElements { - "custom-select": { - name: string; - dangerouslySetInnerHTML: { __html: string }; - }; - } - } -} - -export default async function EmailTemplatePage(props: { - params: { template: string }; -}) { - const session = await getServerSession(); - - if (!session?.user.email) { - return redirect("/"); - } - - const admins = process.env.ADMINS?.split(",") ?? []; - // Note: ../layout.tsx currently hides this page for non-admins. - // Not sure if we actually want to have this available to non-admins as well. - const isAdminPreview = admins.includes(session.user.email); - const chosenTemplate = - Object.values(EmailTemplateType).find((t) => t === props.params.template) ?? - EmailTemplateType.Verification; - const l10n = getL10n(); - const templates = getTemplatesData(l10n); - const selectedPreviewTemplate = templates[chosenTemplate].template; - const recipients = [session.user.email]; - if (appConstants.EMAIL_TEST_RECIPIENT) { - recipients.push(appConstants.EMAIL_TEST_RECIPIENT); - } - - return ( -
-