Refactor campaign recipient and review presentation
This commit is contained in:
@@ -6,6 +6,10 @@ const api = readFileSync("src/api/campaigns.ts", "utf8");
|
||||
const page = readFileSync("src/features/reports/AggregateReportsPage.tsx", "utf8");
|
||||
const reportPage = readFileSync("src/features/campaigns/CampaignReportPage.tsx", "utf8");
|
||||
const reviewPage = readFileSync("src/features/campaigns/ReviewSendPage.tsx", "utf8");
|
||||
const reviewPresentation = readFileSync(
|
||||
"src/features/campaigns/review/reviewPresentation.tsx",
|
||||
"utf8"
|
||||
);
|
||||
const operatorPage = readFileSync("src/features/operator/OperatorQueuePage.tsx", "utf8");
|
||||
const deliveryMode = readFileSync("src/features/campaigns/utils/deliveryMode.ts", "utf8");
|
||||
const translationCatalog = readFileSync("src/i18n/generatedTranslations.ts", "utf8");
|
||||
@@ -50,7 +54,14 @@ assert(!page.includes("{report.privacy.rule}"), "the known privacy contract uses
|
||||
assert(page.includes("all_persisted_recipient_delivery_jobs_for_the_se.208e90cc"), "the denominator explanation is bilingual");
|
||||
assert(page.includes("positive_counts_below_the_threshold_are_hidden_a.1dc97093"), "the suppression rule is bilingual");
|
||||
|
||||
const touchedSources = [page, reportPage, reviewPage, operatorPage, deliveryMode].join("\n");
|
||||
const touchedSources = [
|
||||
page,
|
||||
reportPage,
|
||||
reviewPage,
|
||||
reviewPresentation,
|
||||
operatorPage,
|
||||
deliveryMode
|
||||
].join("\n");
|
||||
const touchedKeys = new Set(touchedSources.match(/i18n:govoplan-campaign\.[a-z0-9_]+\.[a-f0-9]{8}/g) ?? []);
|
||||
for (const key of touchedKeys) {
|
||||
const escapedKey = key.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
import { readFileSync } from "node:fs";
|
||||
|
||||
const source = readFileSync(
|
||||
new URL("../src/features/campaigns/RecipientDataPage.tsx", import.meta.url),
|
||||
"utf8"
|
||||
).replace(/\s+/g, " ");
|
||||
const source = [
|
||||
"../src/features/campaigns/RecipientDataPage.tsx",
|
||||
"../src/features/campaigns/recipients/RecipientAddressEditor.tsx",
|
||||
"../src/features/campaigns/recipients/recipientProfileColumns.tsx"
|
||||
]
|
||||
.map((path) => readFileSync(new URL(path, import.meta.url), "utf8"))
|
||||
.join("\n")
|
||||
.replace(/\s+/g, " ");
|
||||
|
||||
function assertIncludes(fragment, message) {
|
||||
if (!source.includes(fragment.replace(/\s+/g, " "))) throw new Error(message);
|
||||
|
||||
Reference in New Issue
Block a user