diff --git a/components/admin/tabs/documents.js b/components/admin/tabs/documents.js
index a95e4ab6..ce9cce63 100644
--- a/components/admin/tabs/documents.js
+++ b/components/admin/tabs/documents.js
@@ -15,177 +15,177 @@ import { sendGAEvent } from "@next/third-parties/google";
import {
getSearchDocumentDetails,
getSearchDocumentDetailsPaged,
- getSearchDocumentTypes,
- getNewDocumentsPaged,
-} from "../../../actions";
+ getSearchDocumentTypes
+} from "../../../actions/services/searchService";
+import { getNewDocumentsPaged } from "../../../actions/services/adminService";
import { setCurrentPage } from "../../../store/currentView/action";
import { setDocumentDetails } from "../../../store/searchOutput/action";
const getDocumentTypes = [
{
"Value": 846040009,
- "Label": "Main Party - Pre-Submission Docs",
+ "Label": "Main Party - Pre-Submission Docs"
},
{
"Value": 846040000,
- "Label": "Main Party - Submission Document",
+ "Label": "Main Party - Submission Document"
},
{
"Value": 846040001,
- "Label": "Main Party - Questionnaire",
+ "Label": "Main Party - Questionnaire"
},
{
"Value": 846040002,
- "Label": "Main Party - Statements",
+ "Label": "Main Party - Statements"
},
{
"Value": 846040003,
- "Label": "Main Party - Comments",
+ "Label": "Main Party - Comments"
},
{
"Value": 846040004,
- "Label": "Main Party - Written Statements of Evidence",
+ "Label": "Main Party - Written Statements of Evidence"
},
{
"Value": 846040010,
- "Label": "Main Party - Environmental Statements",
+ "Label": "Main Party - Environmental Statements"
},
{
"Value": 846040005,
- "Label": "Interested Party Representations",
+ "Label": "Interested Party Representations"
},
{
"Value": 846040006,
- "Label": "Correspondence",
+ "Label": "Correspondence"
},
{
"Value": 846040008,
- "Label": "Inspector Notes",
+ "Label": "Inspector Notes"
},
{
"Value": 846040007,
- "Label": "Final Decision/Report",
+ "Label": "Final Decision/Report"
},
{
"Value": 846040011,
- "Label": "Post Decision Correspondence",
+ "Label": "Post Decision Correspondence"
},
{
"Value": 846040012,
- "Label": "High Court Challenge Correspondence",
+ "Label": "High Court Challenge Correspondence"
},
{
"Value": 846040013,
- "Label": "Event - Correspondence",
+ "Label": "Event - Correspondence"
},
{
"Value": 846040014,
- "Label": "Event - Documents",
+ "Label": "Event - Documents"
},
{
"Value": 846040015,
- "Label": "Pre-Application - General",
+ "Label": "Pre-Application - General"
},
{
"Value": 846040016,
- "Label": "Pre-Application - EIA Screening",
+ "Label": "Pre-Application - EIA Screening"
},
{
"Value": 846040017,
- "Label": "Pre-Application - EIA Scoping",
+ "Label": "Pre-Application - EIA Scoping"
},
{
"Value": 846040018,
- "Label": "EIA Screening",
+ "Label": "EIA Screening"
},
{
"Value": 846040019,
- "Label": "EIA Scoping",
+ "Label": "EIA Scoping"
},
{
"Value": 846040020,
- "Label": "Pre-Application Services Documents",
+ "Label": "Pre-Application Services Documents"
},
{
"Value": 846040021,
- "Label": "Notification",
+ "Label": "Notification"
},
{
"Value": 846040022,
"Label":
- "Submission - Environmental Statement - written statement and NTS",
+ "Submission - Environmental Statement - written statement and NTS"
},
{
"Value": 846040023,
- "Label": "Submission - Environmental Statement - Appendices",
+ "Label": "Submission - Environmental Statement - Appendices"
},
{
"Value": 846040024,
- "Label": "Submission - Environmental Statement - Figures",
+ "Label": "Submission - Environmental Statement - Figures"
},
{
"Value": 846040025,
- "Label": "Submission - Draft Infrastructure Consent Orders",
+ "Label": "Submission - Draft Infrastructure Consent Orders"
},
{
"Value": 846040026,
- "Label": "Submission - Compulsory Acquisition Information",
+ "Label": "Submission - Compulsory Acquisition Information"
},
{
"Value": 846040027,
- "Label": "Submission - Application Documents",
+ "Label": "Submission - Application Documents"
},
{
"Value": 846040028,
- "Label": "Examination Notices",
+ "Label": "Examination Notices"
},
{
"Value": 846040029,
- "Label": "Local/Marine Impact Reports",
+ "Label": "Local/Marine Impact Reports"
},
{
"Value": 846040030,
- "Label": "Submission - Further Information",
+ "Label": "Submission - Further Information"
},
{
"Value": 846040031,
- "Label": "Formal Variation requests",
+ "Label": "Formal Variation requests"
},
{
"Value": 846040032,
- "Label": "Further Information - Interested Party Representations",
+ "Label": "Further Information - Interested Party Representations"
},
{
"Value": 846040033,
- "Label": "Hearing Statements",
+ "Label": "Hearing Statements"
},
{
"Value": 846040034,
- "Label": "Events - Recordings",
+ "Label": "Events - Recordings"
},
{
"Value": 846040035,
- "Label": "Internal Correspondence",
+ "Label": "Internal Correspondence"
},
{
"Value": 846040036,
- "Label": "Consultation Response",
- },
+ "Label": "Consultation Response"
+ }
];
const getOrigin = [
{
"Value": 846040000,
- "Label": "MDU",
+ "Label": "MDU"
},
{
"Value": 846040001,
- "Label": "Portal",
+ "Label": "Portal"
},
{
"Value": 846040002,
- "Label": "Manual",
- },
+ "Label": "Manual"
+ }
];
const DocumentsTab = (props) => {
@@ -200,7 +200,7 @@ const DocumentsTab = (props) => {
setDocumentDetails,
setCurrentPage,
docsOffline,
- showFilteredDocs,
+ showFilteredDocs
} = props;
const router = useRouter();
@@ -236,7 +236,7 @@ const DocumentsTab = (props) => {
setCheckedItems((prev) => ({
...prev,
- [name]: checked,
+ [name]: checked
}));
setSelectAll(false);
};
@@ -246,7 +246,7 @@ const DocumentsTab = (props) => {
setCheckedOriginItems((prev) => ({
...prev,
- [name]: checked,
+ [name]: checked
}));
setSelectOriginAll(false);
};
@@ -404,7 +404,7 @@ const DocumentsTab = (props) => {
item.Label +
'")].value_cy',
json: transLookup,
- eval: true,
+ eval: true
})
: item.Label ||
t(
@@ -477,7 +477,7 @@ const DocumentsTab = (props) => {
item.Label +
'")].value_cy',
json: transLookup,
- eval: true,
+ eval: true
})
: item.Label ||
t(
@@ -496,7 +496,7 @@ const DocumentsTab = (props) => {
const checkedValues = [
...document.querySelectorAll(
".govuk-checkboxes__input:checked"
- ),
+ )
].map((e) => e.value);
const origins = checkedValues
@@ -697,7 +697,7 @@ const DocumentsTab = (props) => {
incidentid +
"')]",
json: item,
- eval: true,
+ eval: true
});
detailsObj = item;
return (
@@ -831,7 +831,7 @@ const DocumentsTab = (props) => {
] +
'")].value_cy',
json: transLookup,
- eval: true,
+ eval: true
})
: detailsObj[
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
@@ -946,7 +946,7 @@ const DocumentsTab = (props) => {
selectedDocumentType,
selectedWeeks,
selectedDocumentOrigin,
- props.setDocumentDetails,
+ props.setDocumentDetails
]
);
@@ -1081,7 +1081,7 @@ const DocumentsTab = (props) => {
getOrigin,
getDocumentResults,
lang,
- selectedWeeks,
+ selectedWeeks
]);
function countFieldValue(obj, field, targetValue) {
@@ -1166,7 +1166,7 @@ const DocumentsTab = (props) => {
const mapStateToProps = (state) => {
return {
- ...state,
+ ...state
};
};
@@ -1177,7 +1177,7 @@ const mapDispatchToProps = (dispatch) => {
},
setCurrentPage: (currentPage) => {
dispatch(setCurrentPage(currentPage));
- },
+ }
};
};
diff --git a/components/admin/tabs/storage.js b/components/admin/tabs/storage.js
index fcbfb15f..4feb135e 100644
--- a/components/admin/tabs/storage.js
+++ b/components/admin/tabs/storage.js
@@ -4,9 +4,9 @@ import Link from "next/link";
import { bytesToSize } from "../../../components/utils";
import {
deleteMyRepresentationsFromBlob,
- deleteAwaitingSubmissionsFromBlob,
- sendRepCompleteMessage,
-} from "../../../actions";
+ deleteAwaitingSubmissionsFromBlob
+} from "../../../actions/services/documentService";
+import { sendRepCompleteMessage } from "../../../actions/services/portalService";
import { formatBlobDates } from "../utils/adminHelper";
@@ -74,9 +74,9 @@ export default function StorageTab({ data, repCompleteCount }) {
showRepJson && folder.hasRepJson
? { display: "block" }
: showTmpFile &&
- folder.hasTmpFile
- ? { display: "block" }
- : { display: "none" }
+ folder.hasTmpFile
+ ? { display: "block" }
+ : { display: "none" }
}
>
{folder.folderPath || "Root"}
@@ -150,7 +150,7 @@ export default function StorageTab({ data, repCompleteCount }) {
headers:
{
"Content-Type":
- "application/json",
+ "application/json"
},
body: JSON.stringify(
{
@@ -159,18 +159,18 @@ export default function StorageTab({ data, repCompleteCount }) {
blobName:
folder
.repJsonBlob
- .name,
+ .name
}
- ),
+ )
}
);
const result =
await response.json();
if (response.ok) {
- alert(
+ (alert(
"repComplete removed!"
),
- window.location.reload();
+ window.location.reload());
// Optionally refresh the page or update UI state here
} else {
alert(
diff --git a/components/admin/utils/serverside.js b/components/admin/utils/serverside.js
index 9bb35048..5db3ab4a 100644
--- a/components/admin/utils/serverside.js
+++ b/components/admin/utils/serverside.js
@@ -67,7 +67,7 @@ export async function fetchAdminStorageData() {
const blobWithHash = {
...blob,
hashedfilepath,
- isTmpFile,
+ isTmpFile
};
let folderGroup = acc.find(
@@ -80,7 +80,7 @@ export async function fetchAdminStorageData() {
hasRepJson: false,
repJsonBlob: null,
repComplete: false,
- hasTmpFile: false,
+ hasTmpFile: false
};
acc.push(folderGroup);
}
@@ -137,7 +137,7 @@ export async function fetchAdminStorageData() {
? {
id: user.id,
email: user.email,
- containers: containersWithHashes,
+ containers: containersWithHashes
}
: null;
})
@@ -150,7 +150,7 @@ export async function fetchAdminStorageData() {
.map((user) => ({
id: user.id,
email: user.email,
- created: user.emailVerified?.toLocaleString("en-GB") || "",
+ created: user.emailVerified?.toLocaleString("en-GB") || ""
}));
let repCompleteCount = 0;
diff --git a/components/case/documents.js b/components/case/documents.js
index 37a12ce5..29325ada 100644
--- a/components/case/documents.js
+++ b/components/case/documents.js
@@ -12,8 +12,8 @@ import { sendGAEvent } from "@next/third-parties/google";
import {
getSearchDocumentDetails,
getSearchDocumentDetailsPaged,
- getSearchDocumentTypes,
-} from "../../actions";
+ getSearchDocumentTypes
+} from "../../actions/services/searchService";
import { setCurrentPage } from "../../store/currentView/action";
import { setDocumentDetails } from "../../store/searchOutput/action";
@@ -32,7 +32,7 @@ const DocumentDetails = (props) => {
setDocumentDetails,
setCurrentPage,
docsOffline,
- showFilteredDocs,
+ showFilteredDocs
} = props;
const router = useRouter();
@@ -57,7 +57,7 @@ const DocumentDetails = (props) => {
setCheckedItems((prev) => ({
...prev,
- [name]: checked,
+ [name]: checked
}));
setSelectAll(false);
};
@@ -132,7 +132,7 @@ const DocumentDetails = (props) => {
? jsonpath({
path: '$..[?(@ && @.value=="All")].value_cy',
json: transLookup,
- eval: true,
+ eval: true
})
: "All"}
@@ -151,7 +151,7 @@ const DocumentDetails = (props) => {
item.pinswg_isharedocumentlocationsLabel +
'")].value_cy',
json: transLookup,
- eval: true,
+ eval: true
})
: item.pinswg_isharedocumentlocationsLabel ||
t(
@@ -298,7 +298,7 @@ const DocumentDetails = (props) => {
incidentid +
"')]",
json: item,
- sanbox: {},
+ sanbox: {}
});
detailsObj = item;
return (
@@ -330,7 +330,7 @@ const DocumentDetails = (props) => {
}
key={key}
onClick={() => {
- toggleDownLoadLink(key),
+ (toggleDownLoadLink(key),
sendGAEvent(
"event",
"DownloadedFile",
@@ -338,9 +338,9 @@ const DocumentDetails = (props) => {
caseReference:
props.caseReference,
filename:
- detailsObj.pinswg_name,
+ detailsObj.pinswg_name
}
- );
+ ));
}}
>
@@ -388,7 +388,7 @@ const DocumentDetails = (props) => {
] +
'")].value_cy',
json: transLookup,
- eval: true,
+ eval: true
})
: detailsObj[
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
@@ -554,7 +554,7 @@ const DocumentDetails = (props) => {
item.pinswg_isharedocumentlocationsLabel +
'")].value_cy',
json: transLookup,
- eval: true,
+ eval: true
})
: item.pinswg_isharedocumentlocationsLabel ||
t(
@@ -574,7 +574,7 @@ const DocumentDetails = (props) => {
const data = [
...document.querySelectorAll(
".govuk-checkboxes__input:checked"
- ),
+ )
].map((e) => e.value);
setSelectedDocumentType(data);
setCurrentPage(1);
@@ -710,7 +710,7 @@ const DocumentDetails = (props) => {
incidentid +
"')]",
json: item,
- eval: true,
+ eval: true
});
detailsObj = item;
return (
@@ -827,7 +827,7 @@ const DocumentDetails = (props) => {
] +
'")].value_cy',
json: transLookup,
- eval: true,
+ eval: true
})
: detailsObj[
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
@@ -905,7 +905,7 @@ const DocumentDetails = (props) => {
props.incidentid,
selectedOption,
selectedDocumentType,
- setDocumentDetails,
+ setDocumentDetails
]
);
@@ -1029,7 +1029,7 @@ const DocumentDetails = (props) => {
orderByState,
getDocumentTypes,
getDocumentResults,
- lang,
+ lang
]);
return (
@@ -1059,7 +1059,7 @@ const DocumentDetails = (props) => {
const mapStateToProps = (state) => {
return {
- ...state,
+ ...state
};
};
@@ -1070,7 +1070,7 @@ const mapDispatchToProps = (dispatch) => {
},
setCurrentPage: (currentPage) => {
dispatch(setCurrentPage(currentPage));
- },
+ }
};
};
diff --git a/components/case/representation/representationComplete.js b/components/case/representation/representationComplete.js
index 4e8791c2..d8c38184 100644
--- a/components/case/representation/representationComplete.js
+++ b/components/case/representation/representationComplete.js
@@ -7,10 +7,10 @@ import { connect } from "react-redux";
import { useDropzone } from "react-dropzone";
import {
createWatchedCases,
- sendEmail,
sendRepCompleteMessage,
- setRepInvolvment,
-} from "../../../actions";
+ setRepInvolvment
+} from "../../../actions/services/portalService";
+import { sendEmail } from "../../../actions/services/notifyService";
import { setRepresentationReset } from "../../../store/currentView/action";
const RepComplete = (props) => {
@@ -27,7 +27,7 @@ const RepComplete = (props) => {
setSubmitBack,
setRepresentationSubmitConfirmation,
setRepresentationMessageSent,
- repFormData,
+ repFormData
} = props;
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
const files = acceptedFiles.map((file) => (
@@ -55,10 +55,10 @@ const RepComplete = (props) => {
"emailAddress":
props.props.props.props.accountDetails.accountDetails
.emailaddress1,
- "linkExpiry": 10 * 60,
+ "linkExpiry": 10 * 60
};
- props.props.currentView.representationMessageSent != true &&
+ (props.props.currentView.representationMessageSent != true &&
(setRepInvolvment(
props.props.currentView.caseReference.incidentid,
props.props.props.props.accountDetails.accountDetails.contactid
@@ -89,10 +89,10 @@ const RepComplete = (props) => {
? props.props.currentView.caseReference.repDetails
.representationType
: props.props.currentView.caseReference
- .representationType,
+ .representationType
}),
setRepresentationMessageSent(true)),
- window.scrollTo({ top: 0, behavior: "smooth" });
+ window.scrollTo({ top: 0, behavior: "smooth" }));
});
return (
@@ -130,7 +130,7 @@ const mapStateToProps = (state) => {
currentView: state.currentView,
myRepresentations: state.myRepresentations,
initialValues: state.currentView.caseReference.repDetails,
- accountDetails: state.accountDetails,
+ accountDetails: state.accountDetails
//form: state.form,
};
};
diff --git a/components/case/representation/representationElements.js b/components/case/representation/representationElements.js
index 3ab97732..b1c6deaf 100644
--- a/components/case/representation/representationElements.js
+++ b/components/case/representation/representationElements.js
@@ -14,7 +14,7 @@ import {
deleteRepBlob,
getFilesFromBlobHashed,
getFilesFromBlobproxy
-} from "../../../actions";
+} from "../../../actions/services/documentService";
const LoadingMessage = () =>
Loading the editor...
;
diff --git a/components/elements/index.js b/components/elements/index.js
index 3c6d9ba1..5e5d10ad 100644
--- a/components/elements/index.js
+++ b/components/elements/index.js
@@ -15,7 +15,7 @@ import {
getFilesFromBlobHashed,
uploadSingleFile,
getFilesFromBlobproxy
-} from "../../actions";
+} from "../../actions/services/documentService";
import fieldLookup from "../../data/crmfieldlookuptranslations.json";
import pickListLookup from "../../data/picklistLookups.json";
diff --git a/components/myportal/awaitingsubmissionfromblob.js b/components/myportal/awaitingsubmissionfromblob.js
index 21b50bc9..4fbadb85 100644
--- a/components/myportal/awaitingsubmissionfromblob.js
+++ b/components/myportal/awaitingsubmissionfromblob.js
@@ -7,7 +7,7 @@ import { connect } from "react-redux";
import {
deleteAwaitingSubmissionsFromBlob,
getAwaitingSubmissionFromBlobProxy
-} from "../../actions";
+} from "../../actions/services/documentService";
import { getFormCollectionByID } from "../../components/utils";
import transLookup from "../../data/lookuptranslations.json";
import {
diff --git a/components/myportal/topthree.js b/components/myportal/topthree.js
index e98027e0..5b176723 100644
--- a/components/myportal/topthree.js
+++ b/components/myportal/topthree.js
@@ -10,22 +10,22 @@ import {
deleteWatchedCases,
getAwaitingSubmissionProxy,
getPortalModuleDetailsProxy,
- getWatchedCasesProxy,
-} from "../../actions";
+ getWatchedCasesProxy
+} from "../../actions/services/portalService";
import { getFormCollectionByID, getDetailsProxy } from "../../components/utils";
import transLookup from "../../data/lookuptranslations.json";
import {
setAwaitingSubmission,
- setAwaitingSubmissionDetails,
+ setAwaitingSubmissionDetails
} from "../../store/awaitingSubmission/action";
import { setCurrentReference } from "../../store/currentView/action";
import {
setSearchDetails,
- setSearchResults,
+ setSearchResults
} from "../../store/searchOutput/action";
import {
setWatchedCases,
- setWatchedCasesDetails,
+ setWatchedCasesDetails
} from "../../store/watchedCases/action";
import { planningappeals78_pdf } from "../../components/pdftemplates/planningappeals78_pdf";
@@ -47,7 +47,7 @@ const TopThree = (props) => {
setAwaitingSubmissionDetails,
setSearchResults,
setSearchDetails,
- showLoginCheck,
+ showLoginCheck
} = props;
const router = useRouter();
@@ -132,19 +132,19 @@ const TopThree = (props) => {
let newObj = {};
return Object.assign(newObj, {
"@odata.count": required.length,
- "value": required,
+ "value": required
});
};
let filteredWatchedCases = showWatchedCases(data);
- setWatchedCases(filteredWatchedCases),
+ (setWatchedCases(filteredWatchedCases),
getDetailsProxy(
filteredWatchedCases,
"myWatchedCases"
).then((data) => {
setWatchedCasesDetails(data);
- });
+ }));
});
});
@@ -156,7 +156,7 @@ const TopThree = (props) => {
.then(() => {
getAwaitingSubmissionProxy(cookies.pinsUser).then(
(data) => {
- setAwaitingSubmission(data),
+ (setAwaitingSubmission(data),
getDetailsProxy(
data,
"awaitingSubmission"
@@ -166,7 +166,7 @@ const TopThree = (props) => {
// data
// );
setAwaitingSubmissionDetails(data);
- });
+ }));
}
);
});
@@ -196,7 +196,7 @@ const TopThree = (props) => {
const res = await fetch("/api/file/generateappealpdfcopy", {
method: "POST",
headers: { "Content-Type": "application/json" },
- body: JSON.stringify({ docProps }),
+ body: JSON.stringify({ docProps })
});
if (!res.ok) throw new Error("PDF generation failed");
@@ -287,25 +287,25 @@ const TopThree = (props) => {
"&inid=" +
showTopThreeArr[key].incidentid
: router.locale == "cy"
- ? "/fymhorth/achos/" +
- showTopThreeArr[key].ticketnumber +
- "?key=" +
- topThreeType +
- "&appealType=" +
- showTopThreeArr[key]
- .pinswg_appealcasetype
- : "/myportal/case/" +
- showTopThreeArr[key].ticketnumber +
- "?key=" +
- topThreeType +
- "&appealType=" +
- showTopThreeArr[key]
- .pinswg_appealcasetype
+ ? "/fymhorth/achos/" +
+ showTopThreeArr[key].ticketnumber +
+ "?key=" +
+ topThreeType +
+ "&appealType=" +
+ showTopThreeArr[key]
+ .pinswg_appealcasetype
+ : "/myportal/case/" +
+ showTopThreeArr[key].ticketnumber +
+ "?key=" +
+ topThreeType +
+ "&appealType=" +
+ showTopThreeArr[key]
+ .pinswg_appealcasetype
}
className="govuk-link--no-underline"
data-id={index}
onClick={() => {
- setSearchResults(
+ (setSearchResults(
props.props[topThreeType][topThreeType]
),
setSearchDetails(
@@ -337,8 +337,8 @@ const TopThree = (props) => {
"appealType":
showTopThreeArr[key]
- .pinswg_appealcasetype,
- });
+ .pinswg_appealcasetype
+ }));
}}
>
{showTopThreeArr[key].pinswg_title}
@@ -423,7 +423,7 @@ const TopThree = (props) => {
] +
'")].value_cy',
json: transLookup,
- eval: true,
+ eval: true
})
: showTopThreeArr[key][
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
@@ -436,26 +436,32 @@ const TopThree = (props) => {
{_.isEmpty(showTopThreeArr[key])
? t("myportal:case-address-not-entered")
: _.isEmpty(showTopThreeArr[key])
- ? t("myportal:case-address-not-entered")
- : _.isEmpty(showTopThreeArr[key])
- ? t("myportal:case-address-not-entered")
- : _.isEmpty(
- showTopThreeArr[key].pinswg_siteaddressline1
- )
- ? t("myportal:case-address-not-entered")
- : showTopThreeArr[key].pinswg_siteaddressline1 +
- (!_.isEmpty(
- showTopThreeArr[key].pinswg_siteaddressline2
- )
- ? ", " +
- showTopThreeArr[key].pinswg_siteaddressline2
- : "") +
- (!_.isEmpty(
- showTopThreeArr[key].pinswg_siteaddresstown
- )
- ? ", " +
- showTopThreeArr[key].pinswg_siteaddresstown
- : "")}
+ ? t("myportal:case-address-not-entered")
+ : _.isEmpty(showTopThreeArr[key])
+ ? t("myportal:case-address-not-entered")
+ : _.isEmpty(
+ showTopThreeArr[key]
+ .pinswg_siteaddressline1
+ )
+ ? t("myportal:case-address-not-entered")
+ : showTopThreeArr[key]
+ .pinswg_siteaddressline1 +
+ (!_.isEmpty(
+ showTopThreeArr[key]
+ .pinswg_siteaddressline2
+ )
+ ? ", " +
+ showTopThreeArr[key]
+ .pinswg_siteaddressline2
+ : "") +
+ (!_.isEmpty(
+ showTopThreeArr[key]
+ .pinswg_siteaddresstown
+ )
+ ? ", " +
+ showTopThreeArr[key]
+ .pinswg_siteaddresstown
+ : "")}
{showTopThreeArr[key].pinswg_appellantagent != null && (
@@ -495,7 +501,7 @@ const TopThree = (props) => {
] +
'")].value_cy',
json: transLookup,
- eval: true,
+ eval: true
})
: showTopThreeArr[key][
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
@@ -591,7 +597,7 @@ const mapDispatchToProps = (dispatch) => {
},
setSearchDetails: (searchDetails) => {
dispatch(setSearchDetails(searchDetails));
- },
+ }
};
};
diff --git a/components/myportal/topthree_reps.js b/components/myportal/topthree_reps.js
index e048770b..ea1a2169 100644
--- a/components/myportal/topthree_reps.js
+++ b/components/myportal/topthree_reps.js
@@ -6,30 +6,32 @@ import { parseCookies } from "nookies";
import { connect } from "react-redux";
import {
deleteAwaitingSubmissions,
- deleteMyRepresentationsFromBlob,
deleteWatchedCases,
getAwaitingSubmissionProxy,
- getPortalModuleDetailsProxy,
- getRepsFromBlobProxy,
- getWatchedCasesProxy,
-} from "../../actions";
+ getWatchedCasesProxy
+} from "../../actions/services/portalService";
+import {
+ deleteMyRepresentationsFromBlob,
+ getRepsFromBlobProxy
+} from "../../actions/services/documentService";
+import { consoleLogger } from "../../actions/core/logger";
import transLookup from "../../data/lookuptranslations.json";
import {
setAwaitingSubmission,
- setAwaitingSubmissionDetails,
+ setAwaitingSubmissionDetails
} from "../../store/awaitingSubmission/action";
import {
setCurrentReference,
setCurrentView,
- setRepresentationCapacity,
+ setRepresentationCapacity
} from "../../store/currentView/action";
import {
setMyRepresentations,
- setMyRepresentationsDetails,
+ setMyRepresentationsDetails
} from "../../store/myRepresentations/action";
import {
setWatchedCases,
- setWatchedCasesDetails,
+ setWatchedCasesDetails
} from "../../store/watchedCases/action";
import { getFormCollectionByID, getDetailsProxy } from "../utils";
@@ -46,7 +48,7 @@ const TopThree = (props) => {
setAwaitingSubmissionDetails,
setMyRepresentations,
setMyRepresentationsDetails,
- setRepresentationCapacity,
+ setRepresentationCapacity
} = props;
const router = useRouter();
@@ -80,12 +82,12 @@ const TopThree = (props) => {
.then((data) => data)
.then(() => {
getWatchedCasesProxy(cookies.pinsUser).then((data) => {
- setWatchedCases(data),
+ (setWatchedCases(data),
getDetailsProxy(data, "myWatchedCases").then(
(data) => {
setWatchedCasesDetails(data);
}
- );
+ ));
});
});
@@ -97,7 +99,7 @@ const TopThree = (props) => {
.then(() => {
getAwaitingSubmissionProxy(cookies.pinsUser).then(
(data) => {
- setAwaitingSubmission(data),
+ (setAwaitingSubmission(data),
getDetailsProxy(
data,
"awaitingSubmission"
@@ -107,7 +109,7 @@ const TopThree = (props) => {
// data
// );
setAwaitingSubmissionDetails(data);
- });
+ }));
}
);
});
@@ -136,12 +138,12 @@ const TopThree = (props) => {
})
.catch((error) => {
consoleLogger(error);
- res.status(400).json(error);
+ return null;
})
.then(() => {
setCurrentView({
"viewName": "My Representations",
- "viewKey": "myRepresentations",
+ "viewKey": "myRepresentations"
});
});
});
@@ -211,7 +213,7 @@ const TopThree = (props) => {
style={{
color: "#0360a6",
cursor: "pointer",
- fontWeight: "bold",
+ fontWeight: "bold"
}}
data-id={index}
onClick={() => {
@@ -225,7 +227,7 @@ const TopThree = (props) => {
showTopThreeArr[key].incidentID,
"appealType":
showTopThreeArr[key].appealType,
- "repDetails": showTopThreeArr[key],
+ "repDetails": showTopThreeArr[key]
});
isLPA && setRepresentationCapacity("LPA");
router.push({
@@ -239,8 +241,8 @@ const TopThree = (props) => {
state: "edit",
created:
showTopThreeArr[key]
- .repfile_name,
- },
+ .repfile_name
+ }
});
}}
>
@@ -294,7 +296,7 @@ const TopThree = (props) => {
showTopThreeArr[key].representationType +
'")].value_cy',
json: transLookup,
- eval: true,
+ eval: true
})
: showTopThreeArr[key].representationType || ""}
@@ -312,27 +314,27 @@ const TopThree = (props) => {
.representationCapacity +
'" )].value_cy',
json: transLookup,
- eval: true,
+ eval: true
})
: jsonpath({
- path:
- '$..[?(@ && @.value_cy=="' +
- showTopThreeArr[key]
- .representationCapacity +
- '")].value',
- json: transLookup,
- eval: true,
- }).length > 0
- ? jsonpath({
- path:
- '$..[?(@ && @.value_cy=="' +
- showTopThreeArr[key]
- .representationCapacity +
- '")].value',
- json: transLookup,
- eval: true,
- })
- : showTopThreeArr[key].representationCapacity}
+ path:
+ '$..[?(@ && @.value_cy=="' +
+ showTopThreeArr[key]
+ .representationCapacity +
+ '")].value',
+ json: transLookup,
+ eval: true
+ }).length > 0
+ ? jsonpath({
+ path:
+ '$..[?(@ && @.value_cy=="' +
+ showTopThreeArr[key]
+ .representationCapacity +
+ '")].value',
+ json: transLookup,
+ eval: true
+ })
+ : showTopThreeArr[key].representationCapacity}
{t("myportal:date-raised")}:
@@ -352,7 +354,7 @@ const TopThree = (props) => {
] +
'")].value_cy',
json: transLookup,
- eval: true,
+ eval: true
})
: showTopThreeArr[key][
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
@@ -400,7 +402,7 @@ const TopThree = (props) => {
const mapStateToProps = (state) => {
return {
// currentView: state.currentView,
- accountDetails: state.accountDetails,
+ accountDetails: state.accountDetails
// search: state.search,
// searchResultsObj: state.searchResultsObj,
};
@@ -431,7 +433,7 @@ const mapDispatchToProps = (dispatch) => {
},
setRepresentationCapacity: (representationCapacity) => {
dispatch(setRepresentationCapacity(representationCapacity));
- },
+ }
};
};
diff --git a/components/utils/index.js b/components/utils/index.js
index 4e3f6462..151c97ba 100644
--- a/components/utils/index.js
+++ b/components/utils/index.js
@@ -3,10 +3,12 @@ import { v4 as uuidv4 } from "uuid";
import {
getBasicPartSavedDetails,
getBasicSearchDetails,
- getBasicSearchDetailsPaged,
+ getBasicSearchDetailsPaged
+} from "../../actions/services/searchService";
+import {
getPortalModuleDetailsProxy,
getPortalModuleDetails
-} from "../../actions";
+} from "../../actions/services/caseService";
import data from "../../data/collections.json";
import { useRouter } from "next/router";
diff --git a/lib/myportal/loadMyPortalAppealPage.js b/lib/myportal/loadMyPortalAppealPage.js
index a1d321c8..f9810fc6 100644
--- a/lib/myportal/loadMyPortalAppealPage.js
+++ b/lib/myportal/loadMyPortalAppealPage.js
@@ -2,14 +2,16 @@
import { getSession } from "next-auth/react";
import {
getAppealsTypesForNewAppeal,
+ getMandatoryFields,
+ getPickLists
+} from "../../actions/services/referenceDataService";
+import {
getAwaitingSubmissionFromBlob,
getFilesFromBlob,
- getIP,
- getMandatoryFields,
- getPickLists,
- getProgressFromBlob,
- getPersonalAccount,
-} from "../../actions";
+ getProgressFromBlob
+} from "../../actions/services/documentService";
+import { getPersonalAccount } from "../../actions/services/accountService";
+import { getIP } from "../../actions/core/logger";
import { readFormXml } from "../forms/readFormXml";
import { requireQueryParams } from "../routing/requireQueryParams";
@@ -27,7 +29,7 @@ export async function loadMyPortalAppealPage(ctx) {
const required = requireQueryParams(query, [
"appealtypes",
"apt",
- "casereference",
+ "casereference"
]);
if (!required.ok) {
return { redirect: required.redirect };
@@ -38,8 +40,8 @@ export async function loadMyPortalAppealPage(ctx) {
return {
redirect: {
destination: "/auth/signin",
- permanent: false,
- },
+ permanent: false
+ }
};
}
@@ -56,7 +58,7 @@ export async function loadMyPortalAppealPage(ctx) {
getAppealsTypesForNewAppeal(),
getMandatoryFields(query.appealtypes),
getPickLists(query.appealtypes),
- getFilesFromBlob(loggedInUserIdent, query.casereference),
+ getFilesFromBlob(loggedInUserIdent, query.casereference)
]);
const blobProgress = await getProgressFromBlob(
@@ -86,6 +88,6 @@ export async function loadMyPortalAppealPage(ctx) {
blobProgress,
accountDetails,
awaitingSubmissionFromBlob,
- xmlStr,
+ xmlStr
};
}
diff --git a/lib/newappeal/loadNewAppealPage.js b/lib/newappeal/loadNewAppealPage.js
index 786e7c43..eeb48242 100644
--- a/lib/newappeal/loadNewAppealPage.js
+++ b/lib/newappeal/loadNewAppealPage.js
@@ -2,12 +2,12 @@
import { getSession } from "next-auth/react";
import {
getAppealsTypesForNewAppeal,
- getIP,
getMandatoryFields,
- getPickLists,
- getProgressFromBlob,
- getPersonalAccount,
-} from "../../actions";
+ getPickLists
+} from "../../actions/services/referenceDataService";
+import { getProgressFromBlob } from "../../actions/services/documentService";
+import { getPersonalAccount } from "../../actions/services/accountService";
+import { getIP } from "../../actions/core/logger";
import { readFormXml } from "../forms/readFormXml";
import { requireQueryParams } from "../routing/requireQueryParams";
@@ -32,8 +32,8 @@ export async function loadNewAppealPage(ctx) {
return {
redirect: {
destination: "/auth/signin",
- permanent: false,
- },
+ permanent: false
+ }
};
}
@@ -46,7 +46,7 @@ export async function loadNewAppealPage(ctx) {
await Promise.all([
getAppealsTypesForNewAppeal(),
getMandatoryFields(query.appealtypes),
- getPickLists(query.appealtypes),
+ getPickLists(query.appealtypes)
]);
const blobProgress = await getProgressFromBlob(loggedInUserIdent, query.id);
@@ -64,6 +64,6 @@ export async function loadNewAppealPage(ctx) {
pickListData,
blobProgress,
accountDetails,
- xmlStr,
+ xmlStr
};
}