show submitted reps on dashboard
This commit is contained in:
@@ -38,6 +38,7 @@ import {
|
|||||||
uploadRepFiles,
|
uploadRepFiles,
|
||||||
sendEmail,
|
sendEmail,
|
||||||
generateRepPDF,
|
generateRepPDF,
|
||||||
|
createWatchedCases,
|
||||||
} from "../../../actions";
|
} from "../../../actions";
|
||||||
import { formatDates } from "../../../components/utils";
|
import { formatDates } from "../../../components/utils";
|
||||||
import RepresentationProgress_s78 from "./representationProgress/representationProgress_s78";
|
import RepresentationProgress_s78 from "./representationProgress/representationProgress_s78";
|
||||||
@@ -527,6 +528,7 @@ let MakeRepresentation = (props) => {
|
|||||||
case 846040003:
|
case 846040003:
|
||||||
case 846040009:
|
case 846040009:
|
||||||
case 846040008:
|
case 846040008:
|
||||||
|
case 846040017:
|
||||||
return (
|
return (
|
||||||
<RepresentationProgress_s78
|
<RepresentationProgress_s78
|
||||||
props={props}
|
props={props}
|
||||||
|
|||||||
@@ -4,7 +4,11 @@ import { useRouter } from "next/router";
|
|||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
|
|
||||||
import { useDropzone } from "react-dropzone";
|
import { useDropzone } from "react-dropzone";
|
||||||
import { sendEmail, sendRepCompleteMessage } from "../../../actions";
|
import {
|
||||||
|
sendEmail,
|
||||||
|
sendRepCompleteMessage,
|
||||||
|
createWatchedCases,
|
||||||
|
} from "../../../actions";
|
||||||
import { setRepresentationReset } from "../../../store/currentView/action";
|
import { setRepresentationReset } from "../../../store/currentView/action";
|
||||||
|
|
||||||
const RepComplete = (props) => {
|
const RepComplete = (props) => {
|
||||||
@@ -51,6 +55,22 @@ const RepComplete = (props) => {
|
|||||||
props.repFormData.repfile_name
|
props.repFormData.repfile_name
|
||||||
),
|
),
|
||||||
sendEmail(templateId, emailAddress, personalisation, reference),
|
sendEmail(templateId, emailAddress, personalisation, reference),
|
||||||
|
createWatchedCases({
|
||||||
|
"pinswg_WatchedCase@odata.bind":
|
||||||
|
"/incidents(" +
|
||||||
|
props.props.currentView.caseReference.incidentid +
|
||||||
|
")",
|
||||||
|
"pinswg_Contact@odata.bind":
|
||||||
|
"/contacts(" +
|
||||||
|
props.props.props.props.accountDetails.loggedinUserId +
|
||||||
|
")",
|
||||||
|
"pinswg_appealcasetype":
|
||||||
|
props.props.currentView.caseReference.appealType,
|
||||||
|
"pinswg_representationsubmitted": new Date(Date.now()),
|
||||||
|
"pinswg_representationtype":
|
||||||
|
props.props.currentView.caseReference.repDetails
|
||||||
|
.representationType,
|
||||||
|
}),
|
||||||
setRepresentationMessageSent(true));
|
setRepresentationMessageSent(true));
|
||||||
});
|
});
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -107,6 +107,7 @@ const RepCompleteSubmit = (props) => {
|
|||||||
case 846040003:
|
case 846040003:
|
||||||
case 846040009:
|
case 846040009:
|
||||||
case 846040008:
|
case 846040008:
|
||||||
|
case 846040017:
|
||||||
return (
|
return (
|
||||||
<RepLPAQuestionnaireCheck_s78
|
<RepLPAQuestionnaireCheck_s78
|
||||||
props={props}
|
props={props}
|
||||||
|
|||||||
@@ -156,6 +156,7 @@ let RepLPA = (props) => {
|
|||||||
case 846040003:
|
case 846040003:
|
||||||
case 846040009:
|
case 846040009:
|
||||||
case 846040008:
|
case 846040008:
|
||||||
|
case 846040017:
|
||||||
return (
|
return (
|
||||||
<RepresentationProgress_s78
|
<RepresentationProgress_s78
|
||||||
props={props}
|
props={props}
|
||||||
@@ -489,7 +490,7 @@ let RepLPA = (props) => {
|
|||||||
}}
|
}}
|
||||||
className="govuk-link"
|
className="govuk-link"
|
||||||
>
|
>
|
||||||
{t("common:back-link")}ss
|
{t("common:back-link")}
|
||||||
</a>
|
</a>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|||||||
+13
-1
@@ -147,6 +147,7 @@ const MyPortal = (props) => {
|
|||||||
currentView={props.currentView}
|
currentView={props.currentView}
|
||||||
watchedCases={props.watchedCases}
|
watchedCases={props.watchedCases}
|
||||||
isLPA={isLPA}
|
isLPA={isLPA}
|
||||||
|
myReps={false}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{props.myRepresentations.myRepresentations[
|
{props.myRepresentations.myRepresentations[
|
||||||
@@ -157,8 +158,19 @@ const MyPortal = (props) => {
|
|||||||
isLPA={isLPA}
|
isLPA={isLPA}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{!isLPA && <Dns />}
|
|
||||||
|
|
||||||
|
{props.myRepresentations.mySubmittedReps
|
||||||
|
.mySubmittedReps.length > 0 && (
|
||||||
|
<WatchedCases
|
||||||
|
currentView={props.currentView}
|
||||||
|
watchedCases={
|
||||||
|
props.myRepresentations.mySubmittedReps
|
||||||
|
}
|
||||||
|
isLPA={isLPA}
|
||||||
|
myReps={true}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{!isLPA && <Dns />}
|
||||||
{/* <YourAccount /> */}
|
{/* <YourAccount /> */}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -44,7 +44,9 @@ const TopThree = (props) => {
|
|||||||
|
|
||||||
let topthreeRow = [];
|
let topthreeRow = [];
|
||||||
|
|
||||||
let showTopThreeArr = showTopThree.value;
|
let showTopThreeArr;
|
||||||
|
|
||||||
|
showTopThreeArr = props.myReps ? showTopThree : showTopThree.value;
|
||||||
|
|
||||||
Object.keys(showTopThreeArr).map((key, index) => {
|
Object.keys(showTopThreeArr).map((key, index) => {
|
||||||
let createdDate = parseInt(showTopThreeArr[key].createdon);
|
let createdDate = parseInt(showTopThreeArr[key].createdon);
|
||||||
@@ -236,8 +238,6 @@ const TopThree = (props) => {
|
|||||||
</Link>
|
</Link>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
{/* {(topThreeType == "awaitingSubmission" ||
|
|
||||||
topThreeType == "watchedCases") && ( */}
|
|
||||||
<div>
|
<div>
|
||||||
<b>{t("myportal:appeal-type-label")}:</b>{" "}
|
<b>{t("myportal:appeal-type-label")}:</b>{" "}
|
||||||
{router.locale == "cy"
|
{router.locale == "cy"
|
||||||
@@ -336,8 +336,31 @@ const TopThree = (props) => {
|
|||||||
{" "}
|
{" "}
|
||||||
{raisedDate(showTopThreeArr[key].createdon)}
|
{raisedDate(showTopThreeArr[key].createdon)}
|
||||||
</div>{" "}
|
</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>
|
</div>
|
||||||
{topThreeType == "watchedCases" && (
|
)}
|
||||||
|
{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" && !props.myReps && (
|
||||||
<div className="">
|
<div className="">
|
||||||
<button
|
<button
|
||||||
title={t("case:you-have-stopped-watching-label")}
|
title={t("case:you-have-stopped-watching-label")}
|
||||||
|
|||||||
@@ -12,23 +12,36 @@ const WatchedCases = (props) => {
|
|||||||
const { locale } = router;
|
const { locale } = router;
|
||||||
const { setCurrentView } = props;
|
const { setCurrentView } = props;
|
||||||
|
|
||||||
|
let recordCountVar = props.myReps
|
||||||
|
? props.watchedCases.mySubmittedReps
|
||||||
|
: props.watchedCases.watchedCases;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="card" id="my-watched-cases-card">
|
<div className="card" id="my-watched-cases-card">
|
||||||
<div className="card-body">
|
<div className="card-body">
|
||||||
<h3 className="heading-small card-heading">
|
<h3 className="heading-small card-heading">
|
||||||
{t("myportal:watchedcases-card-title")}
|
{props.myReps
|
||||||
|
? "Submitted representations"
|
||||||
|
: t("myportal:watchedcases-card-title")}
|
||||||
</h3>
|
</h3>
|
||||||
<div className="cardModuleContainer">
|
<div className="cardModuleContainer">
|
||||||
<TopThree
|
<TopThree
|
||||||
showTopThree={props.watchedCases.watchedCases}
|
showTopThree={
|
||||||
|
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}
|
||||||
currentView={props.currentView}
|
currentView={props.currentView}
|
||||||
|
myReps={props.myReps}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{props.watchedCases.watchedCases["@odata.count"] > 3 && (
|
{(props.myReps
|
||||||
|
? recordCountVar.length > 3
|
||||||
|
: recordCountVar["@odata.count"] > 3) && (
|
||||||
<div className="cardVieAll">
|
<div className="cardVieAll">
|
||||||
<Link
|
<Link
|
||||||
href={
|
href={
|
||||||
@@ -38,7 +51,6 @@ const WatchedCases = (props) => {
|
|||||||
"/fymhorth/gweldpopeth"
|
"/fymhorth/gweldpopeth"
|
||||||
: "/myportal/viewall"
|
: "/myportal/viewall"
|
||||||
}
|
}
|
||||||
shallow
|
|
||||||
className="govuk-link--no-underline"
|
className="govuk-link--no-underline"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setCurrentView({
|
setCurrentView({
|
||||||
@@ -51,7 +63,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.watchedCases.watchedCases[
|
count: props.myReps
|
||||||
|
? props.watchedCases.mySubmittedReps.length
|
||||||
|
: props.watchedCases.watchedCases[
|
||||||
"@odata.count"
|
"@odata.count"
|
||||||
],
|
],
|
||||||
})}
|
})}
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ export default function BuildField(props) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return <>ss{fieldValue}</>;
|
return <>{fieldValue}</>;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -44,6 +44,7 @@
|
|||||||
"representation-type": "Math o gynrychiolaeth",
|
"representation-type": "Math o gynrychiolaeth",
|
||||||
"capacity": "Gallu",
|
"capacity": "Gallu",
|
||||||
"date-raised": "Dyddiad codi",
|
"date-raised": "Dyddiad codi",
|
||||||
|
"representation-submitted": "Cyflwynwyd y sylw",
|
||||||
"submission-processing-label": "Prosesu cyflwyniad",
|
"submission-processing-label": "Prosesu cyflwyniad",
|
||||||
"appeal-pending-label": "Arfaeth"
|
"appeal-pending-label": "Arfaeth"
|
||||||
}
|
}
|
||||||
@@ -44,6 +44,7 @@
|
|||||||
"representation-type": "Representation type",
|
"representation-type": "Representation type",
|
||||||
"capacity": "Capacity",
|
"capacity": "Capacity",
|
||||||
"date-raised": "Date raised",
|
"date-raised": "Date raised",
|
||||||
|
"representation-submitted": "Representation submitted",
|
||||||
"submission-processing-label": "Submission processing",
|
"submission-processing-label": "Submission processing",
|
||||||
"appeal-pending-label": "Pending"
|
"appeal-pending-label": "Pending"
|
||||||
}
|
}
|
||||||
@@ -37,6 +37,8 @@ export default async function ApiProxy(req, res) {
|
|||||||
var token = await getToken();
|
var token = await getToken();
|
||||||
var queryUrl = "pinswg_watchlists(" + watchedCaseID + ")";
|
var queryUrl = "pinswg_watchlists(" + watchedCaseID + ")";
|
||||||
|
|
||||||
|
console.log(WEBAPI_URL + queryUrl + hashAPIPath(queryUrl));
|
||||||
|
|
||||||
var config = {
|
var config = {
|
||||||
method: "delete",
|
method: "delete",
|
||||||
url: WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
url: WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ export default async function ApiProxy(req, res) {
|
|||||||
var queryUrl =
|
var queryUrl =
|
||||||
"pinswg_watchlists?$filter= _pinswg_contact_value eq " +
|
"pinswg_watchlists?$filter= _pinswg_contact_value eq " +
|
||||||
loggedInUserId +
|
loggedInUserId +
|
||||||
"&$select=modifiedon,pinswg_appealcasetype,pinswg_watchlistid,_pinswg_watchedcase_value,statuscode&$count=true&$orderby=createdon desc&$expand=pinswg_WatchedCase($select=pinswg_AssociatedLPA)";
|
"&$select=modifiedon,pinswg_appealcasetype,pinswg_watchlistid,_pinswg_watchedcase_value,statuscode,pinswg_representationsubmitted,pinswg_representationtype&$count=true&$orderby=createdon desc&$expand=pinswg_WatchedCase($select=pinswg_AssociatedLPA)";
|
||||||
|
|
||||||
return axios
|
return axios
|
||||||
.get(
|
.get(
|
||||||
|
|||||||
+43
-3
@@ -40,6 +40,8 @@ import { setMyCases, setMyCasesDetails } from "../../store/myCases/action";
|
|||||||
import {
|
import {
|
||||||
setMyRepresentations,
|
setMyRepresentations,
|
||||||
setMyRepresentationsDetails,
|
setMyRepresentationsDetails,
|
||||||
|
setMySubmittedReps,
|
||||||
|
setMySubmittedRepsDetails,
|
||||||
} from "../../store/myRepresentations/action";
|
} from "../../store/myRepresentations/action";
|
||||||
import { setShowReps } from "../../store/currentView/action";
|
import { setShowReps } from "../../store/currentView/action";
|
||||||
import { wrapper } from "../../store/store";
|
import { wrapper } from "../../store/store";
|
||||||
@@ -54,6 +56,7 @@ const Home = (props) => {
|
|||||||
pages,
|
pages,
|
||||||
myCases,
|
myCases,
|
||||||
myRepresentations,
|
myRepresentations,
|
||||||
|
mySubmittedReps,
|
||||||
watchedCases,
|
watchedCases,
|
||||||
awaitingSubmission,
|
awaitingSubmission,
|
||||||
accountDetails,
|
accountDetails,
|
||||||
@@ -145,6 +148,7 @@ const Home = (props) => {
|
|||||||
<MyPortal
|
<MyPortal
|
||||||
myCases={myCases}
|
myCases={myCases}
|
||||||
myRepresentations={myRepresentations}
|
myRepresentations={myRepresentations}
|
||||||
|
mySubmittedReps={mySubmittedReps}
|
||||||
watchedCases={watchedCases}
|
watchedCases={watchedCases}
|
||||||
awaitingSubmission={awaitingSubmission}
|
awaitingSubmission={awaitingSubmission}
|
||||||
accountDetails={accountDetails}
|
accountDetails={accountDetails}
|
||||||
@@ -247,6 +251,34 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
|||||||
const showReps = process.env.SHOWREPRESENTATIONS || false;
|
const showReps = process.env.SHOWREPRESENTATIONS || false;
|
||||||
store.dispatch(setShowReps(showReps, showLoginCheck));
|
store.dispatch(setShowReps(showReps, showLoginCheck));
|
||||||
|
|
||||||
|
let showWatchedCases = (submittedArr) => {
|
||||||
|
const required = submittedArr.value.filter((el) => {
|
||||||
|
return el.pinswg_representationsubmitted == null;
|
||||||
|
});
|
||||||
|
|
||||||
|
let newObj = {};
|
||||||
|
return Object.assign(newObj, {
|
||||||
|
"@odata.count": required.length,
|
||||||
|
"value": required,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
let filteredWatchedCases = showWatchedCases(watchedCases);
|
||||||
|
|
||||||
|
let showSubmittedReps = (submittedArr) => {
|
||||||
|
submittedArr = submittedArr.value;
|
||||||
|
const required = submittedArr.filter((el) => {
|
||||||
|
let IsSubmittedRep = _.has(el, "pinswg_representationsubmitted")
|
||||||
|
? el.pinswg_representationsubmitted != null &&
|
||||||
|
el.pinswg_representationsubmitted
|
||||||
|
: "";
|
||||||
|
return IsSubmittedRep;
|
||||||
|
});
|
||||||
|
return required;
|
||||||
|
};
|
||||||
|
|
||||||
|
const mySubmittedReps = showSubmittedReps(watchedCases);
|
||||||
|
|
||||||
// if (preferredLocale != ctx.locale) {
|
// if (preferredLocale != ctx.locale) {
|
||||||
// return {
|
// return {
|
||||||
// redirect: {
|
// redirect: {
|
||||||
@@ -266,11 +298,13 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
|||||||
const [
|
const [
|
||||||
myCasesDetails,
|
myCasesDetails,
|
||||||
watchedCasesDetails,
|
watchedCasesDetails,
|
||||||
|
mySubmittedRepsDetails,
|
||||||
//awaitingSubmissionDetails,
|
//awaitingSubmissionDetails,
|
||||||
myRepresentationsDetails,
|
myRepresentationsDetails,
|
||||||
] = await Promise.all([
|
] = await Promise.all([
|
||||||
await getDetails(myCases, "myCases"),
|
await getDetails(myCases, "myCases"),
|
||||||
await getDetails(watchedCases, "myWatchedCases"),
|
await getDetails(filteredWatchedCases, "myWatchedCases"),
|
||||||
|
await getDetails(mySubmittedReps, "mySubmittedReps"),
|
||||||
//await getDetails(awaitingSubmission, "awaitingSubmission"),
|
//await getDetails(awaitingSubmission, "awaitingSubmission"),
|
||||||
await getDetails(myRepresentations, "myRepresentations"),
|
await getDetails(myRepresentations, "myRepresentations"),
|
||||||
]);
|
]);
|
||||||
@@ -284,8 +318,10 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
|||||||
setMyRepresentationsDetails(myRepresentationsDetails)
|
setMyRepresentationsDetails(myRepresentationsDetails)
|
||||||
);
|
);
|
||||||
|
|
||||||
store.dispatch(setWatchedCases(watchedCases));
|
store.dispatch(setWatchedCases(filteredWatchedCases));
|
||||||
store.dispatch(setWatchedCasesDetails(watchedCasesDetails));
|
store.dispatch(setWatchedCasesDetails(watchedCasesDetails));
|
||||||
|
store.dispatch(setMySubmittedReps(mySubmittedReps));
|
||||||
|
store.dispatch(setMySubmittedRepsDetails(mySubmittedRepsDetails));
|
||||||
store.dispatch(setAwaitingSubmission(awaitingSubmission));
|
store.dispatch(setAwaitingSubmission(awaitingSubmission));
|
||||||
store.dispatch(
|
store.dispatch(
|
||||||
setAwaitingSubmissionFromBlob(awaitingSubmissionFromBlob)
|
setAwaitingSubmissionFromBlob(awaitingSubmissionFromBlob)
|
||||||
@@ -318,7 +354,8 @@ const getDetails = (resultsObj, detailsType) => {
|
|||||||
// "\n//////////////////////////////////\n"
|
// "\n//////////////////////////////////\n"
|
||||||
// );
|
// );
|
||||||
|
|
||||||
resultsObj = resultsObj.value;
|
resultsObj =
|
||||||
|
detailsType == "mySubmittedReps" ? resultsObj : resultsObj.value;
|
||||||
|
|
||||||
// console.log(
|
// console.log(
|
||||||
// "////////////////////////////////// resultsobj\n",
|
// "////////////////////////////////// resultsobj\n",
|
||||||
@@ -339,6 +376,7 @@ const getDetails = (resultsObj, detailsType) => {
|
|||||||
caseID = data.pinswg_title;
|
caseID = data.pinswg_title;
|
||||||
break;
|
break;
|
||||||
case "myWatchedCases":
|
case "myWatchedCases":
|
||||||
|
case "mySubmittedReps":
|
||||||
caseID =
|
caseID =
|
||||||
data[
|
data[
|
||||||
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
||||||
@@ -371,6 +409,7 @@ const getDetails = (resultsObj, detailsType) => {
|
|||||||
caseID = searchDetail.pinswg_title;
|
caseID = searchDetail.pinswg_title;
|
||||||
break;
|
break;
|
||||||
case "myWatchedCases":
|
case "myWatchedCases":
|
||||||
|
case "mySubmittedReps":
|
||||||
caseID =
|
caseID =
|
||||||
searchDetail[
|
searchDetail[
|
||||||
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
||||||
@@ -422,6 +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,
|
||||||
awaitingSubmission: state.awaitingSubmission,
|
awaitingSubmission: state.awaitingSubmission,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ export const myRepresentationsActionTypes = {
|
|||||||
SETMYREPRESENTATIONS: "SETMYREPRESENTATIONS",
|
SETMYREPRESENTATIONS: "SETMYREPRESENTATIONS",
|
||||||
SETMYREPRESENTATIONSDETAILS: "SETMYREPRESENTATIONSDETAILS",
|
SETMYREPRESENTATIONSDETAILS: "SETMYREPRESENTATIONSDETAILS",
|
||||||
UPDATEMYREPRESENTATIONS: "UPDATEMYREPRESENTATIONS",
|
UPDATEMYREPRESENTATIONS: "UPDATEMYREPRESENTATIONS",
|
||||||
|
SETMYSUBMITTEDREPS: "SETMYSUBMITTEDREPS",
|
||||||
|
SETMYSUBMITTEDREPSDETAILS: "SETMYSUBMITTEDREPSDETAILS",
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getMyRepresentationsObj = () => (dispatch) => {
|
export const getMyRepresentationsObj = () => (dispatch) => {
|
||||||
@@ -25,3 +27,18 @@ export const setMyRepresentationsDetails =
|
|||||||
myRepresentationsDetails: myRepresentationsDetails,
|
myRepresentationsDetails: myRepresentationsDetails,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const setMySubmittedReps = (mySubmittedReps) => (dispatch) => {
|
||||||
|
return dispatch({
|
||||||
|
type: myRepresentationsActionTypes.SETMYSUBMITTEDREPS,
|
||||||
|
mySubmittedReps: mySubmittedReps,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
export const setMySubmittedRepsDetails =
|
||||||
|
(mySubmittedRepsDetails) => (dispatch) => {
|
||||||
|
return dispatch({
|
||||||
|
type: myRepresentationsActionTypes.SETMYSUBMITTEDREPSDETAILS,
|
||||||
|
mySubmittedRepsDetails: mySubmittedRepsDetails,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|||||||
@@ -3,6 +3,10 @@ import { myRepresentationsActionTypes } from "./action";
|
|||||||
const myRepresentationsInitialState = {
|
const myRepresentationsInitialState = {
|
||||||
myRepresentations: {},
|
myRepresentations: {},
|
||||||
myRepresentationsDetails: {},
|
myRepresentationsDetails: {},
|
||||||
|
mySubmittedReps: {
|
||||||
|
mySubmittedReps: {},
|
||||||
|
mySubmittedRepsDetails: {},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function reducer(state = myRepresentationsInitialState, action) {
|
export default function reducer(state = myRepresentationsInitialState, action) {
|
||||||
@@ -17,6 +21,23 @@ export default function reducer(state = myRepresentationsInitialState, action) {
|
|||||||
...state,
|
...state,
|
||||||
myRepresentationsDetails: action.myRepresentationsDetails,
|
myRepresentationsDetails: action.myRepresentationsDetails,
|
||||||
};
|
};
|
||||||
|
case myRepresentationsActionTypes.SETMYSUBMITTEDREPS:
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
mySubmittedReps: {
|
||||||
|
mySubmittedReps: action.mySubmittedReps,
|
||||||
|
mySubmittedRepsDetails:
|
||||||
|
state.mySubmittedReps.mySubmittedRepsDetails,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
case myRepresentationsActionTypes.SETMYSUBMITTEDREPSDETAILS:
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
mySubmittedReps: {
|
||||||
|
mySubmittedReps: state.mySubmittedReps.mySubmittedReps,
|
||||||
|
mySubmittedRepsDetails: action.mySubmittedRepsDetails,
|
||||||
|
},
|
||||||
|
};
|
||||||
default:
|
default:
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user