diff --git a/actions/services/documentDirectService.js b/actions/services/documentDirectService.js
index 4934576a..d867ce35 100644
--- a/actions/services/documentDirectService.js
+++ b/actions/services/documentDirectService.js
@@ -243,9 +243,11 @@ export const generateRepPDF = async (
var queryUrl =
"/api/file/generatepdf" + (options.download ? "?download=true" : "");
+ const hashedUrl = await buildHashedQueryUrl(queryUrl);
+
const config = {
method: "post",
- url: queryUrl,
+ url: hashedUrl,
data: formValues,
...(options.download ? { responseType: "blob" } : {})
};
@@ -271,9 +273,11 @@ export const generateAppealPDF = async (
var queryUrl = "/api/file/generateappealpdf?appealType=" + appealType;
+ const hashedUrl = await buildHashedQueryUrl(queryUrl);
+
const config = {
method: "post",
- url: queryUrl,
+ url: hashedUrl,
data: formValues
};
diff --git a/components/case/representation/index.js b/components/case/representation/index.js
index e4a94631..0feaf8cd 100644
--- a/components/case/representation/index.js
+++ b/components/case/representation/index.js
@@ -977,8 +977,9 @@ let MakeRepresentation = (props) => {
generateRepPDF(
values,
props.props.accountDetails.containerID,
- currentView.caseReference.currentReference
+ props.currentView.caseReference.currentReference
).then((data) => {
+ console.log(data, "");
if (data.status === "success") {
values = updateLinks(values);
uploadRepresentationFiles(values);
diff --git a/components/case/representation/representationComplete.js b/components/case/representation/representationComplete.js
index d8c38184..7ef18595 100644
--- a/components/case/representation/representationComplete.js
+++ b/components/case/representation/representationComplete.js
@@ -104,6 +104,7 @@ const RepComplete = (props) => {
{t("myrepresentations:rep-complete-para-one")}
{t("myrepresentations:rep-complete-para-two")}
{t("myrepresentations:rep-complete-para-three")}
+ {t("myrepresentations:rep-complete-para-four")}
diff --git a/components/case/representation/representationCompleteSubmit.js b/components/case/representation/representationCompleteSubmit.js
index fc819e03..f471dfca 100644
--- a/components/case/representation/representationCompleteSubmit.js
+++ b/components/case/representation/representationCompleteSubmit.js
@@ -292,8 +292,7 @@ const RepCompleteSubmit = (props) => {
const pdfBlob = await generateRepPDF(
repFormData,
containerID,
- caseRef,
- { download: true }
+ caseRef
);
if (pdfBlob) {
diff --git a/i18n.js b/i18n.js
index 9e62f9c3..09c9872c 100644
--- a/i18n.js
+++ b/i18n.js
@@ -51,7 +51,8 @@ module.exports = {
"case",
"myrepresentations",
"common",
- "home"
+ "home",
+ "myportal"
],
"/myportal/error": ["myportal", "common"],
"/myportal/case/id/[incident]": ["case", "home"],
diff --git a/locales/cy/myrepresentations.json b/locales/cy/myrepresentations.json
index bcaf58c5..fc1c93a1 100644
--- a/locales/cy/myrepresentations.json
+++ b/locales/cy/myrepresentations.json
@@ -58,6 +58,7 @@
"rep-complete-heading": "Cyflwyno Sylwadau",
"rep-complete-para-one": "Diolch am gyflwyno eich sylw/sylwadau gan ddefnyddio'r Porth Gwaith Achos Apeliadau.",
"rep-complete-para-two": "Cofiwch fod angen i ni dderbyn unrhyw ddogfennau ategol o fewn y terfyn amser priodol ar gyfer yr achos. Rhaid i unrhyw beth y byddwch yn ei anfon atom gael ei farcio'n glir gyda chyfeirnod yr achos a chyfeiriad y safle (gan gynnwys y cod post, os yw'n hysbys).",
+ "rep-complete-para-four": "Diolch am eich sylwadau. Bydd eich sylwadau ar gael i'w gweld ar-lein unwaith y bydd y dyddiad cau ar gyfer cyflwyniadau wedi pasio.",
"rep-complete-para-three": "Byddwch yn derbyn cadarnhad yn fuan a anfonir at y cyfeiriad e-bost a roddwyd gennych.",
"lpa-capacity-para-one": "Mae’r ffurflen hon yn eich galluogi i gyflwyno datganiadau, sylwadau a holiaduron ar achos i Benderfyniadau Cynllunio ac Amgylchedd Cymru.",
"s78-section-heading-one": "Y weithdrefn apelio ac ymweliad safle",
diff --git a/locales/en/myrepresentations.json b/locales/en/myrepresentations.json
index 1cd9efc6..23f12f80 100644
--- a/locales/en/myrepresentations.json
+++ b/locales/en/myrepresentations.json
@@ -59,6 +59,7 @@
"rep-complete-para-one": "Thank you for submitting your representation(s) using the Appeals Casework Portal.",
"rep-complete-para-two": "Please remember that any supporting documentation needs to be received by us within the appropriate deadline for the case. Anything you send to us must be clearly marked with the case reference number and the site address (including the postcode, where known).",
"rep-complete-para-three": "You will shortly receive confirmation to the email address you have provided.",
+ "rep-complete-para-four": "Thank you for your representation. Your comments will be available to view online once the deadline for submissions has passed.",
"lpa-capacity-para-one": "This form enables you to submit statements, comments and questionaires on a case to Planning and Environment Decisions Wales.",
"s78-section-heading-one": "Appeal procedure and site visit",
"s78-section-question-1": "PEDW Reference",
diff --git a/pages/api/endpoint/deletewatchedcasesproxy_api.js b/pages/api/endpoint/deletewatchedcasesproxy_api.js
index 72142710..a9208db1 100644
--- a/pages/api/endpoint/deletewatchedcasesproxy_api.js
+++ b/pages/api/endpoint/deletewatchedcasesproxy_api.js
@@ -22,22 +22,12 @@ import CryptoJS from "crypto-js";
import { azureHeaders } from "../../../actions/core/headers";
import { consoleLogger } from "../../../actions/core/logger";
import { getToken } from "../../../actions/core/token";
-
-const WORDKEY = process.env.HASHKEY;
+import { hashAPIPath } from "../../../actions/core/hash";
const WEBAPI_URL =
process.env.RELAY_ROOT ||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
-const hashAPIPath = (queryPath) => {
- var hashlink = CryptoJS.HmacSHA256(
- queryPath,
- CryptoJS.enc.Hex.parse(WORDKEY)
- );
- hashlink = hashlink.toString(CryptoJS.enc.Hex);
- return (queryPath.indexOf("?") > -1 ? "&hash=" : "?hash=") + hashlink;
-};
-
const BASE_URL = process.env.API_ROOT || `http://localhost:${port}`;
export default async function ApiProxy(req, res) {
diff --git a/pages/api/endpoint/gethash_api.js b/pages/api/endpoint/gethash_api.js
index 4c1ce596..37363f64 100644
--- a/pages/api/endpoint/gethash_api.js
+++ b/pages/api/endpoint/gethash_api.js
@@ -21,7 +21,9 @@ ApiProxy.get(async (req, res) => {
"/api/file/deleteblobcase",
"/api/file/deleteblobrep",
"/api/file/createrepcompletemessage_api",
- "/api/file/createappealcompletemessage_api"
+ "/api/file/createappealcompletemessage_api",
+ "/api/file/generatepdf",
+ "/api/file/generateappealpdf"
];
if (
diff --git a/pages/api/file/createcaseinvolvement_api.js b/pages/api/file/createcaseinvolvement_api.js
index f3553eb0..a34d5fc6 100644
--- a/pages/api/file/createcaseinvolvement_api.js
+++ b/pages/api/file/createcaseinvolvement_api.js
@@ -14,25 +14,12 @@ import axios from "axios";
import CryptoJS from "crypto-js";
import { consoleLogger } from "../../../actions/core/logger";
import { getToken } from "../../../actions/core/token";
-
-const WORDKEY = process.env.HASHKEY;
+import { hashAPIPath } from "../../../actions/core/hash";
const WEBAPI_URL =
process.env.RELAY_ROOT ||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
-const hashAPIPath = (queryPath) => {
- var hashlink = CryptoJS.HmacSHA256(
- queryPath,
- CryptoJS.enc.Hex.parse(WORDKEY)
- );
- hashlink = hashlink.toString(CryptoJS.enc.Hex);
-
- //return "&hash=" + hashlink;
-
- return (queryPath.indexOf("?") > -1 ? "&hash=" : "?hash=") + hashlink;
-};
-
export default async function ApiProxy(req, res) {
if (
!req.body ||