Skip to content

Commit

Permalink
show the custom exposures in the removal under maintenace view
Browse files Browse the repository at this point in the history
  • Loading branch information
codemist committed Jan 16, 2025
1 parent 0f671e6 commit fbd98dd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
import { getCountryCode } from "../../../../../../../../../functions/server/getCountryCode";
import { headers } from "next/headers";
import {
getMockedScanResults,
getScanResultsWithBroker,
getScanResultsWithBrokerUnderMaintenance,
} from "../../../../../../../../../../db/tables/onerep_scans";
Expand All @@ -20,6 +21,7 @@ import { getSubscriberEmails } from "../../../../../../../../../functions/server
import { RemovalUnderMaintenanceView } from "./RemovalUnderMaintenanceView";
import { hasPremium } from "../../../../../../../../../functions/universal/user";
import { getEnabledFeatureFlags } from "../../../../../../../../../../db/tables/featureFlags";
import { getQaToggleRow } from "../../../../../../../../../../db/tables/qa_customs";

export default async function RemovalUnderMaintenance() {
const session = await getServerSession();
Expand Down Expand Up @@ -64,19 +66,30 @@ export default async function RemovalUnderMaintenance() {
"DataBrokerManualRemoval",
);

if (
scansWithRemovalUnderMaintenance?.results.length === 0 ||
!scansWithRemovalUnderMaintenance
) {
const mockScanResultsData = await getMockedScanResults(profileId ?? 100);
const qaToggles = await getQaToggleRow(profileId);
let showCustomBrokers = false;

if (qaToggles) {
showCustomBrokers = qaToggles.show_custom_brokers;
}

const brokerData = showCustomBrokers
? mockScanResultsData
: scansWithRemovalUnderMaintenance;

if (brokerData?.results.length === 0 || !brokerData) {
redirect(getNextStep.href);
}

console.log({ brokerData });

const subscriberEmails = await getSubscriberEmails(session.user);

return (
<RemovalUnderMaintenanceView
stepDeterminationData={data}
data={scansWithRemovalUnderMaintenance}
data={brokerData}
subscriberEmails={subscriberEmails}
enabledFeatureFlags={enabledFeatureFlags}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const isMatchingContent = (
) => {
const { hasExposures, hasUnresolvedBreaches, hasUnresolvedBrokers } =
contentConditions;

// If a user does not have any exposures it’s also not possible to have unresolved ones.
// This check is meant to avoid adding invalid conditions in `getUserDashboardState`.
/* c8 ignore next 8 */
Expand Down

0 comments on commit fbd98dd

Please sign in to comment.