diff --git a/.prettierrc b/.prettierrc index ced81142..d67fc9a8 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,5 +1,6 @@ { "tabWidth": 4, "useTabs": false, -"quoteProps":"preserve" + "quoteProps": "preserve", + "trailingComma": "none" } \ No newline at end of file diff --git a/components/case/summary.js b/components/case/summary.js index 83605ce4..94ebe0d6 100644 --- a/components/case/summary.js +++ b/components/case/summary.js @@ -16,17 +16,17 @@ import { getLinkedCases, getPortalModuleDetailsProxy, getWatchedCasesProxy, - setCaseInvolvment, + setCaseInvolvment } from "../../actions"; import { setCurrentLinkedCases, setCurrentReference, - setCurrentView, + setCurrentView } from "../../store/currentView/action"; import { setWatchedCases, - setWatchedCasesDetails, + setWatchedCasesDetails } from "../../store/watchedCases/action"; import { signIn, useSession } from "next-auth/react"; @@ -43,7 +43,7 @@ import { hasOwnPropertyAndNotNull, linkedCasesList, showRepsEnded, - getBilingualText, + getBilingualText } from "./summary/utils/helpers"; import CaseNoticeBanner from "./caseNoticeBanner"; @@ -79,13 +79,13 @@ const CaseSummary = (props) => { currentView, messagesObj, docsOffline, - ticketnumber, + ticketnumber } = props; - // const showLoginCheck = - // currentType == "directResultsObj" ? "true" : currentView.showLogin; + const showLoginCheck = + currentType == "directResultsObj" ? "true" : currentView.showLogin; - let showLoginCheck = props.showLoginCheck; + //let showLoginCheck = props.showLoginCheck; const { data: session, status } = useSession(); const [isModalOpen, setIsModalOpen] = useState(false); @@ -112,7 +112,7 @@ const CaseSummary = (props) => { let updateBody = { "pinswg_WatchedCase@odata.bind": "/incidents(" + incidentID + ")", "pinswg_Contact@odata.bind": "/contacts(" + loggedInUser + ")", - "pinswg_appealcasetype": +appealType, + "pinswg_appealcasetype": +appealType }; createWatchedCases(updateBody) @@ -133,13 +133,13 @@ const CaseSummary = (props) => { emailaddress, loggedInUser, incidentID, - appealType, + appealType ) => { let updateBody = { "pinswg_WatchedCase@odata.bind": "/incidents(" + incidentID + ")", "pinswg_Contact@odata.bind": "/contacts(" + loggedInUser + ")", "pinswg_appealcasetype": +appealType, - "pinswg_emailnotifications": true, + "pinswg_emailnotifications": true }; console.log("Email signed up"); @@ -152,9 +152,9 @@ const CaseSummary = (props) => { getDetailsProxy(data, "myWatchedCases").then( (data) => { setWatchedCasesDetails(data); - }, + } )); - }, + } ); }); }; @@ -166,7 +166,7 @@ const CaseSummary = (props) => { whichIncident + "')]", json: watchedCases, - eval: true, + eval: true }); return isWatched; @@ -180,7 +180,7 @@ const CaseSummary = (props) => { "' && @.pinswg_emailnotifications==true)]", json: watchedCases, - eval: true, + eval: true }); return isEmail; }; @@ -202,7 +202,7 @@ const CaseSummary = (props) => { let newObj = {}; return Object.assign(newObj, { "@odata.count": required.length, - "value": required, + "value": required }); }; @@ -217,7 +217,7 @@ const CaseSummary = (props) => { getDetailsProxy(data, "myWatchedCases").then( (data) => { setWatchedCasesDetails(data); - }, + } )); }); }); @@ -240,30 +240,30 @@ const CaseSummary = (props) => { ? (casesObj = jsonpath({ path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]', json: searchResultsObj, - eval: true, + eval: true })) : currentType == "watchedCases" ? (casesObj = jsonpath({ path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]', json: setCaseQueryObj, - eval: true, + eval: true })) : currentType == "myCases" ? (casesObj = jsonpath({ path: '$..[?(@ && @.pinswg_title=="' + caseReference + '")]', json: setCaseQueryObj, - eval: true, + eval: true })) : currentType == "directResultsObj" ? (casesObj = jsonpath({ path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]', json: setCaseQueryObj, - eval: true, + eval: true })) : (casesObj = jsonpath({ path: '$..[?(@ && @.reference=="' + caseReference + '")]', json: setCaseQueryObj, - eval: true, + eval: true })); casesObj = Object.assign({}, ...casesObj); @@ -274,14 +274,14 @@ const CaseSummary = (props) => { ? (detailsObj = jsonpath({ path: '$..[?(@ && @.pinswg_name=="' + caseReference + '")]', json: searchDetailsObj, - eval: true, + eval: true })) : currentType == "directResultsObj" ? (detailsObj = setCaseDetailsObj[0].value[0]) : (detailsObj = jsonpath({ path: '$..[?(@ && @.pinswg_name=="' + caseReference + '")]', jsopn: setCaseDetailsObj, - eval: true, + eval: true })); detailsObj = typeof detailsObj == "object" ? detailsObj : detailsObj[0]; @@ -308,7 +308,7 @@ const CaseSummary = (props) => { detailsObj.pinswg_anticipatedgridreferencenorthingtext || detailsObj.pinswg_anticipatedgridrefnorthing, detailsObj.pinswg_anticipatedgridreferenceeastingtext || - detailsObj.pinswg_anticipatedgridrefeasting, + detailsObj.pinswg_anticipatedgridrefeasting ); siteCoords = point.toOSGB36(); //console.log(siteCoords); @@ -319,7 +319,7 @@ const CaseSummary = (props) => { : parseFloat(siteCoords.latitude), lng: isNaN(parseFloat(siteCoords.longitude)) ? -3.437989 - : parseFloat(siteCoords.longitude), + : parseFloat(siteCoords.longitude) }; const zoom = isNaN(parseFloat(siteCoords.latitude)) ? 7 : 12; @@ -377,19 +377,19 @@ const CaseSummary = (props) => { {((hasValidKey( detailsObj, - "pinswg_anticipatedgridreferencenorthingtext", + "pinswg_anticipatedgridreferencenorthingtext" ) && hasValidKey( detailsObj, - "pinswg_anticipatedgridreferenceeastingtext", + "pinswg_anticipatedgridreferenceeastingtext" )) || (hasValidKey( detailsObj, - "pinswg_anticipatedgridrefeasting", + "pinswg_anticipatedgridrefeasting" ) && hasValidKey( detailsObj, - "pinswg_anticipatedgridrefnorthing", + "pinswg_anticipatedgridrefnorthing" ))) && (
+ {t(
+ "case:representation-date-passed-label",
+ {
+ startDate:
+ formatDates(
+ detailsObj.pinswg_startdate
),
endDate:
props
@@ -876,27 +984,27 @@ const CaseSummary = (props) => {
.appealType ==
846040019
? formatDates(
- detailsObj.pinswg_statementduedate,
+ detailsObj.pinswg_statementduedate
)
: formatDates(
- detailsObj.pinswg_finalcommentsduedate,
- ),
- },
+ detailsObj.pinswg_finalcommentsduedate
+ )
+ }
)}
{" "}
{t(
- "case:representation-date-passed-additional-label",
+ "case:representation-date-passed-additional-label"
)}{" "}
{t(
- "home:login-contact-email",
+ "home:login-contact-email"
)}