show submitted reps on dashboard
This commit is contained in:
@@ -44,7 +44,9 @@ const TopThree = (props) => {
|
||||
|
||||
let topthreeRow = [];
|
||||
|
||||
let showTopThreeArr = showTopThree.value;
|
||||
let showTopThreeArr;
|
||||
|
||||
showTopThreeArr = props.myReps ? showTopThree : showTopThree.value;
|
||||
|
||||
Object.keys(showTopThreeArr).map((key, index) => {
|
||||
let createdDate = parseInt(showTopThreeArr[key].createdon);
|
||||
@@ -236,8 +238,6 @@ const TopThree = (props) => {
|
||||
</Link>
|
||||
)}
|
||||
</div>
|
||||
{/* {(topThreeType == "awaitingSubmission" ||
|
||||
topThreeType == "watchedCases") && ( */}
|
||||
<div>
|
||||
<b>{t("myportal:appeal-type-label")}:</b>{" "}
|
||||
{router.locale == "cy"
|
||||
@@ -336,8 +336,31 @@ const TopThree = (props) => {
|
||||
{" "}
|
||||
{raisedDate(showTopThreeArr[key].createdon)}
|
||||
</div>{" "}
|
||||
{topThreeType == "watchedCases" &&
|
||||
props.myReps &&
|
||||
showTopThreeArr[key].pinswg_representationsubmitted !=
|
||||
null && (
|
||||
<div className="cardModuleReference">
|
||||
<b>{t("myportal:representation-submitted")}:</b>
|
||||
{" "}
|
||||
{raisedDate(
|
||||
showTopThreeArr[key]
|
||||
.pinswg_representationsubmitted
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
{topThreeType == "watchedCases" &&
|
||||
props.myReps &&
|
||||
showTopThreeArr[key].pinswg_representationtype !=
|
||||
null && (
|
||||
<div className="cardModuleReference">
|
||||
<b>{t("myportal:representation-type")}:</b>
|
||||
{" "}
|
||||
{showTopThreeArr[key].pinswg_representationtype}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
{topThreeType == "watchedCases" && (
|
||||
{topThreeType == "watchedCases" && !props.myReps && (
|
||||
<div className="">
|
||||
<button
|
||||
title={t("case:you-have-stopped-watching-label")}
|
||||
|
||||
@@ -12,23 +12,36 @@ const WatchedCases = (props) => {
|
||||
const { locale } = router;
|
||||
const { setCurrentView } = props;
|
||||
|
||||
let recordCountVar = props.myReps
|
||||
? props.watchedCases.mySubmittedReps
|
||||
: props.watchedCases.watchedCases;
|
||||
|
||||
return (
|
||||
<div className="card" id="my-watched-cases-card">
|
||||
<div className="card-body">
|
||||
<h3 className="heading-small card-heading">
|
||||
{t("myportal:watchedcases-card-title")}
|
||||
{props.myReps
|
||||
? "Submitted representations"
|
||||
: t("myportal:watchedcases-card-title")}
|
||||
</h3>
|
||||
<div className="cardModuleContainer">
|
||||
<TopThree
|
||||
showTopThree={props.watchedCases.watchedCases}
|
||||
showTopThree={
|
||||
props.myReps
|
||||
? props.watchedCases.mySubmittedReps
|
||||
: props.watchedCases.watchedCases
|
||||
}
|
||||
showDetails={props.watchedCases.watchedCasesDetails}
|
||||
topThreeType={"watchedCases"}
|
||||
showLoginCheck={props.showLoginCheck}
|
||||
currentView={props.currentView}
|
||||
myReps={props.myReps}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{props.watchedCases.watchedCases["@odata.count"] > 3 && (
|
||||
{(props.myReps
|
||||
? recordCountVar.length > 3
|
||||
: recordCountVar["@odata.count"] > 3) && (
|
||||
<div className="cardVieAll">
|
||||
<Link
|
||||
href={
|
||||
@@ -38,7 +51,6 @@ const WatchedCases = (props) => {
|
||||
"/fymhorth/gweldpopeth"
|
||||
: "/myportal/viewall"
|
||||
}
|
||||
shallow
|
||||
className="govuk-link--no-underline"
|
||||
onClick={() => {
|
||||
setCurrentView({
|
||||
@@ -51,9 +63,11 @@ const WatchedCases = (props) => {
|
||||
{props.watchedCases.watchedCases["@odata.count"] +
|
||||
" cases"} */}
|
||||
{t("myportal:viewall-link-count", {
|
||||
count: props.watchedCases.watchedCases[
|
||||
"@odata.count"
|
||||
],
|
||||
count: props.myReps
|
||||
? props.watchedCases.mySubmittedReps.length
|
||||
: props.watchedCases.watchedCases[
|
||||
"@odata.count"
|
||||
],
|
||||
})}
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user