Merged PR 1074: watched cases and view all

watched cases and view all

Related work items: #9444, #9445, #9456, #9457, #9476, #9477, #9490, #9491
This commit is contained in:
Robert Bond
2024-02-05 15:27:48 +00:00
15 changed files with 57 additions and 40 deletions
+1 -1
View File
@@ -40,7 +40,7 @@ RELAYPATH = "dev-pedw-hc"
GOOGLE_TAG_MANAGER = GTM-T78CBC3
SHOWLOGIN = true
SHOWREPRESENTATIONS = false
SHOWREPRESENTATIONS = true
SHOWFILEUPLOAD = "false"
SHOWMAPS = "false"
API_ROOT = "http://localhost:3000"
+1 -1
View File
@@ -36,7 +36,7 @@ const Case = (props) => {
searchString={props.searchString}
incidentid={props.incidentid}
showMap={props.showMap}
showLoginCheck={props.showLoginCheck}
currentView={props.currentView}
/>
<Documents
incidentid={props.incidentid}
@@ -20,8 +20,8 @@ const RepDetails = (props) => {
? props.myRepresentations.myRepresentations
: props.searchResultsObj.searchDetailsObj
: props.currentType == "watchedCases"
? props.props.props.watchedCases.watchedCasesDetails
: props.props.searchResultsObj.searchDetailsObj;
? props.props.props.props.watchedCases.watchedCasesDetails
: props.props.props.searchResultsObj.searchDetailsObj;
var detailsObj = {};
@@ -348,7 +348,7 @@ let RepLPA = (props) => {
className="govuk-button"
data-module="govuk-button"
>
{t("common:continue-button")}ww
{t("common:continue-button")}
</button>
// <a
// href="#"
@@ -368,7 +368,7 @@ let RepLPA = (props) => {
className="govuk-button"
data-module="govuk-button"
>
{t("common:continue-button")}ww
{t("common:continue-button")}
</button>
)}
{showQuestionnaireSection > 1 && (
@@ -999,7 +999,6 @@ let S78_Questionnaire = (props) => {
dateEnd="1-y"
locale={locale}
/>
ss
</fieldset>
)}
</>
+5 -1
View File
@@ -76,9 +76,10 @@ const CaseSummary = (props) => {
setWatchedCases,
setWatchedCasesDetails,
showMap,
currentView,
} = props;
const showLoginCheck = props.currentView.caseReference.showLoginCheck;
const showLoginCheck = currentView.showLogin;
const { data: session, status } = useSession();
//console.log("session status:", status, session);
@@ -406,6 +407,9 @@ const CaseSummary = (props) => {
currentType ==
"searchResultsObj"
? detailsObj.pinswg_name
: currentType ==
"watchedCases"
? casesObj.pinswg_title
: casesObj.reference,
},
}}
+1 -1
View File
@@ -145,9 +145,9 @@ const MyPortal = (props) => {
{props.watchedCases.watchedCases["@odata.count"] >
0 && (
<WatchedCases
currentView={props.currentView}
watchedCases={props.watchedCases}
isLPA={isLPA}
showLoginCheck={props.showLoginCheck}
/>
)}
{props.myRepresentations.myRepresentations[
+7 -4
View File
@@ -46,10 +46,13 @@ const MyRepresentations = (props) => {
"viewName": "My Representations",
"viewKey": "myRepresentations",
});
}}>
{t("myportal:viewall-link")}
}}
>
{t("myportal:viewall-link")}{" "}
{props.isLPA &&
props.myRepresentations.myRepresentations[
"@odata.count"
] + " representations"}
</Link>
</div>
)}
@@ -46,10 +46,13 @@ const MyRepresentations = (props) => {
"viewName": "My Representations",
"viewKey": "myRepresentations",
});
}}>
{t("myportal:viewall-link")}
}}
>
{t("myportal:viewall-link")}{" "}
{props.isLPA &&
props.myRepresentations.myRepresentations[
"@odata.count"
] + " representations"}
</Link>
</div>
)}
+2 -1
View File
@@ -27,6 +27,7 @@ import { getFormCollectionByID } from "../../components/utils";
const TopThree = (props) => {
let { t } = useTranslation();
const {
currentView,
showTopThree,
showDetails,
setCurrentReference,
@@ -194,7 +195,7 @@ const TopThree = (props) => {
"appealType":
showTopThreeArr[key]
.pinswg_appealcasetype,
"showLoginCheck": props.showLoginCheck,
"showLoginCheck": currentView.showLogin,
});
}}
>
+5 -8
View File
@@ -124,14 +124,12 @@ const ViewAllResults = (props) => {
resultsArr[key].pinswg_appealcasetype,
"repDetails":
currentView.viewKey ==
"myRepresentations" &&
resultsArr[key],
"myRepresentations" && resultsArr[key],
});
}}>
}}
>
<span className="results-visually-hidden">
{t("search:searchresults-case-reference-label")}
:
{t("search:searchresults-case-reference-label")}:
</span>
{currentView.viewKey != "watchedCases"
? currentView.viewKey == "myRepresentations"
@@ -140,7 +138,6 @@ const ViewAllResults = (props) => {
: resultsArr[key][
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
]}
</Link>
</dd>
<dd className="govuk-summary-list__value govuk-!-font-size-16">
@@ -528,7 +525,7 @@ const ViewAllResults = (props) => {
<div className="govuk-grid-column-full">
<div className="govuk-button-group">
<a
onClick={() => router.back()}
onClick={() => router.replace("/myportal")}
className="govuk-button"
>
Back
+4 -2
View File
@@ -19,12 +19,12 @@ const WatchedCases = (props) => {
{t("myportal:watchedcases-card-title")}
</h3>
<div className="cardModuleContainer">
<div>werwrew {props.showLoginCheck}</div>
<TopThree
showTopThree={props.watchedCases.watchedCases}
showDetails={props.watchedCases.watchedCasesDetails}
topThreeType={"watchedCases"}
showLoginCheck={props.showLoginCheck}
currentView={props.currentView}
/>
</div>
@@ -47,7 +47,9 @@ const WatchedCases = (props) => {
});
}}
>
{t("myportal:viewall-link")}
{t("myportal:viewall-link")}{" "}
{props.watchedCases.watchedCases["@odata.count"] +
" cases"}
</Link>
</div>
)}
+2 -4
View File
@@ -80,10 +80,8 @@ const Home = (props) => {
representationsObj={
props.searchResultsObj.representationsObj
}
showRepresentations={showRepresentations}
showLoginCheck={
props.currentView.caseReference.showLogin
}
showRepresentations={props.currentView.showReps}
currentView={props.currentView}
/>
</div>
<Footer footerLinks={footerLinks} />
+8
View File
@@ -40,6 +40,7 @@ import {
setMyRepresentations,
setMyRepresentationsDetails,
} from "../../store/myRepresentations/action";
import { setShowReps } from "../../store/currentView/action";
import { wrapper } from "../../store/store";
import {
setWatchedCases,
@@ -57,6 +58,7 @@ const Home = (props) => {
accountDetails,
showFileUpload,
showLoginCheck,
currentView,
} = props;
let { t, lang } = useTranslation();
@@ -148,6 +150,7 @@ const Home = (props) => {
showFileUpload={showFileUpload}
containerID={accountDetails.containerID}
showLoginCheck={showLoginCheck}
currentView={currentView}
/>
</div>
<Footer footerLinks={footerLinks} />
@@ -237,6 +240,11 @@ export const getServerSideProps = wrapper.getServerSideProps(
? "cy"
: "en";
const showLoginCheck = process.env.SHOWLOGIN || false;
const showMapCheck = process.env.SHOWMAPS || false;
const showReps = process.env.SHOWREPRESENTATIONS || false;
store.dispatch(setShowReps(showReps, showLoginCheck));
// if (preferredLocale != ctx.locale) {
// return {
// redirect: {
+10 -8
View File
@@ -40,7 +40,7 @@ import {
} from "../../store/accountDetails/action";
const Home = (props) => {
const { footerLinks, pages, watchedCases } = props;
const { footerLinks, pages, watchedCases, showLoginCheck } = props;
let { t, lang } = useTranslation();
const router = useRouter();
@@ -84,6 +84,10 @@ export const getServerSideProps = wrapper.getServerSideProps(
let thisSession = await getSession(ctx);
const showReps = process.env.SHOWREPRESENTATIONS || false;
const showLoginCheck = process.env.SHOWLOGIN || false;
store.dispatch(setShowReps(showReps, showLoginCheck));
if (!thisSession) {
console.log("not has sesssion.......");
return {
@@ -98,13 +102,6 @@ export const getServerSideProps = wrapper.getServerSideProps(
await getPortalLogin(thisSession.user.email),
]);
const showReps = process.env.SHOWREPRESENTATIONS || false;
const showLoginCheck = process.env.SHOWLOGIN || false;
store.dispatch(setShowReps(showReps, showLoginCheck));
console.log("env var ", process.env.SHOWREPRESENTATIONS);
store.dispatch(setShowReps(showReps, showLoginCheck));
searchResultsObj =
searchResultsObj.status == 502
? {
@@ -139,6 +136,11 @@ export const getServerSideProps = wrapper.getServerSideProps(
thisSession != false &&
store.dispatch(setContainerID(thisSession.user.id));
}
return {
props: {
showLoginCheck: showLoginCheck,
},
};
}
);