Merged PR 571: updated drop downs

updated drop downs

Related work items: #6498
This commit is contained in:
Robert Bond
2021-10-29 15:30:31 +00:00
16 changed files with 204 additions and 101 deletions
+10 -10
View File
@@ -1,9 +1,9 @@
// dev
RELAY_ROOT = https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/
RELAYURI = "dev-pedw-ns.servicebus.windows.net"
RELAYPATH = "dev-pedw-hc"
SASKEY = "Ml0Y/S/nfRcmIrHFRkO4jNm2J3iH52TSxPiak7+E1+Y="
SASKEYNAME = "devpedwnspolicy"
//RELAY_ROOT = https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/
//RELAYURI = "dev-pedw-ns.servicebus.windows.net"
//RELAYPATH = "dev-pedw-hc"
//SASKEY = "Ml0Y/S/nfRcmIrHFRkO4jNm2J3iH52TSxPiak7+E1+Y="
//SASKEYNAME = "devpedwnspolicy"
PORT= "3000"
@@ -15,11 +15,11 @@ I18N_DOMAIN = "cymru.local"
//I18N_DOMAIN ="gwaithcynllunio.gwasanaeth.llyw.cymru"
//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"
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
+24 -7
View File
@@ -5,6 +5,7 @@ import useTranslation from "next-translate/useTranslation";
import Banner from "../components/banner";
import { useDispatch, useSelector, shallowEqual, connect } from "react-redux";
import { setLogout } from "../store/accountDetails/action";
import _ from "lodash";
const Header = (props) => {
let { t, lang } = useTranslation();
@@ -45,6 +46,8 @@ const Header = (props) => {
} else {
domainSwitch = process.env.I18N_DOMAIN;
}
console.log(_.isEmpty(router.query));
return (
<header
className="govuk-header "
@@ -220,13 +223,27 @@ const Header = (props) => {
<Link
href={
locale == "en"
? router.query.q != null
? router.pathname +
"?q=" +
router.query.q
: router.pathname
: router.query.q != null
? router.asPath + "?q=" + router.query.q
? _.isEmpty(router.query)
? router.pathname
: router.pathname +
"?" +
Object.keys(router.query)
.map(
(key) =>
key +
"=" +
router.query[key]
)
.join("&")
: _.isEmpty(router.query) != false
? router.asPath +
"?" +
Object.keys(router.query)
.map(
(key) =>
key + "=" + router.query[key]
)
.join("&")
: router.asPath
}
locale={locale == "en" ? "cy" : "en"}
+17 -9
View File
@@ -113,6 +113,7 @@ let Login = (props) => {
const { locale } = router;
const [showSpinnerState, setShowSpinnerState] = useState(false);
const [validLoginID, setValidLoginID] = useState(null);
let spinnerState = () => {
showSpinnerState == true
@@ -124,14 +125,17 @@ let Login = (props) => {
spinnerState();
getLogin(values.loginUserID, values.loginUserPassword).then((data) => {
setLoggedInUserId(data.value[0].contactid);
spinnerState();
router.replace({
pathname: router.locale == "cy" ? "/fymhorth" : "/myportal",
query: { q: data.value[0].contactid },
shallow: true,
});
data.value.length != 0
? (setValidLoginID(true),
setLoggedInUserId(data.value[0].contactid),
spinnerState(),
router.replace({
pathname:
router.locale == "cy" ? "/fymhorth" : "/myportal",
query: { q: data.value[0].contactid },
shallow: true,
}))
: (setShowSpinnerState(false), setValidLoginID(false));
});
};
@@ -142,7 +146,11 @@ let Login = (props) => {
<h3 className="heading-small card-heading">
{t("home:login-card-title")}
</h3>
{validLoginID == false && (
<div className="govuk-error-message govuk-form-group--error">
Incorrect username or password
</div>
)}
<Field
// validate={[
// required(
+2 -2
View File
@@ -28,8 +28,8 @@ export default function Home({ children, pages }) {
<CaseSearch />
<CaseComment />
<Dns />
{/* <Login />
<Inspectorate /> */}
{/*<Login />
<Inspectorate /> */}
</div>
</div>
</div>
+16 -15
View File
@@ -24,21 +24,22 @@ const MyCases = (props) => {
topThreeType={"myCases"}
/>
</div>
<div className="cardVieAll">
<Link href="/myportal/viewall" shallow>
<a
onClick={() => {
setCurrentView({
"viewName": "My Cases",
"viewKey": "myCases",
});
}}
>
{t("myportal:viewall-link")}
</a>
</Link>
</div>
{props.myCases.myCases["@odata.count"] != 0 && (
<div className="cardVieAll">
<Link href="/myportal/viewall" shallow>
<a
onClick={() => {
setCurrentView({
"viewName": "My Cases",
"viewKey": "myCases",
});
}}
>
{t("myportal:viewall-link")}
</a>
</Link>
</div>
)}
</div>
</div>
);
+17 -14
View File
@@ -25,20 +25,23 @@ const MyRepresentations = (props) => {
/>
</div>
<div className="cardVieAll">
<Link href="/myportal/viewall">
<a
onClick={() => {
setCurrentView({
"viewName": "My Representations",
"viewKey": "myRepresentations",
});
}}
>
{t("myportal:viewall-link")}
</a>
</Link>
</div>
{props.myRepresentations.myRepresentations["@odata.count"] !=
0 && (
<div className="cardVieAll">
<Link href="/myportal/viewall" shallow>
<a
onClick={() => {
setCurrentView({
"viewName": "My Representations",
"viewKey": "myRepresentations",
});
}}
>
{t("myportal:viewall-link")}
</a>
</Link>
</div>
)}
</div>
</div>
);
+24 -1
View File
@@ -140,7 +140,30 @@ const TopThree = (props) => {
);
});
return <>{topthreeRow}</>;
let noRecordsLabel = "";
switch (topThreeType) {
case "watchedCases":
noRecordsLabel = "You are not watching any cases";
break;
case "myRepresentations":
noRecordsLabel = "You have no representations";
break;
case "myCases":
noRecordsLabel = "You have no cases";
break;
case "awaitingSubmission":
noRecordsLabel = "You have no awaiting submissions";
break;
}
return (
<>
{topthreeRow.length == 0 ? (
<div>{noRecordsLabel}</div>
) : (
topthreeRow
)}
</>
);
};
const mapDispatchToProps = (dispatch) => {
+16 -14
View File
@@ -25,20 +25,22 @@ const WatchedCases = (props) => {
/>
</div>
<div className="cardVieAll">
<Link href="/myportal/viewall">
<a
onClick={() => {
setCurrentView({
"viewName": "Watched Cases",
"viewKey": "watchedCases",
});
}}
>
{t("myportal:viewall-link")}
</a>
</Link>
</div>
{props.watchedCases.watchedCases["@odata.count"] != 0 && (
<div className="cardVieAll">
<Link href="/myportal/viewall" shallow>
<a
onClick={() => {
setCurrentView({
"viewName": "Watched Cases",
"viewKey": "watchedCases",
});
}}
>
{t("myportal:viewall-link")}
</a>
</Link>
</div>
)}
</div>
</div>
);
+9 -3
View File
@@ -249,9 +249,15 @@ let AdvancedSearch = (props) => {
("apt=" + values.appealTypes.split(",")[0])
: "";
router.replace("/advancedsearchresults" + searchString, null, {
shallow: true,
});
router.replace(
(router.locale == "cy"
? "/canlyniadauchwiliouwch"
: "/advancedsearchresults") + searchString,
null,
{
shallow: true,
}
);
};
return (
+5 -17
View File
@@ -39,16 +39,10 @@ export const getSearchDetails = (token, searchResultsObj) => {
if (searchDetail.pinswg_appealcasetype == null) {
console.log(searchDetail.title);
} else {
let formMeta = getFormCollection(
"pinswg_" +
searchDetail[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
]
.replace(/(\band|[\s\-\+\(\)\,\&])/g, "")
.toLowerCase()
.slice(0, 39)
let formMeta = getFormCollectionByID(
searchDetail.pinswg_appealcasetype
);
//console.log(formMeta);
detailsArr.push(
getBasicSearchDetails(
token,
@@ -79,14 +73,8 @@ export const getSearchDetailsPaged = (searchResultsObj) => {
if (searchDetail.pinswg_appealcasetype == null) {
console.log(searchDetail.title);
} else {
let formMeta = getFormCollection(
"pinswg_" +
searchDetail[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
]
.replace(/(\band|[\s\-\+\(\)\,\&])/g, "")
.toLowerCase()
.slice(0, 39)
let formMeta = getFormCollectionByID(
searchDetail.pinswg_appealcasetype
);
detailsArr.push(
+1 -1
View File
@@ -259,7 +259,7 @@
{
"LogicalCollectionName": "pinswg_hedgeshedgerowstreepreservationreplacems",
"LogicalName": "pinswg_hedgeshedgerowstreepreservationreplacem",
"PrimaryIdAttribute": "pinswg_hedgeshedgerowstreepreservatioids",
"PrimaryIdAttribute": "pinswg_hedgeshedgerowstreepreservatioid",
"UrlName": "hedgeshedgerowstreepreservationreplacem",
"MetadataId": "60f38fed-5382-eb11-aac0-00224800be9c",
"appealTypeID": "846040017"
+40
View File
@@ -24,6 +24,12 @@
"stringmapid": "cf4aa9f2-e275-eb11-aabd-00224800be9c",
"attributevalue": 846040004
},
{
"value": "Householder and Minor Commercial Appeals - HAS/CAS",
"value_cy": "Apeliadau Deiliaid Tai a Mân Apeliadau Masnachol",
"stringmapid": "cf4aa9f2-e275-eb11-aabd-00224800be9c",
"attributevalue": 846040004
},
{
"value": "Enforcement Notice Appeal - S174",
"value_cy": "Apêl Hysbysiad Gorfodi - A174",
@@ -54,6 +60,12 @@
"stringmapid": "ba56f05c-7f90-eb11-aac2-00224800be9c",
"attributevalue": 846040009
},
{
"value": "Called In Applications - S77",
"value_cy": "Cais a Alwyd i Mewn - A77",
"stringmapid": "bb56f05c-7f90-eb11-aac2-00224800be9c",
"attributevalue": 846040010
},
{
"value": "Call-Ins - S77",
"value_cy": "Galwadau i Mewn - A77",
@@ -66,6 +78,12 @@
"stringmapid": "bc56f05c-7f90-eb11-aac2-00224800be9c",
"attributevalue": 846040011
},
{
"value": "Developments of National Significance",
"value_cy": "Datblygiad o Arwyddocâd Cenedlaethol",
"stringmapid": "bc56f05c-7f90-eb11-aac2-00224800be9c",
"attributevalue": 846040011
},
{
"value": "Electricity Act",
"value_cy": "Deddf Trydan",
@@ -90,6 +108,12 @@
"stringmapid": "c056f05c-7f90-eb11-aac2-00224800be9c",
"attributevalue": 846040015
},
{
"value": "Rights of Way",
"value_cy": "Hawliau Tramwy",
"stringmapid": "c056f05c-7f90-eb11-aac2-00224800be9c",
"attributevalue": 846040015
},
{
"value": "Common Land",
"value_cy": "Tir Comin",
@@ -149,6 +173,12 @@
"value_cy": "Caniatâd Adeilad Rhestredig ac Ardal Gadwraeth - A20",
"stringmapid": "977522df-8aef-eb11-aac7-00224800be9c",
"attributevalue": 846040025
},
{
"value": "Listed Building and Conservation Area Consent",
"value_cy": "Caniatâd Adeilad Rhestredig ac Ardal Gadwraeth - A20",
"stringmapid": "977522df-8aef-eb11-aac7-00224800be9c",
"attributevalue": 846040025
}
],
"statusCodes": [
@@ -301,6 +331,11 @@
"value_cy": "Cyngor Bwrdeistref Sirol Rhondda Cynon Taf",
"pinswg_lpa": 0
},
{
"value": "Rhondda Cynon Taf County Borough Council",
"value_cy": "Cyngor Bwrdeistref Sirol Rhondda Cynon Taf",
"pinswg_lpa": 0
},
{
"value": "Rhondda Cynon Taf CBC",
"value_cy": "Cyngor Bwrdeistref Sirol Rhondda Cynon Taf",
@@ -326,6 +361,11 @@
"value_cy": "Cyngor Bro Morgannwg",
"pinswg_lpa": 0
},
{
"value": "Vale of Glamorgan Borough Council",
"value_cy": "Cyngor Bro Morgannwg",
"pinswg_lpa": 0
},
{
"value": "Wrexham County Borough Council",
"value_cy": "Cyngor Bwrdeistref Sirol Wrecsam",
+8
View File
@@ -49,6 +49,14 @@ module.exports = {
source: "/fymhorth/chwiliouwch",
destination: "/myportal/advancedsearch",
},
{
source: "/canlyniadauchwiliouwch",
destination: "/advancedsearchresults",
},
{
source: "/fymhorth/canlyniadauchwiliouwch",
destination: "/myportal/advancedsearchresults",
},
{
source: "/fymhorth",
destination: "/myportal",
+4
View File
@@ -19,6 +19,7 @@ import { reduxForm, formValueSelector } from "redux-form";
import PersonalDetails from "../../components/account/personaldetails";
import { setAccountDetails } from "../../store/accountDetails/action";
import { getPersonalAccount } from "../../actions";
import { setCookie } from "nookies";
const Home = (props) => {
const { footerLinks, formData } = props;
@@ -32,6 +33,9 @@ const Home = (props) => {
useState(false);
const [accountUpdatedComplete, setAccountUpdatedComplete] = useState(false);
setCookie(null, "pinsUser", props.accountDetails.loggedinUserId),
{ path: "/" };
return (
<div>
<Head>
+11 -7
View File
@@ -151,9 +151,9 @@ export const getServerSideProps = wrapper.getServerSideProps(
const { cookies } = req;
console.log(cookies);
const token = await getSASToken();
console.log("does it have ", cookies.pinsUser);
let loggedInUser =
typeof query.q == undefined ? cookies.pinsUser : query.q;
@@ -173,23 +173,28 @@ export const getServerSideProps = wrapper.getServerSideProps(
await getAwaitingSubmission(token),
]);
console.log("perosnal: ", accountDetails);
//const cookiesMaker = nookies.get(ctx)
let now = new Date();
let expDate = new Date(now);
expDate.setDate(now.getDate() + 1);
nookies.set(ctx, "pinsUser", query.q, {
console.log(
"Check: ",
cookies,
cookies.pinsUser,
loggedInUser,
nookies.get("pinsUser")
);
nookies.set(ctx, "pinsUser", loggedInUser, {
expires: expDate,
httpOnly: false,
path: "/",
});
console.log(" from cookie ", cookies);
console.log(myCases);
const [
myCasesDetails,
myRepresentationsDetails,
@@ -202,7 +207,6 @@ export const getServerSideProps = wrapper.getServerSideProps(
// await getDetails(awaitingSubmission),
]);
console.log(myCasesDetails);
store.dispatch(setAccountDetails(accountDetails));
store.dispatch(setLoggedInUserId(loggedInUser));
store.dispatch(setMyCases(myCases));
-1
View File
@@ -276,7 +276,6 @@ textarea,
.govuk-select {
appearance: none;
width: 100%;
margin-bottom: 20px;
background-image: url(/assets/images/select-down-arrow.svg);
background-size: 19px 12px;