Merged PR 1643: right click and language pref bugs
Related work items: #16185, #16478, #16630
This commit is contained in:
@@ -59,6 +59,7 @@ const Header = (props) => {
|
|||||||
"/register",
|
"/register",
|
||||||
"/myportal/searchresults",
|
"/myportal/searchresults",
|
||||||
"/myportal/representation",
|
"/myportal/representation",
|
||||||
|
"/myportal/viewall",
|
||||||
];
|
];
|
||||||
|
|
||||||
const hasContactLink = [
|
const hasContactLink = [
|
||||||
@@ -279,6 +280,7 @@ const Header = (props) => {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{" "}
|
{" "}
|
||||||
|
wwww
|
||||||
{t("common:available-in")}
|
{t("common:available-in")}
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -356,7 +356,7 @@ const AwaitingSubmissionFromBlob = (props) => {
|
|||||||
router.locale +
|
router.locale +
|
||||||
"/fymhorth/gweldpopeth"
|
"/fymhorth/gweldpopeth"
|
||||||
: "/myportal/viewall") +
|
: "/myportal/viewall") +
|
||||||
"?viewKey=awaitingSubmission"
|
"?viewKey=awaitingSubmissionDetails"
|
||||||
}
|
}
|
||||||
className="govuk-link--no-underline"
|
className="govuk-link--no-underline"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|||||||
@@ -43,7 +43,7 @@
|
|||||||
"account-title": "Your account",
|
"account-title": "Your account",
|
||||||
"account-about-you-label": "About you",
|
"account-about-you-label": "About you",
|
||||||
"account-role-label": "Role",
|
"account-role-label": "Role",
|
||||||
"account-preferred-language-label": "Prefered language",
|
"account-preferred-language-label": "Preferred language",
|
||||||
"account-preferred-language-english": "English",
|
"account-preferred-language-english": "English",
|
||||||
"account-preferred-language-welsh": "Welsh",
|
"account-preferred-language-welsh": "Welsh",
|
||||||
"account-first-name-label": "First name",
|
"account-first-name-label": "First name",
|
||||||
|
|||||||
+3
-3
@@ -24,9 +24,9 @@ class MyDocument extends Document {
|
|||||||
const cookieObj = ctx.req.cookies.CookiePolicy || {};
|
const cookieObj = ctx.req.cookies.CookiePolicy || {};
|
||||||
|
|
||||||
console.log("useGATracking: ", useGATracking);
|
console.log("useGATracking: ", useGATracking);
|
||||||
setCookie(ctx, "pedw_locale", ctx.locale, {
|
// setCookie(ctx, "pedw_locale", ctx.locale, {
|
||||||
path: "/",
|
// path: "/",
|
||||||
});
|
// });
|
||||||
|
|
||||||
const headers = ctx.req?.headers;
|
const headers = ctx.req?.headers;
|
||||||
const generatedNonce = headers?.["x-nonce"];
|
const generatedNonce = headers?.["x-nonce"];
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ const Home = (props) => {
|
|||||||
<div>
|
<div>
|
||||||
<Head>
|
<Head>
|
||||||
<title>
|
<title>
|
||||||
{t("search:page-title")} - {t("common:service-name")}
|
{t("account:account-title")} - {t("common:service-name")}
|
||||||
</title>
|
</title>
|
||||||
</Head>
|
</Head>
|
||||||
<div id="page_wrapper">
|
<div id="page_wrapper">
|
||||||
|
|||||||
@@ -264,15 +264,19 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
|||||||
);
|
);
|
||||||
|
|
||||||
console.log("req locale :", ctx.locale);
|
console.log("req locale :", ctx.locale);
|
||||||
|
console.log("cookie locale :", cookies.pedw_locale);
|
||||||
|
|
||||||
store.dispatch(setLocale(ctx.locale));
|
store.dispatch(setLocale(ctx.locale));
|
||||||
|
|
||||||
const preferredLocale =
|
let preferredLocale =
|
||||||
accountDetails.pinswg_preferredlanguage == "846040000"
|
accountDetails.pinswg_preferredlanguage == "846040000"
|
||||||
? "cy"
|
? "cy"
|
||||||
: "en";
|
: "en";
|
||||||
|
|
||||||
// added to redirect if not the users preferred language
|
// added to redirect if not the users preferred language
|
||||||
|
cookies.hasOwnProperty("pedw_locale") &&
|
||||||
|
(preferredLocale = cookies.pedw_locale);
|
||||||
|
|
||||||
if (preferredLocale != ctx.locale) {
|
if (preferredLocale != ctx.locale) {
|
||||||
return {
|
return {
|
||||||
redirect: {
|
redirect: {
|
||||||
|
|||||||
Reference in New Issue
Block a user