@@ -304,7 +304,7 @@ const RepInterestedPartyPerson = (props) => {
|
||||
);
|
||||
}}
|
||||
>
|
||||
{t("common:save-exit-button")}sssss
|
||||
{t("common:save-exit-button")}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
+3
-1
@@ -11,7 +11,9 @@
|
||||
"start3": "NODE_ENV=production next start",
|
||||
"start": "NODE_ENV=production node_modules/next/dist/bin/next start",
|
||||
"lint": "next lint",
|
||||
"prisma:generate": "prisma generate"
|
||||
"prisma:generate": "prisma generate",
|
||||
"test:reps": "cd '../../welsh government/Playwright/Playwright' && npx playwright test tests/loggedin/raiserep.spec.js --headed",
|
||||
"test:newappeal": "cd '../../welsh government/Playwright/Playwright' && npx playwright test tests/loggedin/newappeal.spec.js --headed"
|
||||
},
|
||||
"browser": {
|
||||
"child_process": false
|
||||
|
||||
+34
-31
@@ -86,15 +86,13 @@ const buildNotifyPayloads = (watchlistByEmail) => {
|
||||
const ref = doc.pinswg_isharedocumentreference || t.noRef;
|
||||
const name = doc.pinswg_name || t.untitled;
|
||||
const date =
|
||||
formatDates(
|
||||
doc.pinswg_documentpublisheddate?.split("T")[0],
|
||||
language
|
||||
) || t.noDate;
|
||||
formatDates(doc.pinswg_documentpublisheddate, language) ||
|
||||
t.noDate;
|
||||
const link =
|
||||
(process.env.NEXTAUTH_URL || "") + doc.pinswg_hashlink ||
|
||||
"[No Link]";
|
||||
|
||||
return ` - ${name} (${date})\n ${t.link}: ${link}`;
|
||||
return ` - [${name} (${date})](${link})`;
|
||||
})
|
||||
.join("\n");
|
||||
};
|
||||
@@ -119,11 +117,12 @@ const buildNotifyPayloads = (watchlistByEmail) => {
|
||||
.map((event) => {
|
||||
const name = event.pinswg_name || t.unnamed;
|
||||
const date =
|
||||
formatDates(
|
||||
event.pinswg_dateeventrequested?.split("T")[0],
|
||||
language
|
||||
) || t.noDate;
|
||||
return ` - ${name} ${t.on} ${date}`;
|
||||
formatDates(event.pinswg_dateeventrequested, false) ||
|
||||
t.noDate;
|
||||
const time =
|
||||
formatDates(event.pinswg_dateeventrequested, true) ||
|
||||
t.noDate;
|
||||
return ` - ${name} ${t.on} ${date} ${time}`;
|
||||
})
|
||||
.join("\n");
|
||||
};
|
||||
@@ -149,15 +148,9 @@ const buildNotifyPayloads = (watchlistByEmail) => {
|
||||
return reps
|
||||
.map((rep) => {
|
||||
const start =
|
||||
formatDates(
|
||||
rep.pinswg_consultationopen?.split("T")[0],
|
||||
language
|
||||
) || t.na;
|
||||
formatDates(rep.pinswg_consultationopen, false) || t.na;
|
||||
const end =
|
||||
formatDates(
|
||||
rep.pinswg_consultationclose?.split("T")[0],
|
||||
language
|
||||
) || t.na;
|
||||
formatDates(rep.pinswg_consultationclose, false) || t.na;
|
||||
|
||||
return ` - ${t.open}: ${start} ${t.to} ${t.close}: ${end}`;
|
||||
})
|
||||
@@ -197,28 +190,33 @@ const buildNotifyPayloads = (watchlistByEmail) => {
|
||||
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
||||
] || "Unknown Case";
|
||||
|
||||
const appealType =
|
||||
entry[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] || "";
|
||||
|
||||
const docSection = entry.documents?.length
|
||||
? `Documents added or updated:\n${formatDocuments(
|
||||
? `### Documents added or updated:\n${formatDocuments(
|
||||
entry.documents,
|
||||
"en"
|
||||
)}\n`
|
||||
: "";
|
||||
const sipSection = entry.sipEvents?.length
|
||||
? `SIP Events created:\n${formatSipEvents(
|
||||
? `### SIP Events created:\n${formatSipEvents(
|
||||
entry.sipEvents
|
||||
)}\n`
|
||||
: "";
|
||||
const repsSection = entry.repsPeriods?.length
|
||||
? `Consultation Periods:\n${formatReps(
|
||||
? `### Consultation Periods:\n${formatReps(
|
||||
entry.repsPeriods
|
||||
)}\n`
|
||||
: "";
|
||||
|
||||
const caseUnsubscribelink = `Unsubscribe to updates on this case ${process.env.NEXTAUTH_URL}/unsubscribe/${entry.pinswg_watchlistid}`;
|
||||
const caseUnsubscribelink = `[Unsubscribe](${process.env.NEXTAUTH_URL}/unsubscribe/${entry.pinswg_watchlistid}) to updates on this case `;
|
||||
|
||||
return `Case: ${caseRef}\nLink to case:${
|
||||
return `---\n## Case: [${caseRef}](${
|
||||
process.env.NEXTAUTH_URL
|
||||
}/case/${caseRef}\n\n${[
|
||||
}/case/${caseRef}) - ${appealType}\n\n${[
|
||||
docSection,
|
||||
sipSection,
|
||||
repsSection,
|
||||
@@ -228,9 +226,9 @@ const buildNotifyPayloads = (watchlistByEmail) => {
|
||||
.join("\n")}`;
|
||||
})
|
||||
.join("\n\n"),
|
||||
unsubscribeLink: `Unsubscribe by selecting this link if you no longer want to receive any updates ${
|
||||
unsubscribeLink: `[Unsubscribe](${
|
||||
process.env.NEXTAUTH_URL + "/unsubscribeall/" + contactId
|
||||
}`
|
||||
}) by selecting this link if you no longer want to receive any updates `
|
||||
};
|
||||
|
||||
const personalisationCY = {
|
||||
@@ -242,6 +240,11 @@ const buildNotifyPayloads = (watchlistByEmail) => {
|
||||
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
||||
] || "Achos Anhysbys";
|
||||
|
||||
const appealType =
|
||||
entry[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] || "";
|
||||
|
||||
const docSection = entry.documents?.length
|
||||
? `Dogfennau wedi'u hychwanegu neu eu diweddaru:\n${formatDocuments(
|
||||
entry.documents,
|
||||
@@ -261,11 +264,11 @@ const buildNotifyPayloads = (watchlistByEmail) => {
|
||||
)}\n`
|
||||
: "";
|
||||
|
||||
const caseUnsubscribelink = `Dad-danysgrifio i ddiweddariadau ar yr achos hwn ${process.env.NEXTAUTH_URL}/unsubscribe/${entry.pinswg_watchlistid}`;
|
||||
const caseUnsubscribelink = `[Dad-danysgrifio](${process.env.NEXTAUTH_URL}/cy/unsubscribe/${entry.pinswg_watchlistid}) i ddiweddariadau ar yr achos hwn `;
|
||||
|
||||
return `Achos: ${caseRef}\nDolen i'r achos: ${
|
||||
return `## Achos: [${caseRef}](${
|
||||
process.env.NEXTAUTH_URL
|
||||
}/case/${caseRef}\n\n${[
|
||||
}/cy/case/${caseRef}) - ${appealType}\n\n${[
|
||||
docSection,
|
||||
sipSection,
|
||||
repsSection,
|
||||
@@ -276,7 +279,7 @@ const buildNotifyPayloads = (watchlistByEmail) => {
|
||||
})
|
||||
.join("\n\n"),
|
||||
unsubscribeLink: `Dad-danysgrifiwch drwy ddewis y ddolen hon os nad ydych chi eisiau derbyn unrhyw ddiweddariadau mwyach ${
|
||||
process.env.NEXTAUTH_URL + "/unsubscribeall/" + contactId
|
||||
process.env.NEXTAUTH_URL + "/cy/unsubscribeall/" + contactId
|
||||
}`
|
||||
};
|
||||
|
||||
@@ -304,7 +307,7 @@ export default async function CombinedApiProxy(req, res) {
|
||||
const token = await getToken();
|
||||
|
||||
// Step 1: Fetch all watchlist entries
|
||||
const watchlistQuery = `pinswg_watchlists?$count=true&$filter=pinswg_emailnotifications ne null&$expand=pinswg_Contact($select=contactid,emailaddress1,firstname,lastname,pinswg_preferredlanguage)&$select=pinswg_emailnotifications,_pinswg_watchedcase_value`;
|
||||
const watchlistQuery = `pinswg_watchlists?$count=true&$filter=pinswg_emailnotifications ne null&$expand=pinswg_Contact($select=contactid,emailaddress1,firstname,lastname,pinswg_preferredlanguage)&$select=pinswg_emailnotifications,_pinswg_watchedcase_value,pinswg_appealcasetype`;
|
||||
const watchlistRes = await axios.get(
|
||||
WEBAPI_URL + watchlistQuery + hashAPIPath(watchlistQuery),
|
||||
azureHeaders(token.access_token)
|
||||
|
||||
@@ -25,7 +25,7 @@ export default async function ApiProxy(req, res) {
|
||||
const token = await getToken();
|
||||
|
||||
const queryUrl =
|
||||
"pinswg_watchlists?$count=true&$filter=pinswg_emailnotifications ne null&$expand=pinswg_Contact($select=contactid,emailaddress1)&$select=pinswg_emailnotifications,_pinswg_watchedcase_value";
|
||||
"pinswg_watchlists?$count=true&$filter=pinswg_emailnotifications ne null&$expand=pinswg_Contact($select=contactid,emailaddress1)&$select=pinswg_emailnotifications,_pinswg_watchedcase_value,pinswg_appealcasetype";
|
||||
|
||||
try {
|
||||
const { data } = await axios.get(
|
||||
|
||||
Reference in New Issue
Block a user