updated link for submitted reps viewall
This commit is contained in:
@@ -475,6 +475,9 @@ const Breadcrumbs = (props) => {
|
||||
t(
|
||||
"myportal:myrepresentations-card-title"
|
||||
)}
|
||||
{currentView.currentView.viewKey ==
|
||||
"mySubmittedReps" &&
|
||||
"Submitted representations"}
|
||||
</li>
|
||||
</>
|
||||
)}
|
||||
|
||||
@@ -13,6 +13,7 @@ import MyCases from "./myportal/mycases";
|
||||
import MyRepresentations from "./myportal/myrepresentations";
|
||||
import SearchCases from "./myportal/searchcases";
|
||||
import WatchedCases from "./myportal/watchedcases";
|
||||
import MySubmittedReps from "./myportal/mysubmittedrepresentations";
|
||||
import ServiceBanner from "./myportal/servicebanner";
|
||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
||||
import transLookup from "../data/lookuptranslations.json";
|
||||
@@ -183,9 +184,9 @@ const MyPortal = (props) => {
|
||||
|
||||
{props.myRepresentations.mySubmittedReps
|
||||
.mySubmittedReps.length > 0 && (
|
||||
<WatchedCases
|
||||
<MySubmittedReps
|
||||
currentView={props.currentView}
|
||||
watchedCases={
|
||||
mySubmittedReps={
|
||||
props.myRepresentations.mySubmittedReps
|
||||
}
|
||||
isLPA={isLPA}
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/router";
|
||||
import { connect } from "react-redux";
|
||||
import { setCurrentView } from "../../store/currentView/action";
|
||||
import TopThree from "./topthree";
|
||||
|
||||
const MySubmittedReps = (props) => {
|
||||
let { t } = useTranslation();
|
||||
|
||||
const router = useRouter();
|
||||
const { locale } = router;
|
||||
const { setCurrentView } = props;
|
||||
|
||||
let recordCountVar = props.mySubmittedReps.mySubmittedReps;
|
||||
|
||||
return (
|
||||
<div className="card" id="my-watched-cases-card">
|
||||
<div className="card-body">
|
||||
<h3 className="heading-small card-heading">
|
||||
{t("myportal:submitted-reps-card-title")}
|
||||
</h3>
|
||||
<div className="cardModuleContainer">
|
||||
<TopThree
|
||||
showTopThree={props.mySubmittedReps.mySubmittedReps}
|
||||
showDetails={
|
||||
props.mySubmittedReps.mySubmittedRepsDetails
|
||||
}
|
||||
topThreeType={"watchedCases"}
|
||||
showLoginCheck={props.showLoginCheck}
|
||||
currentView={props.currentView}
|
||||
myReps={props.myReps}
|
||||
props={props}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{(props.myReps
|
||||
? recordCountVar.length > 3
|
||||
: recordCountVar["@odata.count"] > 3) && (
|
||||
<div className="cardVieAll">
|
||||
<Link
|
||||
href={
|
||||
router.locale != "en"
|
||||
? "/" +
|
||||
router.locale +
|
||||
"/fymhorth/gweldpopeth"
|
||||
: "/myportal/viewall"
|
||||
}
|
||||
className="govuk-link--no-underline"
|
||||
onClick={() => {
|
||||
setCurrentView({
|
||||
"viewName": "Submitted Representations",
|
||||
"viewKey": "mySubmittedReps",
|
||||
});
|
||||
}}
|
||||
>
|
||||
{t("myportal:viewall-link-count", {
|
||||
count: props.mySubmittedReps.mySubmittedReps
|
||||
.length,
|
||||
})}
|
||||
</Link>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
const mapDispatchToProps = (dispatch) => {
|
||||
return {
|
||||
setCurrentView: (currentView) => {
|
||||
dispatch(setCurrentView(currentView));
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default connect(null, mapDispatchToProps)(MySubmittedReps);
|
||||
@@ -84,6 +84,8 @@ const ViewAllResults = (props) => {
|
||||
var resultsArr =
|
||||
currentView.viewKey == "awaitingSubmissionDetails"
|
||||
? props["awaitingSubmission"].awaitingSubmissionDetails.case
|
||||
: currentView.viewKey == "mySubmittedReps"
|
||||
? props[currentView.viewKey][currentView.viewKey]
|
||||
: props[currentView.viewKey][currentView.viewKey].value || [];
|
||||
|
||||
const [orderByState, setOrderbyState] = useState("createdon");
|
||||
@@ -829,6 +831,8 @@ const ViewAllResults = (props) => {
|
||||
t("myportal:mycases-card-title")}
|
||||
{currentView.viewKey == "myRepresentations" &&
|
||||
t("myportal:myrepresentations-card-title")}
|
||||
{currentView.viewKey == "mySubmittedReps" &&
|
||||
"Submitted representations"}
|
||||
</h1>
|
||||
|
||||
{resultsRowArr.length == 0 ? (
|
||||
|
||||
@@ -12,9 +12,7 @@ const WatchedCases = (props) => {
|
||||
const { locale } = router;
|
||||
const { setCurrentView } = props;
|
||||
|
||||
let recordCountVar = props.myReps
|
||||
? props.watchedCases.mySubmittedReps
|
||||
: props.watchedCases.watchedCases;
|
||||
let recordCountVar = props.watchedCases.watchedCases;
|
||||
|
||||
return (
|
||||
<div className="card" id="my-watched-cases-card">
|
||||
@@ -26,11 +24,7 @@ const WatchedCases = (props) => {
|
||||
</h3>
|
||||
<div className="cardModuleContainer">
|
||||
<TopThree
|
||||
showTopThree={
|
||||
props.myReps
|
||||
? props.watchedCases.mySubmittedReps
|
||||
: props.watchedCases.watchedCases
|
||||
}
|
||||
showTopThree={props.watchedCases.watchedCases}
|
||||
showDetails={props.watchedCases.watchedCasesDetails}
|
||||
topThreeType={"watchedCases"}
|
||||
showLoginCheck={props.showLoginCheck}
|
||||
@@ -64,11 +58,9 @@ const WatchedCases = (props) => {
|
||||
{props.watchedCases.watchedCases["@odata.count"] +
|
||||
" cases"} */}
|
||||
{t("myportal:viewall-link-count", {
|
||||
count: props.myReps
|
||||
? props.watchedCases.mySubmittedReps.length
|
||||
: props.watchedCases.watchedCases[
|
||||
"@odata.count"
|
||||
],
|
||||
count: props.watchedCases.watchedCases[
|
||||
"@odata.count"
|
||||
],
|
||||
})}
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
@@ -54,16 +54,18 @@ const Home = (props) => {
|
||||
pages,
|
||||
myCases,
|
||||
myRepresentations,
|
||||
mySubmittedReps,
|
||||
watchedCases,
|
||||
awaitingSubmission,
|
||||
accountDetails,
|
||||
showFileUpload,
|
||||
showLoginCheck,
|
||||
currentView,
|
||||
mySubmittedReps,
|
||||
} = props;
|
||||
let { t, lang } = useTranslation();
|
||||
|
||||
// const mySubmittedReps = myRepresentations.mySubmittedReps;
|
||||
|
||||
const router = useRouter();
|
||||
const { locale } = router;
|
||||
const { appealtypes } = router.query;
|
||||
@@ -459,7 +461,7 @@ const mapStateToProps = (state) => {
|
||||
myCases: state.myCases,
|
||||
watchedCases: state.watchedCases,
|
||||
myRepresentations: state.myRepresentations,
|
||||
mySubmittedReps: state.mySubmittedReps,
|
||||
mySubmittedReps: state.myRepresentations.mySubmittedReps,
|
||||
awaitingSubmission: state.awaitingSubmission,
|
||||
};
|
||||
};
|
||||
|
||||
@@ -57,6 +57,7 @@ const Home = (props) => {
|
||||
awaitingSubmission={props.awaitingSubmission}
|
||||
accountDetails={props.accountDetails}
|
||||
myportal={true}
|
||||
mySubmittedReps={props.mySubmittedReps}
|
||||
/>
|
||||
</div>
|
||||
<Footer footerLinks={footerLinks} ticketnumber={props} />
|
||||
@@ -88,6 +89,7 @@ const mapStateToProps = (state) => {
|
||||
myRepresentations: state.myRepresentations,
|
||||
awaitingSubmission: state.awaitingSubmission,
|
||||
currentView: state.currentView,
|
||||
mySubmittedReps: state.myRepresentations.mySubmittedReps,
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user