awaiting submissions from storage acc

This commit is contained in:
2022-09-05 16:46:30 +01:00
parent b0dde836b0
commit c66883b4c5
25 changed files with 653 additions and 69 deletions
+25 -19
View File
@@ -7,7 +7,7 @@ import { useEffect } from "react";
import { connect } from "react-redux";
import xpath from "xpath";
import {
getAppealsTypes,
getAppealsTypesForNewAppeal,
getMandatoryFields,
getPickLists,
getPartSavedAppeal,
@@ -26,6 +26,7 @@ import TimeOut from "../../components/timeout";
import {
setLoggedInUserId,
setLoggedInUserEmail,
setContainerID,
} from "../../store/accountDetails/action";
import {
@@ -217,32 +218,32 @@ export const getServerSideProps = wrapper.getServerSideProps(
const { query, req, res } = ctx;
const { cookies } = req;
console.log(cookies);
console.log("the query", query.appealtypes);
//console.log(cookies);
//console.log("the query", query.appealtypes);
let loggedInUser = cookies.pinsUser;
let thisSession = await getSession(ctx);
console.log("nextAuth Session:", thisSession);
//console.log("nextAuth Session:", thisSession);
let loggedInUserIdent = thisSession.user.id;
let loggedInUserEmail = thisSession.user.email;
console.log("logged ident:", loggedInUserIdent);
//console.log("logged ident:", loggedInUserIdent);
const [
appealTypeData,
mandatoryFieldsData,
pickListData,
blobList,
blobProgress,
] = await Promise.all([
await getAppealsTypes(),
await getMandatoryFields(query.appealtypes),
await getPickLists(query.appealtypes),
await getFilesFromBlob(loggedInUserIdent, query.casereference),
await getProgressFromBlob(loggedInUserIdent, query.casereference),
]);
const [appealTypeData, mandatoryFieldsData, pickListData, blobList] =
await Promise.all([
await getAppealsTypesForNewAppeal(),
await getMandatoryFields(query.appealtypes),
await getPickLists(query.appealtypes),
await getFilesFromBlob(loggedInUserIdent, query.casereference),
]);
console.log("has blobprogess:", loggedInUserIdent, query.casereference);
const blobProgress = await getProgressFromBlob(
loggedInUserIdent,
query.casereference
);
console.log("/////////\nappela tupe data:", appealTypeData);
//
// Removed to make progress from Blob not CRM
@@ -288,6 +289,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
const providerConfig = await getProviderConfig();
store.dispatch(getGovGatewayConfig(providerConfig));
store.dispatch(setLoggedInUserId(loggedInUser));
store.dispatch(setLoggedInUserEmail(loggedInUserEmail));
store.dispatch(setAppealLPA(query.lpa));
store.dispatch(setAppealTypeID(query.apt));
store.dispatch(setCaseReference(caseReference));
@@ -295,6 +297,10 @@ export const getServerSideProps = wrapper.getServerSideProps(
store.dispatch(setAppealType(appealTypeData));
store.dispatch(setFilesForAppeal(blobList));
store.dispatch(setContainerID(thisSession.user.id));
return {
props: { url: process.env.API_ROOT },
};
}
);
+8
View File
@@ -5,6 +5,7 @@ import Head from "next/head";
import { useRouter } from "next/router";
import { connect } from "react-redux";
import {
getAwaitingSubmissionFromBlob,
getAwaitingSubmission,
getMyCases,
getMyRepresentations,
@@ -27,6 +28,7 @@ import {
} from "../../store/accountDetails/action";
import {
setAwaitingSubmission,
setAwaitingSubmissionFromBlob,
setAwaitingSubmissionDetails,
} from "../../store/awaitingSubmission/action";
import { getGovGatewayConfig } from "../../store/govgateway/action";
@@ -185,12 +187,14 @@ export const getServerSideProps = wrapper.getServerSideProps(
myRepresentations,
watchedCases,
awaitingSubmission,
awaitingSubmissionFromBlob,
] = await Promise.all([
await getPersonalAccount(loggedInUser),
await getMyCases(loggedInUser),
await getMyRepresentations(loggedInUser),
await getWatchedCases(loggedInUser),
await getAwaitingSubmission(loggedInUser),
await getAwaitingSubmissionFromBlob(thisSession.user.id),
]);
if (_.has(accountDetails, "errorCode") != false) {
@@ -224,6 +228,10 @@ export const getServerSideProps = wrapper.getServerSideProps(
store.dispatch(setWatchedCases(watchedCases));
store.dispatch(setWatchedCasesDetails(watchedCasesDetails));
store.dispatch(setAwaitingSubmission(awaitingSubmission));
store.dispatch(
setAwaitingSubmissionFromBlob(awaitingSubmissionFromBlob)
);
store.dispatch(
setAwaitingSubmissionDetails(awaitingSubmissionDetails)
);