This commit is contained in:
2023-11-08 13:20:43 +00:00
parent e7afa582ff
commit ef1f773022
74 changed files with 3390 additions and 3540 deletions
+1 -1
View File
@@ -27,7 +27,7 @@ const FourOhFour = (props) => {
<div className="govuk-grid-column-two-thirds ">
<h1>{t("common:404-not-found-title")}</h1>
<Link href="/">
<a>{t("common:404-not-found-link")}</a>
{t("common:404-not-found-link")}
</Link>
</div>
</div>
+12 -3
View File
@@ -3,6 +3,7 @@ import SkipLink from "../components/skiplink";
import { Tracking, TrackingNoScript } from "../components/tracking";
import { nanoid } from "nanoid";
import { setCookie } from "nookies";
import Script from "next/script";
class MyDocument extends Document {
static async getInitialProps(ctx) {
@@ -64,11 +65,19 @@ class MyDocument extends Document {
{!process.browser && (
<>
<script nonce={generatedNonce}>
window.switchDomain = `{process.env.I18N_DOMAIN}
`
window.switchDomain = {process.env.I18N_DOMAIN}
</script>
<script nonce={generatedNonce}>
window.apiRoot = `{process.env.API_ROOT}`
window.apiRoot = {process.env.API_ROOT}
</script>
</>
)}
{typeof window !== "undefined" && (
<>
<div>hello</div>
<script nonce={generatedNonce}>
{`window.apiRoot = '${process.env.API_ROOT}'`}
</script>
</>
)}
-81
View File
@@ -1,81 +0,0 @@
import nodemailer from "nodemailer";
export default function handler(req, res) {
const { email, subject, emailcontenttitle, emailcontent } = req.body;
console.log(email);
//console.log(process.env);
const client = nodemailer.createTransport({
auth: {
user: process.env.EMAIL_SERVER_USER,
pass: process.env.EMAIL_SERVER_PASSWORD,
},
host: process.env.EMAIL_SERVER_HOST,
port: process.env.EMAIL_SERVER_PORT,
secure: true,
});
//console.log(client);
// Some simple styling options
const backgroundColor = "#ffffff";
const textColor = "#444444";
const mainBackgroundColor = "#ffffff";
const buttonBackgroundColor = "#aa1111";
const buttonBorderColor = "#aa1111";
const buttonTextColor = "#ffffff";
const headerBackgroundColor = "#000000";
const url = process.env.API_ROOT;
let emailBodyContent = ` <body style="background: ${backgroundColor};">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" style="padding: 10px 0px 20px 0px; font-size: 22px; font-family: Helvetica, Arial, sans-serif; color: #fff;background-color: ${headerBackgroundColor};border-bottom: 10px solid #ffd530;>
<strong>PEDW - Planning Casework</strong>
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="20" cellpadding="0" style="background: ${mainBackgroundColor}; max-width: 600px; margin: auto; border-radius: 10px;">
<tr>
<td align="left" style="padding: 10px 0px 0px 0px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; color: ${textColor};">
${emailcontenttitle}
</td>
<img src ="${url}/assets/images/planning-casework-en.svg"/>
</tr>
<tr>
<td align="left" style="padding: 10px 0px 0px 0px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; color: ${textColor};">
${emailcontent}
</td>
</tr>
<tr>
<td align="center" style="padding: 20px 0;">
</td>
</tr>
<tr>
<td align="center" style="padding: 0px 0px 10px 0px; font-size: 16px; line-height: 22px; font-family: Helvetica, Arial, sans-serif; color: ${textColor};">
If you did not request this email you can safely ignore it.
</td>
</tr>
</table>
</body>`;
const mailData = {
from: "no-reply@rdbdigital.com",
to: email,
subject: subject,
text: emailBodyContent,
html: emailBodyContent,
};
client.sendMail(mailData, (err, data) => {
if (err) {
console.log(err);
res.status(400);
} else {
console.log("mail sent");
res.status(200).json(data);
}
});
}
+1 -1
View File
@@ -58,7 +58,7 @@ const Error = (props) => {
</div>
<div className="govuk-grid-row">
<div className="govuk-grid-column-two-thirds govuk-body">
<Link href="/">
<Link href="/" legacyBehavior>
{t("auth:auth-return-home-link-label")}
</Link>
</div>
+1 -1
View File
@@ -40,7 +40,7 @@ const SignIn = (props) => {
<div className="govuk-grid-row">
<div className="govuk-grid-column-two-thirds govuk-body">
{" "}
<Link href="/">
<Link href="/" legacyBehavior>
{t("auth:auth-return-home-link-label")}
</Link>
</div>
+1 -1
View File
@@ -30,7 +30,7 @@ const FourOhFour = (props) => {
found
</h1>
<Link href="/">
<a>{t("common:404-not-found-link")}</a>
{t("common:404-not-found-link")}
</Link>
</div>
</div>
+17 -17
View File
@@ -42,8 +42,8 @@ const Home = (props) => {
contains the following:
</p>
<h2 className="govuk-heading-s">
<Link href="#">
<a className="govuk-link">Accessibility</a>
<Link href="#" className="govuk-link">
Accessibility
</Link>
</h2>
<p>
@@ -51,10 +51,10 @@ const Home = (props) => {
help using the site.
</p>
<h2 className="govuk-heading-s">
<Link href="#">
<a className="govuk-link">
<Link href="#" className="govuk-link">
Terms and conditions
</a>
</Link>
</h2>
<p>
@@ -62,8 +62,8 @@ const Home = (props) => {
site.
</p>
<h2 className="govuk-heading-s">
<Link href="#">
<a className="govuk-link">Cookies</a>
<Link href="#" className="govuk-link">
Cookies
</Link>
</h2>
<p>
@@ -71,14 +71,14 @@ const Home = (props) => {
website uses them.
</p>
<h2 className="govuk-heading-s">
<Link href="#">
<a className="govuk-link">Privacy</a>
<Link href="#" className="govuk-link">
Privacy
</Link>
</h2>
<p>View our Privacy Notice on GOV.UK.</p>
<h2 className="govuk-heading-s">
<Link href="#">
<a className="govuk-link">Welsh language</a>
<Link href="#" className="govuk-link">
Welsh language
</Link>
</h2>
<p>
@@ -87,8 +87,8 @@ const Home = (props) => {
Scheme.
</p>
<h2 className="govuk-heading-s">
<Link href="#">
<a className="govuk-link">Sitemap</a>
<Link href="#" className="govuk-link">
Sitemap
</Link>
</h2>
<p>
@@ -96,16 +96,16 @@ const Home = (props) => {
heirarchy of the site.
</p>
<h2 className="govuk-heading-s">
<Link href="#">
<a className="govuk-link">Useful links</a>
<Link href="#" className="govuk-link">
Useful links
</Link>
</h2>
<p>
Links to other related websites and documents.
</p>
<h2 className="govuk-heading-s">
<Link href="#">
<a className="govuk-link">Contact</a>
<Link href="#" className="govuk-link">
Contact
</Link>
</h2>
<p>
+1 -1
View File
@@ -91,7 +91,7 @@ const LogOut = (props) => {
<div className="govuk-width-container">
<h2>{t("common:logged-out-title")}</h2>
<div className="govuk-!-margin-top-9 govuk-!-margin-bottom-9">
<Link href={locale == "cy" ? "/cy" : "/"}>
<Link href={locale == "cy" ? "/cy" : "/"} legacyBehavior>
{t("common:logged-out-link")}
</Link>
</div>
+1 -1
View File
@@ -28,7 +28,7 @@ function Error({ statusCode }, props) {
A problem occured when trying to login
</p>
<Link href="/">
<a>{t("common:404-not-found-link")}</a>
{t("common:404-not-found-link")}
</Link>
</div>
</div>
+18 -21
View File
@@ -40,29 +40,26 @@ const Home = (props) => {
const dispatch = useDispatch();
useEffect(() => {
const updateAccountStore = async () => {
const thisSession = await getSession();
// useEffect(() => {
// const updateAccountStore = async () => {
// const thisSession = await getSession();
if (thisSession) {
let [loggedInUser] = await Promise.all([
await getPortalLogin(thisSession.user.email),
]);
// if (thisSession) {
// let loggedInUser = await getPortalLogin(thisSession.user.email);
// dispatch(
// setAccountDetails(
// await getPersonalAccount(
// loggedInUser.value[0].contactid
// )
// )
// );
// dispatch(setContainerID(thisSession.user.id));
dispatch(
setAccountDetails(
await getPersonalAccount(
loggedInUser.value[0].contactid
)
)
);
dispatch(setContainerID(thisSession.user.id));
//dispatch(setRepresentationSubmit(true));
}
};
updateAccountStore();
}, [dispatch]);
// //dispatch(setRepresentationSubmit(true));
// }
// };
// updateAccountStore();
// }, [dispatch]);
const { data: session, status } = useSession();