Merged PR 1296: updated link for submitted reps viewall
updated link for submitted reps viewall Related work items: #12767
This commit is contained in:
@@ -475,6 +475,9 @@ const Breadcrumbs = (props) => {
|
|||||||
t(
|
t(
|
||||||
"myportal:myrepresentations-card-title"
|
"myportal:myrepresentations-card-title"
|
||||||
)}
|
)}
|
||||||
|
{currentView.currentView.viewKey ==
|
||||||
|
"mySubmittedReps" &&
|
||||||
|
"Submitted representations"}
|
||||||
</li>
|
</li>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import MyCases from "./myportal/mycases";
|
|||||||
import MyRepresentations from "./myportal/myrepresentations";
|
import MyRepresentations from "./myportal/myrepresentations";
|
||||||
import SearchCases from "./myportal/searchcases";
|
import SearchCases from "./myportal/searchcases";
|
||||||
import WatchedCases from "./myportal/watchedcases";
|
import WatchedCases from "./myportal/watchedcases";
|
||||||
|
import MySubmittedReps from "./myportal/mysubmittedrepresentations";
|
||||||
import ServiceBanner from "./myportal/servicebanner";
|
import ServiceBanner from "./myportal/servicebanner";
|
||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
import { JSONPath as jsonpath } from "jsonpath-plus";
|
||||||
import transLookup from "../data/lookuptranslations.json";
|
import transLookup from "../data/lookuptranslations.json";
|
||||||
@@ -183,9 +184,9 @@ const MyPortal = (props) => {
|
|||||||
|
|
||||||
{props.myRepresentations.mySubmittedReps
|
{props.myRepresentations.mySubmittedReps
|
||||||
.mySubmittedReps.length > 0 && (
|
.mySubmittedReps.length > 0 && (
|
||||||
<WatchedCases
|
<MySubmittedReps
|
||||||
currentView={props.currentView}
|
currentView={props.currentView}
|
||||||
watchedCases={
|
mySubmittedReps={
|
||||||
props.myRepresentations.mySubmittedReps
|
props.myRepresentations.mySubmittedReps
|
||||||
}
|
}
|
||||||
isLPA={isLPA}
|
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 =
|
var resultsArr =
|
||||||
currentView.viewKey == "awaitingSubmissionDetails"
|
currentView.viewKey == "awaitingSubmissionDetails"
|
||||||
? props["awaitingSubmission"].awaitingSubmissionDetails.case
|
? props["awaitingSubmission"].awaitingSubmissionDetails.case
|
||||||
|
: currentView.viewKey == "mySubmittedReps"
|
||||||
|
? props[currentView.viewKey][currentView.viewKey]
|
||||||
: props[currentView.viewKey][currentView.viewKey].value || [];
|
: props[currentView.viewKey][currentView.viewKey].value || [];
|
||||||
|
|
||||||
const [orderByState, setOrderbyState] = useState("createdon");
|
const [orderByState, setOrderbyState] = useState("createdon");
|
||||||
@@ -829,6 +831,8 @@ const ViewAllResults = (props) => {
|
|||||||
t("myportal:mycases-card-title")}
|
t("myportal:mycases-card-title")}
|
||||||
{currentView.viewKey == "myRepresentations" &&
|
{currentView.viewKey == "myRepresentations" &&
|
||||||
t("myportal:myrepresentations-card-title")}
|
t("myportal:myrepresentations-card-title")}
|
||||||
|
{currentView.viewKey == "mySubmittedReps" &&
|
||||||
|
"Submitted representations"}
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
{resultsRowArr.length == 0 ? (
|
{resultsRowArr.length == 0 ? (
|
||||||
|
|||||||
@@ -12,9 +12,7 @@ const WatchedCases = (props) => {
|
|||||||
const { locale } = router;
|
const { locale } = router;
|
||||||
const { setCurrentView } = props;
|
const { setCurrentView } = props;
|
||||||
|
|
||||||
let recordCountVar = props.myReps
|
let recordCountVar = props.watchedCases.watchedCases;
|
||||||
? props.watchedCases.mySubmittedReps
|
|
||||||
: props.watchedCases.watchedCases;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="card" id="my-watched-cases-card">
|
<div className="card" id="my-watched-cases-card">
|
||||||
@@ -26,11 +24,7 @@ const WatchedCases = (props) => {
|
|||||||
</h3>
|
</h3>
|
||||||
<div className="cardModuleContainer">
|
<div className="cardModuleContainer">
|
||||||
<TopThree
|
<TopThree
|
||||||
showTopThree={
|
showTopThree={props.watchedCases.watchedCases}
|
||||||
props.myReps
|
|
||||||
? props.watchedCases.mySubmittedReps
|
|
||||||
: props.watchedCases.watchedCases
|
|
||||||
}
|
|
||||||
showDetails={props.watchedCases.watchedCasesDetails}
|
showDetails={props.watchedCases.watchedCasesDetails}
|
||||||
topThreeType={"watchedCases"}
|
topThreeType={"watchedCases"}
|
||||||
showLoginCheck={props.showLoginCheck}
|
showLoginCheck={props.showLoginCheck}
|
||||||
@@ -64,11 +58,9 @@ const WatchedCases = (props) => {
|
|||||||
{props.watchedCases.watchedCases["@odata.count"] +
|
{props.watchedCases.watchedCases["@odata.count"] +
|
||||||
" cases"} */}
|
" cases"} */}
|
||||||
{t("myportal:viewall-link-count", {
|
{t("myportal:viewall-link-count", {
|
||||||
count: props.myReps
|
count: props.watchedCases.watchedCases[
|
||||||
? props.watchedCases.mySubmittedReps.length
|
"@odata.count"
|
||||||
: props.watchedCases.watchedCases[
|
],
|
||||||
"@odata.count"
|
|
||||||
],
|
|
||||||
})}
|
})}
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -54,16 +54,18 @@ const Home = (props) => {
|
|||||||
pages,
|
pages,
|
||||||
myCases,
|
myCases,
|
||||||
myRepresentations,
|
myRepresentations,
|
||||||
mySubmittedReps,
|
|
||||||
watchedCases,
|
watchedCases,
|
||||||
awaitingSubmission,
|
awaitingSubmission,
|
||||||
accountDetails,
|
accountDetails,
|
||||||
showFileUpload,
|
showFileUpload,
|
||||||
showLoginCheck,
|
showLoginCheck,
|
||||||
currentView,
|
currentView,
|
||||||
|
mySubmittedReps,
|
||||||
} = props;
|
} = props;
|
||||||
let { t, lang } = useTranslation();
|
let { t, lang } = useTranslation();
|
||||||
|
|
||||||
|
// const mySubmittedReps = myRepresentations.mySubmittedReps;
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { locale } = router;
|
const { locale } = router;
|
||||||
const { appealtypes } = router.query;
|
const { appealtypes } = router.query;
|
||||||
@@ -459,7 +461,7 @@ const mapStateToProps = (state) => {
|
|||||||
myCases: state.myCases,
|
myCases: state.myCases,
|
||||||
watchedCases: state.watchedCases,
|
watchedCases: state.watchedCases,
|
||||||
myRepresentations: state.myRepresentations,
|
myRepresentations: state.myRepresentations,
|
||||||
mySubmittedReps: state.mySubmittedReps,
|
mySubmittedReps: state.myRepresentations.mySubmittedReps,
|
||||||
awaitingSubmission: state.awaitingSubmission,
|
awaitingSubmission: state.awaitingSubmission,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ const Home = (props) => {
|
|||||||
awaitingSubmission={props.awaitingSubmission}
|
awaitingSubmission={props.awaitingSubmission}
|
||||||
accountDetails={props.accountDetails}
|
accountDetails={props.accountDetails}
|
||||||
myportal={true}
|
myportal={true}
|
||||||
|
mySubmittedReps={props.mySubmittedReps}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<Footer footerLinks={footerLinks} ticketnumber={props} />
|
<Footer footerLinks={footerLinks} ticketnumber={props} />
|
||||||
@@ -88,6 +89,7 @@ const mapStateToProps = (state) => {
|
|||||||
myRepresentations: state.myRepresentations,
|
myRepresentations: state.myRepresentations,
|
||||||
awaitingSubmission: state.awaitingSubmission,
|
awaitingSubmission: state.awaitingSubmission,
|
||||||
currentView: state.currentView,
|
currentView: state.currentView,
|
||||||
|
mySubmittedReps: state.myRepresentations.mySubmittedReps,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user