Removed proxy and added api calls, has gov gateway auth
This commit is contained in:
+29
-24
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
ACCESS_TOKEN_ENDPOINT = https://login.microsoftonline.com/
|
ACCESS_TOKEN_ENDPOINT = https://login.microsoftonline.com/
|
||||||
TENANT = a8d860de-d5e1-45af-8376-d93f02e6b502
|
TENANT = a8d860de-d5e1-45af-8376-d93f02e6b502
|
||||||
|
//TENANT = 9ac1a5ab-cd58-409e-a1b6-6b10422a68f5
|
||||||
GRANT_TYPE = "client_credentials"
|
GRANT_TYPE = "client_credentials"
|
||||||
|
|
||||||
HASHKEY = 028ffbae928d7191c0017f298260995f901d78eabde1436c0af0423459cc3715832136d84f68818d3a96399467b52143e273d4f3bf4ae190848891535421cd6c
|
HASHKEY = 028ffbae928d7191c0017f298260995f901d78eabde1436c0af0423459cc3715832136d84f68818d3a96399467b52143e273d4f3bf4ae190848891535421cd6c
|
||||||
@@ -11,44 +12,34 @@ NEXT_PUBLIC_HASHKEY = 028ffbae928d7191c0017f298260995f901d78eabde1436c0af0423459
|
|||||||
//Dev oauth
|
//Dev oauth
|
||||||
//CLIENT_ID = e082def0-3453-461f-9a5e-f4ab127dc015
|
//CLIENT_ID = e082def0-3453-461f-9a5e-f4ab127dc015
|
||||||
//CLIENT_SECRET = qW.7Q~TSr3sZmLEnJQJPXEdOckb_yo2t1yJmY
|
//CLIENT_SECRET = qW.7Q~TSr3sZmLEnJQJPXEdOckb_yo2t1yJmY
|
||||||
|
|
||||||
// dev
|
|
||||||
//RELAY_ROOT = https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/
|
//RELAY_ROOT = https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/
|
||||||
//RELAYURI = "dev-pedw-ns.servicebus.windows.net"
|
//RELAYURI = "dev-pedw-ns.servicebus.windows.net"
|
||||||
//RELAYPATH = "dev-pedw-hc"
|
//RELAYPATH = "dev-pedw-hc"
|
||||||
//SASKEY = "Ml0Y/S/nfRcmIrHFRkO4jNm2J3iH52TSxPiak7+E1+Y="
|
|
||||||
//SASKEYNAME = "devpedwnspolicy"
|
|
||||||
|
|
||||||
|
|
||||||
//Test Oauth
|
//Test Oauth
|
||||||
//CLIENT_ID = 6619ad85-c908-490d-811b-de8c93c0f2aa
|
CLIENT_ID = 6619ad85-c908-490d-811b-de8c93c0f2aa
|
||||||
//CLIENT_SECRET = qKo7Q~5QvLEplbwnBbint_I5lXqx_-kDm8Vj-
|
CLIENT_SECRET = qKo7Q~5QvLEplbwnBbint_I5lXqx_-kDm8Vj-
|
||||||
|
RELAY_ROOT = https://test-pedw-ns.servicebus.windows.net/test-pedw-hc/
|
||||||
|
RELAYURI = "test-pedw-ns.servicebus.windows.net"
|
||||||
|
RELAYPATH = "test-pedw-hc"
|
||||||
|
|
||||||
//test
|
|
||||||
//RELAY_ROOT = https://test-pedw-ns.servicebus.windows.net/test-pedw-hc/
|
|
||||||
//RELAYURI = "test-pedw-ns.servicebus.windows.net"
|
|
||||||
//RELAYPATH = "test-pedw-hc"
|
|
||||||
//SASKEY = "kTLrs9UHwuW9Msc9uNfjf+89qLYT6ly80lK0zdTYJW4="
|
|
||||||
//SASKEYNAME = "testpedwhcpolicy"
|
|
||||||
|
|
||||||
//Preprod Oauth
|
//Preprod Oauth
|
||||||
CLIENT_ID = 75594242-8773-45c7-a3da-85e62485b2f3
|
//CLIENT_ID = ab6c4678-b31a-4eb3-b429-e039120e488a
|
||||||
CLIENT_SECRET = UDF7Q~OwTLIV7LXPHlIYHSWbJunlBD53ieLt-
|
//CLIENT_SECRET = Ioo7Q~RJfhWsE45wPsuHm1CzRk1SppnNN3lZF
|
||||||
|
//RELAY_ROOT = https://pp-pedw-ns.servicebus.windows.net/pp-pedw-hc/
|
||||||
|
//RELAYURI = "pp-pedw-ns.servicebus.windows.net"
|
||||||
|
//RELAYPATH = "pp-pedw-hc"
|
||||||
|
|
||||||
|
|
||||||
//preprod
|
|
||||||
RELAY_ROOT = https://pp-pedw-ns.servicebus.windows.net/pp-pedw-hc/
|
|
||||||
RELAYURI = "pp-pedw-ns.servicebus.windows.net"
|
|
||||||
RELAYPATH = "pp-pedw-hc"
|
|
||||||
//SASKEY = "JzrOYfMTsGBD1cZHH2nkzqsbfDCqg0brO6jyiIDNVPo="
|
|
||||||
//SASKEYNAME = "pppedwnspolicy"
|
|
||||||
|
|
||||||
|
|
||||||
//Prod Oauth
|
//Prod Oauth
|
||||||
//CLIENT_ID = 01904c07-9035-4cf9-a535-3945f6e470d2
|
//CLIENT_ID = 01904c07-9035-4cf9-a535-3945f6e470d2
|
||||||
//CLIENT_SECRET = PRo7Q~GQoKSdARRqF-NOXQDx2Ka8UCINyvagk
|
//CLIENT_SECRET = PRo7Q~GQoKSdARRqF-NOXQDx2Ka8UCINyvagk
|
||||||
|
//RELAY_ROOT = https://prod-pedw-ns.servicebus.windows.net/prod-pedw-hc/
|
||||||
|
//RELAYURI = "prod-pedw-ns.servicebus.windows.net"
|
||||||
|
//RELAYPATH = "prod-pedw-hc"
|
||||||
|
|
||||||
|
|
||||||
GOOGLE_TAG_MANAGER = GTM-T78CBC3
|
GOOGLE_TAG_MANAGER = GTM-T78CBC3
|
||||||
@@ -63,4 +54,18 @@ I18N_DOMAIN = "cymru.local"
|
|||||||
//I18N_DOMAIN ="dev-gwaithcynllunio.gwasanaeth.llyw.cymru"
|
//I18N_DOMAIN ="dev-gwaithcynllunio.gwasanaeth.llyw.cymru"
|
||||||
//I18N_DOMAIN ="stage-gwaithcynllunio.gwasanaeth.llyw.cymru"
|
//I18N_DOMAIN ="stage-gwaithcynllunio.gwasanaeth.llyw.cymru"
|
||||||
//I18N_DOMAIN ="pp-gwaithcynllunio.gwasanaeth.llyw.cymru"s
|
//I18N_DOMAIN ="pp-gwaithcynllunio.gwasanaeth.llyw.cymru"s
|
||||||
//I18N_DOMAIN ="gwaithcynllunio.gwasanaeth.llyw.cymru"
|
//I18N_DOMAIN ="gwaithcynllunio.gwasanaeth.llyw.cymru"
|
||||||
|
|
||||||
|
|
||||||
|
//gov gateway
|
||||||
|
GG_PROVIDER_CONFIG_ENDPOINT = "https://api.ete.access.service.gov.uk/.well-known/openid-configuration"
|
||||||
|
GG_CLIENT_ID = 5vTukeSpN7d6uBV7YLb7A5wOctzzkZ
|
||||||
|
GG_CLIENT_SECRET = z1PGLAKPxIhjMBegTdzX22AayIORc1GsCbMQZ6mieBn7zChjzzxup5lkIByEmsYS
|
||||||
|
GG_REDIRECT_URI = "http://localhost:3000"
|
||||||
|
|
||||||
|
NEXT_PUBLIC_GG_CLIENT_ID = 5vTukeSpN7d6uBV7YLb7A5wOctzzkZ
|
||||||
|
NEXT_PUBLIC_GG_REDIRECT_URI = "http://localhost:3000"
|
||||||
|
|
||||||
|
API_ROOT = "http://localhost:3000"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,191 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import { hashAPIPath } from "./";
|
||||||
|
|
||||||
|
const configEndpoint = process.env.GG_PROVIDER_CONFIG_ENDPOINT;
|
||||||
|
const ggClientID = process.env.GG_CLIENT_ID;
|
||||||
|
const ggClientSecret = process.env.GG_CLIENT_SECRET;
|
||||||
|
const WEBAPI_URL =
|
||||||
|
process.env.RELAY_ROOT ||
|
||||||
|
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
||||||
|
|
||||||
|
export const getProviderConfig = () => {
|
||||||
|
return axios
|
||||||
|
.get(configEndpoint)
|
||||||
|
.then((res) => res.data)
|
||||||
|
.catch((error) => {
|
||||||
|
console.log("error :", error.response);
|
||||||
|
// return error;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getGGToken = (tokenURL, authCode, redirectUri) => {
|
||||||
|
const tokenBody =
|
||||||
|
"grant_type=authorization_code" +
|
||||||
|
"&code=" +
|
||||||
|
authCode +
|
||||||
|
"&redirect_uri=" +
|
||||||
|
redirectUri;
|
||||||
|
|
||||||
|
const basicAuthBase64 = (ggClientID + ":" + ggClientSecret).toString();
|
||||||
|
//console.log("base64 " + Base64.encode(basicAuthBase64));
|
||||||
|
|
||||||
|
const tokenConfig = {
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/x-www-form-urlencoded",
|
||||||
|
"Authorization": "Basic " + Base64.encode(basicAuthBase64),
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
return axios
|
||||||
|
.post(tokenURL, tokenBody, tokenConfig)
|
||||||
|
.then((res) => res.data)
|
||||||
|
.catch((error) => {
|
||||||
|
// if (error.response) {
|
||||||
|
// console.log(error.response.data);
|
||||||
|
// console.log(error.response.status);
|
||||||
|
// console.log(error.response.headers);
|
||||||
|
// }
|
||||||
|
return error.response;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getUserInfo = (userInfoURL, authToken) => {
|
||||||
|
const tokenConfig = {
|
||||||
|
headers: {
|
||||||
|
"Authorization": "Bearer " + authToken,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
return axios
|
||||||
|
.get(userInfoURL, tokenConfig)
|
||||||
|
.then((res) => res)
|
||||||
|
.catch((error) => {
|
||||||
|
//console.log(`Error: ${err?.response?.data}`);
|
||||||
|
//return error;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getPortalLogin = (emailAddress, token) => {
|
||||||
|
var queryUrl =
|
||||||
|
"contacts?$filter=emailaddress1 eq '" +
|
||||||
|
emailAddress +
|
||||||
|
"'&$count=true&$select=emailaddress1,contactid,pinswg_custom_password,yomifullname,firstname,lastname";
|
||||||
|
return axios
|
||||||
|
.get(WEBAPI_URL + queryUrl + hashAPIPath(queryUrl), azureHeaders(token))
|
||||||
|
.then((res) => res.data)
|
||||||
|
.catch((error) => {
|
||||||
|
console.log("thiserror", error);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const azureHeaders = (access_token) => {
|
||||||
|
return {
|
||||||
|
headers: {
|
||||||
|
"OData-MaxVersion": "4.0",
|
||||||
|
"OData-Version": "4.0",
|
||||||
|
"Accept": "application/json;odata.metadata=none",
|
||||||
|
"Prefer": 'odata.include-annotations="*",return=representation',
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
"Authorization": "Bearer " + access_token,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
var Base64 = {
|
||||||
|
_keyStr:
|
||||||
|
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
|
||||||
|
encode: function (e) {
|
||||||
|
var t = "";
|
||||||
|
var n, r, i, s, o, u, a;
|
||||||
|
var f = 0;
|
||||||
|
e = Base64._utf8_encode(e);
|
||||||
|
while (f < e.length) {
|
||||||
|
n = e.charCodeAt(f++);
|
||||||
|
r = e.charCodeAt(f++);
|
||||||
|
i = e.charCodeAt(f++);
|
||||||
|
s = n >> 2;
|
||||||
|
o = ((n & 3) << 4) | (r >> 4);
|
||||||
|
u = ((r & 15) << 2) | (i >> 6);
|
||||||
|
a = i & 63;
|
||||||
|
if (isNaN(r)) {
|
||||||
|
u = a = 64;
|
||||||
|
} else if (isNaN(i)) {
|
||||||
|
a = 64;
|
||||||
|
}
|
||||||
|
t =
|
||||||
|
t +
|
||||||
|
this._keyStr.charAt(s) +
|
||||||
|
this._keyStr.charAt(o) +
|
||||||
|
this._keyStr.charAt(u) +
|
||||||
|
this._keyStr.charAt(a);
|
||||||
|
}
|
||||||
|
return t;
|
||||||
|
},
|
||||||
|
decode: function (e) {
|
||||||
|
var t = "";
|
||||||
|
var n, r, i;
|
||||||
|
var s, o, u, a;
|
||||||
|
var f = 0;
|
||||||
|
//e = e.replace(/[^A-Za-z0-9\+\/\=]/g, "");
|
||||||
|
while (f < e.length) {
|
||||||
|
s = this._keyStr.indexOf(e.charAt(f++));
|
||||||
|
o = this._keyStr.indexOf(e.charAt(f++));
|
||||||
|
u = this._keyStr.indexOf(e.charAt(f++));
|
||||||
|
a = this._keyStr.indexOf(e.charAt(f++));
|
||||||
|
n = (s << 2) | (o >> 4);
|
||||||
|
r = ((o & 15) << 4) | (u >> 2);
|
||||||
|
i = ((u & 3) << 6) | a;
|
||||||
|
t = t + String.fromCharCode(n);
|
||||||
|
if (u != 64) {
|
||||||
|
t = t + String.fromCharCode(r);
|
||||||
|
}
|
||||||
|
if (a != 64) {
|
||||||
|
t = t + String.fromCharCode(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
t = Base64._utf8_decode(t);
|
||||||
|
return t;
|
||||||
|
},
|
||||||
|
_utf8_encode: function (e) {
|
||||||
|
e = e.replace(/\r\n/g, "\n");
|
||||||
|
var t = "";
|
||||||
|
for (var n = 0; n < e.length; n++) {
|
||||||
|
var r = e.charCodeAt(n);
|
||||||
|
if (r < 128) {
|
||||||
|
t += String.fromCharCode(r);
|
||||||
|
} else if (r > 127 && r < 2048) {
|
||||||
|
t += String.fromCharCode((r >> 6) | 192);
|
||||||
|
t += String.fromCharCode((r & 63) | 128);
|
||||||
|
} else {
|
||||||
|
t += String.fromCharCode((r >> 12) | 224);
|
||||||
|
t += String.fromCharCode(((r >> 6) & 63) | 128);
|
||||||
|
t += String.fromCharCode((r & 63) | 128);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return t;
|
||||||
|
},
|
||||||
|
_utf8_decode: function (e) {
|
||||||
|
var t = "";
|
||||||
|
var n = 0;
|
||||||
|
var r = (c1 = c2 = 0);
|
||||||
|
while (n < e.length) {
|
||||||
|
r = e.charCodeAt(n);
|
||||||
|
if (r < 128) {
|
||||||
|
t += String.fromCharCode(r);
|
||||||
|
n++;
|
||||||
|
} else if (r > 191 && r < 224) {
|
||||||
|
c2 = e.charCodeAt(n + 1);
|
||||||
|
t += String.fromCharCode(((r & 31) << 6) | (c2 & 63));
|
||||||
|
n += 2;
|
||||||
|
} else {
|
||||||
|
c2 = e.charCodeAt(n + 1);
|
||||||
|
c3 = e.charCodeAt(n + 2);
|
||||||
|
t += String.fromCharCode(
|
||||||
|
((r & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)
|
||||||
|
);
|
||||||
|
n += 3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return t;
|
||||||
|
},
|
||||||
|
};
|
||||||
+393
-647
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,50 @@
|
|||||||
|
export const getSelectQuery = (appealTypeName) => {
|
||||||
|
switch (appealTypeName) {
|
||||||
|
case "pinswg_advertses":
|
||||||
|
return "&$select=_pinswg_appellant_value,pinswg_name,pinswg_siteaddresscounty,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_procedure,pinswg_questionnaireduedate,statuscode";
|
||||||
|
break;
|
||||||
|
case "pinswg_callinss77s":
|
||||||
|
return "&$select=_pinswg_appellant_value,pinswg_name,pinswg_siteaddresscounty,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_procedure,pinswg_proofsofevidencewrittenstatementsofeviden,pinswg_questionnaireduedate,pinswg_startdate,statuscode";
|
||||||
|
break;
|
||||||
|
case "pinswg_commonlands":
|
||||||
|
case "pinswg_environmentalpermittings":
|
||||||
|
case "pinswg_hedgeshedgerowstreepreservationreplacems":
|
||||||
|
case "pinswg_miscellaneouscaseworks":
|
||||||
|
case "pinswg_wayleaves":
|
||||||
|
return "&$select=_pinswg_appellant_value,pinswg_name,pinswg_siteaddresscounty,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_proofsofevidencewrittenstatementsofeviden,pinswg_questionnaireduedate,pinswg_relevantauthorityname,pinswg_startdate,statuscode";
|
||||||
|
break;
|
||||||
|
case "pinswg_communityinfrastructurelevys117118119s":
|
||||||
|
return "&$select=_pinswg_appellant_value,pinswg_name,pinswg_siteaddresscounty,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_procedure,pinswg_startdate,statuscode";
|
||||||
|
break;
|
||||||
|
case "pinswg_compulsorypurchaseorderses":
|
||||||
|
return "&$select=_pinswg_appellant_value,pinswg_name,pinswg_siteaddresscounty,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_proofsofevidencewrittenstatementsofeviden,pinswg_questionnaireduedate,pinswg_relevantauthorityname,pinswg_startdate,statuscode";
|
||||||
|
case "pinswg_dnses":
|
||||||
|
return "&$select=_pinswg_appellant_value,pinswg_name,pinswg_addressline1,pinswg_addressline2,pinswg_postcode,pinswg_addresstown,_pinswg_associatedlpa_value,pinswg_addresscounty,pinswg_applicationacceptedasvalid,pinswg_applicationrejectedasinvalid,pinswg_choiceofprocedure,pinswg_confirmrequesttovaryapplication,pinswg_dateeventrequested,pinswg_dateofdecision,pinswg_dateofrequesttovarytheapplication,pinswg_dateofsubmissionofapplication,pinswg_dateprojectpublishedonwebsite,pinswg_deadlineforsubmissionofapplication,pinswg_decision,pinswg_endofrepresentationperiod,pinswg_inspectorreportsubmittedtowelshgovernment,pinswg_procedureconfirmed,pinswg_projectdescription,pinswg_projectdescription,pinswg_projectlocation,pinswg_projectlocation,pinswg_recommendation,pinswg_rejectrequesttovaryapplication,pinswg_reportdueby,pinswg_suspensiondates,pinswg_suspensionenddates,pinswg_suspensionstartdates,pinswg_validnoticeofintentiontosubmitanapplicati,pinswg_webaddress,pinswg_withdrawndate,pinswg_writtenacceptanceofnotification,statuscode";
|
||||||
|
case "pinswg_electricityacts":
|
||||||
|
return "&$select=_pinswg_appellant_value,pinswg_name,pinswg_addressline1,pinswg_addressline2,pinswg_postcode,pinswg_addresstown,_pinswg_associatedlpa_value,pinswg_applicationacceptedasvalid,pinswg_applicationrejectedasinvalid,pinswg_confirmrequesttovaryapplication,pinswg_dateeventrequested,pinswg_dateofrequesttovarytheapplication,pinswg_dateofsubmissionofapplication,pinswg_dateprojectpublishedonwebsite,pinswg_deadlineforsubmissionofapplication,pinswg_decision,pinswg_endofrepresentationperiod,pinswg_inspectorreportsubmittedtowelshgovernment,pinswg_procedureconfirmed,pinswg_projectlocation,pinswg_recommendation,pinswg_rejectrequesttovaryapplication,pinswg_reportdueby,pinswg_suspensiondates,pinswg_validnoticeofintentiontosubmitanapplicati,pinswg_webaddress,pinswg_withdrawndate,pinswg_writtenacceptanceofnotification,statuscode";
|
||||||
|
case "pinswg_householderappealhases":
|
||||||
|
return "&$select=_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_otherpartiesstatement,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode";
|
||||||
|
case "pinswg_enforcementnoticeappeals174s":
|
||||||
|
return "&$select=_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode";
|
||||||
|
case "pinswg_enforcementlistedbuildingconservationaps":
|
||||||
|
return "&$select=_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatements,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdates,pinswg_statementduedate,statuscode";
|
||||||
|
case "pinswg_maintenanceoflands217s":
|
||||||
|
return "&$select=_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdates,pinswg_statementduedate,statuscode";
|
||||||
|
case "pinswg_lawfuldevelopmentcertificates":
|
||||||
|
return "&$select=_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatements,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode";
|
||||||
|
case "pinswg_listedbuildingandconservationareaconsens":
|
||||||
|
return "&$select=_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_sitepostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode";
|
||||||
|
case "pinswg_planningappeals78s":
|
||||||
|
return "&$select=_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_finalcommentsduedate,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode";
|
||||||
|
case "pinswg_planningconditionss73s79s":
|
||||||
|
return "&$select=_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode";
|
||||||
|
case "pinswg_planningobligationappeals106s":
|
||||||
|
return "&$select=_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatements,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode";
|
||||||
|
case "pinswg_rows":
|
||||||
|
return "&$select=_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_proofsofevidencewrittenstatementsofeviden,pinswg_questionnaireduedate,pinswg_relevantauthorityname,pinswg_startdate,statuscode";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return "";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -82,10 +82,11 @@ let PersonalDetails = (props) => {
|
|||||||
let errorsobj = {};
|
let errorsobj = {};
|
||||||
|
|
||||||
const required = (value) => (value ? undefined : "Is required");
|
const required = (value) => (value ? undefined : "Is required");
|
||||||
|
const emailRegex =
|
||||||
|
/(?:[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/gi;
|
||||||
|
|
||||||
const email = (value) =>
|
const email = (value) =>
|
||||||
value && !/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i.test(value)
|
value && !emailRegex.test(value) ? "Invalid email address" : undefined;
|
||||||
? "Invalid email address"
|
|
||||||
: undefined;
|
|
||||||
const phoneNumber = (value) =>
|
const phoneNumber = (value) =>
|
||||||
value &&
|
value &&
|
||||||
!/^(?:(?:\(?(?:0(?:0|11)\)?[\s-]?\(?|\+)44\)?[\s-]?(?:\(?0\)?[\s-]?)?)|(?:\(?0))(?:(?:\d{5}\)?[\s-]?\d{4,5})|(?:\d{4}\)?[\s-]?(?:\d{5}|\d{3}[\s-]?\d{3}))|(?:\d{3}\)?[\s-]?\d{3}[\s-]?\d{3,4})|(?:\d{2}\)?[\s-]?\d{4}[\s-]?\d{4}))(?:[\s-]?(?:x|ext\.?|\#)\d{3,4})?$/i.test(
|
!/^(?:(?:\(?(?:0(?:0|11)\)?[\s-]?\(?|\+)44\)?[\s-]?(?:\(?0\)?[\s-]?)?)|(?:\(?0))(?:(?:\d{5}\)?[\s-]?\d{4,5})|(?:\d{4}\)?[\s-]?(?:\d{5}|\d{3}[\s-]?\d{3}))|(?:\d{3}\)?[\s-]?\d{3}[\s-]?\d{3,4})|(?:\d{2}\)?[\s-]?\d{4}[\s-]?\d{4}))(?:[\s-]?(?:x|ext\.?|\#)\d{3,4})?$/i.test(
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ const RenderTextfield = ({
|
|||||||
input,
|
input,
|
||||||
type,
|
type,
|
||||||
errorMsg,
|
errorMsg,
|
||||||
|
disabled,
|
||||||
meta: { touched, error },
|
meta: { touched, error },
|
||||||
...custom
|
...custom
|
||||||
}) => {
|
}) => {
|
||||||
@@ -39,6 +40,7 @@ const RenderTextfield = ({
|
|||||||
name={name}
|
name={name}
|
||||||
id={id}
|
id={id}
|
||||||
type={type}
|
type={type}
|
||||||
|
disabled={disabled}
|
||||||
/>
|
/>
|
||||||
{touched && error && (
|
{touched && error && (
|
||||||
<span
|
<span
|
||||||
@@ -69,6 +71,8 @@ const RegisterForm = (props) => {
|
|||||||
value,
|
value,
|
||||||
setRegisterFormComplete,
|
setRegisterFormComplete,
|
||||||
setAccountCreatedComplete,
|
setAccountCreatedComplete,
|
||||||
|
loggedInUserEmail,
|
||||||
|
emailaddress1,
|
||||||
} = props;
|
} = props;
|
||||||
let { t, lang } = useTranslation();
|
let { t, lang } = useTranslation();
|
||||||
|
|
||||||
@@ -135,7 +139,8 @@ const RegisterForm = (props) => {
|
|||||||
<h2 className="govuk-fieldset__heading">
|
<h2 className="govuk-fieldset__heading">
|
||||||
{t(
|
{t(
|
||||||
"account:register-new-account-sub-heading-1"
|
"account:register-new-account-sub-heading-1"
|
||||||
)}
|
)}{" "}
|
||||||
|
{loggedInUserEmail}
|
||||||
</h2>
|
</h2>
|
||||||
</legend>
|
</legend>
|
||||||
<Field
|
<Field
|
||||||
@@ -176,6 +181,7 @@ const RegisterForm = (props) => {
|
|||||||
label={t(
|
label={t(
|
||||||
"account:register-new-account-email-address-label"
|
"account:register-new-account-email-address-label"
|
||||||
)}
|
)}
|
||||||
|
disabled
|
||||||
/>
|
/>
|
||||||
<Field
|
<Field
|
||||||
name="telephone1"
|
name="telephone1"
|
||||||
@@ -327,13 +333,16 @@ const RegisterForm = (props) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const mapStateToProps = (state) => {
|
const mapStateToProps = (state, props) => {
|
||||||
return {
|
return {
|
||||||
search: state.search,
|
search: state.search,
|
||||||
searchResultsObj: state.searchResultsObj,
|
searchResultsObj: state.searchResultsObj,
|
||||||
formData: state.formData,
|
formData: state.formData,
|
||||||
appealType: state.appealType,
|
appealType: state.appealType,
|
||||||
//form: state.form,
|
//form: state.form,
|
||||||
|
initialValues: {
|
||||||
|
emailaddress1: props.loggedInUserEmail,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -353,6 +362,7 @@ export default connect(
|
|||||||
)(
|
)(
|
||||||
reduxForm({
|
reduxForm({
|
||||||
form: "accountRegisterForm",
|
form: "accountRegisterForm",
|
||||||
|
enableReinitialize: true,
|
||||||
destroyOnUnmount: false,
|
destroyOnUnmount: false,
|
||||||
})(RegisterForm)
|
})(RegisterForm)
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -107,10 +107,7 @@ const Breadcrumbs = (props) => {
|
|||||||
) : (
|
) : (
|
||||||
""
|
""
|
||||||
)}
|
)}
|
||||||
{router.pathname ==
|
{router.pathname == "/searchresults" ? (
|
||||||
(router.locale == "cy"
|
|
||||||
? "/canlyniadauchwilio"
|
|
||||||
: "/searchresults") ? (
|
|
||||||
<>
|
<>
|
||||||
<li className="govuk-breadcrumbs__list-item">
|
<li className="govuk-breadcrumbs__list-item">
|
||||||
{t("common:breadcrumb-search-results")}
|
{t("common:breadcrumb-search-results")}
|
||||||
@@ -128,6 +125,28 @@ const Breadcrumbs = (props) => {
|
|||||||
) : (
|
) : (
|
||||||
""
|
""
|
||||||
)}
|
)}
|
||||||
|
{router.pathname == "/myportal/advancedsearch" ? (
|
||||||
|
<>
|
||||||
|
<li className="govuk-breadcrumbs__list-item">
|
||||||
|
<Link
|
||||||
|
href={
|
||||||
|
router.locale != "en"
|
||||||
|
? router.locale + "/myportal"
|
||||||
|
: "/myportal"
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<a className="govuk-breadcrumbs__link">
|
||||||
|
{t("common:breadcrumb-my-portal")}
|
||||||
|
</a>
|
||||||
|
</Link>
|
||||||
|
</li>
|
||||||
|
<li className="govuk-breadcrumbs__list-item">
|
||||||
|
{t("common:breadcrumb-advanced-search")}
|
||||||
|
</li>
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
""
|
||||||
|
)}
|
||||||
{router.pathname == "/advancedsearchresults" ? (
|
{router.pathname == "/advancedsearchresults" ? (
|
||||||
<>
|
<>
|
||||||
{" "}
|
{" "}
|
||||||
@@ -156,6 +175,47 @@ const Breadcrumbs = (props) => {
|
|||||||
) : (
|
) : (
|
||||||
""
|
""
|
||||||
)}
|
)}
|
||||||
|
{router.pathname ==
|
||||||
|
"/myportal/advancedsearchresults" ? (
|
||||||
|
<>
|
||||||
|
<li className="govuk-breadcrumbs__list-item">
|
||||||
|
<Link
|
||||||
|
href={
|
||||||
|
router.locale != "en"
|
||||||
|
? router.locale + "/myportal"
|
||||||
|
: "/myportal"
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<a className="govuk-breadcrumbs__link">
|
||||||
|
{t("common:breadcrumb-my-portal")}
|
||||||
|
</a>
|
||||||
|
</Link>
|
||||||
|
</li>
|
||||||
|
<li className="govuk-breadcrumbs__list-item">
|
||||||
|
<Link
|
||||||
|
href={
|
||||||
|
router.locale != "en"
|
||||||
|
? router.locale +
|
||||||
|
"/myportal/advancedsearch"
|
||||||
|
: "/myportal/advancedsearch"
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<a className="govuk-breadcrumbs__link">
|
||||||
|
{t(
|
||||||
|
"common:breadcrumb-advanced-search"
|
||||||
|
)}
|
||||||
|
</a>
|
||||||
|
</Link>
|
||||||
|
</li>
|
||||||
|
<li className="govuk-breadcrumbs__list-item">
|
||||||
|
{t(
|
||||||
|
"common:breadcrumb-advanced-search-results"
|
||||||
|
)}
|
||||||
|
</li>
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
""
|
||||||
|
)}
|
||||||
{router.pathname == "/newappeal" ? (
|
{router.pathname == "/newappeal" ? (
|
||||||
<>
|
<>
|
||||||
<li className="govuk-breadcrumbs__list-item">
|
<li className="govuk-breadcrumbs__list-item">
|
||||||
@@ -442,10 +502,7 @@ const Breadcrumbs = (props) => {
|
|||||||
) : (
|
) : (
|
||||||
""
|
""
|
||||||
)}
|
)}
|
||||||
{router.pathname ==
|
{router.pathname == "/dnsdetails" ? (
|
||||||
(router.locale == "cy"
|
|
||||||
? "/manyliondns"
|
|
||||||
: "/dnsdetails") ? (
|
|
||||||
<>
|
<>
|
||||||
<li className="govuk-breadcrumbs__list-item">
|
<li className="govuk-breadcrumbs__list-item">
|
||||||
<Link
|
<Link
|
||||||
|
|||||||
@@ -12,11 +12,10 @@ import CryptoJS from "crypto-js";
|
|||||||
import {
|
import {
|
||||||
getBasicSearch,
|
getBasicSearch,
|
||||||
getBasicSearchDetails,
|
getBasicSearchDetails,
|
||||||
getSearchDocumentDetails1,
|
getSearchDocumentDetails,
|
||||||
getSearchDocumentHistory1,
|
getSearchDocumentHistory,
|
||||||
getSearchDocumentHistory1Paged,
|
getSearchDocumentHistoryPaged,
|
||||||
getSearchDocumentDetails1Paged,
|
getSearchDocumentDetailsPaged,
|
||||||
getToken,
|
|
||||||
} from "../../actions";
|
} from "../../actions";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -105,9 +104,9 @@ const DocumentDetails = (props) => {
|
|||||||
>
|
>
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
|
||||||
<a
|
<a
|
||||||
href={encryptDocReference(
|
href={
|
||||||
detailsObj.pinswg_isharedocumentreference
|
detailsObj.pinswg_hashlink
|
||||||
)}
|
}
|
||||||
>
|
>
|
||||||
<span className="results-visually-hidden">
|
<span className="results-visually-hidden">
|
||||||
{t(
|
{t(
|
||||||
@@ -191,23 +190,9 @@ const DocumentDetails = (props) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const WORDKEY = process.env.NEXT_PUBLIC_HASHKEY;
|
|
||||||
|
|
||||||
const encryptDocReference = (documentRef) => {
|
|
||||||
var hashlink = CryptoJS.HmacSHA256(
|
|
||||||
"documents/download/" + documentRef,
|
|
||||||
CryptoJS.enc.Hex.parse(WORDKEY)
|
|
||||||
);
|
|
||||||
hashlink = hashlink.toString(CryptoJS.enc.Hex);
|
|
||||||
|
|
||||||
return (
|
|
||||||
"/api/proxy/documents/download/" + documentRef + "?hash=" + hashlink
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const docDetailsObj = async () => {
|
const docDetailsObj = async () => {
|
||||||
let docObj = await getSearchDocumentDetails1(incidentid)
|
let docObj = await getSearchDocumentDetails(incidentid)
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
//console.log(data);
|
//console.log(data);
|
||||||
setDocumentDetails(data);
|
setDocumentDetails(data);
|
||||||
@@ -239,7 +224,7 @@ const DocumentDetails = (props) => {
|
|||||||
console.log(historyDetail.pinswg_documentid);
|
console.log(historyDetail.pinswg_documentid);
|
||||||
} else {
|
} else {
|
||||||
historyArr.push(
|
historyArr.push(
|
||||||
getSearchDocumentHistory1(
|
getSearchDocumentHistory(
|
||||||
historyDetail.pinswg_documentid
|
historyDetail.pinswg_documentid
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@@ -252,8 +237,7 @@ const DocumentDetails = (props) => {
|
|||||||
}, [incidentid, setDocumentHistory, setDocumentDetails]);
|
}, [incidentid, setDocumentHistory, setDocumentDetails]);
|
||||||
|
|
||||||
const getDocumentResults = (pageNumber) => {
|
const getDocumentResults = (pageNumber) => {
|
||||||
//console.log(advancedSearch, searchString, pageNumber);
|
getSearchDocumentDetailsPaged(incidentid, pageNumber)
|
||||||
getSearchDocumentDetails1Paged(incidentid, pageNumber)
|
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
//console.log(data);
|
//console.log(data);
|
||||||
setDocumentDetails(data);
|
setDocumentDetails(data);
|
||||||
@@ -269,10 +253,7 @@ const DocumentDetails = (props) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const getDocumentDetails = async () => {
|
const getDocumentDetails = async () => {
|
||||||
let docObj = await getSearchDocumentDetails1Paged(
|
let docObj = await getSearchDocumentDetailsPaged(incidentid, pageNumber)
|
||||||
incidentid,
|
|
||||||
pageNumber
|
|
||||||
)
|
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
//console.log(data);
|
//console.log(data);
|
||||||
setDocumentDetails(data);
|
setDocumentDetails(data);
|
||||||
@@ -303,7 +284,7 @@ const DocumentDetails = (props) => {
|
|||||||
console.log(historyDetail.pinswg_documentid);
|
console.log(historyDetail.pinswg_documentid);
|
||||||
} else {
|
} else {
|
||||||
historyArr.push(
|
historyArr.push(
|
||||||
getSearchDocumentHistory1Paged(
|
getSearchDocumentHistoryPaged(
|
||||||
historyDetail.pinswg_documentid,
|
historyDetail.pinswg_documentid,
|
||||||
pageNumber
|
pageNumber
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -73,12 +73,7 @@ const RepresentationList = (props) => {
|
|||||||
return (
|
return (
|
||||||
<div className="govuk-summary-list__row" key={key}>
|
<div className="govuk-summary-list__row" key={key}>
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
|
||||||
<a
|
<a href={detailsObj.pinswg_hashlink}>
|
||||||
href={
|
|
||||||
"/api/proxy/documents/download/" +
|
|
||||||
detailsObj.pinswg_isharedocumentreference
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<span className="results-visually-hidden">
|
<span className="results-visually-hidden">
|
||||||
{t("case:documents-name-label")}:
|
{t("case:documents-name-label")}:
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
+30
-33
@@ -121,23 +121,28 @@ const CaseSummary = (props) => {
|
|||||||
] || "not entered"}
|
] || "not entered"}
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
{_.has(detailsObj, "pinswg_agentcontactname") ? (
|
|
||||||
<div className="govuk-summary-list__row">
|
{detailsObj.pinswg_agentcontactname != null &&
|
||||||
<dt className="govuk-summary-list__key">
|
(_.has(
|
||||||
{t("case:summary-agent-label")}
|
detailsObj,
|
||||||
</dt>
|
"pinswg_agentcontactname"
|
||||||
<dd className="govuk-summary-list__value">
|
) ? (
|
||||||
{_.has(
|
<div className="govuk-summary-list__row">
|
||||||
detailsObj,
|
<dt className="govuk-summary-list__key">
|
||||||
"pinswg_agentcontactname"
|
{t("case:summary-agent-label")}
|
||||||
)
|
</dt>
|
||||||
? detailsObj.pinswg_agentcontactname
|
<dd className="govuk-summary-list__value">
|
||||||
: ""}
|
{_.has(
|
||||||
</dd>
|
detailsObj,
|
||||||
</div>
|
"pinswg_agentcontactname"
|
||||||
) : (
|
)
|
||||||
""
|
? detailsObj.pinswg_agentcontactname
|
||||||
)}
|
: ""}
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
""
|
||||||
|
))}
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t("case:summary-site-address-label")}
|
{t("case:summary-site-address-label")}
|
||||||
@@ -235,7 +240,7 @@ const CaseSummary = (props) => {
|
|||||||
<div>
|
<div>
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="govuk-grid-column-full">
|
<div className="govuk-grid-column-full">
|
||||||
<h1>Not details currently held</h1>
|
<h1>{t("case:summary-no-details-label")}</h1>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -601,23 +606,15 @@ const CaseSummary = (props) => {
|
|||||||
<Link
|
<Link
|
||||||
href={
|
href={
|
||||||
router.locale == "cy"
|
router.locale == "cy"
|
||||||
? "/achos"
|
? "/canlyniadauchwilio?q=" +
|
||||||
: "/case"
|
item.title +
|
||||||
|
"&lk=1"
|
||||||
|
: "/searchresults?q=" +
|
||||||
|
item.title +
|
||||||
|
"&lk=1"
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<a
|
<a className="">{item.title}</a>
|
||||||
onClick={() => {
|
|
||||||
setCurrentReference({
|
|
||||||
"currentReference": item.title,
|
|
||||||
"currentType":
|
|
||||||
"searchResultsObj",
|
|
||||||
"incidentid": item.incidentid,
|
|
||||||
});
|
|
||||||
}}
|
|
||||||
className=""
|
|
||||||
>
|
|
||||||
{item.title}
|
|
||||||
</a>
|
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -128,12 +128,12 @@ const Pinswg_dnsid = (props) => {
|
|||||||
transLookup,
|
transLookup,
|
||||||
'$..[?(@.value=="' +
|
'$..[?(@.value=="' +
|
||||||
detailsObj[
|
detailsObj[
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
"pinswg_choiceofprocedure@OData.Community.Display.V1.FormattedValue"
|
||||||
] +
|
] +
|
||||||
'")].value_cy'
|
'")].value_cy'
|
||||||
)
|
)
|
||||||
: detailsObj[
|
: detailsObj[
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
"pinswg_choiceofprocedure@OData.Community.Display.V1.FormattedValue"
|
||||||
] || ""}
|
] || ""}
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
@@ -245,44 +245,49 @@ const Pinswg_dnsid = (props) => {
|
|||||||
detailsObj.pinswg_recommendation +
|
detailsObj.pinswg_recommendation +
|
||||||
'")].value_cy'
|
'")].value_cy'
|
||||||
)
|
)
|
||||||
: detailsObj.pinswg_recommendation ||
|
: detailsObj.pinswg_recommendation}
|
||||||
t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-case-website-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath.query(
|
|
||||||
transLookup,
|
|
||||||
'$..[?(@.value=="' +
|
|
||||||
detailsObj.pinswg_webaddress +
|
|
||||||
'")].value_cy'
|
|
||||||
)
|
|
||||||
: (
|
|
||||||
<a
|
|
||||||
target="_blank"
|
|
||||||
rel="noreferrer"
|
|
||||||
href={
|
|
||||||
detailsObj.pinswg_webaddress
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{
|
|
||||||
detailsObj.pinswg_webaddress
|
|
||||||
}
|
|
||||||
</a>
|
|
||||||
) ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{detailsObj.pinswg_webaddress != null && (
|
||||||
|
<div className="govuk-summary-list__row">
|
||||||
|
<dt className="govuk-summary-list__key">
|
||||||
|
{t(
|
||||||
|
"case:summary-case-website-label"
|
||||||
|
)}
|
||||||
|
</dt>
|
||||||
|
<dd className="govuk-summary-list__value">
|
||||||
|
{router.locale == "cy"
|
||||||
|
? jsonpath.query(
|
||||||
|
transLookup,
|
||||||
|
'$..[?(@.value=="' +
|
||||||
|
detailsObj.pinswg_webaddress +
|
||||||
|
'")].value_cy'
|
||||||
|
)
|
||||||
|
: (
|
||||||
|
<a
|
||||||
|
target="_blank"
|
||||||
|
rel="noreferrer"
|
||||||
|
href={
|
||||||
|
detailsObj.pinswg_webaddress.indexOf(
|
||||||
|
"https://"
|
||||||
|
)
|
||||||
|
? "https://" +
|
||||||
|
detailsObj.pinswg_webaddress
|
||||||
|
: detailsObj.pinswg_webaddress
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{
|
||||||
|
detailsObj.pinswg_webaddress
|
||||||
|
}
|
||||||
|
</a>
|
||||||
|
) ||
|
||||||
|
t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)}
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -250,26 +250,28 @@ const Pinswg_electricityactid = (props) => {
|
|||||||
)}
|
)}
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
<div className="govuk-summary-list__row">
|
{detailsObj.pinswg_webaddress != null && (
|
||||||
<dt className="govuk-summary-list__key">
|
<div className="govuk-summary-list__row">
|
||||||
{t(
|
<dt className="govuk-summary-list__key">
|
||||||
"case:summary-case-website-label"
|
{t(
|
||||||
)}
|
"case:summary-case-website-label"
|
||||||
</dt>
|
)}
|
||||||
<dd className="govuk-summary-list__value">
|
</dt>
|
||||||
{router.locale == "cy"
|
<dd className="govuk-summary-list__value">
|
||||||
? jsonpath.query(
|
{router.locale == "cy"
|
||||||
transLookup,
|
? jsonpath.query(
|
||||||
'$..[?(@.value=="' +
|
transLookup,
|
||||||
detailsObj.pinswg_webaddress +
|
'$..[?(@.value=="' +
|
||||||
'")].value_cy'
|
detailsObj.pinswg_webaddress +
|
||||||
)
|
'")].value_cy'
|
||||||
: detailsObj.pinswg_webaddress ||
|
)
|
||||||
t(
|
: detailsObj.pinswg_webaddress ||
|
||||||
"case:summary-no-date-entered-label"
|
t(
|
||||||
)}
|
"case:summary-no-date-entered-label"
|
||||||
</dd>
|
)}
|
||||||
</div>
|
</dd>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -250,26 +250,28 @@ const Pinswg_harbourrevisionorderid = (props) => {
|
|||||||
)}
|
)}
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
<div className="govuk-summary-list__row">
|
{detailsObj.pinswg_webaddress != null && (
|
||||||
<dt className="govuk-summary-list__key">
|
<div className="govuk-summary-list__row">
|
||||||
{t(
|
<dt className="govuk-summary-list__key">
|
||||||
"case:summary-case-website-label"
|
{t(
|
||||||
)}
|
"case:summary-case-website-label"
|
||||||
</dt>
|
)}
|
||||||
<dd className="govuk-summary-list__value">
|
</dt>
|
||||||
{router.locale == "cy"
|
<dd className="govuk-summary-list__value">
|
||||||
? jsonpath.query(
|
{router.locale == "cy"
|
||||||
transLookup,
|
? jsonpath.query(
|
||||||
'$..[?(@.value=="' +
|
transLookup,
|
||||||
detailsObj.pinswg_webaddress +
|
'$..[?(@.value=="' +
|
||||||
'")].value_cy'
|
detailsObj.pinswg_webaddress +
|
||||||
)
|
'")].value_cy'
|
||||||
: detailsObj.pinswg_webaddress ||
|
)
|
||||||
t(
|
: detailsObj.pinswg_webaddress ||
|
||||||
"case:summary-no-date-entered-label"
|
t(
|
||||||
)}
|
"case:summary-no-date-entered-label"
|
||||||
</dd>
|
)}
|
||||||
</div>
|
</dd>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -102,26 +102,28 @@ const Pinswg_transportandworkactid = (props) => {
|
|||||||
)}
|
)}
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
<div className="govuk-summary-list__row">
|
{detailsObj.pinswg_webaddress != null && (
|
||||||
<dt className="govuk-summary-list__key">
|
<div className="govuk-summary-list__row">
|
||||||
{t(
|
<dt className="govuk-summary-list__key">
|
||||||
"case:summary-case-website-label"
|
{t(
|
||||||
)}
|
"case:summary-case-website-label"
|
||||||
</dt>
|
)}
|
||||||
<dd className="govuk-summary-list__value">
|
</dt>
|
||||||
{router.locale == "cy"
|
<dd className="govuk-summary-list__value">
|
||||||
? jsonpath.query(
|
{router.locale == "cy"
|
||||||
transLookup,
|
? jsonpath.query(
|
||||||
'$..[?(@.value=="' +
|
transLookup,
|
||||||
detailsObj.pinswg_webaddress +
|
'$..[?(@.value=="' +
|
||||||
'")].value_cy'
|
detailsObj.pinswg_webaddress +
|
||||||
)
|
'")].value_cy'
|
||||||
: detailsObj.pinswg_webaddress ||
|
)
|
||||||
t(
|
: detailsObj.pinswg_webaddress ||
|
||||||
"case:summary-no-date-entered-label"
|
t(
|
||||||
)}
|
"case:summary-no-date-entered-label"
|
||||||
</dd>
|
)}
|
||||||
</div>
|
</dd>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ const CookieManagementMain = (props) => {
|
|||||||
Object.assign(values, {
|
Object.assign(values, {
|
||||||
"essential": "accepted",
|
"essential": "accepted",
|
||||||
"usage": usageState,
|
"usage": usageState,
|
||||||
"communications": communicationsState,
|
// "communications": communicationsState,
|
||||||
"settings": settingsState,
|
"settings": settingsState,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -42,14 +42,15 @@ const CookieManagementMain = (props) => {
|
|||||||
";expires=Thu, 01 Jan 1970 00:00:01 GMT";
|
";expires=Thu, 01 Jan 1970 00:00:01 GMT";
|
||||||
}
|
}
|
||||||
|
|
||||||
usageState == "revoked" && delete_cookie("CookiePolicy", "/"),
|
usageState == "revoked" && delete_cookie("_ga", "/"),
|
||||||
delete_cookie("_ga", "/"),
|
|
||||||
delete_cookie("_gid", "/");
|
delete_cookie("_gid", "/");
|
||||||
|
|
||||||
cookie.set("planning_casework", true, {
|
cookie.set("planning_casework", true, {
|
||||||
expires: expDate,
|
expires: expDate,
|
||||||
path: "/",
|
path: "/",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
setSavedState(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
let cookieCheck = parseCookies();
|
let cookieCheck = parseCookies();
|
||||||
@@ -59,14 +60,16 @@ const CookieManagementMain = (props) => {
|
|||||||
? {}
|
? {}
|
||||||
: JSON.parse(cookieCheck.CookiePolicy);
|
: JSON.parse(cookieCheck.CookiePolicy);
|
||||||
|
|
||||||
|
const [savedState, setSavedState] = useState(false);
|
||||||
|
|
||||||
const [usageState, setUsageState] = useState(
|
const [usageState, setUsageState] = useState(
|
||||||
typeof cookieCheck.CookiePolicy == "undefined" ? null : cookieObj.usage
|
typeof cookieCheck.CookiePolicy == "undefined" ? null : cookieObj.usage
|
||||||
);
|
);
|
||||||
const [communicationsState, setCommunicationsState] = useState(
|
// const [communicationsState, setCommunicationsState] = useState(
|
||||||
typeof cookieCheck.CookiePolicy == "undefined"
|
// typeof cookieCheck.CookiePolicy == "undefined"
|
||||||
? null
|
// ? null
|
||||||
: cookieObj.communications
|
// : cookieObj.communications
|
||||||
);
|
// );
|
||||||
const [settingsState, setSettingsState] = useState(
|
const [settingsState, setSettingsState] = useState(
|
||||||
typeof cookieCheck.CookiePolicy == "undefined"
|
typeof cookieCheck.CookiePolicy == "undefined"
|
||||||
? null
|
? null
|
||||||
@@ -78,9 +81,9 @@ const CookieManagementMain = (props) => {
|
|||||||
case "usage":
|
case "usage":
|
||||||
setUsageState(value);
|
setUsageState(value);
|
||||||
break;
|
break;
|
||||||
case "communications":
|
// case "communications":
|
||||||
setCommunicationsState(value);
|
// setCommunicationsState(value);
|
||||||
break;
|
// break;
|
||||||
case "settings":
|
case "settings":
|
||||||
setSettingsState(value);
|
setSettingsState(value);
|
||||||
break;
|
break;
|
||||||
@@ -102,6 +105,22 @@ const CookieManagementMain = (props) => {
|
|||||||
{t("cookies:cookie-title-heading")}
|
{t("cookies:cookie-title-heading")}
|
||||||
</h1>
|
</h1>
|
||||||
<hr className="govuk-section-break govuk-section-break--visible" />
|
<hr className="govuk-section-break govuk-section-break--visible" />
|
||||||
|
|
||||||
|
{savedState && (
|
||||||
|
<div
|
||||||
|
id="cookieSettingsMessageSuccess"
|
||||||
|
className="govuk-inset-text paragraph--type--call-out-message call-out-type-positive-alert-message"
|
||||||
|
>
|
||||||
|
<h2 className="govuk-heading-l">
|
||||||
|
<strong>
|
||||||
|
{t("cookies:cookie-saved-heading")}
|
||||||
|
</strong>
|
||||||
|
</h2>
|
||||||
|
<p className="govuk-body">
|
||||||
|
{t("cookies:cookie-saved-paragraph")}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
{typeof cookieCheck.CookiePolicy == "undefined" ? (
|
{typeof cookieCheck.CookiePolicy == "undefined" ? (
|
||||||
<>
|
<>
|
||||||
<div className="govuk-inset-text paragraph--type--call-out-message">
|
<div className="govuk-inset-text paragraph--type--call-out-message">
|
||||||
@@ -455,7 +474,7 @@ const mapStateToProps = (state) => {
|
|||||||
return {
|
return {
|
||||||
initialValues: {
|
initialValues: {
|
||||||
usage: state.accountDetails.cookieObj.usage,
|
usage: state.accountDetails.cookieObj.usage,
|
||||||
communications: state.accountDetails.cookieObj.communications,
|
//communications: state.accountDetails.cookieObj.communications,
|
||||||
settings: state.accountDetails.cookieObj.settings,
|
settings: state.accountDetails.cookieObj.settings,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
+6
-10
@@ -219,11 +219,9 @@ export default function Footer(props) {
|
|||||||
|
|
||||||
<li className="govuk-footer__inline-list-item">
|
<li className="govuk-footer__inline-list-item">
|
||||||
<Link
|
<Link
|
||||||
href={
|
href={t(
|
||||||
router.locale == "cy"
|
"common:footer-privacy-link"
|
||||||
? "/preifatrwydd"
|
)}
|
||||||
: "/privacy"
|
|
||||||
}
|
|
||||||
>
|
>
|
||||||
<a
|
<a
|
||||||
id="aPrivacy"
|
id="aPrivacy"
|
||||||
@@ -238,11 +236,9 @@ export default function Footer(props) {
|
|||||||
|
|
||||||
<li className="govuk-footer__inline-list-item">
|
<li className="govuk-footer__inline-list-item">
|
||||||
<Link
|
<Link
|
||||||
href={
|
href={t(
|
||||||
router.locale == "cy"
|
"common:footer-terms-conditions-link"
|
||||||
? "/telerau-ac-amodau"
|
)}
|
||||||
: "/terms-and-conditions"
|
|
||||||
}
|
|
||||||
>
|
>
|
||||||
<a
|
<a
|
||||||
id="aTermsConds"
|
id="aTermsConds"
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ export default function AccessibilityCY() {
|
|||||||
<li>
|
<li>
|
||||||
Anfonwch neges e-bost at:{" "}
|
Anfonwch neges e-bost at:{" "}
|
||||||
<a
|
<a
|
||||||
className="govuk-link--no-underline govuk-!-font-weight-bold"
|
className="govuk-link govuk-link--no-underline govuk-!-font-weight-bold"
|
||||||
href="mailto:PEDW.GwaithAchos@llyw.cymru"
|
href="mailto:PEDW.GwaithAchos@llyw.cymru"
|
||||||
>
|
>
|
||||||
PEDW.GwaithAchos@llyw.cymru
|
PEDW.GwaithAchos@llyw.cymru
|
||||||
@@ -110,7 +110,7 @@ export default function AccessibilityCY() {
|
|||||||
<li>
|
<li>
|
||||||
Ffoniwch:{" "}
|
Ffoniwch:{" "}
|
||||||
<a
|
<a
|
||||||
className="govuk-link--no-underline govuk-!-font-weight-bold"
|
className="govuk-link govuk-link--no-underline govuk-!-font-weight-bold"
|
||||||
href="tel:03000 604400"
|
href="tel:03000 604400"
|
||||||
>
|
>
|
||||||
03000 604400
|
03000 604400
|
||||||
@@ -128,7 +128,7 @@ export default function AccessibilityCY() {
|
|||||||
ffoniwch ni neu anfonwch neges e-bost atom i gael
|
ffoniwch ni neu anfonwch neges e-bost atom i gael
|
||||||
cyfarwyddiadau;{" "}
|
cyfarwyddiadau;{" "}
|
||||||
<a
|
<a
|
||||||
className="govuk-link--no-underline govuk-!-font-weight-bold"
|
className="govuk-link govuk-link--no-underline govuk-!-font-weight-bold"
|
||||||
href="https://llyw.cymru/penderfyndiadau-cynllunio-ac-amgylchedd-cymru/cysylltwch-ni"
|
href="https://llyw.cymru/penderfyndiadau-cynllunio-ac-amgylchedd-cymru/cysylltwch-ni"
|
||||||
>
|
>
|
||||||
Cysylltwch â Ni
|
Cysylltwch â Ni
|
||||||
@@ -174,9 +174,14 @@ export default function AccessibilityCY() {
|
|||||||
<h3>Statws cydymffurfio</h3>
|
<h3>Statws cydymffurfio</h3>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Mae’r wefan hon yn cydymffurfio’n rhannol â Chanllawiau
|
Mae’r wefan hon yn cydymffurfio’n rhannol â{" "}
|
||||||
Hygyrchedd Cynnwys y We (WCAG) fersiwn 2.1 – safon Lefel AA,
|
<a
|
||||||
o ganlyniad i’r ‘achosion o ddiffyg
|
className="govuk-link govuk-link--no-underline govuk-!-font-weight-bold"
|
||||||
|
href="https://www.w3.org/TR/WCAG21/"
|
||||||
|
>
|
||||||
|
Chanllawiau Hygyrchedd Cynnwys y We (WCAG) fersiwn 2.1
|
||||||
|
</a>{" "}
|
||||||
|
– safon Lefel AA, o ganlyniad i’r ‘achosion o ddiffyg
|
||||||
cydymffurfio’/’eithriadau’ neu’r ‘achosion o ddiffyg
|
cydymffurfio’/’eithriadau’ neu’r ‘achosion o ddiffyg
|
||||||
cydymffurfio ac eithriadau’] a restrir isod.
|
cydymffurfio ac eithriadau’] a restrir isod.
|
||||||
</p>
|
</p>
|
||||||
@@ -184,26 +189,23 @@ export default function AccessibilityCY() {
|
|||||||
<h3>Diffyg cydymffurfio â’r rheoliadau hygyrchedd</h3>
|
<h3>Diffyg cydymffurfio â’r rheoliadau hygyrchedd</h3>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Nid oes testun amgen ar gyfer rhai delweddau, felly ni all
|
Mae rhai o’r dogfennau a gyhoeddir ar-lein trwy’r gwasanaeth
|
||||||
pobl sy’n defnyddio rhaglen darllen sgrin gael at y
|
hwn yn cynnwys diagramau cynllunio sy’n dechnegol eu natur i
|
||||||
wybodaeth. Mae hyn yn methu maen prawf llwyddiant 1.1.1
|
raddau helaeth. Er y cydnabyddwn efallai na fydd pob agwedd
|
||||||
(cynnwys nad yw’n destun).
|
ar gynnwys o’r fath yn gwbl hygyrch, rydym wedi ceisio eu
|
||||||
</p>
|
gwella trwy gynyddu maint y testun sylfaenol lle y bo’n
|
||||||
<p>
|
bosibl, ac ychwanegu disgrifiadau testun ystyrlon i ategu
|
||||||
Bwriadwn ychwanegu testun amgen at yr holl ddelweddau erbyn
|
unrhyw wybodaeth weledol bwysig.
|
||||||
mis Medi 2020. Pan fyddwn yn cyhoeddi cynnwys newydd, byddwn
|
|
||||||
yn sicrhau bod ein defnydd o ddelweddau’n bodloni safonau
|
|
||||||
hygyrchedd.
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h3>Paratoi’r datganiad hygyrchedd hwn</h3>
|
<h3>Paratoi’r datganiad hygyrchedd hwn</h3>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Paratowyd y datganiad hwn ar [TBC]. Fe’i hadolygwyd
|
Paratowyd y datganiad hwn ar 22/11/2021. Fe’i hadolygwyd
|
||||||
ddiwethaf ar [TBC when signed off].
|
ddiwethaf ar 02/12/2021.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
{/* <p>
|
||||||
Profwyd y wefan hon ddiwethaf ar [TBC]. Cynhaliwyd y prawf
|
Profwyd y wefan hon ddiwethaf ar [TBC]. Cynhaliwyd y prawf
|
||||||
gan [add name of organisation that carried out test, or
|
gan [add name of organisation that carried out test, or
|
||||||
indicate that you did your own testing].
|
indicate that you did your own testing].
|
||||||
@@ -217,8 +219,8 @@ export default function AccessibilityCY() {
|
|||||||
|
|
||||||
<p>
|
<p>
|
||||||
Gallwch ddarllen yr adroddiad llawn ar y prawf hygyrchedd
|
Gallwch ddarllen yr adroddiad llawn ar y prawf hygyrchedd
|
||||||
[add link to report].
|
[add link to report].
|
||||||
</p>
|
</p>*/}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ export default function AccessibilityEN() {
|
|||||||
<li>
|
<li>
|
||||||
Email:{" "}
|
Email:{" "}
|
||||||
<a
|
<a
|
||||||
className="govuk-link--no-underline govuk-!-font-weight-bold"
|
className="govuk-link govuk-link--no-underline govuk-!-font-weight-bold"
|
||||||
href="mailto:PEDW.Casework@gov.wales"
|
href="mailto:PEDW.Casework@gov.wales"
|
||||||
>
|
>
|
||||||
PEDW.Casework@gov.wales
|
PEDW.Casework@gov.wales
|
||||||
@@ -105,7 +105,7 @@ export default function AccessibilityEN() {
|
|||||||
<li>
|
<li>
|
||||||
Call:{" "}
|
Call:{" "}
|
||||||
<a
|
<a
|
||||||
className="govuk-link--no-underline govuk-!-font-weight-bold"
|
className="govuk-link govuk-link--no-underline govuk-!-font-weight-bold"
|
||||||
href="tel:03000 604400"
|
href="tel:03000 604400"
|
||||||
>
|
>
|
||||||
03000 604400
|
03000 604400
|
||||||
@@ -150,7 +150,7 @@ export default function AccessibilityEN() {
|
|||||||
<p>
|
<p>
|
||||||
Find out how to{" "}
|
Find out how to{" "}
|
||||||
<a
|
<a
|
||||||
className="govuk-link--no-underline govuk-!-font-weight-bold"
|
className="govuk-link govuk-link--no-underline govuk-!-font-weight-bold"
|
||||||
href="https://gov.wales/planning-and-environment-decisions-wales/contact-us"
|
href="https://gov.wales/planning-and-environment-decisions-wales/contact-us"
|
||||||
>
|
>
|
||||||
contact us
|
contact us
|
||||||
@@ -171,33 +171,37 @@ export default function AccessibilityEN() {
|
|||||||
<h3>Compliance status</h3>
|
<h3>Compliance status</h3>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
This website is partially compliant with the Web Content
|
This website is partially compliant with the{" "}
|
||||||
Accessibility Guidelines version 2.1 – Level AA standard,
|
<a
|
||||||
due to the non-compliances’/‘the exemptions’ or ‘the
|
className="govuk-link govuk-link--no-underline govuk-!-font-weight-bold"
|
||||||
non-compliances and exemptions’] listed below.
|
href="https://www.w3.org/TR/WCAG21/"
|
||||||
|
>
|
||||||
|
Web Content Accessibility Guidelines version 2.1
|
||||||
|
</a>
|
||||||
|
– Level AA standard, due to the non-compliances listed
|
||||||
|
below.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h3>Non-compliance with the accessibility regulations</h3>
|
<h3>Non-compliance with the accessibility regulations</h3>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Some images do not have a text alternative, so people using
|
Some documents published online via this service contain
|
||||||
a screen reader cannot access the information. This fails
|
planning diagrams that are largely technical in nature.
|
||||||
WCAG 2.1 success criterion 1.1.1 (non-text content).
|
While we acknowledge that all aspects of such content may
|
||||||
</p>
|
not be fully accessible, we have endeavoured to improve them
|
||||||
<p>
|
by increasing the base text size where possible, and adding
|
||||||
We plan to add text alternatives for all images by September
|
meaningful text descriptions to supplement any important
|
||||||
2020. When we publish new content we’ll make sure our use of
|
visual information.
|
||||||
images meets accessibility standards.
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h3>Preparation of this accessibility statement</h3>
|
<h3>Preparation of this accessibility statement</h3>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
This statement was prepared on [TBC]. It was last reviewed
|
This statement was prepared on 22/11/2021. It was last
|
||||||
on [TBC when signed off].
|
reviewed on 02/12/2021.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
{/* <p>
|
||||||
This website was last tested on [TBC]. The test was carried
|
This website was last tested on [TBC]. The test was carried
|
||||||
out by [add name of organisation that carried out test, or
|
out by [add name of organisation that carried out test, or
|
||||||
indicate that you did your own testing].
|
indicate that you did your own testing].
|
||||||
@@ -212,7 +216,7 @@ export default function AccessibilityEN() {
|
|||||||
<p>
|
<p>
|
||||||
You can read the full accessibility test report [add link to
|
You can read the full accessibility test report [add link to
|
||||||
report].
|
report].
|
||||||
</p>
|
</p> */}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
+1132
-1219
File diff suppressed because it is too large
Load Diff
@@ -757,20 +757,23 @@ export default function PrivacyEN() {
|
|||||||
We provide your information to the relevant Welsh
|
We provide your information to the relevant Welsh
|
||||||
Minister who make the final decision on the applications
|
Minister who make the final decision on the applications
|
||||||
and appeals we examine via:
|
and appeals we examine via:
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
The Department for Business, Energy, and
|
||||||
|
Industrial Strategy
|
||||||
|
</li>
|
||||||
|
<li>The Department for Transport</li>
|
||||||
|
<li>
|
||||||
|
The Department for Environment, Food and Rural
|
||||||
|
Affairs and
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
The Ministry of Housing, Communities and Local
|
||||||
|
Government.
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
|
||||||
The Department for Business, Energy, and Industrial
|
|
||||||
Strategy
|
|
||||||
</li>
|
|
||||||
<li>The Department for Transport</li>
|
|
||||||
<li>
|
|
||||||
The Department for Environment, Food and Rural Affairs
|
|
||||||
and
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
The Ministry of Housing, Communities and Local
|
|
||||||
Government.
|
|
||||||
</li>
|
|
||||||
<li>
|
<li>
|
||||||
For fairness to the other parties interested in a case,
|
For fairness to the other parties interested in a case,
|
||||||
we need to share your representations as indicated
|
we need to share your representations as indicated
|
||||||
@@ -857,9 +860,7 @@ export default function PrivacyEN() {
|
|||||||
This will normally be set out in our guidance, but if you
|
This will normally be set out in our guidance, but if you
|
||||||
have specific queries or concerns in respect of a particular
|
have specific queries or concerns in respect of a particular
|
||||||
case then please contact the case officer who, if necessary,
|
case then please contact the case officer who, if necessary,
|
||||||
will discuss the matter with … - process to be established,
|
will discuss the matter with PEDW.
|
||||||
can this be internal to PEDW or should it be sent up the
|
|
||||||
line?.
|
|
||||||
</p>
|
</p>
|
||||||
<h3>10. Do we use any data processors? </h3>
|
<h3>10. Do we use any data processors? </h3>
|
||||||
<p>
|
<p>
|
||||||
|
|||||||
@@ -30,6 +30,9 @@ const Header = (props) => {
|
|||||||
"/dnsdetails",
|
"/dnsdetails",
|
||||||
"/404",
|
"/404",
|
||||||
"/account/register",
|
"/account/register",
|
||||||
|
"/myportal/error",
|
||||||
|
"/accessibility",
|
||||||
|
"/details-about-cookies",
|
||||||
];
|
];
|
||||||
const hasContactLink = [
|
const hasContactLink = [
|
||||||
"/dns",
|
"/dns",
|
||||||
|
|||||||
@@ -92,7 +92,6 @@ let CaseSearch = (props) => {
|
|||||||
? "/canlyniadauchwilio"
|
? "/canlyniadauchwilio"
|
||||||
: "/searchresults",
|
: "/searchresults",
|
||||||
query: { q: values.basicSearch.trim() },
|
query: { q: values.basicSearch.trim() },
|
||||||
shallow: true,
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+145
-41
@@ -108,8 +108,15 @@ const RenderPasswordfield = ({
|
|||||||
|
|
||||||
let Login = (props) => {
|
let Login = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
const { handleSubmit, pristine, reset, submitting, setLoggedInUserId } =
|
const {
|
||||||
props;
|
handleSubmit,
|
||||||
|
pristine,
|
||||||
|
reset,
|
||||||
|
submitting,
|
||||||
|
setLoggedInUserId,
|
||||||
|
GG_CLIENT_ID,
|
||||||
|
GG_REDIRECT_URI,
|
||||||
|
} = props;
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { locale } = router;
|
const { locale } = router;
|
||||||
@@ -117,6 +124,17 @@ let Login = (props) => {
|
|||||||
// const [showSpinnerState, setShowSpinnerState] = useState(false);
|
// const [showSpinnerState, setShowSpinnerState] = useState(false);
|
||||||
const [validLoginID, setValidLoginID] = useState(null);
|
const [validLoginID, setValidLoginID] = useState(null);
|
||||||
|
|
||||||
|
// console.log(
|
||||||
|
// "built login url path:",
|
||||||
|
// props.govGateway.config.authorization_endpoint +
|
||||||
|
// "?response_type=code&scope=openid&client_id=" +
|
||||||
|
// GG_CLIENT_ID +
|
||||||
|
// "&redirect_uri=" +
|
||||||
|
// GG_REDIRECT_URI +
|
||||||
|
// "&ui_locales=" +
|
||||||
|
// (router.locale == "cy" ? "cy" : "en-GB")
|
||||||
|
// );
|
||||||
|
|
||||||
// let spinnerState = () => {
|
// let spinnerState = () => {
|
||||||
// showSpinnerState == true
|
// showSpinnerState == true
|
||||||
// ? setShowSpinnerState(false)
|
// ? setShowSpinnerState(false)
|
||||||
@@ -161,13 +179,35 @@ let Login = (props) => {
|
|||||||
: "";
|
: "";
|
||||||
}, [cookies.pinsUser, router]);
|
}, [cookies.pinsUser, router]);
|
||||||
|
|
||||||
|
const govGatwayLoginRedirect = () => {
|
||||||
|
let ggUrl =
|
||||||
|
props.govGateway.config.authorization_endpoint +
|
||||||
|
"?response_type=code&scope=openid&client_id=" +
|
||||||
|
GG_CLIENT_ID +
|
||||||
|
"&redirect_uri=" +
|
||||||
|
GG_REDIRECT_URI +
|
||||||
|
"&ui_locales=" +
|
||||||
|
(router.locale == "cy" ? "cy" : "en-GB");
|
||||||
|
|
||||||
|
console.log("login Url:", ggUrl);
|
||||||
|
|
||||||
|
router.replace(ggUrl);
|
||||||
|
};
|
||||||
|
|
||||||
|
const govGatwayForgottenLink = () => {
|
||||||
|
let ggUrl =
|
||||||
|
props.govGateway.config.authorization_endpoint +
|
||||||
|
"/login/forgot-password";
|
||||||
|
router.replace(ggUrl);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="card" id="login-card">
|
<div className="card" id="login-card">
|
||||||
<form onSubmit={handleSubmit(onHandleSubmit)}>
|
<div className="card-body active">
|
||||||
<div className="card-body active">
|
<h3 className="heading-small card-heading">
|
||||||
<h3 className="heading-small card-heading">
|
{t("home:login-card-title")}
|
||||||
{t("home:login-card-title")}
|
</h3>{" "}
|
||||||
</h3>
|
<form onSubmit={handleSubmit(onHandleSubmit)}>
|
||||||
{validLoginID == false && (
|
{validLoginID == false && (
|
||||||
<div className="govuk-error-message govuk-form-group--error">
|
<div className="govuk-error-message govuk-form-group--error">
|
||||||
Incorrect username or password
|
Incorrect username or password
|
||||||
@@ -210,46 +250,109 @@ let Login = (props) => {
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<div className="govuk-form-group">
|
<div className="govuk-form-group">
|
||||||
{/* <Link
|
|
||||||
href={
|
|
||||||
router.locale == "cy"
|
|
||||||
? "/fymhorth"
|
|
||||||
: "/myportal"
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<a className="govuk-button">
|
|
||||||
{t("home:login-card-button")}
|
|
||||||
</a>
|
|
||||||
</Link> */}
|
|
||||||
<button type="submit" className="govuk-button">
|
<button type="submit" className="govuk-button">
|
||||||
{t("home:login-card-button")}
|
{t("home:login-card-button")}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div className="govuk-form-group govuk-!-margin-top-4">
|
</form>
|
||||||
<p className="govuk-body-s">
|
<div className="govuk-form-group govuk-!-margin-top-4">
|
||||||
{t("home:login-card-register-label")}{" "}
|
<p className="govuk-body-xs">
|
||||||
<Link
|
<a
|
||||||
href={
|
onClick={() => {
|
||||||
router.locale == "cy"
|
govGatwayLoginRedirect();
|
||||||
? "/cyfrif/cofrestr"
|
}}
|
||||||
: "/account/register"
|
className="govuk-button withChevron govuk-button-cta"
|
||||||
}
|
>
|
||||||
|
{t("home:login-via-gov-gateway-label")}
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
<p className="govuk-body-s">
|
||||||
|
{t("home:login-card-register-label")}{" "}
|
||||||
|
<Link
|
||||||
|
href={
|
||||||
|
router.locale == "cy"
|
||||||
|
? "/cyfrif/cofrestr"
|
||||||
|
: "/account/register"
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<a className="govuk-link--no-underline">
|
||||||
|
{t("home:login-card-register-link")}
|
||||||
|
</a>
|
||||||
|
</Link>
|
||||||
|
</p>
|
||||||
|
<p className="govuk-body-s">
|
||||||
|
<a
|
||||||
|
onClick={() => {
|
||||||
|
govGatwayForgottenLink();
|
||||||
|
}}
|
||||||
|
className="govuk-link--no-underline"
|
||||||
|
>
|
||||||
|
{t("home:login-card-forgotten-label")}{" "}
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
<hr className="govuk-!-margin-bottom-4" />
|
||||||
|
<p className="govuk-body-s">
|
||||||
|
{t("home:login-comingsoon-temp-2")}
|
||||||
|
</p>
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<a
|
||||||
|
className="govuk-link--no-underline"
|
||||||
|
target="_blank"
|
||||||
|
href={t("home:login-comingsoon-forms-link-1")}
|
||||||
|
rel="noreferrer"
|
||||||
>
|
>
|
||||||
<a className="govuk-link--no-underline">
|
{t("home:login-comingsoon-forms-label-1")}
|
||||||
{t("home:login-card-register-link")}
|
</a>
|
||||||
</a>
|
</li>
|
||||||
</Link>
|
<li>
|
||||||
</p>
|
{" "}
|
||||||
<p className="govuk-body-s">
|
<a
|
||||||
<Link href="/">
|
className="govuk-link--no-underline"
|
||||||
<a className="govuk-link--no-underline">
|
target="_blank"
|
||||||
{t("home:login-card-forgotten-label")}{" "}
|
href={t("home:login-comingsoon-forms-link-2")}
|
||||||
</a>
|
rel="noreferrer"
|
||||||
</Link>
|
>
|
||||||
</p>
|
{t("home:login-comingsoon-forms-label-2")}
|
||||||
</div>
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
{" "}
|
||||||
|
<a
|
||||||
|
className="govuk-link--no-underline"
|
||||||
|
target="_blank"
|
||||||
|
href={t("home:login-comingsoon-forms-link-3")}
|
||||||
|
rel="noreferrer"
|
||||||
|
>
|
||||||
|
{t("home:login-comingsoon-forms-label-3")}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
{" "}
|
||||||
|
<a
|
||||||
|
className="govuk-link--no-underline"
|
||||||
|
target="_blank"
|
||||||
|
href={t("home:login-comingsoon-forms-link-4")}
|
||||||
|
rel="noreferrer"
|
||||||
|
>
|
||||||
|
{t("home:login-comingsoon-forms-label-4")}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<br />
|
||||||
|
|
||||||
|
<p className="govuk-body-s">
|
||||||
|
{t("home:login-comingsoon-email-link-label")}{" "}
|
||||||
|
<a
|
||||||
|
href={"mailto:" + t("home:login-contact-email")}
|
||||||
|
className="govuk-link--no-underline"
|
||||||
|
>
|
||||||
|
{t("home:login-contact-email")}
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</div>
|
||||||
|
|
||||||
{/* <LoadingOverlay
|
{/* <LoadingOverlay
|
||||||
active={showSpinnerState}
|
active={showSpinnerState}
|
||||||
spinner
|
spinner
|
||||||
@@ -271,6 +374,7 @@ const mapStateToProps = (state) => {
|
|||||||
watchedCases: state.watchedCases,
|
watchedCases: state.watchedCases,
|
||||||
myRepresentations: state.myRepresentations,
|
myRepresentations: state.myRepresentations,
|
||||||
awaitingSubmission: state.awaitingSubmission,
|
awaitingSubmission: state.awaitingSubmission,
|
||||||
|
govGateway: state.govGateway,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+11
-3
@@ -9,9 +9,10 @@ import Inspectorate from "./homepage/inspectorate";
|
|||||||
import CaseComment from "./homepage/casecomment";
|
import CaseComment from "./homepage/casecomment";
|
||||||
import Dns from "./homepage/dns";
|
import Dns from "./homepage/dns";
|
||||||
|
|
||||||
export default function MainHome({ children, pages, showLogin }) {
|
const MainHome = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
|
|
||||||
|
const { showLogin, GG_REDIRECT_URI, GG_CLIENT_ID } = props;
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { locale } = router;
|
const { locale } = router;
|
||||||
|
|
||||||
@@ -28,11 +29,18 @@ export default function MainHome({ children, pages, showLogin }) {
|
|||||||
<CaseSearch />
|
<CaseSearch />
|
||||||
<CaseComment />
|
<CaseComment />
|
||||||
<Dns />
|
<Dns />
|
||||||
{showLogin == "true" && <Login />}
|
{showLogin == "true" && (
|
||||||
|
<Login
|
||||||
|
GG_CLIENT_ID={GG_CLIENT_ID}
|
||||||
|
GG_REDIRECT_URI={GG_REDIRECT_URI}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
{/* <Inspectorate /> */}
|
{/* <Inspectorate /> */}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
|
export default MainHome;
|
||||||
|
|||||||
+122
-39
@@ -9,6 +9,11 @@ import AwaitingSubmission from "./myportal/awaitingsubmission";
|
|||||||
import MyRepresentations from "./myportal/myrepresentations";
|
import MyRepresentations from "./myportal/myrepresentations";
|
||||||
import WatchedCases from "./myportal/watchedcases";
|
import WatchedCases from "./myportal/watchedcases";
|
||||||
import YourAccount from "./myportal/youraccount";
|
import YourAccount from "./myportal/youraccount";
|
||||||
|
import { parseCookies, setCookie, destroyCookie } from "nookies";
|
||||||
|
|
||||||
|
import IdleTimer from "react-idle-timer";
|
||||||
|
import TimeoutModal from "../components/timeoutmodal";
|
||||||
|
import { useState } from "react";
|
||||||
|
|
||||||
const MyPortal = (props) => {
|
const MyPortal = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
@@ -16,49 +21,127 @@ const MyPortal = (props) => {
|
|||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { locale } = router;
|
const { locale } = router;
|
||||||
|
|
||||||
|
const [showModal, setShowModal] = useState(false);
|
||||||
|
const inactiveTimeOut = 12000; // in seconds
|
||||||
|
const reminderTimeout = 60; // in seconds
|
||||||
|
|
||||||
|
let idleTimer = null;
|
||||||
|
let logoutTimer = null;
|
||||||
|
|
||||||
|
let onIdle = () => {
|
||||||
|
togglePopup();
|
||||||
|
logoutTimer = setTimeout(() => {
|
||||||
|
handleLogout();
|
||||||
|
}, 1000 * reminderTimeout * 1);
|
||||||
|
};
|
||||||
|
|
||||||
|
let togglePopup = () => {
|
||||||
|
showModal == true ? setShowModal(false) : setShowModal(true);
|
||||||
|
};
|
||||||
|
|
||||||
|
let handleStayLoggedIn = () => {
|
||||||
|
if (logoutTimer) {
|
||||||
|
clearTimeout(logoutTimer);
|
||||||
|
logoutTimer = null;
|
||||||
|
}
|
||||||
|
idleTimer.reset();
|
||||||
|
togglePopup();
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleLogout = () => {
|
||||||
|
console.log("////////////", "\n", "logout", "\n", "//////////");
|
||||||
|
destroyCookie({}, "pinsUser"),
|
||||||
|
window.localStorage.clear(),
|
||||||
|
router.replace(props.ggLogout);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<main className="" id="main-content" role="main">
|
<>
|
||||||
<div className="servicebanner govuk-!-margin-bottom-4">
|
<main className="" id="main-content" role="main">
|
||||||
<h1>
|
<div className="servicebanner myportal govuk-!-margin-bottom-4">
|
||||||
<img
|
<h1>
|
||||||
src={
|
<img
|
||||||
router.locale == "cy"
|
src={
|
||||||
? "/assets/images/my-portal-cy.svg"
|
router.locale == "cy"
|
||||||
: "/assets/images/my-portal-en.svg"
|
? "/assets/images/planning-casework-cy.svg"
|
||||||
}
|
: "/assets/images/planning-casework-en.svg"
|
||||||
alt={router.locale == "cy" ? "Fy mhorth" : "My Portal"}
|
}
|
||||||
/>
|
alt={
|
||||||
<img
|
router.locale == "cy"
|
||||||
className="pedw_logo"
|
? "Fy mhorth"
|
||||||
src="/assets/images/pedw_logo.png"
|
: "My Portal"
|
||||||
alt={
|
}
|
||||||
router.locale == "cy"
|
|
||||||
? "Penderfyniadau Cynllunio ac Amgylchedd Cymru"
|
|
||||||
: "Planning & Environment Decisions Wales"
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</h1>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-grid-row">
|
|
||||||
<div className="govuk-grid-column-full">
|
|
||||||
<div className="flex-container grid-row govuk-body ">
|
|
||||||
<MakeNewAppeal />
|
|
||||||
<MyCases myCases={props.myCases} />
|
|
||||||
<SearchCases />
|
|
||||||
<AwaitingSubmission
|
|
||||||
awaitingSubmission={props.awaitingSubmission}
|
|
||||||
/>
|
/>
|
||||||
<MyRepresentations
|
</h1>
|
||||||
myRepresentations={props.myRepresentations}
|
|
||||||
/>
|
<div className="serviceBanner_userDetails">
|
||||||
<WatchedCases watchedCases={props.watchedCases} />
|
<img
|
||||||
</div>
|
className="user_logo"
|
||||||
<div className="flex-container grid-row govuk-body ">
|
src="/assets/images/user.svg"
|
||||||
<YourAccount />
|
alt={router.locale == "cy" ? "Defnyddiwr" : "User"}
|
||||||
|
/>{" "}
|
||||||
|
<div className="serviceBanner_userDetails_name">
|
||||||
|
{props.accountDetails.accountDetails.firstname}{" "}
|
||||||
|
{props.accountDetails.accountDetails.lastname}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<Link
|
||||||
|
href={
|
||||||
|
router.locale == "cy"
|
||||||
|
? "/allgofnodi"
|
||||||
|
: "/logout"
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<a
|
||||||
|
onClick={() => {
|
||||||
|
handleLogout();
|
||||||
|
}}
|
||||||
|
className="govuk-header__link govuk-!-margin-right-3"
|
||||||
|
>
|
||||||
|
{t("common:signout-label")}
|
||||||
|
</a>
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div className="govuk-grid-row">
|
||||||
</main>
|
<div className="govuk-grid-column-full">
|
||||||
|
<div className="flex-container grid-row govuk-body ">
|
||||||
|
<MakeNewAppeal />
|
||||||
|
<MyCases myCases={props.myCases} />
|
||||||
|
<SearchCases />
|
||||||
|
<AwaitingSubmission
|
||||||
|
awaitingSubmission={props.awaitingSubmission}
|
||||||
|
/>
|
||||||
|
<MyRepresentations
|
||||||
|
myRepresentations={props.myRepresentations}
|
||||||
|
/>
|
||||||
|
<WatchedCases watchedCases={props.watchedCases} />
|
||||||
|
</div>
|
||||||
|
<div className="flex-container grid-row govuk-body ">
|
||||||
|
<YourAccount />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
<IdleTimer
|
||||||
|
ref={(ref) => {
|
||||||
|
idleTimer = ref;
|
||||||
|
}}
|
||||||
|
element={document}
|
||||||
|
stopOnIdle={true}
|
||||||
|
onActive={console.log(" bbis active", idleTimer)}
|
||||||
|
onIdle={onIdle}
|
||||||
|
timeout={1000 * inactiveTimeOut * 1}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<TimeoutModal
|
||||||
|
remainingCountdown={reminderTimeout}
|
||||||
|
showModal={showModal}
|
||||||
|
togglePopup={togglePopup}
|
||||||
|
handleStayLoggedIn={handleStayLoggedIn}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import { setCurrentReference } from "../../store/currentView/action";
|
|||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { parseCookies } from "nookies";
|
import { parseCookies } from "nookies";
|
||||||
import {
|
import {
|
||||||
getToken,
|
|
||||||
getWatchedCasesProxy,
|
getWatchedCasesProxy,
|
||||||
getPortalModuleDetailsProxy,
|
getPortalModuleDetailsProxy,
|
||||||
deleteWatchedCases,
|
deleteWatchedCases,
|
||||||
@@ -37,26 +36,21 @@ const TopThree = (props) => {
|
|||||||
let showTopThreeArr = showTopThree.value;
|
let showTopThreeArr = showTopThree.value;
|
||||||
|
|
||||||
const deleteItem = (caseID, topThreeType) => {
|
const deleteItem = (caseID, topThreeType) => {
|
||||||
let token = getToken();
|
|
||||||
let cookies = parseCookies();
|
let cookies = parseCookies();
|
||||||
topThreeType == "watchedCases" &&
|
topThreeType == "watchedCases" &&
|
||||||
deleteWatchedCases(caseID)
|
deleteWatchedCases(caseID)
|
||||||
.then((data) => data)
|
.then((data) => data)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
getWatchedCasesProxy(token, cookies.pinsUser).then(
|
getWatchedCasesProxy(cookies.pinsUser).then((data) => {
|
||||||
(data) => {
|
setWatchedCases(data),
|
||||||
setWatchedCases(data),
|
getDetails(data, "myWatchedCases").then((data) => {
|
||||||
getDetails(token, data, "myWatchedCases").then(
|
setWatchedCasesDetails(data);
|
||||||
(data) => {
|
});
|
||||||
setWatchedCasesDetails(data);
|
});
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const getDetails = (token, resultsObj, detailsType) => {
|
const getDetails = (resultsObj, detailsType) => {
|
||||||
//console.log(resultsObj);
|
//console.log(resultsObj);
|
||||||
let detailsArr = [];
|
let detailsArr = [];
|
||||||
resultsObj = resultsObj.value;
|
resultsObj = resultsObj.value;
|
||||||
@@ -72,7 +66,6 @@ const TopThree = (props) => {
|
|||||||
} else {
|
} else {
|
||||||
detailsArr.push(
|
detailsArr.push(
|
||||||
getPortalModuleDetailsProxy(
|
getPortalModuleDetailsProxy(
|
||||||
token,
|
|
||||||
getFormCollectionByID(
|
getFormCollectionByID(
|
||||||
searchDetail.pinswg_appealcasetype
|
searchDetail.pinswg_appealcasetype
|
||||||
).LogicalCollectionName,
|
).LogicalCollectionName,
|
||||||
@@ -89,6 +82,24 @@ const TopThree = (props) => {
|
|||||||
return Promise.all(detailsArr);
|
return Promise.all(detailsArr);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const getIncidentId = (topThreeType, objArr) => {
|
||||||
|
switch (topThreeType) {
|
||||||
|
case "myCases":
|
||||||
|
return objArr.incidentid;
|
||||||
|
break;
|
||||||
|
case "watchedCases":
|
||||||
|
return objArr._pinswg_watchedcase_value;
|
||||||
|
break;
|
||||||
|
case "myRepresentations":
|
||||||
|
return objArr.ticketnumber;
|
||||||
|
break;
|
||||||
|
case "awaitingSubmission":
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
// code block
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
let topThreeOnlyArr = showTopThreeArr.slice(0, 3);
|
let topThreeOnlyArr = showTopThreeArr.slice(0, 3);
|
||||||
Object.keys(topThreeOnlyArr).map((key, index) => {
|
Object.keys(topThreeOnlyArr).map((key, index) => {
|
||||||
topthreeRow.push(
|
topthreeRow.push(
|
||||||
@@ -126,18 +137,10 @@ const TopThree = (props) => {
|
|||||||
],
|
],
|
||||||
"currentType": topThreeType,
|
"currentType": topThreeType,
|
||||||
|
|
||||||
"incidentid":
|
"incidentid": getIncidentId(
|
||||||
topThreeType != "watchedCases"
|
topThreeType,
|
||||||
? topThreeType !=
|
showTopThreeArr[key]
|
||||||
"myRepresentations"
|
),
|
||||||
? showTopThreeArr[key]
|
|
||||||
._pinswg_case_value
|
|
||||||
: showTopThreeArr[key][
|
|
||||||
" _pinswg_watchedcase_value"
|
|
||||||
]
|
|
||||||
: showTopThreeArr[key][
|
|
||||||
" _pinswg_watchedcase_value"
|
|
||||||
],
|
|
||||||
|
|
||||||
"appealType":
|
"appealType":
|
||||||
showTopThreeArr[key]
|
showTopThreeArr[key]
|
||||||
|
|||||||
@@ -29,10 +29,10 @@ const ViewAllResults = (props) => {
|
|||||||
<Link
|
<Link
|
||||||
href={
|
href={
|
||||||
router.locale == "cy"
|
router.locale == "cy"
|
||||||
? myportal == "true"
|
? myportal == true
|
||||||
? "/fymhorth/achos"
|
? "/fymhorth/achos"
|
||||||
: "/achos"
|
: "/achos"
|
||||||
: myportal == "true"
|
: myportal == true
|
||||||
? "/myportal/case"
|
? "/myportal/case"
|
||||||
: "/case"
|
: "/case"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,14 @@ import data from "../../data/collections.json";
|
|||||||
import LoadingOverlay from "react-loading-overlay";
|
import LoadingOverlay from "react-loading-overlay";
|
||||||
import transLookup from "../../data/lookuptranslations.json";
|
import transLookup from "../../data/lookuptranslations.json";
|
||||||
|
|
||||||
|
const required = (errorMsg) => (value) =>
|
||||||
|
value || typeof value === "number" ? undefined : errorMsg;
|
||||||
|
|
||||||
|
export const minLength = (errorMsg) => (value) =>
|
||||||
|
value && value.length < 4
|
||||||
|
? errorMsg //`Must be ${min} characters or more`
|
||||||
|
: undefined;
|
||||||
|
|
||||||
let AdvancedSearch = (props) => {
|
let AdvancedSearch = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
|
|
||||||
@@ -37,6 +45,53 @@ let AdvancedSearch = (props) => {
|
|||||||
? [{}]
|
? [{}]
|
||||||
: props.LPAData.LPAData.value;
|
: props.LPAData.LPAData.value;
|
||||||
|
|
||||||
|
const RenderTextfield = ({
|
||||||
|
id,
|
||||||
|
className,
|
||||||
|
rows,
|
||||||
|
datafieldname,
|
||||||
|
name,
|
||||||
|
label,
|
||||||
|
input,
|
||||||
|
hint1,
|
||||||
|
hint2,
|
||||||
|
hint3,
|
||||||
|
meta: { touched, error },
|
||||||
|
...custom
|
||||||
|
}) => {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<div className="govuk-form-group">
|
||||||
|
<div id="basicSearch-hint" className="govuk-hint ">
|
||||||
|
<label className="govuk-label" htmlFor="caseRef">
|
||||||
|
{t("search:casereference-label")}
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<input
|
||||||
|
{...input}
|
||||||
|
className={className}
|
||||||
|
name={name}
|
||||||
|
id={id}
|
||||||
|
/>
|
||||||
|
{touched && error && (
|
||||||
|
<span
|
||||||
|
id={id + "-error"}
|
||||||
|
className="govuk-error-message govuk-form-group--error"
|
||||||
|
>
|
||||||
|
<span className="govuk-visually-hidden">
|
||||||
|
Error:
|
||||||
|
</span>{" "}
|
||||||
|
{error}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
const RenderLPAList = ({
|
const RenderLPAList = ({
|
||||||
name,
|
name,
|
||||||
id,
|
id,
|
||||||
@@ -216,8 +271,6 @@ let AdvancedSearch = (props) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const required = (value) => (value ? undefined : "Required");
|
|
||||||
|
|
||||||
// const [showSpinnerState, setShowSpinnerState] = useState(false);
|
// const [showSpinnerState, setShowSpinnerState] = useState(false);
|
||||||
|
|
||||||
// let spinnerState = () => {
|
// let spinnerState = () => {
|
||||||
@@ -252,8 +305,8 @@ let AdvancedSearch = (props) => {
|
|||||||
|
|
||||||
router.replace(
|
router.replace(
|
||||||
(router.locale == "cy"
|
(router.locale == "cy"
|
||||||
? "/canlyniadauchwiliouwch"
|
? "/fymhorth/canlyniadauchwiliouwch"
|
||||||
: "/advancedsearchresults") + searchString,
|
: "/myportal/advancedsearchresults") + searchString,
|
||||||
null,
|
null,
|
||||||
{
|
{
|
||||||
shallow: true,
|
shallow: true,
|
||||||
@@ -275,27 +328,31 @@ let AdvancedSearch = (props) => {
|
|||||||
{t("search:search-title-label")}
|
{t("search:search-title-label")}
|
||||||
</h1>
|
</h1>
|
||||||
</legend>
|
</legend>
|
||||||
<div className="govuk-form-group">
|
|
||||||
<label
|
|
||||||
className="govuk-label"
|
|
||||||
htmlFor="caseRef"
|
|
||||||
>
|
|
||||||
{t(
|
|
||||||
"search:casereference-label"
|
|
||||||
)}
|
|
||||||
</label>
|
|
||||||
|
|
||||||
<Field
|
<Field
|
||||||
name="caseRef"
|
validate={[
|
||||||
id="caseRef"
|
minLength(
|
||||||
component="input"
|
t(
|
||||||
className="govuk-input govuk-!-width-two-thirds"
|
"myportal:searchcases-validation-minlength"
|
||||||
label={t(
|
)
|
||||||
"search:casereference-label"
|
),
|
||||||
)}
|
]}
|
||||||
errormsg="Appeal type is required"
|
className="govuk-input govuk-!-width-two-thirds"
|
||||||
/>
|
component={RenderTextfield}
|
||||||
</div>
|
id="caseRef"
|
||||||
|
name="caseRef"
|
||||||
|
type="text"
|
||||||
|
aria-describedby="caseRef-hint"
|
||||||
|
hint1={t(
|
||||||
|
"myportal:searchcases-card-search-hint"
|
||||||
|
)}
|
||||||
|
hint2={t(
|
||||||
|
"myportal:searchcases-card-search-example-label-1"
|
||||||
|
)}
|
||||||
|
hint3={t(
|
||||||
|
"myportal:searchcases-card-search-example-label-2"
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
|
||||||
<Field
|
<Field
|
||||||
name="appealTypes"
|
name="appealTypes"
|
||||||
|
|||||||
@@ -260,7 +260,6 @@ const DNSSearchResults = (props) => {
|
|||||||
|
|
||||||
getBasicDNSSearchPaged(pageNumber)
|
getBasicDNSSearchPaged(pageNumber)
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
//console.log(data);
|
|
||||||
setSearchResults(data);
|
setSearchResults(data);
|
||||||
return data;
|
return data;
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ import {
|
|||||||
|
|
||||||
import {
|
import {
|
||||||
createWatchedCases,
|
createWatchedCases,
|
||||||
getToken,
|
|
||||||
getWatchedCasesProxy,
|
getWatchedCasesProxy,
|
||||||
getPortalModuleDetailsProxy,
|
getPortalModuleDetailsProxy,
|
||||||
deleteWatchedCases,
|
deleteWatchedCases,
|
||||||
@@ -58,6 +57,7 @@ const SearchResults = (props) => {
|
|||||||
watchedCases,
|
watchedCases,
|
||||||
setWatchedCases,
|
setWatchedCases,
|
||||||
setWatchedCasesDetails,
|
setWatchedCasesDetails,
|
||||||
|
isLinkedCase,
|
||||||
} = props;
|
} = props;
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
|
|
||||||
@@ -77,8 +77,6 @@ const SearchResults = (props) => {
|
|||||||
const cookies = parseCookies();
|
const cookies = parseCookies();
|
||||||
|
|
||||||
const selectWatchedCase = (loggedInUser, incidentID, appealType) => {
|
const selectWatchedCase = (loggedInUser, incidentID, appealType) => {
|
||||||
let token = getToken();
|
|
||||||
|
|
||||||
let updateBody = {
|
let updateBody = {
|
||||||
"pinswg_WatchedCase@odata.bind": "/incidents(" + incidentID + ")",
|
"pinswg_WatchedCase@odata.bind": "/incidents(" + incidentID + ")",
|
||||||
"pinswg_Contact@odata.bind": "/contacts(" + loggedInUser + ")",
|
"pinswg_Contact@odata.bind": "/contacts(" + loggedInUser + ")",
|
||||||
@@ -88,13 +86,11 @@ const SearchResults = (props) => {
|
|||||||
createWatchedCases(updateBody)
|
createWatchedCases(updateBody)
|
||||||
.then((data) => data)
|
.then((data) => data)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
getWatchedCasesProxy(token, cookies.pinsUser).then((data) => {
|
getWatchedCasesProxy(cookies.pinsUser).then((data) => {
|
||||||
setWatchedCases(data),
|
setWatchedCases(data),
|
||||||
getDetails(token, data, "myWatchedCases").then(
|
getDetails(data, "myWatchedCases").then((data) => {
|
||||||
(data) => {
|
setWatchedCasesDetails(data);
|
||||||
setWatchedCasesDetails(data);
|
});
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -109,26 +105,21 @@ const SearchResults = (props) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const deleteItem = (caseID, topThreeType) => {
|
const deleteItem = (caseID, topThreeType) => {
|
||||||
let token = getToken();
|
|
||||||
let cookies = parseCookies();
|
let cookies = parseCookies();
|
||||||
topThreeType == "watchedCases" &&
|
topThreeType == "watchedCases" &&
|
||||||
deleteWatchedCases(caseID)
|
deleteWatchedCases(caseID)
|
||||||
.then((data) => data)
|
.then((data) => data)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
getWatchedCasesProxy(token, cookies.pinsUser).then(
|
getWatchedCasesProxy(cookies.pinsUser).then((data) => {
|
||||||
(data) => {
|
setWatchedCases(data),
|
||||||
setWatchedCases(data),
|
getDetails(data, "myWatchedCases").then((data) => {
|
||||||
getDetails(token, data, "myWatchedCases").then(
|
setWatchedCasesDetails(data);
|
||||||
(data) => {
|
});
|
||||||
setWatchedCasesDetails(data);
|
});
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const getDetails = (token, resultsObj, detailsType) => {
|
const getDetails = (resultsObj, detailsType) => {
|
||||||
//console.log(resultsObj);
|
//console.log(resultsObj);
|
||||||
let detailsArr = [];
|
let detailsArr = [];
|
||||||
resultsObj = resultsObj.value;
|
resultsObj = resultsObj.value;
|
||||||
@@ -144,7 +135,6 @@ const SearchResults = (props) => {
|
|||||||
} else {
|
} else {
|
||||||
detailsArr.push(
|
detailsArr.push(
|
||||||
getPortalModuleDetailsProxy(
|
getPortalModuleDetailsProxy(
|
||||||
token,
|
|
||||||
getFormCollectionByID(
|
getFormCollectionByID(
|
||||||
searchDetail.pinswg_appealcasetype
|
searchDetail.pinswg_appealcasetype
|
||||||
).LogicalCollectionName,
|
).LogicalCollectionName,
|
||||||
@@ -184,7 +174,7 @@ const SearchResults = (props) => {
|
|||||||
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
||||||
{t("search:searchresults-status-label")}
|
{t("search:searchresults-status-label")}
|
||||||
</dd>
|
</dd>
|
||||||
{myportal == "true" && (
|
{myportal == true && (
|
||||||
<dd className="govuk-summary-list__key govuk-!-font-size-16 govuk-summary-list__action"></dd>
|
<dd className="govuk-summary-list__key govuk-!-font-size-16 govuk-summary-list__action"></dd>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@@ -201,10 +191,10 @@ const SearchResults = (props) => {
|
|||||||
<Link
|
<Link
|
||||||
href={
|
href={
|
||||||
router.locale == "cy"
|
router.locale == "cy"
|
||||||
? myportal == "true"
|
? myportal == true
|
||||||
? "/fymhorth/achos"
|
? "/fymhorth/achos"
|
||||||
: "/achos"
|
: "/achos"
|
||||||
: myportal == "true"
|
: myportal == true
|
||||||
? "/myportal/case"
|
? "/myportal/case"
|
||||||
: "/case"
|
: "/case"
|
||||||
}
|
}
|
||||||
@@ -378,7 +368,7 @@ const SearchResults = (props) => {
|
|||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
] || "N/A"}
|
] || "N/A"}
|
||||||
</dd>
|
</dd>
|
||||||
{myportal == "true" && (
|
{myportal == true && (
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-14 govuk-summary-list__action">
|
<dd className="govuk-summary-list__value govuk-!-font-size-14 govuk-summary-list__action">
|
||||||
{isWatchedCase(item.incidentid).length >
|
{isWatchedCase(item.incidentid).length >
|
||||||
0 ==
|
0 ==
|
||||||
@@ -501,27 +491,34 @@ const SearchResults = (props) => {
|
|||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="govuk-grid-column-full">
|
<div className="govuk-grid-column-full">
|
||||||
<h1 className="govuk-heading-xl govuk-!-margin-bottom-7">
|
<h1 className="govuk-heading-xl govuk-!-margin-bottom-7">
|
||||||
{t("search:searchresults-title-label")}
|
{isLinkedCase
|
||||||
|
? t("search:searchresults-title-label-linked-case")
|
||||||
|
: t("search:searchresults-title-label")}
|
||||||
</h1>
|
</h1>
|
||||||
<p className="govuk-body">
|
|
||||||
{resultsArr.length > 200
|
{!isLinkedCase && (
|
||||||
? t("search:searchresults-max-count-label")
|
<p className="govuk-body">
|
||||||
: t("search:searchresults-count-label", {
|
{resultsArr.length > 200
|
||||||
count: searchResultsObj["@odata.count"],
|
? t("search:searchresults-max-count-label")
|
||||||
})}
|
: t("search:searchresults-count-label", {
|
||||||
.
|
count: searchResultsObj["@odata.count"],
|
||||||
{advancedSearch != true ? (
|
})}
|
||||||
<>
|
.
|
||||||
<span>
|
{advancedSearch != true ? (
|
||||||
{t("search:searchresults-case-count-label")}{" "}
|
<>
|
||||||
{" "}
|
<span>
|
||||||
<em>"{searchString}"</em>
|
{t(
|
||||||
</span>
|
"search:searchresults-case-count-label"
|
||||||
</>
|
)}{" "}
|
||||||
) : (
|
{" "}
|
||||||
""
|
<em>"{searchString}"</em>
|
||||||
)}
|
</span>
|
||||||
</p>
|
</>
|
||||||
|
) : (
|
||||||
|
""
|
||||||
|
)}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
{resultsArr.length > 0 ? (
|
{resultsArr.length > 0 ? (
|
||||||
ResultsView(resultsArr)
|
ResultsView(resultsArr)
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ export default function Search(props) {
|
|||||||
advancedSearch,
|
advancedSearch,
|
||||||
myportal,
|
myportal,
|
||||||
watchedCases,
|
watchedCases,
|
||||||
|
isLinkedCase,
|
||||||
} = props;
|
} = props;
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
|
|
||||||
@@ -48,6 +49,7 @@ export default function Search(props) {
|
|||||||
}
|
}
|
||||||
myportal={myportal}
|
myportal={myportal}
|
||||||
watchedCases={watchedCases}
|
watchedCases={watchedCases}
|
||||||
|
isLinkedCase={isLinkedCase}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ export default function ServiceBanner() {
|
|||||||
<div className="servicebanner">
|
<div className="servicebanner">
|
||||||
<h1>
|
<h1>
|
||||||
<img
|
<img
|
||||||
|
className="govuk-!-margin-top-4"
|
||||||
src={
|
src={
|
||||||
router.locale == "cy"
|
router.locale == "cy"
|
||||||
? "/assets/images/planning-casework-cy.svg"
|
? "/assets/images/planning-casework-cy.svg"
|
||||||
@@ -16,7 +17,7 @@ export default function ServiceBanner() {
|
|||||||
}
|
}
|
||||||
alt="Planning casework"
|
alt="Planning casework"
|
||||||
/>
|
/>
|
||||||
<img
|
{/* <img
|
||||||
className="pedw_logo"
|
className="pedw_logo"
|
||||||
src="/assets/images/pedw_logo.png"
|
src="/assets/images/pedw_logo.png"
|
||||||
alt={
|
alt={
|
||||||
@@ -24,7 +25,7 @@ export default function ServiceBanner() {
|
|||||||
? "Penderfyniadau Cynllunio ac Amgylchedd Cymru"
|
? "Penderfyniadau Cynllunio ac Amgylchedd Cymru"
|
||||||
: "Planning & Environment Decisions Wales"
|
: "Planning & Environment Decisions Wales"
|
||||||
}
|
}
|
||||||
/>
|
/> */}
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
import React from "react";
|
||||||
|
import { useState, useEffect } from "react";
|
||||||
|
|
||||||
|
const TimeoutModal = (props) => {
|
||||||
|
const { showModal, handleStayLoggedIn, remainingCountdown } = props;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={showModal == false ? "modal fade" : "modal fade show"}>
|
||||||
|
<div backdrop="static" className="modal-dialog">
|
||||||
|
<div className="modal-content">
|
||||||
|
<h3>
|
||||||
|
Your session is about to expire in {remainingCountdown}{" "}
|
||||||
|
seconds due to inactivity. You will be redirected to the
|
||||||
|
login page.
|
||||||
|
</h3>
|
||||||
|
<button
|
||||||
|
className="govuk-button"
|
||||||
|
onClick={handleStayLoggedIn}
|
||||||
|
>
|
||||||
|
Stay Logged In
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="modal-backdrop fade show"></div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default TimeoutModal;
|
||||||
@@ -1,8 +1,9 @@
|
|||||||
import React, { Fragment } from "react";
|
import React, { Fragment } from "react";
|
||||||
|
|
||||||
export const Tracking = ({ googleTagManagerID }) => (
|
export const Tracking = ({ googleTagManagerID, nonce }) => (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<script
|
<script
|
||||||
|
nonce={nonce}
|
||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
__html: `(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
__html: `(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
||||||
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
||||||
|
|||||||
@@ -27,10 +27,9 @@ export const getFormCollectionByID = (appealTypeID) => {
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Get the details of a case from the appeal type
|
* Get the details of a case from the appeal type
|
||||||
* @param String token
|
|
||||||
* @param object searchResultsObj
|
* @param object searchResultsObj
|
||||||
*/
|
*/
|
||||||
export const getSearchDetails = (token, searchResultsObj) => {
|
export const getSearchDetails = (searchResultsObj) => {
|
||||||
//console.log(searchResultsObj);
|
//console.log(searchResultsObj);
|
||||||
|
|
||||||
let detailsArr = [];
|
let detailsArr = [];
|
||||||
@@ -45,7 +44,6 @@ export const getSearchDetails = (token, searchResultsObj) => {
|
|||||||
//console.log(formMeta);
|
//console.log(formMeta);
|
||||||
detailsArr.push(
|
detailsArr.push(
|
||||||
getBasicSearchDetails(
|
getBasicSearchDetails(
|
||||||
token,
|
|
||||||
formMeta.LogicalCollectionName,
|
formMeta.LogicalCollectionName,
|
||||||
searchDetail.title,
|
searchDetail.title,
|
||||||
formMeta.PrimaryIdAttribute,
|
formMeta.PrimaryIdAttribute,
|
||||||
@@ -90,3 +88,21 @@ export const getSearchDetailsPaged = (searchResultsObj) => {
|
|||||||
// console.log(detailsArr);
|
// console.log(detailsArr);
|
||||||
return Promise.all(detailsArr);
|
return Promise.all(detailsArr);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// export const absoluteUrl = (req, setLocalhost) => {
|
||||||
|
// var protocol = "https:";
|
||||||
|
// var host = req
|
||||||
|
// ? req.headers["x-forwarded-host"] || req.headers["host"]
|
||||||
|
// : window.location.host;
|
||||||
|
|
||||||
|
// if (host.indexOf("localhost") > -1) {
|
||||||
|
// if (setLocalhost) host = setLocalhost;
|
||||||
|
// protocol = "http:";
|
||||||
|
// }
|
||||||
|
|
||||||
|
// return {
|
||||||
|
// protocol: protocol,
|
||||||
|
// host: host,
|
||||||
|
// origin: protocol + "//" + host,
|
||||||
|
// };
|
||||||
|
// };
|
||||||
|
|||||||
@@ -228,6 +228,23 @@
|
|||||||
"value": "Planning permission granted",
|
"value": "Planning permission granted",
|
||||||
"value_cy": "Rhoddwyd caniatâd cynllunio",
|
"value_cy": "Rhoddwyd caniatâd cynllunio",
|
||||||
"pinswg_decision": 846040002
|
"pinswg_decision": 846040002
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "Approved with Conditions",
|
||||||
|
"value_cy": "Cymeradwywyd gydag Amodau",
|
||||||
|
"pinswg_decision": 846040002
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"pinswg_recommendation": [
|
||||||
|
{
|
||||||
|
"value": "Approved with Conditions",
|
||||||
|
"value_cy": "Cymeradwywyd gydag Amodau",
|
||||||
|
"pinswg_recommendation": 846040002
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "Dismissed",
|
||||||
|
"value_cy": "Gwrthodwyd",
|
||||||
|
"pinswg_recommendation": 846040001
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"pinswg_lpa": [
|
"pinswg_lpa": [
|
||||||
@@ -394,6 +411,28 @@
|
|||||||
"pinswg_procedure": 0
|
"pinswg_procedure": 0
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"pinswg_choiceofprocedure": [
|
||||||
|
{
|
||||||
|
"value": "Written representations only with no hearing or inquiry session(s)",
|
||||||
|
"value_cy": "Sylwadau ysgrifenedig yn unig heb unrhyw sesiwn (sesiynau) gwrandawiad nac ymholiad",
|
||||||
|
"pinswg_choiceofprocedure": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "Written representations with topic specific hearing session(s)",
|
||||||
|
"value_cy": "Sylwadau ysgrifenedig gyda sesiwn (sesiynau) gwrandawiad pwnc-benodol",
|
||||||
|
"pinswg_choiceofprocedure": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "Written representations with topic specific inquiry session(s)",
|
||||||
|
"value_cy": "Sylwadau ysgrifenedig gyda sesiwn (sesiynau) ymholiad pwnc-benodol",
|
||||||
|
"pinswg_choiceofprocedure": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "Written representations with topic specific hearing and inquiry session(s)",
|
||||||
|
"value_cy": "Sylwadau ysgrifenedig gyda sesiwn (sesiynau) gwrandawiad ac ymholi pwnc-benodol",
|
||||||
|
"pinswg_choiceofprocedure": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
"pinswg_isharedocumentlocations": [
|
"pinswg_isharedocumentlocations": [
|
||||||
{
|
{
|
||||||
"value": "Main Party - Pre-Submission Docs",
|
"value": "Main Party - Pre-Submission Docs",
|
||||||
|
|||||||
@@ -9,19 +9,20 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
"pages": {
|
"pages": {
|
||||||
"*": ["common", "newappeal"],
|
"*": ["common", "newappeal", "search"],
|
||||||
"/": ["common", "home"],
|
"/": ["common", "home"],
|
||||||
"/myportal": ["myportal"],
|
"/myportal": ["myportal"],
|
||||||
"/myportal/viewall": ["search"],
|
"/myportal/viewall": ["search"],
|
||||||
"/myportal/advancedsearch": ["search"],
|
"/myportal/advancedsearch": ["search"],
|
||||||
"/myportal/searchresults": ["search"],
|
"/myportal/searchresults": ["search"],
|
||||||
"/myportal/case": ["case"],
|
"/myportal/case": ["case"],
|
||||||
"/advancedsearch": ["search"],
|
"/advancedsearch": ["search", "myportal"],
|
||||||
"/advancedsearchresults": ["search"],
|
"/advancedsearchresults": ["search"],
|
||||||
"/searchresults": ["search"],
|
"/searchresults": ["search"],
|
||||||
"/viewall": ["search"],
|
"/viewall": ["search"],
|
||||||
"/case": ["case"],
|
"/case": ["case"],
|
||||||
"/myportal/representation": ["case"],
|
"/myportal/representation": ["case"],
|
||||||
|
"/myportal/error": ["myportal", "common"],
|
||||||
"/newappeal": ["newappeal"],
|
"/newappeal": ["newappeal"],
|
||||||
"/newappeal/*": ["newappeal"],
|
"/newappeal/*": ["newappeal"],
|
||||||
"/newappeal/selectappeal": ["newappeal"],
|
"/newappeal/selectappeal": ["newappeal"],
|
||||||
|
|||||||
@@ -63,5 +63,7 @@
|
|||||||
"summary-withdrawn-date": "Dyddiad tynnu'n ôl",
|
"summary-withdrawn-date": "Dyddiad tynnu'n ôl",
|
||||||
"summary-written-acceptance-of-notice": "Derbyniad ysgrifenedig o rybudd",
|
"summary-written-acceptance-of-notice": "Derbyniad ysgrifenedig o rybudd",
|
||||||
"summary-case-website-label": "Gwefan",
|
"summary-case-website-label": "Gwefan",
|
||||||
"summary-case-recommendation-label": "Argymhelliad"
|
"summary-case-recommendation-label": "Argymhelliad",
|
||||||
|
"summary-no-details-label": "Nid oes unrhyw fanylion ar gael ar hyn o bryd",
|
||||||
|
"summary-case-relevant-authoritylabel": "Awdurdod perthnasol"
|
||||||
}
|
}
|
||||||
@@ -17,9 +17,9 @@
|
|||||||
"search-button": "Chwilio",
|
"search-button": "Chwilio",
|
||||||
"submit-and-start": "Cyflwyno a dechrau'r cwrs",
|
"submit-and-start": "Cyflwyno a dechrau'r cwrs",
|
||||||
"footer-terms-conditions-link-label": "Telerau ac amodau",
|
"footer-terms-conditions-link-label": "Telerau ac amodau",
|
||||||
"footer-terms-conditions-link": "/telerau-ac-amodau",
|
"footer-terms-conditions-link": "https://llyw.cymru/telerau-ac-amodau",
|
||||||
"footer-privacy-link-label": "Preifatrwydd",
|
"footer-privacy-link-label": "Preifatrwydd",
|
||||||
"footer-privacy-link": "/preifatrwydd",
|
"footer-privacy-link": "https://llyw.cymru/gwaith-achos-cynllunio-hysbysiad-preifatrwydd",
|
||||||
"footer-cookies-link": "Cwcis",
|
"footer-cookies-link": "Cwcis",
|
||||||
"footer-accessibility-link-label": "Hygyrchedd",
|
"footer-accessibility-link-label": "Hygyrchedd",
|
||||||
"footer-accessibility-link": "/hygyrchedd",
|
"footer-accessibility-link": "/hygyrchedd",
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
"cookie-title-heading": "Cwcis ar cynllunio gwaith achos",
|
"cookie-title-heading": "Cwcis ar cynllunio gwaith achos",
|
||||||
"cookie-not-saved-heading": "Nid yw eich dewisiadau cwcis wedi eu cadw eto",
|
"cookie-not-saved-heading": "Nid yw eich dewisiadau cwcis wedi eu cadw eto",
|
||||||
"cookie-not-saved-paragraph": "Mae y gwasanaeth gwaith achos cynllunio yn gosod cwcis pan fyddwch yn ymweld â'n gwefan. Gallwch newid y gosodiadau hyn i'ch dewis chi. Mae angen i chi gadw'r dudalen hon gyda'ch dewisiadau newydd.",
|
"cookie-not-saved-paragraph": "Mae y gwasanaeth gwaith achos cynllunio yn gosod cwcis pan fyddwch yn ymweld â'n gwefan. Gallwch newid y gosodiadau hyn i'ch dewis chi. Mae angen i chi gadw'r dudalen hon gyda'ch dewisiadau newydd.",
|
||||||
|
"cookie-saved-heading": "Cafodd eich dewisiadau cwcis eu cadw",
|
||||||
|
"cookie-saved-paragraph": "Mae y gwasanaeth gwaith achos cynllunio yn gosod cwcis pan fyddwch yn ymweld â'n gwefan. Gallwch newid y gosodiadau hyn i'ch dewis chi.",
|
||||||
"cookie-intro-paragraph-1": "Ffeiliau sy'n cael eu cadw ar eich ffôn, tabled neu gyfrifiadur pan fyddwch yn ymweld â gwefan yw cwcis.",
|
"cookie-intro-paragraph-1": "Ffeiliau sy'n cael eu cadw ar eich ffôn, tabled neu gyfrifiadur pan fyddwch yn ymweld â gwefan yw cwcis.",
|
||||||
"cookie-intro-paragraph-2": "Rydym yn defnyddio cwcis i storio gwybodaeth ynghylch sut yr ydych yn defnyddio gwefan y gwasanaeth gwaith achos cynllunio, megis y tudalennau yr ydych yn ymweld â nhw. Nid yw'r cwcis hyn yn cael eu defnyddio i'ch adnabod chi'n bersonol.",
|
"cookie-intro-paragraph-2": "Rydym yn defnyddio cwcis i storio gwybodaeth ynghylch sut yr ydych yn defnyddio gwefan y gwasanaeth gwaith achos cynllunio, megis y tudalennau yr ydych yn ymweld â nhw. Nid yw'r cwcis hyn yn cael eu defnyddio i'ch adnabod chi'n bersonol.",
|
||||||
"cookie-intro-paragraph-3": "Rydym yn defnyddio 4 cwci gwahanol. Gallwch ddewis pa fath o gwcis rydych yn hapus i ni eu defnyddio.",
|
"cookie-intro-paragraph-3": "Rydym yn defnyddio 4 cwci gwahanol. Gallwch ddewis pa fath o gwcis rydych yn hapus i ni eu defnyddio.",
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
"login-card-register-link": "Gofrestru",
|
"login-card-register-link": "Gofrestru",
|
||||||
"login-card-forgotten-label": "Rwyf wedi anghofio fy nghyfrinair",
|
"login-card-forgotten-label": "Rwyf wedi anghofio fy nghyfrinair",
|
||||||
"login-card-forgotten-link": "Cliciwch yma",
|
"login-card-forgotten-link": "Cliciwch yma",
|
||||||
|
"login-via-gov-gateway-label": "Mewngofnodi trwy Borth y Llywodraeth",
|
||||||
"casesearch-card-title": "Chwilio apeliadau a Datblygiadau o Arwyddocâd Cenedlaethol",
|
"casesearch-card-title": "Chwilio apeliadau a Datblygiadau o Arwyddocâd Cenedlaethol",
|
||||||
"casesearch-card-search-hint": "Defnyddiwch gyfeimod yr achos neu deitl DAC i chwilio. Bydd cyfeirnod yr achos yn debyg i un o'r canlynol:",
|
"casesearch-card-search-hint": "Defnyddiwch gyfeimod yr achos neu deitl DAC i chwilio. Bydd cyfeirnod yr achos yn debyg i un o'r canlynol:",
|
||||||
"casesearch-card-search-example-label-1": "APP-A12345-A-21-1234567",
|
"casesearch-card-search-example-label-1": "APP-A12345-A-21-1234567",
|
||||||
@@ -37,5 +38,7 @@
|
|||||||
"inspectorate-card-alt-text": "Yr Arolygiaeth Gynllunio",
|
"inspectorate-card-alt-text": "Yr Arolygiaeth Gynllunio",
|
||||||
"dns-card-title": "Gweld yr holl Ddatblygiadau o Arwyddocâd Cenedlaethol",
|
"dns-card-title": "Gweld yr holl Ddatblygiadau o Arwyddocâd Cenedlaethol",
|
||||||
"dns-card-paragraph": "Mae Datblygiad o Arwyddocâd Cenedlaethol yn fath o gais cynllunio ar gyfer prosiect seilwaith mawr o bwysigrwydd cenedlaethol.",
|
"dns-card-paragraph": "Mae Datblygiad o Arwyddocâd Cenedlaethol yn fath o gais cynllunio ar gyfer prosiect seilwaith mawr o bwysigrwydd cenedlaethol.",
|
||||||
"dns-card-button": "Gweld pob cais"
|
"dns-card-button": "Gweld pob cais",
|
||||||
|
"logging-in-heading": "Mewngofnodi",
|
||||||
|
"logging-in-paragraph": "Arhoswch os gwelwch yn dda..."
|
||||||
}
|
}
|
||||||
@@ -30,5 +30,5 @@
|
|||||||
"norecords-cases": "Nid oes gennych unrhyw achosion",
|
"norecords-cases": "Nid oes gennych unrhyw achosion",
|
||||||
"norecords-representations": "Nid oes gennych unrhyw sylwadau",
|
"norecords-representations": "Nid oes gennych unrhyw sylwadau",
|
||||||
"norecords-watched-cases": "Nid ydych yn gwylio unrhyw achosion",
|
"norecords-watched-cases": "Nid ydych yn gwylio unrhyw achosion",
|
||||||
"norecords-awaiting-submission": "Nid oes gennych unrhyw gyflwyniadau sy'n aros"
|
"norecords-awaiting-submissions": "Nid oes gennych unrhyw gyflwyniadau sy'n aros"
|
||||||
}
|
}
|
||||||
@@ -47,6 +47,7 @@
|
|||||||
"clear-button-label": "Cliriwch",
|
"clear-button-label": "Cliriwch",
|
||||||
"clear-all-button-label": "Clirio Pob Un",
|
"clear-all-button-label": "Clirio Pob Un",
|
||||||
"searchresults-title-label": "Chwilio am achos",
|
"searchresults-title-label": "Chwilio am achos",
|
||||||
|
"searchresults-title-label-linked-case": "Achosion cysylltiedig",
|
||||||
"searchresults-count-label": "Cafodd eich chwiliad {{count}} o ganlyniadau",
|
"searchresults-count-label": "Cafodd eich chwiliad {{count}} o ganlyniadau",
|
||||||
"searchresults-max-count-label": "Dychwelodd eich chwiliad fwy na 200 o ganlyniadau. Mireiniwch eich chwiliad. Mae'r 200 achos diweddaraf yn cael eu harddangos",
|
"searchresults-max-count-label": "Dychwelodd eich chwiliad fwy na 200 o ganlyniadau. Mireiniwch eich chwiliad. Mae'r 200 achos diweddaraf yn cael eu harddangos",
|
||||||
"searchresults-case-reference-label": "Cyfeirnod yr Achos",
|
"searchresults-case-reference-label": "Cyfeirnod yr Achos",
|
||||||
|
|||||||
@@ -63,5 +63,7 @@
|
|||||||
"summary-withdrawn-date": "Withdrawn Date",
|
"summary-withdrawn-date": "Withdrawn Date",
|
||||||
"summary-written-acceptance-of-notice": "Written Acceptance of Notice",
|
"summary-written-acceptance-of-notice": "Written Acceptance of Notice",
|
||||||
"summary-case-website-label": "Website",
|
"summary-case-website-label": "Website",
|
||||||
"summary-case-recommendation-label": "Recommendation"
|
"summary-case-recommendation-label": "Recommendation",
|
||||||
|
"summary-no-details-label": "No details currently held",
|
||||||
|
"summary-case-relevant-authoritylabel": "Relevant authority"
|
||||||
}
|
}
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
"gov-wales-link": "https://www.gov.wales",
|
"gov-wales-link": "https://www.gov.wales",
|
||||||
"gov-wales-label": "GOV.WALES",
|
"gov-wales-label": "GOV.WALES",
|
||||||
"service-description": "This service is being developed to support online appeals and applications.",
|
"service-description": "This service is being developed to support online appeals and applications.",
|
||||||
"service-name": "Casework",
|
"service-name": "Planning Casework",
|
||||||
"service-home-url": "https://planningcasework.service.gov.wales",
|
"service-home-url": "https://planningcasework.service.gov.wales",
|
||||||
"service-name-breadcrumb": "Home",
|
"service-name-breadcrumb": "Home",
|
||||||
"new-service-beta": "This is a new service",
|
"new-service-beta": "This is a new service",
|
||||||
@@ -17,9 +17,9 @@
|
|||||||
"search-button": "Search",
|
"search-button": "Search",
|
||||||
"submit-and-start": "Submit and start course",
|
"submit-and-start": "Submit and start course",
|
||||||
"footer-terms-conditions-link-label": "Terms and conditions",
|
"footer-terms-conditions-link-label": "Terms and conditions",
|
||||||
"footer-terms-conditions-link": "/terms-and-conditions",
|
"footer-terms-conditions-link": "https://gov.wales/terms-and-conditions",
|
||||||
"footer-privacy-link-label": "Privacy",
|
"footer-privacy-link-label": "Privacy",
|
||||||
"footer-privacy-link": "/privacy",
|
"footer-privacy-link": "https://gov.wales/planning-casework-privacy-notice",
|
||||||
"footer-cookies-link": "Cookies",
|
"footer-cookies-link": "Cookies",
|
||||||
"footer-accessibility-link-label": "Accessibility",
|
"footer-accessibility-link-label": "Accessibility",
|
||||||
"footer-accessibility-link": "/accessibility",
|
"footer-accessibility-link": "/accessibility",
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
"cookie-title-heading": "Cookies on planning casework",
|
"cookie-title-heading": "Cookies on planning casework",
|
||||||
"cookie-not-saved-heading": "Your cookie settings have not yet been saved",
|
"cookie-not-saved-heading": "Your cookie settings have not yet been saved",
|
||||||
"cookie-not-saved-paragraph": "The planning casework service sets cookies when you visit our website. You can choose to change these settings to your own preferences. You need to save this page with your new choices.",
|
"cookie-not-saved-paragraph": "The planning casework service sets cookies when you visit our website. You can choose to change these settings to your own preferences. You need to save this page with your new choices.",
|
||||||
|
"cookie-saved-heading": "Your cookie settings were saved",
|
||||||
|
"cookie-saved-paragraph": "The planning casework service sets cookies when you visit our website. You can choose to change these settings to your own preferences.",
|
||||||
"cookie-intro-paragraph-1": "Cookies are files saved on your phone, tablet or computer when you visit a website.",
|
"cookie-intro-paragraph-1": "Cookies are files saved on your phone, tablet or computer when you visit a website.",
|
||||||
"cookie-intro-paragraph-2": "We use cookies to store information about how you use the the planning casework service website, such as the pages you visit. These cookies are not used to identify you personally.",
|
"cookie-intro-paragraph-2": "We use cookies to store information about how you use the the planning casework service website, such as the pages you visit. These cookies are not used to identify you personally.",
|
||||||
"cookie-intro-paragraph-3": "We use 4 types of cookie. You can choose which cookies you're happy for us to use.",
|
"cookie-intro-paragraph-3": "We use 4 types of cookie. You can choose which cookies you're happy for us to use.",
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
"login-card-register-link": "Register",
|
"login-card-register-link": "Register",
|
||||||
"login-card-forgotten-label": "I have forgotten my password",
|
"login-card-forgotten-label": "I have forgotten my password",
|
||||||
"login-card-forgotten-link": "Click here",
|
"login-card-forgotten-link": "Click here",
|
||||||
|
"login-via-gov-gateway-label": "Log in via Government Gateway",
|
||||||
"casesearch-card-title": "Search appeals and Developments of National Significance",
|
"casesearch-card-title": "Search appeals and Developments of National Significance",
|
||||||
"casesearch-card-search-hint": "Use the case reference or DNS title to search. Case reference will be similar to one of the following:",
|
"casesearch-card-search-hint": "Use the case reference or DNS title to search. Case reference will be similar to one of the following:",
|
||||||
"casesearch-card-search-example-label-1": "APP-A12345-A-21-1234567",
|
"casesearch-card-search-example-label-1": "APP-A12345-A-21-1234567",
|
||||||
@@ -37,5 +38,7 @@
|
|||||||
"inspectorate-card-alt-text": "The Planning Inspectorate",
|
"inspectorate-card-alt-text": "The Planning Inspectorate",
|
||||||
"dns-card-title": "View all Developments of National Significance ",
|
"dns-card-title": "View all Developments of National Significance ",
|
||||||
"dns-card-paragraph": "A Development of National Significance is a type of planning application for a large infrastructure project of national importance.",
|
"dns-card-paragraph": "A Development of National Significance is a type of planning application for a large infrastructure project of national importance.",
|
||||||
"dns-card-button": "View all applications"
|
"dns-card-button": "View all applications",
|
||||||
|
"logging-in-heading": "Logging in",
|
||||||
|
"logging-in-paragraph": "Please wait..."
|
||||||
}
|
}
|
||||||
@@ -30,5 +30,5 @@
|
|||||||
"norecords-cases": "You have no cases",
|
"norecords-cases": "You have no cases",
|
||||||
"norecords-representations": "You have no representations",
|
"norecords-representations": "You have no representations",
|
||||||
"norecords-watched-cases": "You are not watching any cases",
|
"norecords-watched-cases": "You are not watching any cases",
|
||||||
"norecords-awaiting-submission": "You have no awaiting submissions"
|
"norecords-awaiting-submissions": "You have no awaiting submissions"
|
||||||
}
|
}
|
||||||
@@ -47,6 +47,7 @@
|
|||||||
"clear-button-label": "Clear",
|
"clear-button-label": "Clear",
|
||||||
"clear-all-button-label": "Clear all",
|
"clear-all-button-label": "Clear all",
|
||||||
"searchresults-title-label": "Search for a case",
|
"searchresults-title-label": "Search for a case",
|
||||||
|
"searchresults-title-label-linked-case": "Linked case",
|
||||||
"searchresults-count-label": "Your search returned {{count}} results",
|
"searchresults-count-label": "Your search returned {{count}} results",
|
||||||
"searchresults-max-count-label": "Your searched returned more than 200 results. Please refine your search. The most recent 200 cases are displayed",
|
"searchresults-max-count-label": "Your searched returned more than 200 results. Please refine your search. The most recent 200 cases are displayed",
|
||||||
"searchresults-case-reference-label": "Case reference",
|
"searchresults-case-reference-label": "Case reference",
|
||||||
|
|||||||
+19
-3
@@ -27,14 +27,30 @@ const securityHeaders = [
|
|||||||
key: "X-Frame-Options",
|
key: "X-Frame-Options",
|
||||||
value: "SAMEORIGIN",
|
value: "SAMEORIGIN",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
key: "X-Content-Type-Options",
|
||||||
|
value: "nosniff",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "X-Permitted-Cross-Domain-Policies",
|
||||||
|
value: "none",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "Referrer-Policy",
|
||||||
|
value: "origin-when-cross-origin", //no-referrer
|
||||||
|
},
|
||||||
{
|
{
|
||||||
key: "Strict-Transport-Security",
|
key: "Strict-Transport-Security",
|
||||||
value: "max-age=63072000; includeSubDomains; preload",
|
value: "max-age=63072000; includeSubDomains; preload",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "Content-Security-Policy",
|
key: "X-XSS-Protection",
|
||||||
value: "frame-src 'self'; child-src 'self'",
|
value: "1; mode=block",
|
||||||
},
|
},
|
||||||
|
// {
|
||||||
|
// key: "Content-Security-Policy",
|
||||||
|
// value: "frame-src 'self'; child-src 'self';object-src 'none'; script-src 'self' 'https://www.googletagmanager.com' unsafe-inline",
|
||||||
|
// },
|
||||||
];
|
];
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
@@ -42,7 +58,7 @@ module.exports = {
|
|||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
// Apply these headers to all routes in your application.
|
// Apply these headers to all routes in your application.
|
||||||
source: "/(.*)",
|
source: "/(.*)?",
|
||||||
headers: securityHeaders,
|
headers: securityHeaders,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
+27
-25
@@ -5,61 +5,63 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
"dev:app": "node ./server/server.js",
|
"dev:app": "node ./server/server.js",
|
||||||
"build": "next build",
|
"build": "NODE_ENV=production node_modules/next/dist/bin/next build",
|
||||||
"start": "next start"
|
"start": "node_modules/next/dist/bin/next start"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@webdeb/next-styles": "^1.1.1",
|
"@webdeb/next-styles": "^1.1.1",
|
||||||
"applicationinsights": "^2.1.3",
|
"applicationinsights": "^2.2.0",
|
||||||
"axios": "^0.21.1",
|
"axios": "^0.24.0",
|
||||||
"compression": "^1.7.4",
|
"compression": "^1.7.4",
|
||||||
"cookie-cutter": "^0.2.0",
|
"cookie-cutter": "^0.2.0",
|
||||||
"cookies": "^0.8.0",
|
"cookies": "^0.8.0",
|
||||||
"crypto-js": "^4.1.1",
|
"crypto-js": "^4.1.1",
|
||||||
"date-fns": "^2.25.0",
|
"date-fns": "^2.28.0",
|
||||||
"dom": "^0.0.3",
|
"dom": "^0.0.3",
|
||||||
"dynamics-web-api": "^1.7.4",
|
"dynamics-web-api": "^1.7.4",
|
||||||
"express": "^4.17.1",
|
"express": "^4.17.2",
|
||||||
"govuk-frontend": "^3.13.0",
|
"govuk-frontend": "3.13.0",
|
||||||
"https": "^1.0.0",
|
"https": "^1.0.0",
|
||||||
"hyco-https": "^1.4.5",
|
"hyco-https": "^1.4.5",
|
||||||
"jsonpath": "^1.1.1",
|
"jsonpath": "^1.1.1",
|
||||||
"jsonpath-plus": "^5.1.0",
|
"jsonpath-plus": "^6.0.1",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"moment": "^2.29.1",
|
"moment": "^2.29.1",
|
||||||
"next": "^11.0.1",
|
"nanoid": "^3.2.0",
|
||||||
"next-redux-wrapper": "^7.0.2",
|
"next": "^12.0.8",
|
||||||
"next-translate": "^1.0.7",
|
"next-redux-wrapper": "^7.0.5",
|
||||||
|
"next-translate": "^1.2.0",
|
||||||
"nextjs-basic-auth-middleware": "^0.2.1",
|
"nextjs-basic-auth-middleware": "^0.2.1",
|
||||||
"nookies": "^2.5.2",
|
"nookies": "^2.5.2",
|
||||||
"path": "^0.12.7",
|
"path": "^0.12.7",
|
||||||
"pm2": "^5.1.0",
|
"pm2": "^5.1.2",
|
||||||
"react": "17.0.2",
|
"react": "17.0.2",
|
||||||
"react-accessible-accordion": "^3.3.5",
|
"react-accessible-accordion": "^4.0.0",
|
||||||
"react-autosuggest": "^10.1.0",
|
"react-autosuggest": "^10.1.0",
|
||||||
"react-cookie-consent": "^6.2.4",
|
"react-cookie-consent": "^7.2.1",
|
||||||
"react-datepicker": "^4.1.1",
|
"react-datepicker": "^4.6.0",
|
||||||
"react-dom": "17.0.2",
|
"react-dom": "17.0.2",
|
||||||
"react-dropzone": "^11.3.4",
|
"react-dropzone": "^11.5.1",
|
||||||
|
"react-idle-timer": "^4.6.4",
|
||||||
"react-loading-overlay": "^1.0.1",
|
"react-loading-overlay": "^1.0.1",
|
||||||
"react-redux": "^7.2.4",
|
"react-redux": "^7.2.6",
|
||||||
"react-xml-parser": "^1.1.8",
|
"react-xml-parser": "^1.1.8",
|
||||||
"redux-devtools-extension": "^2.13.9",
|
"redux-devtools-extension": "^2.13.9",
|
||||||
"redux-form": "^8.3.7",
|
"redux-form": "^8.3.8",
|
||||||
"redux-persist": "^6.0.0",
|
"redux-persist": "^6.0.0",
|
||||||
"redux-thunk": "^2.3.0",
|
"redux-thunk": "^2.4.1",
|
||||||
"sass": "1.32",
|
"sass": "1.32",
|
||||||
"sass-loader": "^12.1.0",
|
"sass-loader": "^12.4.0",
|
||||||
"swr": "^0.5.6",
|
"swr": "^1.1.2",
|
||||||
"webpack": "^5.40.0",
|
"webpack": "^5.66.0",
|
||||||
"xml2js": "^0.4.23",
|
"xml2js": "^0.4.23",
|
||||||
"xmldom": "^0.6.0",
|
"xmldom": "^0.6.0",
|
||||||
"xmlhttprequest": "^1.8.0",
|
"xmlhttprequest": "^1.8.0",
|
||||||
"xpath": "^0.0.32"
|
"xpath": "^0.0.32"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"eslint": "^7.29.0",
|
"eslint": "^8.6.0",
|
||||||
"eslint-config-next": "^11.0.1",
|
"eslint-config-next": "^12.0.8",
|
||||||
"prettier": "2.3.2"
|
"prettier": "2.5.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-5
@@ -1,11 +1,10 @@
|
|||||||
// 404.js
|
// 404.js
|
||||||
import Link from "next/link";
|
|
||||||
import Head from "next/head";
|
|
||||||
import Header from "../components/header";
|
|
||||||
import Banner from "../components/banner";
|
|
||||||
import CookieBanner from "../components/cookieBanner";
|
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
|
import Head from "next/head";
|
||||||
|
import Link from "next/link";
|
||||||
|
import CookieBanner from "../components/cookieBanner";
|
||||||
import Footer from "../components/footer";
|
import Footer from "../components/footer";
|
||||||
|
import Header from "../components/header";
|
||||||
|
|
||||||
const FourOhFour = (props) => {
|
const FourOhFour = (props) => {
|
||||||
let { t, lang } = useTranslation();
|
let { t, lang } = useTranslation();
|
||||||
|
|||||||
+30
-5
@@ -2,6 +2,7 @@ import Document, { Html, Head, Main, NextScript } from "next/document";
|
|||||||
import SkipLink from "../components/skiplink";
|
import SkipLink from "../components/skiplink";
|
||||||
import { Tracking, TrackingNoScript } from "../components/tracking";
|
import { Tracking, TrackingNoScript } from "../components/tracking";
|
||||||
import basicAuthMiddleware from "nextjs-basic-auth-middleware";
|
import basicAuthMiddleware from "nextjs-basic-auth-middleware";
|
||||||
|
import { nanoid } from "nanoid";
|
||||||
|
|
||||||
class MyDocument extends Document {
|
class MyDocument extends Document {
|
||||||
static async getInitialProps(ctx) {
|
static async getInitialProps(ctx) {
|
||||||
@@ -13,7 +14,7 @@ class MyDocument extends Document {
|
|||||||
let hasBasicAuth =
|
let hasBasicAuth =
|
||||||
typeof process.env.BASIC_AUTH_CREDENTIALS != "undefined";
|
typeof process.env.BASIC_AUTH_CREDENTIALS != "undefined";
|
||||||
|
|
||||||
console.log(hasBasicAuth);
|
console.log("hasbasicAuth:", hasBasicAuth);
|
||||||
|
|
||||||
if (ctx.req && ctx.res) {
|
if (ctx.req && ctx.res) {
|
||||||
hasBasicAuth &&
|
hasBasicAuth &&
|
||||||
@@ -38,23 +39,47 @@ class MyDocument extends Document {
|
|||||||
render() {
|
render() {
|
||||||
const googleTagManagerID = process.env.GOOGLE_TAG_MANAGER || null;
|
const googleTagManagerID = process.env.GOOGLE_TAG_MANAGER || null;
|
||||||
const { useGATracking } = this.props;
|
const { useGATracking } = this.props;
|
||||||
|
|
||||||
|
const generatedNonce = nanoid();
|
||||||
|
|
||||||
|
let csp = ``;
|
||||||
|
csp += `base-uri 'self';`;
|
||||||
|
csp += `form-action 'self';`;
|
||||||
|
csp += `object-src 'self' data:;`;
|
||||||
|
csp += `script-src 'self' https://www.googletagmanager.com 'nonce-${generatedNonce}' ${
|
||||||
|
process.env.NODE_ENV != "production" ? " 'unsafe-eval';" : " ;"
|
||||||
|
}`;
|
||||||
|
csp += `img-src 'self' https://www.googletagmanager.com https://gov.wales https://www.google-analytics.com 'nonce-${generatedNonce}' data:;`;
|
||||||
|
csp += `style-src 'self' https://fonts.googleapis.com 'unsafe-inline' data:;`;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Html lang="en">
|
<Html lang="en">
|
||||||
<Head>
|
<Head>
|
||||||
|
<meta httpEquiv="Content-Security-Policy" content={csp} />
|
||||||
{useGATracking && (
|
{useGATracking && (
|
||||||
<Tracking googleTagManagerID={googleTagManagerID} />
|
<Tracking
|
||||||
|
googleTagManagerID={googleTagManagerID}
|
||||||
|
nonce={generatedNonce}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
</Head>
|
</Head>
|
||||||
<body className="js-enabled">
|
<body className="js-enabled">
|
||||||
{useGATracking && (
|
{useGATracking && (
|
||||||
<TrackingNoScript
|
<TrackingNoScript
|
||||||
|
nonce={generatedNonce}
|
||||||
googleTagManagerID={googleTagManagerID}
|
googleTagManagerID={googleTagManagerID}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{!process.browser && (
|
{!process.browser && (
|
||||||
<script>
|
<>
|
||||||
window.switchDomain = `{process.env.I18N_DOMAIN}`
|
<script nonce={generatedNonce}>
|
||||||
</script>
|
window.switchDomain = `{process.env.I18N_DOMAIN}
|
||||||
|
`
|
||||||
|
</script>
|
||||||
|
<script nonce={generatedNonce}>
|
||||||
|
window.apiRoot = `{process.env.API_ROOT}`
|
||||||
|
</script>
|
||||||
|
</>
|
||||||
)}
|
)}
|
||||||
<SkipLink />
|
<SkipLink />
|
||||||
<Main />
|
<Main />
|
||||||
|
|||||||
+4
-5
@@ -1,10 +1,9 @@
|
|||||||
import Link from "next/link";
|
|
||||||
import Head from "next/head";
|
|
||||||
import Header from "../components/header";
|
|
||||||
import Banner from "../components/banner";
|
|
||||||
import CookieBanner from "../components/cookieBanner";
|
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
|
import Head from "next/head";
|
||||||
|
import Link from "next/link";
|
||||||
|
import CookieBanner from "../components/cookieBanner";
|
||||||
import Footer from "../components/footer";
|
import Footer from "../components/footer";
|
||||||
|
import Header from "../components/header";
|
||||||
|
|
||||||
function Error({ statusCode }, props) {
|
function Error({ statusCode }, props) {
|
||||||
let { t, lang } = useTranslation();
|
let { t, lang } = useTranslation();
|
||||||
|
|||||||
+7
-16
@@ -1,26 +1,17 @@
|
|||||||
import _ from "lodash";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useState, useEffect, useRef } from "react";
|
|
||||||
import Head from "next/head";
|
import Head from "next/head";
|
||||||
|
import { useRouter } from "next/router";
|
||||||
|
import AccessibilityStatement from "../components/accessibility";
|
||||||
|
import Breadcrumbs from "../components/breadcrumbs";
|
||||||
|
import CookieBanner from "../components/cookieBanner";
|
||||||
|
import Footer from "../components/footer";
|
||||||
import Header from "../components/header";
|
import Header from "../components/header";
|
||||||
import ServiceBanner from "../components/servicebanner";
|
import ServiceBanner from "../components/servicebanner";
|
||||||
import CookieBanner from "../components/cookieBanner";
|
|
||||||
import Breadcrumbs from "../components/breadcrumbs";
|
|
||||||
import Main from "../components/main";
|
|
||||||
import Footer from "../components/footer";
|
|
||||||
import Errorpage from "../components/errorpage";
|
|
||||||
import styles from "../styles/Home.module.css";
|
|
||||||
import { useSelector, shallowEqual, connect } from "react-redux";
|
|
||||||
import { wrapper } from "../store/store";
|
|
||||||
import { useRouter } from "next/router";
|
|
||||||
import useTranslation from "next-translate/useTranslation";
|
|
||||||
import { getIncidents } from "../actions";
|
|
||||||
import { parseCookies } from "nookies";
|
|
||||||
import AccessibilityStatement from "../components/accessibility";
|
|
||||||
|
|
||||||
const Accessibility = (props) => {
|
const Accessibility = (props) => {
|
||||||
const { footerLinks, pages, showLogin } = props;
|
const { footerLinks, pages, showLogin } = props;
|
||||||
let { t, lang } = useTranslation();
|
let { t, lang } = useTranslation();
|
||||||
|
ß;
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { locale } = router;
|
const { locale } = router;
|
||||||
|
|
||||||
|
|||||||
+30
-12
@@ -17,9 +17,10 @@ import jsonpath from "jsonpath";
|
|||||||
import { reduxForm, formValueSelector } from "redux-form";
|
import { reduxForm, formValueSelector } from "redux-form";
|
||||||
|
|
||||||
import RegisterForm from "../../components/account/registerform";
|
import RegisterForm from "../../components/account/registerform";
|
||||||
|
import { dehashString, hashAPIPath } from "../../actions";
|
||||||
|
|
||||||
const Home = (props) => {
|
const Home = (props) => {
|
||||||
const { footerLinks, formData } = props;
|
const { footerLinks, formData, loggedInUserEmail } = props;
|
||||||
let { t, lang } = useTranslation();
|
let { t, lang } = useTranslation();
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -97,6 +98,9 @@ const Home = (props) => {
|
|||||||
setAccountCreatedComplete={
|
setAccountCreatedComplete={
|
||||||
setAccountCreatedComplete
|
setAccountCreatedComplete
|
||||||
}
|
}
|
||||||
|
loggedInUserEmail={
|
||||||
|
loggedInUserEmail
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{registerFormComplete != true ||
|
{registerFormComplete != true ||
|
||||||
@@ -151,17 +155,31 @@ const Home = (props) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
// export const getServerSideProps = wrapper.getServerSideProps(
|
export const getServerSideProps = wrapper.getServerSideProps(
|
||||||
// (store) =>
|
(store) =>
|
||||||
// async ({ query, req, res }) => {
|
async ({ query, req, res }) => {
|
||||||
// const appealTypeData = await getAppealsTypes();
|
// const appealTypeData = await getAppealsTypes();
|
||||||
// const lpaData = await getLPA();
|
// const lpaData = await getLPA();
|
||||||
// console.log("appeal types", appealTypeData);
|
// console.log("appeal types", appealTypeData);
|
||||||
// console.log("lpa typeswwwww", lpaData);
|
// console.log("lpa typeswwwww", lpaData);
|
||||||
// store.dispatch(setAppealType(appealTypeData));
|
// store.dispatch(setAppealType(appealTypeData));
|
||||||
// store.dispatch(setLPA(lpaData));
|
// store.dispatch(setLPA(lpaData));
|
||||||
// }
|
|
||||||
// );
|
let hasRegistrationEmail = typeof query.id != "undefined";
|
||||||
|
let loginEmailStr = "";
|
||||||
|
|
||||||
|
if (hasRegistrationEmail == true) {
|
||||||
|
loginEmailStr = dehashString(query.id);
|
||||||
|
|
||||||
|
console.log(loginEmailStr);
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
props: {
|
||||||
|
loggedInUserEmail: loginEmailStr,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
const mapStateToProps = (state) => {
|
const mapStateToProps = (state) => {
|
||||||
return {
|
return {
|
||||||
|
|||||||
+13
-50
@@ -1,36 +1,18 @@
|
|||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { useState } from "react";
|
|
||||||
import Head from "next/head";
|
|
||||||
import Header from "../components/header";
|
|
||||||
import Banner from "../components/banner";
|
|
||||||
import CookieBanner from "../components/cookieBanner";
|
|
||||||
import Breadcrumbs from "../components/breadcrumbs";
|
|
||||||
import Search from "../components/search";
|
|
||||||
import Footer from "../components/footer";
|
|
||||||
import Errorpage from "../components/errorpage";
|
|
||||||
import styles from "../styles/Home.module.css";
|
|
||||||
import { useSelector, shallowEqual, connect } from "react-redux";
|
|
||||||
import { wrapper } from "../store/store";
|
|
||||||
|
|
||||||
import { useRouter } from "next/router";
|
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
|
import Head from "next/head";
|
||||||
|
import { useRouter } from "next/router";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import { getAppealsTypes, getLPA } from "../actions";
|
||||||
|
import Breadcrumbs from "../components/breadcrumbs";
|
||||||
|
import CookieBanner from "../components/cookieBanner";
|
||||||
import CRMError from "../components/crmError";
|
import CRMError from "../components/crmError";
|
||||||
|
import Footer from "../components/footer";
|
||||||
import {
|
import Header from "../components/header";
|
||||||
setAppealType,
|
import Search from "../components/search";
|
||||||
setAppealTypeTitle,
|
import { setAppealType } from "../store/appealType/action";
|
||||||
setAppealTypeID,
|
|
||||||
setAppealLPA,
|
|
||||||
getAppealTypeObj,
|
|
||||||
} from "../store/appealType/action";
|
|
||||||
import {
|
|
||||||
getAppealsTypes,
|
|
||||||
getLPA,
|
|
||||||
updateCase,
|
|
||||||
createCase,
|
|
||||||
getToken,
|
|
||||||
} from "../actions";
|
|
||||||
import { setLPA } from "../store/lpa/action";
|
import { setLPA } from "../store/lpa/action";
|
||||||
|
import { wrapper } from "../store/store";
|
||||||
|
|
||||||
const Home = (props) => {
|
const Home = (props) => {
|
||||||
const { footerLinks, pages } = props;
|
const { footerLinks, pages } = props;
|
||||||
@@ -40,7 +22,6 @@ const Home = (props) => {
|
|||||||
const { locale } = router;
|
const { locale } = router;
|
||||||
const { appealtypes } = router.query;
|
const { appealtypes } = router.query;
|
||||||
|
|
||||||
//console.log(props, props.LPAData);
|
|
||||||
var hasError =
|
var hasError =
|
||||||
_.has(props.LPAData.LPAData, "errorCode") ||
|
_.has(props.LPAData.LPAData, "errorCode") ||
|
||||||
_.has(props.appealType.appealType, "errorCode")
|
_.has(props.appealType.appealType, "errorCode")
|
||||||
@@ -139,27 +120,9 @@ const Home = (props) => {
|
|||||||
export const getServerSideProps = wrapper.getServerSideProps(
|
export const getServerSideProps = wrapper.getServerSideProps(
|
||||||
(store) =>
|
(store) =>
|
||||||
async ({ query, req, res }) => {
|
async ({ query, req, res }) => {
|
||||||
let token = await getToken();
|
|
||||||
|
|
||||||
var tokenIssuedAt = new Date();
|
|
||||||
var tokenExpiryTimeAt = new Date();
|
|
||||||
tokenExpiryTimeAt.setSeconds(
|
|
||||||
tokenExpiryTimeAt.getSeconds() + token.expires_in
|
|
||||||
);
|
|
||||||
|
|
||||||
console.log(
|
|
||||||
"token issued:",
|
|
||||||
tokenIssuedAt.toUTCString(),
|
|
||||||
"\n",
|
|
||||||
"token expires:",
|
|
||||||
tokenExpiryTimeAt.toUTCString()
|
|
||||||
);
|
|
||||||
console.log(token);
|
|
||||||
token = token.access_token;
|
|
||||||
|
|
||||||
const [appealTypeData, lpaData] = await Promise.all([
|
const [appealTypeData, lpaData] = await Promise.all([
|
||||||
await getAppealsTypes(token),
|
await getAppealsTypes(),
|
||||||
await getLPA(token),
|
await getLPA(),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
store.dispatch(setAppealType(appealTypeData));
|
store.dispatch(setAppealType(appealTypeData));
|
||||||
|
|||||||
@@ -1,28 +1,20 @@
|
|||||||
import _ from "lodash";
|
|
||||||
import Head from "next/head";
|
|
||||||
import Header from "../components/header";
|
|
||||||
import Banner from "../components/banner";
|
|
||||||
import CookieBanner from "../components/cookieBanner";
|
|
||||||
import Breadcrumbs from "../components/breadcrumbs";
|
|
||||||
import SearchResults from "../components/searchresults";
|
|
||||||
import Footer from "../components/footer";
|
|
||||||
import Errorpage from "../components/errorpage";
|
|
||||||
import styles from "../styles/Home.module.css";
|
|
||||||
import { useSelector, shallowEqual, connect } from "react-redux";
|
|
||||||
import { wrapper } from "../store/store";
|
|
||||||
|
|
||||||
import { useRouter } from "next/router";
|
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import jsonpath from "jsonpath";
|
import Head from "next/head";
|
||||||
import data from "../data/collections.json";
|
import { useRouter } from "next/router";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import { getAdvancedSearch } from "../actions";
|
||||||
|
import Breadcrumbs from "../components/breadcrumbs";
|
||||||
|
import CookieBanner from "../components/cookieBanner";
|
||||||
|
import Footer from "../components/footer";
|
||||||
|
import Header from "../components/header";
|
||||||
|
import SearchResults from "../components/searchresults";
|
||||||
import { getSearchDetails } from "../components/utils";
|
import { getSearchDetails } from "../components/utils";
|
||||||
import { setSearch, getSearchObj } from "../store/search/action";
|
import { setSearch } from "../store/search/action";
|
||||||
import {
|
import {
|
||||||
setSearchResults,
|
|
||||||
setSearchDetails,
|
setSearchDetails,
|
||||||
getSearchResultsObj,
|
setSearchResults,
|
||||||
} from "../store/searchOutput/action";
|
} from "../store/searchOutput/action";
|
||||||
import { getAdvancedSearch, getBasicSearchDetails, getToken } from "../actions";
|
import { wrapper } from "../store/store";
|
||||||
|
|
||||||
const Home = (props) => {
|
const Home = (props) => {
|
||||||
const { footerLinks, pages } = props;
|
const { footerLinks, pages } = props;
|
||||||
@@ -123,14 +115,8 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
|||||||
console.log("query-", query);
|
console.log("query-", query);
|
||||||
//console.log("search array:", Object.entries(query));
|
//console.log("search array:", Object.entries(query));
|
||||||
|
|
||||||
let token = await getToken();
|
const searchResultsObj = await getAdvancedSearch(query);
|
||||||
token = token.access_token;
|
const searchDetailsObj = await getSearchDetails(searchResultsObj);
|
||||||
|
|
||||||
const searchResultsObj = await getAdvancedSearch(token, query);
|
|
||||||
const searchDetailsObj = await getSearchDetails(
|
|
||||||
token,
|
|
||||||
searchResultsObj
|
|
||||||
);
|
|
||||||
|
|
||||||
store.dispatch(setSearchResults(searchResultsObj));
|
store.dispatch(setSearchResults(searchResultsObj));
|
||||||
store.dispatch(setSearchDetails(searchDetailsObj));
|
store.dispatch(setSearchDetails(searchDetailsObj));
|
||||||
|
|||||||
@@ -0,0 +1,70 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import https from "https";
|
||||||
|
import CryptoJS from "crypto-js";
|
||||||
|
import { getToken } from "../../../../actions";
|
||||||
|
|
||||||
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
const accessTokenEndpoint = process.env.ACCESS_TOKEN_ENDPOINT;
|
||||||
|
const tenantId = process.env.TENANT;
|
||||||
|
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
|
||||||
|
const azureHeadersPaged = (access_token) => {
|
||||||
|
return {
|
||||||
|
headers: {
|
||||||
|
"OData-MaxVersion": "4.0",
|
||||||
|
"OData-Version": "4.0",
|
||||||
|
"Accept": "application/json;odata.metadata=none",
|
||||||
|
"Prefer":
|
||||||
|
'odata.include-annotations="*",return=representation, odata.maxpagesize=10',
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
"Authorization": "Bearer " + access_token,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export default async function ApiProxy(req, res) {
|
||||||
|
var token = await getToken();
|
||||||
|
|
||||||
|
var docRef = req.query;
|
||||||
|
|
||||||
|
console.log(docRef.id);
|
||||||
|
|
||||||
|
var queryUrl = "documents/download/" + docRef.id + "?hash=" + docRef.hash;
|
||||||
|
|
||||||
|
console.log(WEBAPI_URL + queryUrl);
|
||||||
|
return axios
|
||||||
|
.get(
|
||||||
|
WEBAPI_URL + queryUrl, // + hashAPIPath(queryUrl),
|
||||||
|
azureHeadersPaged(token.access_token)
|
||||||
|
)
|
||||||
|
.then((response) => {
|
||||||
|
console.log(response.headers);
|
||||||
|
res.status(200);
|
||||||
|
res.setHeader(
|
||||||
|
"Content-disposition",
|
||||||
|
"attachment; filename=" +
|
||||||
|
response.headers["content-disposition"].split(
|
||||||
|
"filename="
|
||||||
|
)[1]
|
||||||
|
);
|
||||||
|
res.end(response.data);
|
||||||
|
})
|
||||||
|
.catch(({ err }) => {
|
||||||
|
res.status(400).json(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import CryptoJS from "crypto-js";
|
||||||
|
import { getToken, azureHeadersPaged } from "../../../actions";
|
||||||
|
|
||||||
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
|
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) {
|
||||||
|
var token = await getToken();
|
||||||
|
var queryUrl = "contacts";
|
||||||
|
var data = JSON.stringify(req.body);
|
||||||
|
|
||||||
|
var config = {
|
||||||
|
method: "post",
|
||||||
|
url: WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
headers: {
|
||||||
|
"OData-MaxVersion": "4.0",
|
||||||
|
"OData-Version": "4.0",
|
||||||
|
"Accept": "application/json",
|
||||||
|
"Prefer": 'odata.include-annotations="*",return=representation',
|
||||||
|
"Authorization": "Bearer " + token.access_token,
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
},
|
||||||
|
data: data,
|
||||||
|
};
|
||||||
|
|
||||||
|
return axios(config)
|
||||||
|
.then(({ data }) => {
|
||||||
|
res.status(200).json(data);
|
||||||
|
})
|
||||||
|
.catch(({ err }) => {
|
||||||
|
res.status(400).json(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import CryptoJS from "crypto-js";
|
||||||
|
import _ from "lodash";
|
||||||
|
import { getToken, azureHeadersPaged } from "../../../actions";
|
||||||
|
|
||||||
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
|
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) {
|
||||||
|
var contactid = req.query.contactid;
|
||||||
|
var appealTypeId = req.query.appealTypeId;
|
||||||
|
var lpaID = req.query.lpaID;
|
||||||
|
var queryUrl = "incidents";
|
||||||
|
var token = await getToken();
|
||||||
|
|
||||||
|
var data = JSON.stringify({
|
||||||
|
"title": "insertion test case",
|
||||||
|
"caseorigincode": 3,
|
||||||
|
"customerid_contact@odata.bind": "/contacts(" + contactid + ")",
|
||||||
|
"pinswg_appealcasetype": appealTypeId,
|
||||||
|
"pinswg_AssociatedLPA@odata.bind": "/accounts(" + lpaID + ")",
|
||||||
|
});
|
||||||
|
|
||||||
|
var config = {
|
||||||
|
method: "post",
|
||||||
|
url: WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
headers: {
|
||||||
|
"OData-MaxVersion": "4.0",
|
||||||
|
"OData-Version": "4.0",
|
||||||
|
"Accept": "application/json",
|
||||||
|
"Prefer": 'odata.include-annotations="*",return=representation',
|
||||||
|
"Authorization": "Bearer " + token.access_token,
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
},
|
||||||
|
data: data,
|
||||||
|
};
|
||||||
|
|
||||||
|
var apiResponse = _.isEmpty(req.query)
|
||||||
|
? res.status(400).json()
|
||||||
|
: axios(config)
|
||||||
|
.then(({ data }) => {
|
||||||
|
console.log(data);
|
||||||
|
res.status(200).json(data);
|
||||||
|
})
|
||||||
|
.catch(({ err }) => {
|
||||||
|
res.status(400).json(err);
|
||||||
|
});
|
||||||
|
|
||||||
|
return apiResponse;
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import CryptoJS from "crypto-js";
|
||||||
|
import { getToken, azureHeadersPaged } from "../../../actions";
|
||||||
|
|
||||||
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
|
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) {
|
||||||
|
var token = await getToken();
|
||||||
|
var data = JSON.stringify(req.body);
|
||||||
|
var queryUrl = "pinswg_watchlists";
|
||||||
|
|
||||||
|
var config = {
|
||||||
|
method: "post",
|
||||||
|
url: WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
headers: {
|
||||||
|
"OData-MaxVersion": "4.0",
|
||||||
|
"OData-Version": "4.0",
|
||||||
|
"Accept": "application/json",
|
||||||
|
"Prefer": 'odata.include-annotations="*"',
|
||||||
|
"Authorization": "Bearer " + token.access_token,
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
},
|
||||||
|
data: data,
|
||||||
|
};
|
||||||
|
|
||||||
|
return axios(config)
|
||||||
|
.then(({ data }) => {
|
||||||
|
res.status(200).json(data);
|
||||||
|
})
|
||||||
|
.catch(({ err }) => {
|
||||||
|
res.status(400).json(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import CryptoJS from "crypto-js";
|
||||||
|
import { getToken, azureHeadersPaged } from "../../../actions";
|
||||||
|
|
||||||
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
|
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) {
|
||||||
|
var myRepresentationsID = req.query.myRepresentationsID;
|
||||||
|
var token = await getToken();
|
||||||
|
var queryUrl = "pinswg_representationses(" + myRepresentationsID + ")";
|
||||||
|
|
||||||
|
var config = {
|
||||||
|
method: "delete",
|
||||||
|
url: WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
headers: {
|
||||||
|
"OData-MaxVersion": "4.0",
|
||||||
|
"OData-Version": "4.0",
|
||||||
|
"Accept": "application/json",
|
||||||
|
"Prefer": 'odata.include-annotations="*"',
|
||||||
|
"Authorization": "Bearer " + token.access_token,
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
return axios(config)
|
||||||
|
.then(({ data }) => {
|
||||||
|
console.log("deleted ");
|
||||||
|
res.status(200).json(data);
|
||||||
|
})
|
||||||
|
.catch(({ err }) => {
|
||||||
|
res.status(400).json(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import CryptoJS from "crypto-js";
|
||||||
|
import { getToken, azureHeadersPaged } from "../../../actions";
|
||||||
|
|
||||||
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
|
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) {
|
||||||
|
var watchedCaseID = req.query.watchedCaseID;
|
||||||
|
var token = await getToken();
|
||||||
|
var queryUrl = "pinswg_watchlists(" + watchedCaseID + ")";
|
||||||
|
|
||||||
|
var config = {
|
||||||
|
method: "delete",
|
||||||
|
url: WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
headers: {
|
||||||
|
"OData-MaxVersion": "4.0",
|
||||||
|
"OData-Version": "4.0",
|
||||||
|
"Accept": "application/json",
|
||||||
|
"Prefer": 'odata.include-annotations="*"',
|
||||||
|
"Authorization": "Bearer " + token.access_token,
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
return axios(config)
|
||||||
|
.then(({ data }) => {
|
||||||
|
//console.log("deleted watched case - " + watchedCaseID);
|
||||||
|
res.status(200).json(data);
|
||||||
|
})
|
||||||
|
.catch(({ err }) => {
|
||||||
|
res.status(400).json(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import CryptoJS from "crypto-js";
|
||||||
|
import _ from "lodash";
|
||||||
|
import { getToken, azureHeadersPaged } from "../../../actions";
|
||||||
|
|
||||||
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
|
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) {
|
||||||
|
var searchString = req.query.searchstring;
|
||||||
|
var token = await getToken();
|
||||||
|
|
||||||
|
searchString = _.isEmpty(searchString)
|
||||||
|
? searchString
|
||||||
|
: JSON.parse(decodeURI(searchString));
|
||||||
|
|
||||||
|
var queryString = "";
|
||||||
|
|
||||||
|
queryString +=
|
||||||
|
_.has(searchString, "q") && searchString.q != null
|
||||||
|
? "(contains(title, '" +
|
||||||
|
searchString.q +
|
||||||
|
"') or contains(ticketnumber,'" +
|
||||||
|
searchString.q +
|
||||||
|
"'))"
|
||||||
|
: "";
|
||||||
|
|
||||||
|
queryString +=
|
||||||
|
_.has(searchString, "lpa") && searchString.lpa != null
|
||||||
|
? (typeof searchString.q == "undefined" ? "" : " and ") +
|
||||||
|
"_pinswg_associatedlpa_value eq " +
|
||||||
|
searchString.lpa
|
||||||
|
: "";
|
||||||
|
queryString +=
|
||||||
|
_.has(searchString, "apt") && searchString.apt != null
|
||||||
|
? (typeof searchString.q == "undefined" &&
|
||||||
|
typeof searchString.lpa == "undefined"
|
||||||
|
? ""
|
||||||
|
: " and ") +
|
||||||
|
"pinswg_appealcasetype eq " +
|
||||||
|
searchString.apt
|
||||||
|
: "";
|
||||||
|
|
||||||
|
var queryUrl =
|
||||||
|
"incidents?$select=numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value&$expand=primarycontactid($select=fullname)&$filter=" +
|
||||||
|
queryString +
|
||||||
|
" and pinswg_appealcasetype ne null and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true";
|
||||||
|
|
||||||
|
var apiResponse = _.isEmpty(searchString)
|
||||||
|
? res.status(400).json()
|
||||||
|
: axios
|
||||||
|
.get(
|
||||||
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
azureHeadersPaged(token.access_token)
|
||||||
|
)
|
||||||
|
.then(({ data }) => {
|
||||||
|
var dataStr;
|
||||||
|
_.has(data, "@odata.nextLink") == true &&
|
||||||
|
((dataStr = JSON.stringify(data["@odata.nextLink"])),
|
||||||
|
(data["@odata.nextLink"] = dataStr.split("/v8.2/")[1]));
|
||||||
|
res.status(200).json(data);
|
||||||
|
})
|
||||||
|
.catch(({ err }) => {
|
||||||
|
res.status(400).json(err);
|
||||||
|
});
|
||||||
|
|
||||||
|
return apiResponse;
|
||||||
|
}
|
||||||
@@ -0,0 +1,87 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import CryptoJS from "crypto-js";
|
||||||
|
import _ from "lodash";
|
||||||
|
import { getToken, azureHeadersPaged } from "../../../actions";
|
||||||
|
|
||||||
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
|
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) {
|
||||||
|
var searchString = req.query.searchstring;
|
||||||
|
var pageNumber = req.query.pageNumber;
|
||||||
|
var token = await getToken();
|
||||||
|
|
||||||
|
searchString = _.isEmpty(searchString)
|
||||||
|
? searchString
|
||||||
|
: JSON.parse(decodeURI(searchString));
|
||||||
|
|
||||||
|
var queryString = "";
|
||||||
|
|
||||||
|
queryString +=
|
||||||
|
_.has(searchString, "q") && searchString.q != null
|
||||||
|
? "(contains(title, '" +
|
||||||
|
searchString.q +
|
||||||
|
"') or contains(ticketnumber,'" +
|
||||||
|
searchString.q +
|
||||||
|
"'))"
|
||||||
|
: "";
|
||||||
|
|
||||||
|
queryString +=
|
||||||
|
_.has(searchString, "lpa") && searchString.lpa != null
|
||||||
|
? (typeof searchString.q == "undefined" ? "" : " and ") +
|
||||||
|
"_pinswg_associatedlpa_value eq " +
|
||||||
|
searchString.lpa
|
||||||
|
: "";
|
||||||
|
queryString +=
|
||||||
|
_.has(searchString, "apt") && searchString.apt != null
|
||||||
|
? (typeof searchString.q == "undefined" &&
|
||||||
|
typeof searchString.lpa == "undefined"
|
||||||
|
? ""
|
||||||
|
: " and ") +
|
||||||
|
"pinswg_appealcasetype eq " +
|
||||||
|
searchString.apt
|
||||||
|
: "";
|
||||||
|
|
||||||
|
var queryUrl =
|
||||||
|
"incidents?$select=numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value&$expand=primarycontactid($select=fullname)&$filter=" +
|
||||||
|
queryString +
|
||||||
|
" and pinswg_appealcasetype ne null and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true" +
|
||||||
|
(typeof pageNumber != "undefined"
|
||||||
|
? "&$skiptoken=" + ('<cookie pagenumber="' + pageNumber + '" />')
|
||||||
|
: "");
|
||||||
|
|
||||||
|
var apiResponse = _.isEmpty(searchString)
|
||||||
|
? res.status(400).json()
|
||||||
|
: axios
|
||||||
|
.get(
|
||||||
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
azureHeadersPaged(token.access_token)
|
||||||
|
)
|
||||||
|
.then(({ data }) => {
|
||||||
|
var dataStr;
|
||||||
|
_.has(data, "@odata.nextLink") == true &&
|
||||||
|
((dataStr = JSON.stringify(data["@odata.nextLink"])),
|
||||||
|
(data["@odata.nextLink"] = dataStr.split("/v8.2/")[1]));
|
||||||
|
res.status(200).json(data);
|
||||||
|
})
|
||||||
|
.catch(({ err }) => {
|
||||||
|
res.status(400).json(err);
|
||||||
|
});
|
||||||
|
|
||||||
|
return apiResponse;
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import CryptoJS from "crypto-js";
|
||||||
|
import { getToken, azureHeaders } from "../../../actions";
|
||||||
|
|
||||||
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default async function ApiProxy(req, res) {
|
||||||
|
var caseReference = req.query.caseReference;
|
||||||
|
var updateFormCollection = req.query.updateFormCollection;
|
||||||
|
var primaryAttribute = req.query.primaryAttribute;
|
||||||
|
var token = await getToken();
|
||||||
|
|
||||||
|
const queryUrl =
|
||||||
|
updateFormCollection +
|
||||||
|
"?$count=true&$select=_" +
|
||||||
|
primaryAttribute +
|
||||||
|
"s_value&$filter=pinswg_name eq '" +
|
||||||
|
caseReference +
|
||||||
|
"'";
|
||||||
|
|
||||||
|
return axios
|
||||||
|
.get(
|
||||||
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
azureHeaders(token.access_token)
|
||||||
|
)
|
||||||
|
.then(({ data }) => {
|
||||||
|
res.status(200).json(data);
|
||||||
|
})
|
||||||
|
.catch(({ err }) => {
|
||||||
|
res.status(400).json(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import CryptoJS from "crypto-js";
|
||||||
|
import { getToken, azureHeadersPaged, azureHeaders } from "../../../actions";
|
||||||
|
/**
|
||||||
|
* @swagger
|
||||||
|
* /api/endpoint/getappealtypes_api:
|
||||||
|
* get:
|
||||||
|
* description: Returns appeal types
|
||||||
|
* responses:
|
||||||
|
* 200:
|
||||||
|
* description:
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
|
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) {
|
||||||
|
var token = await getToken();
|
||||||
|
|
||||||
|
var queryUrl =
|
||||||
|
"stringmaps?$filter=objecttypecode eq 'incident' and attributename eq 'pinswg_appealcasetype' and value ne 'LDP' and value ne 'Misc Casework'&$count=true&$select=value,stringmapid,organizationid,attributevalue&$orderby=value asc";
|
||||||
|
|
||||||
|
return axios
|
||||||
|
.get(
|
||||||
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
azureHeaders(token.access_token)
|
||||||
|
)
|
||||||
|
.then(({ data }) => {
|
||||||
|
res.status(200).json(data);
|
||||||
|
})
|
||||||
|
.catch(({ err }) => {
|
||||||
|
res.status(400).json(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import CryptoJS from "crypto-js";
|
||||||
|
import _ from "lodash";
|
||||||
|
import { getToken, azureHeaders, azureHeadersPaged } from "../../../actions";
|
||||||
|
|
||||||
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
|
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) {
|
||||||
|
var token = await getToken();
|
||||||
|
|
||||||
|
var queryUrl =
|
||||||
|
"incidents?$select=numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value&$expand=primarycontactid($select=fullname)&$filter=pinswg_appealcasetype eq 846040011 and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true";
|
||||||
|
|
||||||
|
return axios
|
||||||
|
.get(
|
||||||
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
azureHeadersPaged(token.access_token)
|
||||||
|
)
|
||||||
|
.then(({ data }) => {
|
||||||
|
var dataStr;
|
||||||
|
_.has(data, "@odata.nextLink") == true &&
|
||||||
|
((dataStr = JSON.stringify(data["@odata.nextLink"])),
|
||||||
|
(data["@odata.nextLink"] = dataStr.split("/v8.2/")[1]));
|
||||||
|
res.status(200).json(data);
|
||||||
|
})
|
||||||
|
.catch(({ err }) => {
|
||||||
|
res.status(400).json(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import CryptoJS from "crypto-js";
|
||||||
|
import _ from "lodash";
|
||||||
|
import { getToken, azureHeadersPaged } from "../../../actions";
|
||||||
|
import { getSelectQuery } from "../../../actions/selectQueryTypes";
|
||||||
|
|
||||||
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
|
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) {
|
||||||
|
var caseReference = req.query.caseReference;
|
||||||
|
var token = await getToken();
|
||||||
|
|
||||||
|
var queryUrl =
|
||||||
|
"pinswg_dnses?$filter=pinswg_name eq '" +
|
||||||
|
caseReference +
|
||||||
|
"'&$count=true";
|
||||||
|
|
||||||
|
queryUrl = queryUrl + getSelectQuery("pinswg_dnses");
|
||||||
|
|
||||||
|
var apiResponse = _.isEmpty(req.query)
|
||||||
|
? res.status(400).json()
|
||||||
|
: typeof caseReference != "undefined" && caseReference.length > 0
|
||||||
|
? axios
|
||||||
|
.get(
|
||||||
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
azureHeaders(token.access_token)
|
||||||
|
)
|
||||||
|
.then(({ data }) => {
|
||||||
|
res.status(200).json(data);
|
||||||
|
})
|
||||||
|
.catch(({ err }) => {
|
||||||
|
res.status(400).json(err);
|
||||||
|
})
|
||||||
|
: res.status(400).json();
|
||||||
|
|
||||||
|
return apiResponse;
|
||||||
|
}
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import CryptoJS from "crypto-js";
|
||||||
|
import _ from "lodash";
|
||||||
|
import { getToken, azureHeadersPaged } from "../../../actions";
|
||||||
|
import { getSelectQuery } from "../../../actions/selectQueryTypes";
|
||||||
|
|
||||||
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
|
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) {
|
||||||
|
var caseReference = req.query.caseReference;
|
||||||
|
var token = await getToken();
|
||||||
|
|
||||||
|
var queryUrl =
|
||||||
|
"pinswg_dnses?$filter=pinswg_name eq '" +
|
||||||
|
caseReference +
|
||||||
|
"'&$count=true";
|
||||||
|
|
||||||
|
queryUrl = queryUrl + getSelectQuery("pinswg_dnses");
|
||||||
|
|
||||||
|
var apiResponse = _.isEmpty(req.query)
|
||||||
|
? res.status(400).json()
|
||||||
|
: typeof caseReference != "undefined" && caseReference.length > 0
|
||||||
|
? axios
|
||||||
|
.get(
|
||||||
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
azureHeadersPaged(token.access_token)
|
||||||
|
)
|
||||||
|
.then(({ data }) => {
|
||||||
|
var dataStr;
|
||||||
|
_.has(data, "@odata.nextLink") == true &&
|
||||||
|
((dataStr = JSON.stringify(data["@odata.nextLink"])),
|
||||||
|
(data["@odata.nextLink"] = dataStr.split("/v8.2/")[1]));
|
||||||
|
return res.status(200).json(data);
|
||||||
|
})
|
||||||
|
.catch(({ err }) => {
|
||||||
|
res.status(400).json(err);
|
||||||
|
})
|
||||||
|
: res.status(400).json();
|
||||||
|
|
||||||
|
return apiResponse;
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import CryptoJS from "crypto-js";
|
||||||
|
import _ from "lodash";
|
||||||
|
import { getToken, azureHeadersPaged } from "../../../actions";
|
||||||
|
|
||||||
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
|
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;
|
||||||
|
//console.log(hashlink);
|
||||||
|
return (queryPath.indexOf("?") > -1 ? "&hash=" : "?hash=") + hashlink;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default async function ApiProxy(req, res) {
|
||||||
|
var pageNumber = req.query.pageNumber;
|
||||||
|
var token = await getToken();
|
||||||
|
|
||||||
|
var queryUrl =
|
||||||
|
"incidents?$select=numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value&$expand=primarycontactid($select=fullname)&$filter=pinswg_appealcasetype eq 846040011 and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true" +
|
||||||
|
(typeof pageNumber != "undefined"
|
||||||
|
? "&$skiptoken=" + '<cookie pagenumber="' + pageNumber + '" />'
|
||||||
|
: "");
|
||||||
|
|
||||||
|
return axios
|
||||||
|
.get(
|
||||||
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
azureHeadersPaged(token.access_token)
|
||||||
|
)
|
||||||
|
.then(({ data }) => {
|
||||||
|
var dataStr;
|
||||||
|
_.has(data, "@odata.nextLink") == true &&
|
||||||
|
((dataStr = JSON.stringify(data["@odata.nextLink"])),
|
||||||
|
(data["@odata.nextLink"] = dataStr.split("/v8.2/")[1]));
|
||||||
|
return res.status(200).json(data);
|
||||||
|
})
|
||||||
|
.catch(({ err }) => {
|
||||||
|
res.status(400).json(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import CryptoJS from "crypto-js";
|
||||||
|
import _ from "lodash";
|
||||||
|
import { getToken, azureHeadersPaged } from "../../../actions";
|
||||||
|
|
||||||
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
|
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) {
|
||||||
|
var searchString = req.query.searchString;
|
||||||
|
var token = await getToken();
|
||||||
|
|
||||||
|
var queryUrl =
|
||||||
|
"incidents?$select=numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value&$expand=primarycontactid($select=fullname)&$filter=(contains(title, '" +
|
||||||
|
searchString +
|
||||||
|
"') or contains(ticketnumber, '" +
|
||||||
|
searchString +
|
||||||
|
"')) and pinswg_appealcasetype ne null and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true";
|
||||||
|
|
||||||
|
var apiResponse = _.isEmpty(req.query)
|
||||||
|
? res.status(400).json()
|
||||||
|
: searchString.length > 0
|
||||||
|
? axios
|
||||||
|
.get(
|
||||||
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
azureHeadersPaged(token.access_token)
|
||||||
|
)
|
||||||
|
.then(({ data }) => {
|
||||||
|
var dataStr;
|
||||||
|
_.has(data, "@odata.nextLink") == true &&
|
||||||
|
((dataStr = JSON.stringify(data["@odata.nextLink"])),
|
||||||
|
(data["@odata.nextLink"] = dataStr.split("/v8.2/")[1]));
|
||||||
|
res.status(200).json(data);
|
||||||
|
})
|
||||||
|
.catch(({ err }) => {
|
||||||
|
res.status(400).json(err);
|
||||||
|
})
|
||||||
|
: res.status(400).json();
|
||||||
|
|
||||||
|
return apiResponse;
|
||||||
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import CryptoJS from "crypto-js";
|
||||||
|
import { getToken, azureHeaders } from "../../../actions";
|
||||||
|
import { getSelectQuery } from "../../../actions/selectQueryTypes";
|
||||||
|
|
||||||
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
|
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) {
|
||||||
|
var appealTypeName = req.query.appealTypeName;
|
||||||
|
var primaryIdAttribute = req.query.primaryIdAttribute;
|
||||||
|
var incidentID = req.query.incidentID;
|
||||||
|
var token = await getToken();
|
||||||
|
|
||||||
|
var queryUrl =
|
||||||
|
appealTypeName +
|
||||||
|
"?$filter=_" +
|
||||||
|
primaryIdAttribute +
|
||||||
|
"s_value eq " +
|
||||||
|
incidentID +
|
||||||
|
"&$count=true";
|
||||||
|
|
||||||
|
queryUrl = queryUrl + getSelectQuery(appealTypeName);
|
||||||
|
|
||||||
|
console.log("query: ", queryUrl, "<<<<end query");
|
||||||
|
|
||||||
|
return axios
|
||||||
|
.get(
|
||||||
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
azureHeaders(token.access_token)
|
||||||
|
)
|
||||||
|
.then(({ data }) => {
|
||||||
|
res.status(200).json(data);
|
||||||
|
})
|
||||||
|
.catch(({ err }) => {
|
||||||
|
res.status(400).json(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import CryptoJS from "crypto-js";
|
||||||
|
import _ from "lodash";
|
||||||
|
import { getToken, azureHeadersPaged } from "../../../actions";
|
||||||
|
import { getSelectQuery } from "../../../actions/selectQueryTypes";
|
||||||
|
|
||||||
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
|
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) {
|
||||||
|
var appealTypeName = req.query.appealTypeName;
|
||||||
|
var primaryIdAttribute = req.query.primaryIdAttribute;
|
||||||
|
var incidentID = req.query.incidentID;
|
||||||
|
var token = await getToken();
|
||||||
|
|
||||||
|
var queryUrl =
|
||||||
|
appealTypeName +
|
||||||
|
"?$filter=_" +
|
||||||
|
primaryIdAttribute +
|
||||||
|
"s_value eq " +
|
||||||
|
incidentID +
|
||||||
|
"&$count=true";
|
||||||
|
|
||||||
|
queryUrl = queryUrl + getSelectQuery(appealTypeName);
|
||||||
|
|
||||||
|
console.log("query: ", queryUrl, "<<<<end query");
|
||||||
|
|
||||||
|
return axios
|
||||||
|
.get(
|
||||||
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
azureHeadersPaged(token.access_token)
|
||||||
|
)
|
||||||
|
.then(({ data }) => {
|
||||||
|
var dataStr;
|
||||||
|
_.has(data, "@odata.nextLink") == true &&
|
||||||
|
((dataStr = JSON.stringify(data["@odata.nextLink"])),
|
||||||
|
(data["@odata.nextLink"] = dataStr.split("/v8.2/")[1]));
|
||||||
|
return res.status(200).json(data);
|
||||||
|
})
|
||||||
|
.catch(({ err }) => {
|
||||||
|
res.status(400).json(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import CryptoJS from "crypto-js";
|
||||||
|
import _ from "lodash";
|
||||||
|
import { getToken, azureHeadersPaged } from "../../../actions";
|
||||||
|
|
||||||
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default async function ApiProxy(req, res) {
|
||||||
|
var searchString = req.query.searchString;
|
||||||
|
var pageNumber = req.query.pageNumber;
|
||||||
|
var token = await getToken();
|
||||||
|
|
||||||
|
var queryUrl =
|
||||||
|
"incidents?$select=numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value&$expand=primarycontactid($select=fullname)&$filter=(contains(title, '" +
|
||||||
|
searchString +
|
||||||
|
"') or contains(ticketnumber, '" +
|
||||||
|
searchString +
|
||||||
|
"')) and pinswg_appealcasetype ne null and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true" +
|
||||||
|
(typeof pageNumber != "undefined"
|
||||||
|
? "&$skiptoken=" + '<cookie pagenumber="' + pageNumber + '" />'
|
||||||
|
: "");
|
||||||
|
|
||||||
|
var apiResponse =
|
||||||
|
searchString.length > 0
|
||||||
|
? axios
|
||||||
|
.get(
|
||||||
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
azureHeadersPaged(token.access_token)
|
||||||
|
)
|
||||||
|
.then(({ data }) => {
|
||||||
|
var dataStr;
|
||||||
|
_.has(data, "@odata.nextLink") == true &&
|
||||||
|
((dataStr = JSON.stringify(data["@odata.nextLink"])),
|
||||||
|
(data["@odata.nextLink"] =
|
||||||
|
dataStr.split("/v8.2/")[1]));
|
||||||
|
res.status(200).json(data);
|
||||||
|
})
|
||||||
|
.catch(({ err }) => {
|
||||||
|
res.status(400).json(err);
|
||||||
|
})
|
||||||
|
: res.status(400).json();
|
||||||
|
|
||||||
|
return apiResponse;
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import CryptoJS from "crypto-js";
|
||||||
|
import _ from "lodash";
|
||||||
|
import { getToken, azureHeaders } from "../../../actions";
|
||||||
|
|
||||||
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default async function ApiProxy(req, res) {
|
||||||
|
var emailAddress = req.query.emailAddress;
|
||||||
|
var token = await getToken();
|
||||||
|
|
||||||
|
var queryUrl =
|
||||||
|
"contacts?$filter=emailaddress1 eq '" +
|
||||||
|
emailAddress +
|
||||||
|
"'&$count=true&$select=emailaddress1, contactid";
|
||||||
|
|
||||||
|
var apiResponse = _.isEmpty(req.query)
|
||||||
|
? res.status(400).json()
|
||||||
|
: typeof emailAddress != "undefined" && emailAddress.length > 0
|
||||||
|
? axios
|
||||||
|
.get(
|
||||||
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
azureHeaders(token.access_token)
|
||||||
|
)
|
||||||
|
.then(({ data }) => {
|
||||||
|
res.status(200).json(data);
|
||||||
|
})
|
||||||
|
.catch(({ err }) => {
|
||||||
|
res.status(400).json(err);
|
||||||
|
})
|
||||||
|
: res.status(400).json();
|
||||||
|
|
||||||
|
return apiResponse;
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import CryptoJS from "crypto-js";
|
||||||
|
import { getToken, azureHeadersPaged, azureHeaders } from "../../../actions";
|
||||||
|
|
||||||
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
|
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) {
|
||||||
|
var whichForm = req.query.whichForm;
|
||||||
|
var token = await getToken();
|
||||||
|
|
||||||
|
var queryUrl =
|
||||||
|
"systemforms?$select=formid,name,formxml,type,objecttypecode&$filter=(objecttypecode eq 'pinswg_" +
|
||||||
|
whichForm +
|
||||||
|
"' and type eq 2)&$count=true&$top=201";
|
||||||
|
|
||||||
|
return axios
|
||||||
|
.get(
|
||||||
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
azureHeaders(token.access_token)
|
||||||
|
)
|
||||||
|
.then(({ data }) => {
|
||||||
|
res.status(200).json(data);
|
||||||
|
})
|
||||||
|
.catch(({ err }) => {
|
||||||
|
res.status(400).json(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import CryptoJS from "crypto-js";
|
||||||
|
import { getToken, azureHeadersPaged } from "../../../actions";
|
||||||
|
|
||||||
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
|
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) {
|
||||||
|
var parentIncidentid = req.query.parentincidentid;
|
||||||
|
var token = await getToken();
|
||||||
|
|
||||||
|
var queryUrl =
|
||||||
|
"incidents?$count=true&$filter=_parentcaseid_value eq " +
|
||||||
|
parentIncidentid +
|
||||||
|
" and pinswg_appealcasetype ne null and pinswg_publishtoweb eq true &$select=title, incidentid";
|
||||||
|
|
||||||
|
return axios
|
||||||
|
.get(
|
||||||
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
azureHeadersPaged(token.access_token)
|
||||||
|
)
|
||||||
|
.then(({ data }) => {
|
||||||
|
res.status(200).json(data);
|
||||||
|
})
|
||||||
|
.catch(({ err }) => {
|
||||||
|
res.status(400).json(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import CryptoJS from "crypto-js";
|
||||||
|
import _ from "lodash";
|
||||||
|
import { getToken, azureHeadersPaged } from "../../../actions";
|
||||||
|
|
||||||
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default async function ApiProxy(req, res) {
|
||||||
|
var emailAddress = req.query.emailAddress;
|
||||||
|
var pwd = req.query.pwd;
|
||||||
|
var token = await getToken();
|
||||||
|
|
||||||
|
var queryUrl =
|
||||||
|
"contacts?$filter=emailaddress1 eq '" +
|
||||||
|
emailAddress +
|
||||||
|
"' and pinswg_custom_password eq '" +
|
||||||
|
pwd +
|
||||||
|
"'&$count=true&$select=emailaddress1,contactid,pinswg_custom_password,yomifullname,firstname,lastname";
|
||||||
|
|
||||||
|
console.log(_.isEmpty(req.query));
|
||||||
|
|
||||||
|
var apiResponse = _.isEmpty(req.query)
|
||||||
|
? res.status(400).json()
|
||||||
|
: typeof emailAddress != "undefined" &&
|
||||||
|
emailAddress.length > 0 &&
|
||||||
|
typeof pwd != "undefined" &&
|
||||||
|
pwd.length > 0
|
||||||
|
? axios
|
||||||
|
.get(
|
||||||
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
azureHeadersPaged(token.access_token)
|
||||||
|
)
|
||||||
|
.then(({ data }) => {
|
||||||
|
res.status(200).json(data);
|
||||||
|
})
|
||||||
|
.catch(({ err }) => {
|
||||||
|
res.status(400).json(err);
|
||||||
|
})
|
||||||
|
: res.status(400).json();
|
||||||
|
|
||||||
|
return apiResponse;
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import CryptoJS from "crypto-js";
|
||||||
|
import { getToken, azureHeadersPaged, azureHeaders } from "../../../actions";
|
||||||
|
|
||||||
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
|
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) {
|
||||||
|
var token = await getToken();
|
||||||
|
|
||||||
|
var queryUrl =
|
||||||
|
"accounts?$count=true&$filter=pinswg_isalocalplanningauthorityaccount eq 846040000&$select=name&$orderby=name asc";
|
||||||
|
|
||||||
|
return axios
|
||||||
|
.get(
|
||||||
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
azureHeaders(token.access_token)
|
||||||
|
)
|
||||||
|
.then(({ data }) => {
|
||||||
|
res.status(200).json(data);
|
||||||
|
})
|
||||||
|
.catch(({ err }) => {
|
||||||
|
res.status(400).json(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import CryptoJS from "crypto-js";
|
||||||
|
import { getToken, azureHeadersPaged, azureHeaders } from "../../../actions";
|
||||||
|
|
||||||
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
|
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) {
|
||||||
|
var whichForm = req.query.whichForm;
|
||||||
|
var token = await getToken();
|
||||||
|
|
||||||
|
var queryUrl =
|
||||||
|
"EntityDefinitions(LogicalName='pinswg_" +
|
||||||
|
whichForm +
|
||||||
|
"')/Attributes?$count=true&$select=LogicalName,RequiredLevel";
|
||||||
|
|
||||||
|
return axios
|
||||||
|
.get(
|
||||||
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
azureHeaders(token.access_token)
|
||||||
|
)
|
||||||
|
.then(({ data }) => {
|
||||||
|
res.status(200).json(data);
|
||||||
|
})
|
||||||
|
.catch(({ err }) => {
|
||||||
|
res.status(400).json(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import CryptoJS from "crypto-js";
|
||||||
|
import { getToken, azureHeaders } from "../../../actions";
|
||||||
|
|
||||||
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default async function ApiProxy(req, res) {
|
||||||
|
var loggedInUserId = req.query.loggedInUserId;
|
||||||
|
var token = await getToken();
|
||||||
|
|
||||||
|
var queryUrl =
|
||||||
|
"incidents?$select=ticketnumber,casetypecode,createdon,_customerid_value,description,incidentid,pinswg_appealcasetype,_pinswg_assignedinspectrids_value,statecode,statuscode,title&$filter=_customerid_value eq " +
|
||||||
|
loggedInUserId +
|
||||||
|
" and pinswg_appealcasetype ne null&$orderby=createdon desc&$count=true&$top=3";
|
||||||
|
|
||||||
|
return axios
|
||||||
|
.get(
|
||||||
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
azureHeaders(token.access_token)
|
||||||
|
)
|
||||||
|
.then(({ data }) => {
|
||||||
|
res.status(200).json(data);
|
||||||
|
})
|
||||||
|
.catch(({ err }) => {
|
||||||
|
res.status(400).json(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import CryptoJS from "crypto-js";
|
||||||
|
import { getToken, azureHeaders } from "../../../actions";
|
||||||
|
|
||||||
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default async function ApiProxy(req, res) {
|
||||||
|
var loggedInUserId = req.query.loggedInUserId;
|
||||||
|
var token = await getToken();
|
||||||
|
|
||||||
|
var queryUrl =
|
||||||
|
"pinswg_representationses?$filter= _pinswg_contact_value eq " +
|
||||||
|
loggedInUserId +
|
||||||
|
"&$count=true&$orderby=createdon desc";
|
||||||
|
|
||||||
|
return axios
|
||||||
|
.get(
|
||||||
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
azureHeaders(token.access_token)
|
||||||
|
)
|
||||||
|
.then(({ data }) => {
|
||||||
|
res.status(200).json(data);
|
||||||
|
})
|
||||||
|
.catch(({ err }) => {
|
||||||
|
res.status(400).json(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import CryptoJS from "crypto-js";
|
||||||
|
import { getToken, azureHeaders } from "../../../actions";
|
||||||
|
|
||||||
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default async function ApiProxy(req, res) {
|
||||||
|
var loggedInUserId = req.query.loggedInUserId;
|
||||||
|
var token = await getToken();
|
||||||
|
|
||||||
|
var queryUrl =
|
||||||
|
"pinswg_representationses?$filter= _pinswg_contact_value eq " +
|
||||||
|
loggedInUserId +
|
||||||
|
"&$count=true&$orderby=createdon desc";
|
||||||
|
|
||||||
|
return axios
|
||||||
|
.get(
|
||||||
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
azureHeaders(token.access_token)
|
||||||
|
)
|
||||||
|
.then(({ data }) => {
|
||||||
|
res.status(200).json(data);
|
||||||
|
})
|
||||||
|
.catch(({ err }) => {
|
||||||
|
res.status(400).json(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import CryptoJS from "crypto-js";
|
||||||
|
import { getToken, azureHeaders } from "../../../actions";
|
||||||
|
|
||||||
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default async function ApiProxy(req, res) {
|
||||||
|
var contactid = req.query.contactid;
|
||||||
|
var token = await getToken();
|
||||||
|
|
||||||
|
var queryUrl =
|
||||||
|
"contacts(" +
|
||||||
|
contactid +
|
||||||
|
")?$select=firstname, lastname, emailaddress1, telephone1, company, address1_line1,address1_line2,address1_city, address1_county,address1_postalcode&$count=true";
|
||||||
|
|
||||||
|
var apiResponse =
|
||||||
|
contactid.length > 0
|
||||||
|
? axios
|
||||||
|
.get(
|
||||||
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
azureHeaders(token.access_token)
|
||||||
|
)
|
||||||
|
.then(({ data }) => {
|
||||||
|
res.status(200).json(data);
|
||||||
|
})
|
||||||
|
.catch(({ err }) => {
|
||||||
|
res.status(400).json(err);
|
||||||
|
})
|
||||||
|
: res.status(400).json();
|
||||||
|
|
||||||
|
return apiResponse;
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import CryptoJS from "crypto-js";
|
||||||
|
import { getToken, azureHeaders } from "../../../actions";
|
||||||
|
|
||||||
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default async function ApiProxy(req, res) {
|
||||||
|
var whichForm = req.query.whichForm;
|
||||||
|
var token = await getToken();
|
||||||
|
|
||||||
|
var queryUrl =
|
||||||
|
"EntityDefinitions(LogicalName='pinswg_" +
|
||||||
|
whichForm +
|
||||||
|
"')/Attributes/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?$select=LogicalName&$expand=OptionSet,GlobalOptionSet&$count=true";
|
||||||
|
|
||||||
|
return axios
|
||||||
|
.get(
|
||||||
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
azureHeaders(token.access_token)
|
||||||
|
)
|
||||||
|
.then(({ data }) => {
|
||||||
|
res.status(200).json(data);
|
||||||
|
})
|
||||||
|
.catch(({ err }) => {
|
||||||
|
res.status(400).json(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import CryptoJS from "crypto-js";
|
||||||
|
import { getToken, azureHeaders } from "../../../actions";
|
||||||
|
|
||||||
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default async function ApiProxy(req, res) {
|
||||||
|
var appealType = req.query.appealType;
|
||||||
|
var caseReference = req.query.caseReference;
|
||||||
|
var token = await getToken();
|
||||||
|
|
||||||
|
var queryUrl =
|
||||||
|
appealType +
|
||||||
|
"?$filter=pinswg_name eq '" +
|
||||||
|
caseReference +
|
||||||
|
"'&$count=true";
|
||||||
|
|
||||||
|
return axios
|
||||||
|
.get(
|
||||||
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
azureHeaders(token.access_token)
|
||||||
|
)
|
||||||
|
.then(({ data }) => {
|
||||||
|
res.status(200).json(data);
|
||||||
|
})
|
||||||
|
.catch(({ err }) => {
|
||||||
|
res.status(400).json(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import CryptoJS from "crypto-js";
|
||||||
|
import { getToken, azureHeaders } from "../../../actions";
|
||||||
|
|
||||||
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default async function ApiProxy(req, res) {
|
||||||
|
var appealType = req.query.appealType;
|
||||||
|
var caseReference = req.query.caseReference;
|
||||||
|
var token = await getToken();
|
||||||
|
|
||||||
|
var queryUrl =
|
||||||
|
appealType +
|
||||||
|
"?$filter=pinswg_name eq '" +
|
||||||
|
caseReference +
|
||||||
|
"'&$count=true";
|
||||||
|
|
||||||
|
return axios
|
||||||
|
.get(
|
||||||
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
azureHeaders(token.access_token)
|
||||||
|
)
|
||||||
|
.then(({ data }) => {
|
||||||
|
res.status(200).json(data);
|
||||||
|
})
|
||||||
|
.catch(({ err }) => {
|
||||||
|
res.status(400).json(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import CryptoJS from "crypto-js";
|
||||||
|
import { getToken, azureHeaders } from "../../../actions";
|
||||||
|
|
||||||
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default async function ApiProxy(req, res) {
|
||||||
|
var loggedInUserId = req.query.loggedInUserId;
|
||||||
|
var token = await getToken();
|
||||||
|
|
||||||
|
var queryUrl =
|
||||||
|
"pinswg_representationses?$filter= _pinswg_case_value eq " +
|
||||||
|
incidentID +
|
||||||
|
" and pinswg_publishtoweb eq true&$count=true&$orderby=createdon desc";
|
||||||
|
|
||||||
|
return axios
|
||||||
|
.get(
|
||||||
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
azureHeaders(token.access_token)
|
||||||
|
)
|
||||||
|
.then(({ data }) => {
|
||||||
|
res.status(200).json(data);
|
||||||
|
})
|
||||||
|
.catch(({ err }) => {
|
||||||
|
res.status(400).json(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import CryptoJS from "crypto-js";
|
||||||
|
import { getToken, azureHeaders } from "../../../actions";
|
||||||
|
|
||||||
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default async function ApiProxy(req, res) {
|
||||||
|
var incidentID = req.query.incidentID;
|
||||||
|
var token = await getToken();
|
||||||
|
|
||||||
|
var queryUrl =
|
||||||
|
"pinswg_representationses?$filter= _pinswg_case_value eq " +
|
||||||
|
incidentID +
|
||||||
|
"&$count=true&$orderby=createdon desc";
|
||||||
|
|
||||||
|
return axios
|
||||||
|
.get(
|
||||||
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
azureHeaders(token.access_token)
|
||||||
|
)
|
||||||
|
.then(({ data }) => {
|
||||||
|
res.status(200).json(data);
|
||||||
|
})
|
||||||
|
.catch(({ err }) => {
|
||||||
|
res.status(400).json(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import CryptoJS from "crypto-js";
|
||||||
|
import _ from "lodash";
|
||||||
|
import { getToken, azureHeadersPaged } from "../../../actions";
|
||||||
|
|
||||||
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
|
||||||
|
const encryptDocReference = (documentRef) => {
|
||||||
|
var hashlink = CryptoJS.HmacSHA256(
|
||||||
|
"documents/download/" + documentRef,
|
||||||
|
CryptoJS.enc.Hex.parse(WORDKEY)
|
||||||
|
);
|
||||||
|
hashlink = hashlink.toString(CryptoJS.enc.Hex);
|
||||||
|
|
||||||
|
var hashStr =
|
||||||
|
"/api/documents/download/" + documentRef + "?hash=" + hashlink;
|
||||||
|
|
||||||
|
return hashStr;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default async function ApiProxy(req, res) {
|
||||||
|
var incidentID = req.query.incidentid;
|
||||||
|
var token = await getToken();
|
||||||
|
|
||||||
|
var queryUrl =
|
||||||
|
"pinswg_documents?$count=true&$filter=pinswg_publishtoweb eq true and _pinswg_documentids_value eq " +
|
||||||
|
incidentID +
|
||||||
|
"&$select=pinswg_isharedocumentlocations,_pinswg_documentids_value,pinswg_isharelabelcasetype,pinswg_isharelabellpaname,pinswg_publishtoweb,pinswg_uploadstatus,pinswg_isharedocumentclassification,pinswg_isharedocumentreference";
|
||||||
|
|
||||||
|
return axios
|
||||||
|
.get(
|
||||||
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
azureHeadersPaged(token.access_token)
|
||||||
|
)
|
||||||
|
.then(({ data }) => {
|
||||||
|
data.value.forEach(function (element) {
|
||||||
|
element.pinswg_hashlink = encryptDocReference(
|
||||||
|
element.pinswg_isharedocumentreference
|
||||||
|
);
|
||||||
|
});
|
||||||
|
var dataStr;
|
||||||
|
_.has(data, "@odata.nextLink") == true &&
|
||||||
|
((dataStr = JSON.stringify(data["@odata.nextLink"])),
|
||||||
|
(data["@odata.nextLink"] = dataStr.split("/v8.2/")[1]));
|
||||||
|
|
||||||
|
res.status(200).json(data);
|
||||||
|
})
|
||||||
|
.catch(({ err }) => {
|
||||||
|
res.status(400).json(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import CryptoJS from "crypto-js";
|
||||||
|
import _ from "lodash";
|
||||||
|
import { getToken, azureHeadersPaged } from "../../../actions";
|
||||||
|
|
||||||
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
|
||||||
|
const encryptDocReference = (documentRef) => {
|
||||||
|
var hashlink = CryptoJS.HmacSHA256(
|
||||||
|
"documents/download/" + documentRef,
|
||||||
|
CryptoJS.enc.Hex.parse(WORDKEY)
|
||||||
|
);
|
||||||
|
hashlink = hashlink.toString(CryptoJS.enc.Hex);
|
||||||
|
|
||||||
|
var hashStr =
|
||||||
|
"/api/documents/download/" + documentRef + "?hash=" + hashlink;
|
||||||
|
|
||||||
|
return hashStr;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default async function ApiProxy(req, res) {
|
||||||
|
var pageNumber = req.query.pageNumber;
|
||||||
|
var incidentID = req.query.incidentid;
|
||||||
|
var token = await getToken();
|
||||||
|
|
||||||
|
var queryUrl =
|
||||||
|
"pinswg_documents?$count=true&$filter=pinswg_publishtoweb eq true and _pinswg_documentids_value eq " +
|
||||||
|
incidentID +
|
||||||
|
"&$select=pinswg_isharedocumentlocations,_pinswg_documentids_value,pinswg_isharelabelcasetype,pinswg_isharelabellpaname,pinswg_publishtoweb,pinswg_uploadstatus,pinswg_isharedocumentclassification,pinswg_isharedocumentreference" +
|
||||||
|
(typeof pageNumber != "undefined"
|
||||||
|
? "&$skiptoken=" + ('<cookie pagenumber="' + pageNumber + '" />')
|
||||||
|
: "");
|
||||||
|
|
||||||
|
return axios
|
||||||
|
.get(
|
||||||
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
azureHeadersPaged(token.access_token)
|
||||||
|
)
|
||||||
|
.then(({ data }) => {
|
||||||
|
data.value.forEach(function (element) {
|
||||||
|
element.pinswg_hashlink = encryptDocReference(
|
||||||
|
element.pinswg_isharedocumentreference
|
||||||
|
);
|
||||||
|
});
|
||||||
|
var dataStr;
|
||||||
|
_.has(data, "@odata.nextLink") == true &&
|
||||||
|
((dataStr = JSON.stringify(data["@odata.nextLink"])),
|
||||||
|
(data["@odata.nextLink"] = dataStr.split("/v8.2/")[1]));
|
||||||
|
return res.status(200).json(data);
|
||||||
|
})
|
||||||
|
.catch(({ err }) => {
|
||||||
|
res.status(400).json(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import CryptoJS from "crypto-js";
|
||||||
|
import { getToken, azureHeadersPaged } from "../../../actions";
|
||||||
|
|
||||||
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
|
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) {
|
||||||
|
var documentID = req.query.documentid;
|
||||||
|
var token = await getToken();
|
||||||
|
|
||||||
|
var queryUrl =
|
||||||
|
"pinswg_documenthistories?$count=true&$select=_pinswg_documentid_value,pinswg_createddate,pinswg_state,pinswg_fileexists,statecode,pinswg_publisheddate&$filter=_pinswg_documentid_value eq " +
|
||||||
|
documentID;
|
||||||
|
|
||||||
|
return axios
|
||||||
|
.get(
|
||||||
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
azureHeadersPaged(token.access_token)
|
||||||
|
)
|
||||||
|
.then(({ data }) => {
|
||||||
|
res.status(200).json(data);
|
||||||
|
})
|
||||||
|
.catch(({ err }) => {
|
||||||
|
res.status(400).json(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import CryptoJS from "crypto-js";
|
||||||
|
import { getToken, azureHeadersPaged } from "../../../actions";
|
||||||
|
|
||||||
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
|
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) {
|
||||||
|
var documentID = req.query.documentid;
|
||||||
|
var pageNumber = req.query.pageNumber;
|
||||||
|
var token = await getToken();
|
||||||
|
|
||||||
|
var queryUrl =
|
||||||
|
"pinswg_documenthistories?$count=true&$select=_pinswg_documentid_value,pinswg_createddate,pinswg_state,pinswg_fileexists,statecode,pinswg_publisheddate&$filter=_pinswg_documentid_value eq " +
|
||||||
|
documentID;
|
||||||
|
// +
|
||||||
|
// (typeof pageNumber != "undefined"
|
||||||
|
// ? "&$skiptoken=" + ('<cookie pagenumber="' + pageNumber + '" />')
|
||||||
|
// : "");
|
||||||
|
|
||||||
|
return axios
|
||||||
|
.get(
|
||||||
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
azureHeadersPaged(token.access_token)
|
||||||
|
)
|
||||||
|
.then(({ data }) => {
|
||||||
|
res.status(200).json(data);
|
||||||
|
})
|
||||||
|
.catch(({ err }) => {
|
||||||
|
res.status(400).json(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import CryptoJS from "crypto-js";
|
||||||
|
import { getToken, azureHeaders } from "../../../actions";
|
||||||
|
|
||||||
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default async function ApiProxy(req, res) {
|
||||||
|
var loggedInUserId = req.query.loggedInUserId;
|
||||||
|
var token = await getToken();
|
||||||
|
|
||||||
|
var queryUrl =
|
||||||
|
"pinswg_watchlists?$filter= _pinswg_contact_value eq " +
|
||||||
|
loggedInUserId +
|
||||||
|
"&$count=true&$orderby=createdon desc";
|
||||||
|
|
||||||
|
return axios
|
||||||
|
.get(
|
||||||
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
azureHeaders(token.access_token)
|
||||||
|
)
|
||||||
|
.then(({ data }) => {
|
||||||
|
res.status(200).json(data);
|
||||||
|
})
|
||||||
|
.catch(({ err }) => {
|
||||||
|
res.status(400).json(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import CryptoJS from "crypto-js";
|
||||||
|
import { getToken, azureHeaders } from "../../../actions";
|
||||||
|
|
||||||
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default async function ApiProxy(req, res) {
|
||||||
|
var loggedInUserId = req.query.loggedInUserId;
|
||||||
|
var token = await getToken();
|
||||||
|
|
||||||
|
var queryUrl =
|
||||||
|
"pinswg_watchlists?$filter= _pinswg_contact_value eq " +
|
||||||
|
loggedInUserId +
|
||||||
|
"&$count=true&$orderby=createdon desc";
|
||||||
|
|
||||||
|
return axios
|
||||||
|
.get(
|
||||||
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
azureHeaders(token.access_token)
|
||||||
|
)
|
||||||
|
.then(({ data }) => {
|
||||||
|
res.status(200).json(data);
|
||||||
|
})
|
||||||
|
.catch(({ err }) => {
|
||||||
|
res.status(400).json(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import CryptoJS from "crypto-js";
|
||||||
|
import { azureHeaders, getToken } from "../../../actions";
|
||||||
|
|
||||||
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default async function ApiProxy(req, res) {
|
||||||
|
var loggedInUserId = req.query.loggedInUserId;
|
||||||
|
var token = await getToken();
|
||||||
|
|
||||||
|
var queryUrl =
|
||||||
|
"pinswg_watchlists?$filter= _pinswg_contact_value eq " +
|
||||||
|
loggedInUserId +
|
||||||
|
"&$count=true&$orderby=createdon desc";
|
||||||
|
|
||||||
|
return axios
|
||||||
|
.get(
|
||||||
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
azureHeaders(token.access_token)
|
||||||
|
)
|
||||||
|
.then(({ data }) => {
|
||||||
|
res.status(200).json(data);
|
||||||
|
})
|
||||||
|
.catch(({ err }) => {
|
||||||
|
res.status(400).json(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import CryptoJS from "crypto-js";
|
||||||
|
import { getToken } from "../../../actions";
|
||||||
|
|
||||||
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
|
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) {
|
||||||
|
var contactId = req.query.contactId;
|
||||||
|
var token = await getToken();
|
||||||
|
var data = JSON.stringify(req.body);
|
||||||
|
var queryUrl = "contacts(" + contactId + ")";
|
||||||
|
|
||||||
|
var config = {
|
||||||
|
method: "patch",
|
||||||
|
url: WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
headers: {
|
||||||
|
"OData-MaxVersion": "4.0",
|
||||||
|
"OData-Version": "4.0",
|
||||||
|
"Accept": "application/json",
|
||||||
|
"Prefer": 'odata.include-annotations="*"',
|
||||||
|
"Authorization": "Bearer " + token.access_token,
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
},
|
||||||
|
data: data,
|
||||||
|
};
|
||||||
|
|
||||||
|
return axios(config)
|
||||||
|
.then(({ data }) => {
|
||||||
|
res.status(200).json(data);
|
||||||
|
})
|
||||||
|
.catch(({ err }) => {
|
||||||
|
res.status(400).json(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import CryptoJS from "crypto-js";
|
||||||
|
import { getToken } from "../../../actions";
|
||||||
|
|
||||||
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
|
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) {
|
||||||
|
var data = JSON.stringify(req.body);
|
||||||
|
var appealObj = rea.query.appealObj;
|
||||||
|
var updateFormCollection = req.query.updateFormCollection;
|
||||||
|
var queryUrl = updateFormCollection + "(" + appealObj + ")";
|
||||||
|
|
||||||
|
var token = await getToken();
|
||||||
|
|
||||||
|
var config = {
|
||||||
|
method: "patch",
|
||||||
|
url: WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
headers: {
|
||||||
|
"OData-MaxVersion": "4.0",
|
||||||
|
"OData-Version": "4.0",
|
||||||
|
"Accept": "application/json",
|
||||||
|
"Prefer": 'odata.include-annotations="*"',
|
||||||
|
"Authorization": "Bearer " + token.access_token,
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
},
|
||||||
|
data: data,
|
||||||
|
};
|
||||||
|
|
||||||
|
return axios(config)
|
||||||
|
.then(({ data }) => {
|
||||||
|
res.status(200).json(data);
|
||||||
|
})
|
||||||
|
.catch(({ err }) => {
|
||||||
|
res.status(400).json(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user