From 0d2ad5a2679a9b8f2b892eabb220fd35f6a30d70 Mon Sep 17 00:00:00 2001 From: Kaitlyn Andres Date: Mon, 16 Dec 2024 17:37:47 -0500 Subject: [PATCH] MNTOR-3880 - Manual removal rollback (#5419) * comment out changes * Remove comment out test linter * protect route * append 3880 to commented out code --- .../user/(dashboard)/dashboard/View.tsx | 20 ++-- .../removal-under-maintenance/page.tsx | 18 +++- src/app/components/client/FixNavigation.tsx | 7 +- .../exposure_card/ExposureCard.stories.tsx | 54 ++++++----- .../exposure_card/ExposureCard.test.tsx | 91 ++++++++++--------- .../client/exposure_card/ScanResultCard.tsx | 49 +++++----- src/app/components/server/StatusPill.tsx | 29 +++--- src/app/functions/server/dashboard.ts | 30 +++--- .../server/getRelevantGuidedSteps.test.ts | 60 ++++++------ .../server/getRelevantGuidedSteps.ts | 34 +++---- src/db/tables/featureFlags.ts | 1 + 11 files changed, 223 insertions(+), 170 deletions(-) diff --git a/src/app/(proper_react)/(redesign)/(authenticated)/user/(dashboard)/dashboard/View.tsx b/src/app/(proper_react)/(redesign)/(authenticated)/user/(dashboard)/dashboard/View.tsx index daac164e8cb..0b14171b988 100644 --- a/src/app/(proper_react)/(redesign)/(authenticated)/user/(dashboard)/dashboard/View.tsx +++ b/src/app/(proper_react)/(redesign)/(authenticated)/user/(dashboard)/dashboard/View.tsx @@ -179,7 +179,8 @@ export const View = (props: Props) => { const exposureStatus = getExposureStatus( exposure, props.enabledFeatureFlags.includes("AdditionalRemovalStatuses"), - isDataBrokerUnderMaintenance(exposure), + // TODO: Waiting for criteria for data brokers under maintenance to be determined + // isDataBrokerUnderMaintenance(exposure), ); return ( @@ -561,11 +562,12 @@ export const View = (props: Props) => { ); }; -export function isDataBrokerUnderMaintenance( - exposure: Exposure | OnerepScanResultDataBrokerRow, -): boolean { - return ( - isScanResult(exposure) && - exposure.broker_status === "removal_under_maintenance" - ); -} +// TODO: Waiting for criteria for data brokers under maintenace to be determined +// export function isDataBrokerUnderMaintenance( +// exposure: Exposure | OnerepScanResultDataBrokerRow, +// ): boolean { +// return ( +// isScanResult(exposure) && +// exposure.broker_status === "removal_under_maintenance" +// ); +// } diff --git a/src/app/(proper_react)/(redesign)/(authenticated)/user/(dashboard)/dashboard/fix/data-broker-profiles/removal-under-maintenance/page.tsx b/src/app/(proper_react)/(redesign)/(authenticated)/user/(dashboard)/dashboard/fix/data-broker-profiles/removal-under-maintenance/page.tsx index cb9c437eb68..61ec578ad99 100644 --- a/src/app/(proper_react)/(redesign)/(authenticated)/user/(dashboard)/dashboard/fix/data-broker-profiles/removal-under-maintenance/page.tsx +++ b/src/app/(proper_react)/(redesign)/(authenticated)/user/(dashboard)/dashboard/fix/data-broker-profiles/removal-under-maintenance/page.tsx @@ -19,13 +19,29 @@ import { getSubscriberBreaches } from "../../../../../../../../../functions/serv import { getSubscriberEmails } from "../../../../../../../../../functions/server/getSubscriberEmails"; import { RemovalUnderMaintenanceView } from "./RemovalUnderMaintenanceView"; import { hasPremium } from "../../../../../../../../../functions/universal/user"; +import { getEnabledFeatureFlags } from "../../../../../../../../../../db/tables/featureFlags"; +import { AutoSignIn } from "../../../../../../../../../components/client/AutoSignIn"; export default async function RemovalUnderMaintenance() { const session = await getServerSession(); const countryCode = getCountryCode(headers()); - if (!session?.user?.subscriber?.id || !hasPremium(session.user)) { + + if (!session) { + return ; + } + + const enabledFeatureFlags = await getEnabledFeatureFlags({ + email: session.user.email, + }); + + if ( + !session?.user?.subscriber?.id || + !hasPremium(session.user) || + !enabledFeatureFlags.includes("EnableRemovalUnderMaintenanceStep") + ) { redirect("/user/dashboard"); } + const profileId = await getOnerepProfileId(session.user.subscriber.id); const latestScan = await getScanResultsWithBroker( profileId, diff --git a/src/app/components/client/FixNavigation.tsx b/src/app/components/client/FixNavigation.tsx index 58df6ff3752..2b9668ccedc 100644 --- a/src/app/components/client/FixNavigation.tsx +++ b/src/app/components/client/FixNavigation.tsx @@ -82,9 +82,10 @@ export const Steps = (props: { {label} {count > 0 && `(${count})`} ); - const dataBrokerStepCompleted = - hasCompletedStepSection(props.data, "Scan") && - hasCompletedStepSection(props.data, "DataBrokerManualRemoval"); + const dataBrokerStepCompleted = hasCompletedStepSection(props.data, "Scan"); + // TODO: MNTOR-3880 Waiting for criteria for data brokers under maintenace to be determined + // && hasCompletedStepSection(props.data, "DataBrokerManualRemoval"); + return (