Merged PR 1036: update build id to store version number

update build id to store version number

Related work items: #9877
This commit is contained in:
Robert Bond
2023-12-06 15:22:51 +00:00
8 changed files with 250 additions and 183 deletions
+1
View File
@@ -271,6 +271,7 @@ let MakeRepresentation = (props) => {
/> />
); );
break; break;
case "interestedparty":
case t( case t(
"myrepresentations:capacity-options-arr-interested" "myrepresentations:capacity-options-arr-interested"
).toLowerCase(): ).toLowerCase():
@@ -56,12 +56,24 @@ const RepAgent = (props) => {
> >
{t("myrepresentations:kind-of-rep-label")} {t("myrepresentations:kind-of-rep-label")}
</label> </label>
{typeof props.representationType == "undefined" ||
typeof formObj.representationForm.values
.representationType == "undefined" ? (
<Field <Field
name="representationType" name="representationType"
component={RenderPickList} component={RenderPickList}
datafieldname="representationType" datafieldname="representationType"
optionsArr={appellantApplicantRepresentationArr} optionsArr={appellantApplicantRepresentationArr}
/> />
) : (
<label className="govuk-label govuk-body-m">
Representation Type:{" "}
{
formObj.representationForm.values
.representationType
}{" "}
</label>
)}
</div> </div>
</div> </div>
{/* <div className="govuk-grid-row"> {/* <div className="govuk-grid-row">
@@ -56,13 +56,12 @@ const RepAppellant = (props) => {
className="govuk-label govuk-body-m" className="govuk-label govuk-body-m"
htmlFor="representationType" htmlFor="representationType"
> >
{t( {t("myrepresentations:kind-of-rep-label")}
"myrepresentations:representation-from-an-agent-heading"
)}
?
</label> </label>
{typeof props.representationType == "undefined" ? ( {typeof props.representationType == "undefined" ||
typeof formObj.representationForm.values
.representationType == "undefined" ? (
<Field <Field
name="representationType" name="representationType"
component={RenderPickList} component={RenderPickList}
@@ -70,7 +69,13 @@ const RepAppellant = (props) => {
optionsArr={appellantApplicantRepresentationArr} optionsArr={appellantApplicantRepresentationArr}
/> />
) : ( ) : (
<p>{props.representationType}</p> <label className="govuk-label govuk-body-m">
Representation Type:{" "}
{
formObj.representationForm.values
.representationType
}{" "}
</label>
)} )}
</div> </div>
</div> </div>
@@ -90,6 +95,9 @@ const RepAppellant = (props) => {
</div> </div>
</div> */} </div> */}
{(typeof props.representationType != "undefined" ||
typeof formObj.representationForm.values.representationType !=
"undefined") && (
<div className="govuk-grid-row"> <div className="govuk-grid-row">
<div className="govuk-form-group"> <div className="govuk-form-group">
<p className="govuk-body"> <p className="govuk-body">
@@ -112,20 +120,40 @@ const RepAppellant = (props) => {
className="govuk-textarea govuk-input--width-30" className="govuk-textarea govuk-input--width-30"
aria-describedby={props.name + "-hint"} aria-describedby={props.name + "-hint"}
/> />
{RepresentationGuidanceText( {formObj.representationForm.values.appealType ==
formObj.representationForm.values.appealType "846040004" ? (
<p className="govuk-hint govuk-!-font-size-14 govuk-!-margin-top-5">
{t(
"myrepresentations:questionnaire-publish-policy-label"
)}{" "}
<a href="https://gov.wales/planning-and-environment-decisions-wales-publishing-policy-html">
https://gov.wales/planning-and-environment-decisions-wales-publishing-policy-html
</a>
</p>
) : (
<p className="govuk-hint govuk-!-font-size-14 govuk-!-margin-top-5">
{t(
"myrepresentations:publish-policy-label"
)}{" "}
<a href="https://gov.wales/planning-and-environment-decisions-wales-publishing-policy-html">
https://gov.wales/planning-and-environment-decisions-wales-publishing-policy-html
</a>
</p>
)} )}
</div> </div>
<div className="govuk-form-group govuk-!-margin-bottom-9"> <div className="govuk-form-group govuk-!-margin-bottom-9">
<FileUploadField <FileUploadField
name={"representationDocuments"} name={"representationDocuments"}
label={t("myrepresentations:add-files-label")} label={t(
"myrepresentations:add-files-label"
)}
ticketnumber={props.props.caseReference} ticketnumber={props.props.caseReference}
hint={"sdsd"} hint={"sdsd"}
fileList={[]} fileList={[]}
setFilesForRepresentation={[]} setFilesForRepresentation={[]}
containerID={ containerID={
props.props.props.accountDetails.containerID props.props.props.accountDetails
.containerID
} }
/> />
</div> </div>
@@ -163,6 +191,7 @@ const RepAppellant = (props) => {
</fieldset> </fieldset>
</div>{" "} </div>{" "}
</div> </div>
)}
<div className="govuk-grid-row"> <div className="govuk-grid-row">
<div className="govuk-button-group"> <div className="govuk-button-group">
<button <button
@@ -1128,32 +1128,32 @@ export function FileUploadField(props) {
); );
} }
export const RepresentationGuidanceText = (appealType) => { // export const RepresentationGuidanceText = (appealType) => {
let { t } = useTranslation(); // let { t } = useTranslation();
console.log(appealType); // console.log(appealType);
switch (appealType) { // switch (appealType) {
case "846040004": //has/cas // case "846040004": //has/cas
return ( // return (
<p className="govuk-hint govuk-!-font-size-14 govuk-!-margin-top-5"> // <p className="govuk-hint govuk-!-font-size-14 govuk-!-margin-top-5">
{t("myrepresentations:questionnaire-publish-policy-label")}{" "} // {t("myrepresentations:questionnaire-publish-policy-label")}{" "}
<a href="https://gov.wales/planning-and-environment-decisions-wales-publishing-policy-html"> // <a href="https://gov.wales/planning-and-environment-decisions-wales-publishing-policy-html">
https://gov.wales/planning-and-environment-decisions-wales-publishing-policy-html // https://gov.wales/planning-and-environment-decisions-wales-publishing-policy-html
</a> // </a>
</p> // </p>
); // );
break; // break;
default: // default:
return ( // return (
<p className="govuk-hint govuk-!-font-size-14 govuk-!-margin-top-5"> // <p className="govuk-hint govuk-!-font-size-14 govuk-!-margin-top-5">
{t("myrepresentations:publish-policy-label")}{" "} // {t("myrepresentations:publish-policy-label")}{" "}
<a href="https://gov.wales/planning-and-environment-decisions-wales-publishing-policy-html"> // <a href="https://gov.wales/planning-and-environment-decisions-wales-publishing-policy-html">
https://gov.wales/planning-and-environment-decisions-wales-publishing-policy-html // https://gov.wales/planning-and-environment-decisions-wales-publishing-policy-html
</a> // </a>
</p> // </p>
); // );
break; // break;
} // }
return guidanceString; // return guidanceString;
}; // };
@@ -36,7 +36,7 @@ const RepInterestedPartyPerson = (props) => {
<div className="govuk-grid-row"> <div className="govuk-grid-row">
<h2 className="govuk-heading-m "> <h2 className="govuk-heading-m ">
{t( {t(
"myrepresentations:representation-from-an-interested-party-heading" "myrepresentations:representation-from-an-interested-person-heading"
)} )}
</h2> </h2>
<div className="govuk-form-group"> <div className="govuk-form-group">
@@ -44,11 +44,11 @@ const RepInterestedPartyPerson = (props) => {
className="govuk-label govuk-body-m" className="govuk-label govuk-body-m"
htmlFor="representationType" htmlFor="representationType"
> >
{t( {t("myrepresentations:kind-of-rep-label")}
"myrepresentations:representation-from-an-agent-heading"
)}
?
</label> </label>
{typeof props.representationType == undefined ||
typeof formObj.representationForm.values
.representationType == "undefined" ? (
<Field <Field
name="representationType" name="representationType"
component={RenderPickList} component={RenderPickList}
@@ -57,9 +57,21 @@ const RepInterestedPartyPerson = (props) => {
optionsArr={interestedPersonRepresentationArr} optionsArr={interestedPersonRepresentationArr}
errorMsg={t("newappeal:select-an-option-label")} errorMsg={t("newappeal:select-an-option-label")}
/> />
) : (
<label className="govuk-label govuk-body-m">
Representation Type:{" "}
{
formObj.representationForm.values
.representationType
}{" "}
</label>
)}
</div> </div>
</div> </div>
{(typeof props.representationType != "undefined" ||
typeof formObj.representationForm.values.representationType !=
"undefined") && (
<>
<div className="govuk-grid-row"> <div className="govuk-grid-row">
<div className="govuk-form-group"> <div className="govuk-form-group">
<Field <Field
@@ -88,8 +100,14 @@ const RepInterestedPartyPerson = (props) => {
className="govuk-fieldset" className="govuk-fieldset"
aria-describedby="commentBox-hint" aria-describedby="commentBox-hint"
> >
<div id="commentBox-hint" className="govuk-hint"> <div
{t("myrepresentations:comments-set-out-label")}: id="commentBox-hint"
className="govuk-hint"
>
{t(
"myrepresentations:comments-set-out-label"
)}
:
</div> </div>
<div className="govuk-form-group"> <div className="govuk-form-group">
<Field <Field
@@ -106,20 +124,24 @@ const RepInterestedPartyPerson = (props) => {
<div className="govuk-form-group govuk-!-margin-bottom-9"> <div className="govuk-form-group govuk-!-margin-bottom-9">
<FileUploadField <FileUploadField
name={"representationDocuments"} name={"representationDocuments"}
label={t("myrepresentations:add-files-label")} label={t(
"myrepresentations:add-files-label"
)}
ticketnumber={props.props.caseReference} ticketnumber={props.props.caseReference}
hint={"sdsd"} hint={"sdsd"}
fileList={[]} fileList={[]}
setFilesForRepresentation={[]} setFilesForRepresentation={[]}
containerID={ containerID={
props.props.props.accountDetails.containerID props.props.props.accountDetails
.containerID
} }
/> />
</div> </div>
</fieldset> </fieldset>
</div>{" "} </div>{" "}
</div> </div>
</>
)}
<div className="govuk-grid-row"> <div className="govuk-grid-row">
<div className="govuk-button-group"> <div className="govuk-button-group">
<button <button
+6 -4
View File
@@ -2,6 +2,7 @@
//const withStyles = require("@webdeb/next-styles"); //const withStyles = require("@webdeb/next-styles");
//const { nextI18NextRewrites } = require("next-i18next/rewrites"); //const { nextI18NextRewrites } = require("next-i18next/rewrites");
const nextTranslate = require("next-translate-plugin"); const nextTranslate = require("next-translate-plugin");
const nextBuildId = require("next-build-id");
// module.exports = withStyles({ // module.exports = withStyles({
// sass: true, // use .scss files // sass: true, // use .scss files
@@ -52,8 +53,12 @@ const securityHeaders = [
// value: "frame-src 'self'; child-src 'self';object-src 'none'; script-src 'self' 'https://www.googletagmanager.com' unsafe-inline", // value: "frame-src 'self'; child-src 'self';object-src 'none'; script-src 'self' 'https://www.googletagmanager.com' unsafe-inline",
// }, // },
]; ];
const buildId = nextBuildId.sync({ dir: __dirname });
module.exports = { module.exports = {
env: {
BUILD_ID_ENV: buildId,
},
swcMinify: false, swcMinify: false,
sassOptions: { sassOptions: {
includePaths: [ includePaths: [
@@ -72,10 +77,7 @@ module.exports = {
}, },
]; ];
}, },
generateBuildId: async () => { generateBuildId: () => buildId,
// You can, for example, get the latest git commit hash here
return "pinswg-build-id";
},
poweredByHeader: false, poweredByHeader: false,
async rewrites() { async rewrites() {
return [ return [
+1
View File
@@ -44,6 +44,7 @@
"nanoid": "^3.2.0", "nanoid": "^3.2.0",
"next": "^14.0.1", "next": "^14.0.1",
"next-auth": "^4.24.4", "next-auth": "^4.24.4",
"next-build-id": "^3.0.0",
"next-connect": "^0.12.2", "next-connect": "^0.12.2",
"next-redux-wrapper": "^7.0.5", "next-redux-wrapper": "^7.0.5",
"next-swagger-doc": "^0.4.0", "next-swagger-doc": "^0.4.0",
+1 -1
View File
@@ -137,7 +137,7 @@ const makeStore = ({ isServer }) => {
"watchedCases", "watchedCases",
"form", "form",
], ],
version: 3, version: process.env.BUILD_ID_ENV,
storage: storage, storage: storage,
stateReconciler: autoMergeLevel2, // if needed, use a safer storage stateReconciler: autoMergeLevel2, // if needed, use a safer storage
migrate: createMigrate(migrations, { debug: true }), migrate: createMigrate(migrations, { debug: true }),