Merged PR 450: added login soon box and updated translations
added login soon box and updated translations Related work items: #6208
This commit is contained in:
+3
-1
@@ -27,7 +27,9 @@ const Home = (props) => {
|
||||
<div>
|
||||
<Head>
|
||||
<title>
|
||||
{t("case:page-title")} - {t("common:service-name")}
|
||||
{t("case:page-title")}:{" "}
|
||||
{props.currentView.caseReference.currentReference}{" "}
|
||||
{t("common:service-name")}
|
||||
</title>
|
||||
</Head>
|
||||
<div id="page_wrapper">
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
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 CaseSummary from "../../components/case";
|
||||
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 Cookies from "cookies";
|
||||
import { useRouter } from "next/router";
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
import Case from "../../components/case";
|
||||
|
||||
const Home = (props) => {
|
||||
const { footerLinks, pages } = props;
|
||||
let { t, lang } = useTranslation();
|
||||
|
||||
const router = useRouter();
|
||||
const { locale } = router;
|
||||
const { appealtypes } = router.query;
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Head>
|
||||
<title>
|
||||
{t("case:page-title")} - {t("common:service-name")}
|
||||
</title>
|
||||
</Head>
|
||||
<div id="page_wrapper">
|
||||
<CookieBanner />
|
||||
<Header courseName={t("common:service-name")} />
|
||||
<div className="govuk-width-container">
|
||||
<Banner />
|
||||
<Breadcrumbs slug={appealtypes} props={props} />
|
||||
<Case
|
||||
myCases={props.myCases.myCases}
|
||||
searchResultsObj={
|
||||
props.searchResultsObj.searchResultsObj
|
||||
}
|
||||
searchDetailsObj={
|
||||
props.searchResultsObj.searchDetailsObj
|
||||
}
|
||||
myRepresentations={
|
||||
props.myRepresentations.myRepresentations
|
||||
}
|
||||
watchedCases={props.watchedCases.watchedCases}
|
||||
awaitingSubmission={
|
||||
props.awaitingSubmission.awaitingSubmission
|
||||
}
|
||||
caseReference={
|
||||
props.currentView.caseReference.currentReference
|
||||
}
|
||||
currentType={
|
||||
props.currentView.caseReference.currentType
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
<Footer footerLinks={footerLinks} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
const mapStateToProps = (state) => {
|
||||
//console.log(state);
|
||||
|
||||
return {
|
||||
currentView: state.currentView,
|
||||
search: state.search,
|
||||
searchResultsObj: state.searchResultsObj,
|
||||
formData: state.formData,
|
||||
appealType: state.appealType,
|
||||
form: state.form,
|
||||
myCases: state.myCases,
|
||||
watchedCases: state.watchedCases,
|
||||
myRepresentations: state.myRepresentations,
|
||||
awaitingSubmission: state.awaitingSubmission,
|
||||
};
|
||||
};
|
||||
|
||||
export default connect(mapStateToProps)(Home);
|
||||
@@ -0,0 +1,129 @@
|
||||
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 Cookies from "cookies";
|
||||
import { useRouter } from "next/router";
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
import jsonpath from "jsonpath";
|
||||
import data from "../../data/collections.json";
|
||||
|
||||
import { setSearch, getSearchObj } from "../../store/search/action";
|
||||
import {
|
||||
setSearchResults,
|
||||
setSearchDetails,
|
||||
getSearchResultsObj,
|
||||
} from "../../store/searchOutput/action";
|
||||
import { getBasicSearch, getBasicSearchDetails } from "../../actions";
|
||||
|
||||
const Home = (props) => {
|
||||
const { footerLinks, pages } = props;
|
||||
let { t, lang } = useTranslation();
|
||||
|
||||
const router = useRouter();
|
||||
const { locale } = router;
|
||||
const { appealtypes } = router.query;
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Head>
|
||||
<title>
|
||||
{t("search:page-title")} - {t("common:service-name")}
|
||||
</title>
|
||||
</Head>
|
||||
<div id="page_wrapper">
|
||||
<CookieBanner />
|
||||
<Header courseName={t("common:service-name")} />
|
||||
<div className="govuk-width-container">
|
||||
<Banner />
|
||||
<Breadcrumbs slug={appealtypes} />
|
||||
<SearchResults
|
||||
searchString={props.search.searchString}
|
||||
searchResultsObj={props.searchResultsObj}
|
||||
/>
|
||||
</div>
|
||||
<Footer footerLinks={footerLinks} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export const getServerSideProps = wrapper.getServerSideProps(
|
||||
(store) =>
|
||||
async ({ query, req, res }) => {
|
||||
console.log("query-", query);
|
||||
// const [searchResultsObj, searchDetailsObj] = await Promise.all(
|
||||
// await getBasicSearch(query.q),
|
||||
// await getBasicSearchDetails(query.d)
|
||||
// );
|
||||
|
||||
const searchResultsObj = await getBasicSearch(query.q);
|
||||
const searchDetailsObj = await getSearchDetails(searchResultsObj);
|
||||
// console.log(searchDetailsObj);
|
||||
store.dispatch(setSearchResults(searchResultsObj));
|
||||
store.dispatch(setSearchDetails(searchDetailsObj));
|
||||
store.dispatch(setSearch(query.q));
|
||||
}
|
||||
);
|
||||
|
||||
const getFormCollection = (formtype) => {
|
||||
const collectionName = jsonpath.query(
|
||||
data,
|
||||
"$..[?(@.LogicalName=='" + formtype + "')].LogicalCollectionName"
|
||||
);
|
||||
//console.log(collectionName[0]);
|
||||
return collectionName[0];
|
||||
};
|
||||
|
||||
const getSearchDetails = (searchResultsObj) => {
|
||||
//console.log(searchResultsObj);
|
||||
|
||||
let detailsArr = [];
|
||||
searchResultsObj = searchResultsObj.value;
|
||||
const detailsObj = searchResultsObj.map((searchDetail, index) => {
|
||||
if (searchDetail.pinswg_appealcasetype == null) {
|
||||
console.log(searchDetail.ticketnumber);
|
||||
} else {
|
||||
detailsArr.push(
|
||||
getBasicSearchDetails(
|
||||
getFormCollection(
|
||||
"pinswg_" +
|
||||
searchDetail[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
]
|
||||
.replace(/[\s\-\+\(\)\,\&\.]/g, "")
|
||||
.toLowerCase()
|
||||
),
|
||||
searchDetail.ticketnumber
|
||||
)
|
||||
);
|
||||
}
|
||||
});
|
||||
//console.log(detailsArr);
|
||||
return Promise.all(detailsArr);
|
||||
};
|
||||
|
||||
const mapStateToProps = (state) => {
|
||||
return {
|
||||
currentView: state.currentView,
|
||||
search: state.search,
|
||||
searchResultsObj: state.searchResultsObj,
|
||||
formData: state.formData,
|
||||
appealType: state.appealType,
|
||||
form: state.form,
|
||||
myCases: state.myCases,
|
||||
watchedCases: state.watchedCases,
|
||||
myRepresentations: state.myRepresentations,
|
||||
awaitingSubmission: state.awaitingSubmission,
|
||||
};
|
||||
};
|
||||
|
||||
export default connect(mapStateToProps)(Home);
|
||||
Reference in New Issue
Block a user