Skip to content

Commit 0d2ad5a

Browse files
authored
MNTOR-3880 - Manual removal rollback (#5419)
* comment out changes * Remove comment out test linter * protect route * append 3880 to commented out code
1 parent 2b7e760 commit 0d2ad5a

File tree

11 files changed

+223
-170
lines changed

11 files changed

+223
-170
lines changed

src/app/(proper_react)/(redesign)/(authenticated)/user/(dashboard)/dashboard/View.tsx

+11-9
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,8 @@ export const View = (props: Props) => {
179179
const exposureStatus = getExposureStatus(
180180
exposure,
181181
props.enabledFeatureFlags.includes("AdditionalRemovalStatuses"),
182-
isDataBrokerUnderMaintenance(exposure),
182+
// TODO: Waiting for criteria for data brokers under maintenance to be determined
183+
// isDataBrokerUnderMaintenance(exposure),
183184
);
184185

185186
return (
@@ -561,11 +562,12 @@ export const View = (props: Props) => {
561562
);
562563
};
563564

564-
export function isDataBrokerUnderMaintenance(
565-
exposure: Exposure | OnerepScanResultDataBrokerRow,
566-
): boolean {
567-
return (
568-
isScanResult(exposure) &&
569-
exposure.broker_status === "removal_under_maintenance"
570-
);
571-
}
565+
// TODO: Waiting for criteria for data brokers under maintenace to be determined
566+
// export function isDataBrokerUnderMaintenance(
567+
// exposure: Exposure | OnerepScanResultDataBrokerRow,
568+
// ): boolean {
569+
// return (
570+
// isScanResult(exposure) &&
571+
// exposure.broker_status === "removal_under_maintenance"
572+
// );
573+
// }

src/app/(proper_react)/(redesign)/(authenticated)/user/(dashboard)/dashboard/fix/data-broker-profiles/removal-under-maintenance/page.tsx

+17-1
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,29 @@ import { getSubscriberBreaches } from "../../../../../../../../../functions/serv
1919
import { getSubscriberEmails } from "../../../../../../../../../functions/server/getSubscriberEmails";
2020
import { RemovalUnderMaintenanceView } from "./RemovalUnderMaintenanceView";
2121
import { hasPremium } from "../../../../../../../../../functions/universal/user";
22+
import { getEnabledFeatureFlags } from "../../../../../../../../../../db/tables/featureFlags";
23+
import { AutoSignIn } from "../../../../../../../../../components/client/AutoSignIn";
2224

2325
export default async function RemovalUnderMaintenance() {
2426
const session = await getServerSession();
2527
const countryCode = getCountryCode(headers());
26-
if (!session?.user?.subscriber?.id || !hasPremium(session.user)) {
28+
29+
if (!session) {
30+
return <AutoSignIn />;
31+
}
32+
33+
const enabledFeatureFlags = await getEnabledFeatureFlags({
34+
email: session.user.email,
35+
});
36+
37+
if (
38+
!session?.user?.subscriber?.id ||
39+
!hasPremium(session.user) ||
40+
!enabledFeatureFlags.includes("EnableRemovalUnderMaintenanceStep")
41+
) {
2742
redirect("/user/dashboard");
2843
}
44+
2945
const profileId = await getOnerepProfileId(session.user.subscriber.id);
3046
const latestScan = await getScanResultsWithBroker(
3147
profileId,

src/app/components/client/FixNavigation.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,10 @@ export const Steps = (props: {
8282
{label} {count > 0 && `(${count})`}
8383
</div>
8484
);
85-
const dataBrokerStepCompleted =
86-
hasCompletedStepSection(props.data, "Scan") &&
87-
hasCompletedStepSection(props.data, "DataBrokerManualRemoval");
85+
const dataBrokerStepCompleted = hasCompletedStepSection(props.data, "Scan");
86+
// TODO: MNTOR-3880 Waiting for criteria for data brokers under maintenace to be determined
87+
// && hasCompletedStepSection(props.data, "DataBrokerManualRemoval");
88+
8889
return (
8990
<ul className={styles.steps}>
9091
{isEligibleForStep(props.data, "Scan") && (

src/app/components/client/exposure_card/ExposureCard.stories.tsx

+30-24
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,21 @@ const ScanMockItemInProgress = createRandomScanResult({
5050
status: "optout_in_progress",
5151
manually_resolved: false,
5252
});
53-
const ScanMockItemRemovalUnderMaintenance = createRandomScanResult({
54-
status: "optout_in_progress",
55-
manually_resolved: false,
56-
broker_status: "removal_under_maintenance",
57-
});
5853

59-
const ScanMockItemRemovalUnderMaintenanceFixed = createRandomScanResult({
60-
status: "optout_in_progress",
61-
manually_resolved: true,
62-
broker_status: "removal_under_maintenance",
63-
});
54+
// TODO: Waiting for criteria for data brokers under maintenace to be determined
55+
// const ScanMockItemRemovalUnderMaintenance = createRandomScanResult({
56+
// status: "optout_in_progress",
57+
// manually_resolved: false,
58+
// broker_status: "removal_under_maintenance",
59+
// });
60+
61+
// TODO: Waiting for criteria for data brokers under maintenace to be determined
62+
// const ScanMockItemRemovalUnderMaintenanceFixed = createRandomScanResult({
63+
// status: "optout_in_progress",
64+
// manually_resolved: true,
65+
// broker_status: "removal_under_maintenance",
66+
// });
67+
6468
const BreachMockItemRemoved = createRandomBreach({
6569
isResolved: true,
6670
dataClassesEffected: [
@@ -115,21 +119,23 @@ export const DataBreachActionNeeded: Story = {
115119
},
116120
};
117121

118-
export const DataBrokerRemovalUnderMaintenance: Story = {
119-
args: {
120-
exposureImg: FamilyTreeImage,
121-
exposureData: ScanMockItemRemovalUnderMaintenance,
122-
isPremiumUser: true,
123-
},
124-
};
122+
// TODO: Waiting for criteria for data brokers under maintenace to be determined
123+
// export const DataBrokerRemovalUnderMaintenance: Story = {
124+
// args: {
125+
// exposureImg: FamilyTreeImage,
126+
// exposureData: ScanMockItemRemovalUnderMaintenance,
127+
// isPremiumUser: true,
128+
// },
129+
// };
125130

126-
export const DataBrokerRemovalUnderMaintenanceFixed: Story = {
127-
args: {
128-
exposureImg: FamilyTreeImage,
129-
exposureData: ScanMockItemRemovalUnderMaintenanceFixed,
130-
isPremiumUser: true,
131-
},
132-
};
131+
// TODO: Waiting for criteria for data brokers under maintenace to be determined
132+
// export const DataBrokerRemovalUnderMaintenanceFixed: Story = {
133+
// args: {
134+
// exposureImg: FamilyTreeImage,
135+
// exposureData: ScanMockItemRemovalUnderMaintenanceFixed,
136+
// isPremiumUser: true,
137+
// },
138+
// };
133139

134140
export const DataBreachFixed: Story = {
135141
args: {

src/app/components/client/exposure_card/ExposureCard.test.tsx

+49-42
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@ import Meta, {
1313
DataBrokerActionNeeded,
1414
DataBrokerInProgress,
1515
DataBrokerManualRemoved,
16-
DataBrokerRemovalUnderMaintenance,
17-
DataBrokerRemovalUnderMaintenanceFixed,
1816
DataBrokerRemoved,
1917
DataBrokerRequestedRemoval,
18+
// TODO: MNTOR-3880 Waiting for criteria for data brokers under maintenace to be determined
19+
// DataBrokerRemovalUnderMaintenance,
20+
// DataBrokerRemovalUnderMaintenanceFixed,
2021
} from "./ExposureCard.stories";
2122

2223
jest.mock("../../../hooks/useTelemetry");
@@ -75,35 +76,39 @@ describe("ScanResultCard", () => {
7576
expect(innerDescription).toBeInTheDocument();
7677
});
7778

79+
// TODO: MNTOR-3880 Waiting for criteria for data brokers under maintenace to be determined
7880
// Data broker removal under maintenance
79-
it("shows the right description for a scan result card with removal under maintenance status", () => {
80-
const ComposedProgressCard = composeStory(
81-
DataBrokerRemovalUnderMaintenance,
82-
Meta,
83-
);
84-
render(<ComposedProgressCard />);
85-
const innerDescription = screen.getByText(
86-
"We’ve asked this data broker to remove your profile but they haven’t done it.",
87-
{ exact: false },
88-
);
89-
90-
expect(innerDescription).toBeInTheDocument();
91-
});
92-
81+
// eslint-disable-next-line jest/no-commented-out-tests
82+
// it("shows the right description for a scan result card with removal under maintenance status", () => {
83+
// const ComposedProgressCard = composeStory(
84+
// DataBrokerRemovalUnderMaintenance,
85+
// Meta,
86+
// );
87+
// render(<ComposedProgressCard />);
88+
// const innerDescription = screen.getByText(
89+
// "We’ve asked this data broker to remove your profile but they haven’t done it.",
90+
// { exact: false },
91+
// );
92+
93+
// expect(innerDescription).toBeInTheDocument();
94+
// });
95+
96+
// TODO: MNTOR-3880 Waiting for criteria for data brokers under maintenace to be determined
9397
// Data broker removal under maintenance resolved
94-
it("shows the right description for a scan result card with removal under maintenance status that's been resolved", () => {
95-
const ComposedProgressCard = composeStory(
96-
DataBrokerRemovalUnderMaintenanceFixed,
97-
Meta,
98-
);
99-
render(<ComposedProgressCard />);
100-
const innerDescription = screen.getByText(
101-
"You could be added back in the future, so ⁨Monitor⁩ will continue to scan data broker sites for new exposures.",
102-
{ exact: false },
103-
);
104-
105-
expect(innerDescription).toBeInTheDocument();
106-
});
98+
// eslint-disable-next-line jest/no-commented-out-tests
99+
// it("shows the right description for a scan result card with removal under maintenance status that's been resolved", () => {
100+
// const ComposedProgressCard = composeStory(
101+
// DataBrokerRemovalUnderMaintenanceFixed,
102+
// Meta,
103+
// );
104+
// render(<ComposedProgressCard />);
105+
// const innerDescription = screen.getByText(
106+
// "You could be added back in the future, so ⁨Monitor⁩ will continue to scan data broker sites for new exposures.",
107+
// { exact: false },
108+
// );
109+
110+
// expect(innerDescription).toBeInTheDocument();
111+
// });
107112

108113
// Data broker removal in progress
109114
it("shows the right description for a scan result card where removal is in progress", () => {
@@ -117,20 +122,22 @@ describe("ScanResultCard", () => {
117122
expect(innerDescription).toBeInTheDocument();
118123
});
119124

125+
// TODO: MNTOR-3880 Waiting for criteria for data brokers under maintenace to be determined
120126
// Data broker removal under maintenance
121-
it("shows the right description for a scan result card where removal is under maintenance", () => {
122-
const ComposedProgressCard = composeStory(
123-
DataBrokerRemovalUnderMaintenance,
124-
Meta,
125-
);
126-
render(<ComposedProgressCard />);
127-
const innerDescription = screen.getByText(
128-
"We’ve asked this data broker to remove your profile but they haven’t done it.",
129-
{ exact: false },
130-
);
131-
132-
expect(innerDescription).toBeInTheDocument();
133-
});
127+
// eslint-disable-next-line jest/no-commented-out-tests
128+
// it("shows the right description for a scan result card where removal is under maintenance", () => {
129+
// const ComposedProgressCard = composeStory(
130+
// DataBrokerRemovalUnderMaintenance,
131+
// Meta,
132+
// );
133+
// render(<ComposedProgressCard />);
134+
// const innerDescription = screen.getByText(
135+
// "We’ve asked this data broker to remove your profile but they haven’t done it.",
136+
// { exact: false },
137+
// );
138+
139+
// expect(innerDescription).toBeInTheDocument();
140+
// });
134141

135142
it("shows an additional note for “requested removal” status label", () => {
136143
const ComposedProgressCard = composeStory(DataBrokerRequestedRemoval, Meta);

src/app/components/client/exposure_card/ScanResultCard.tsx

+27-22
Original file line numberDiff line numberDiff line change
@@ -118,22 +118,25 @@ export const ScanResultCard = (props: ScanResultCardProps) => {
118118
const dataBrokerDescription = () => {
119119
// Data broker cards manually resolved do not change their status to "removed";
120120
// instead, we track them using the "manually_resolved" property.
121-
if (scanResult.broker_status === "removal_under_maintenance") {
122-
if (scanResult.manually_resolved) {
123-
return l10n.getFragment(
124-
"exposure-card-description-info-for-sale-fixed-removal-under-maintenance-manually-fixed",
125-
{ elems: { data_broker_profile: dataBrokerProfileLink } },
126-
);
127-
}
128-
return l10n.getFragment(
129-
"exposure-card-description-info-for-sale-manual-removal-needed",
130-
{
131-
elems: {
132-
b: <b />,
133-
},
134-
},
135-
);
136-
}
121+
122+
// TODO: MNTOR-3880 Waiting for criteria for data brokers under maintenace to be determined
123+
// if (scanResult.broker_status === "removal_under_maintenance") {
124+
// if (scanResult.manually_resolved) {
125+
// return l10n.getFragment(
126+
// "exposure-card-description-info-for-sale-fixed-removal-under-maintenance-manually-fixed",
127+
// { elems: { data_broker_profile: dataBrokerProfileLink } },
128+
// );
129+
// }
130+
// return l10n.getFragment(
131+
// "exposure-card-description-info-for-sale-manual-removal-needed",
132+
// {
133+
// elems: {
134+
// b: <b />,
135+
// },
136+
// },
137+
// );
138+
// }
139+
137140
if (scanResult.manually_resolved) {
138141
return l10n.getFragment(
139142
"exposure-card-description-info-for-sale-fixed-manually-fixed",
@@ -249,9 +252,10 @@ export const ScanResultCard = (props: ScanResultCardProps) => {
249252
);
250253
}
251254

252-
if (props.scanResult.broker_status === "removal_under_maintenance") {
253-
return <span>{props.resolutionCta}</span>;
254-
}
255+
// TODO: MNTOR-3880 Waiting for criteria for data brokers under maintenace to be determined
256+
// if (props.scanResult.broker_status === "removal_under_maintenance") {
257+
// return <span>{props.resolutionCta}</span>;
258+
// }
255259

256260
switch (props.scanResult.status) {
257261
case "new":
@@ -323,9 +327,10 @@ export const ScanResultCard = (props: ScanResultCardProps) => {
323327
</dt>
324328
<dd>
325329
<StatusPill
326-
isRemovalUnderMaintenance={
327-
scanResult.broker_status === "removal_under_maintenance"
328-
}
330+
// isRemovalUnderMaintenance={
331+
// // TODO: MNTOR-3880 Waiting for criteria for data brokers under maintenace to be determined
332+
// // scanResult.broker_status === "removal_under_maintenance"
333+
// }
329334
exposure={scanResult}
330335
note={statusPillNote}
331336
enabledFeatureFlags={props.enabledFeatureFlags}

0 commit comments

Comments
 (0)