diff --git a/.env.local b/.env.local index c7577d60..26da4dca 100644 --- a/.env.local +++ b/.env.local @@ -31,7 +31,7 @@ RELAYPATH = "test-pedw-hc" //Prod Oauth WGO //CLIENT_ID = 3e4141a3-1fbd-454e-98f0-7f3a4f14a3cc -////CLIENT_SECRET = mJN7Q~lFu.xFGa5KCc.zwIm_fJAWxajyQaFo~ +//CLIENT_SECRET = mJN7Q~lFu.xFGa5KCc.zwIm_fJAWxajyQaFo~ //CLIENT_SECRET = tFk8Q~E.R-HFjROTu1sRKqwb_ONzy05uPYoF6awR //RELAY_ROOT = https://prod-pedw-ns.servicebus.windows.net/prod-pedw-hc/ //RELAYURI = "prod-pedw-ns.servicebus.windows.net" @@ -64,12 +64,12 @@ AZURE_TENANT_ID = $TENANT AZURE_CLIENT_SECRET = $CLIENT_SECRET // dev key -AZURE_STORAGE_ACCOUNT_NAME = "pedwdev" -AZURE_STORAGE_ACCOUNT_KEY = JS3ZIXianhYhB1lZrHB+bXbdzaLlON0alCyKrFAb+jVEwr9iqo2dty92EBxwnufNFM+CSN/fKX2R+AStDn0byg== -AZURE_PEDW_STORAGE_ENDPOINT = https://pedwdev.blob.core.windows.net +//AZURE_STORAGE_ACCOUNT_NAME = "pedwdev" +//AZURE_STORAGE_ACCOUNT_KEY = JS3ZIXianhYhB1lZrHB+bXbdzaLlON0alCyKrFAb+jVEwr9iqo2dty92EBxwnufNFM+CSN/fKX2R+AStDn0byg== +//AZURE_PEDW_STORAGE_ENDPOINT = https://pedwdev.blob.core.windows.net // test key -AZURE_STORAGE_ACCOUNT_NAME= "pedwtest" +AZURE_STORAGE_ACCOUNT_NAME = "pedwtest" AZURE_STORAGE_ACCOUNT_KEY = Dl8qUVEnR2mglklQorttMurmjUpe2lI3oMWl9V245U6BOLutXDwmpU36afeTrGLK+zfzNVLErsWM+AStiYsimw== AZURE_PEDW_STORAGE_ENDPOINT = https://pedwtest.blob.core.windows.net diff --git a/actions/selectQueryTypes.js b/actions/selectQueryTypes.js index f8e6681f..6060ddb3 100644 --- a/actions/selectQueryTypes.js +++ b/actions/selectQueryTypes.js @@ -7,7 +7,7 @@ export const getSelectQuery = (appealTypeName) => { return "&$select=modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddresscounty,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_procedure,pinswg_proofsofevidencewrittenstatementsofeviden,pinswg_questionnaireduedate,pinswg_startdate,statuscode,pinswg_dateexportedtoiss,pinswg_startdateofevent,pinswg_typeofevent"; break; case "pinswg_commonlands": - return "&$select=modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddresscounty,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_proofsofevidencewrittenstatementsofeviden,pinswg_questionnaireduedate,pinswg_relevantauthorityname,pinswg_startdate,statuscode,pinswg_starttimeoftheevent,pinswg_typeofevent"; + return "&$select=modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddresscounty,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_proofsofevidencewrittenstatementsofeviden,pinswg_questionnaireduedate,pinswg_relevantauthorityname,pinswg_startdate,statuscode,pinswg_starttimeoftheevent,pinswg_typeofevent,pinswg_statementsduedate"; break; case "pinswg_environmentalpermittings": return "&$select=modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddresscounty,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_proofsofevidencewrittenstatementsofeviden,pinswg_questionnaireduedate,pinswg_relevantauthorityname,pinswg_startdate,statuscode,pinswg_startdateofevent,pinswg_typeofevent"; @@ -15,13 +15,13 @@ export const getSelectQuery = (appealTypeName) => { case "pinswg_hedgeshedgerowstreepreservationreplacems": case "pinswg_miscellaneouscaseworks": case "pinswg_wayleaves": - return "&$select=modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddresscounty,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_proofsofevidencewrittenstatementsofeviden,pinswg_questionnaireduedate,pinswg_relevantauthorityname,pinswg_startdate,statuscode,pinswg_startdateoftheevent,pinswg_typeofevent"; + return "&$select=modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddresscounty,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_proofsofevidencewrittenstatementsofeviden,pinswg_questionnaireduedate,pinswg_relevantauthorityname,pinswg_startdate,statuscode,pinswg_startdateoftheevent,pinswg_typeofevent,pinswg_statementduedate"; break; case "pinswg_communityinfrastructurelevys117118119s": return "&$select=modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddresscounty,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_procedure,pinswg_startdate,statuscode,pinswg_startdateoftheevent,pinswg_typeofevent"; break; case "pinswg_compulsorypurchaseorderses": - return "&$select=modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddresscounty,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_proofsofevidencewrittenstatementsofeviden,pinswg_questionnaireduedate,pinswg_relevantauthorityname,pinswg_startdate,statuscode,pinswg_startdateoftheevent,pinswg_typeofevent"; + return "&$select=modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddresscounty,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_proofsofevidencewrittenstatementsofeviden,pinswg_questionnaireduedate,pinswg_relevantauthorityname,pinswg_startdate,statuscode,pinswg_startdateoftheevent,pinswg_typeofevent,pinswg_statementduedate"; break; case "pinswg_dnses": return "&$select=pinswg_anticipatedgridreferenceeastingtext,pinswg_anticipatedgridreferencenorthingtext,_pinswg_appellant_value,pinswg_name,pinswg_addressline1,pinswg_addressline2,pinswg_postcode,pinswg_addresstown,_pinswg_associatedlpa_value,pinswg_addresscounty,pinswg_applicationacceptedasvalid,pinswg_applicationrejectedasinvalid,pinswg_choiceofprocedure,pinswg_confirmrequesttovaryapplication,pinswg_dateeventrequested,pinswg_dateofdecision,pinswg_dateofrequesttovarytheapplication,pinswg_dateofsubmissionofapplication,pinswg_dateprojectpublishedonwebsite,pinswg_deadlineforsubmissionofapplication,pinswg_decision,pinswg_endofrepresentationperiod,pinswg_inspectorreportsubmittedtowelshgovernment,pinswg_procedureconfirmed,pinswg_projectdescription,pinswg_projectlocation,pinswg_recommendation,pinswg_rejectrequesttovaryapplication,pinswg_reportdueby,pinswg_suspensiondates,pinswg_suspensionenddates,pinswg_suspensionstartdates,pinswg_validnoticeofintentiontosubmitanapplicati,pinswg_webaddress,pinswg_withdrawndate,pinswg_writtenacceptanceofnotification,statuscode,pinswg_casestage,_pinswg_dnsids_value,pinswg_startdateofevent,pinswg_typeofevent"; @@ -63,7 +63,7 @@ export const getSelectQuery = (appealTypeName) => { return "&$select=modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatements,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode,pinswg_startdateoftheevent,pinswg_typeofevent"; break; case "pinswg_rows": - return "&$select=modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_proofsofevidencewrittenstatementsofeviden,pinswg_questionnaireduedate,pinswg_relevantauthorityname,pinswg_startdate,statuscode,pinswg_startdateoftheevent,pinswg_typeofevent"; + return "&$select=modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_proofsofevidencewrittenstatementsofeviden,pinswg_questionnaireduedate,pinswg_relevantauthorityname,pinswg_startdate,statuscode,pinswg_startdateoftheevent,pinswg_typeofevent,pinswg_statementduedate"; break; default: return ""; diff --git a/components/case/representation/index.js b/components/case/representation/index.js index ba15bca5..8b7bd708 100644 --- a/components/case/representation/index.js +++ b/components/case/representation/index.js @@ -220,6 +220,8 @@ let MakeRepresentation = (props) => { const buildRepsArr = (detailsObj) => { let buildArr = []; + console.log(currentView.caseReference.appealType); + let todaysDate = new Date(); let startDate = new Date(detailsObj.pinswg_startdate); @@ -232,6 +234,7 @@ let MakeRepresentation = (props) => { let statementDueDate = new Date(detailsObj.pinswg_statementduedate); isLPA && + currentView.caseReference.appealType != 846040019 && todaysDate >= startDate && todaysDate <= questionnaireDate && buildArr.push("Questionnaire"); @@ -240,7 +243,8 @@ let MakeRepresentation = (props) => { todaysDate <= statementDueDate && buildArr.push("Statement"); - todaysDate >= statementDueDate && + currentView.caseReference.appealType != 846040004 && + todaysDate >= statementDueDate && todaysDate <= finalCommentsDate && buildArr.push("Final comments"); @@ -920,7 +924,8 @@ let MakeRepresentation = (props) => { {" "} {formatDates( - detailsObj.pinswg_statementduedate + detailsObj.pinswg_statementduedate || + detailsObj.pinswg_statementsduedate )} diff --git a/components/case/summary.js b/components/case/summary.js index d59bb932..5f404b8a 100644 --- a/components/case/summary.js +++ b/components/case/summary.js @@ -86,6 +86,13 @@ const CaseSummary = (props) => { const cookies = parseCookies(); + const isLPA = + props.accountDetails.accountDetails[ + "pinswg_typeofinvolvement@OData.Community.Display.V1.FormattedValue" + ] == "LPA" + ? true + : false; + const selectWatchedCase = (loggedInUser, incidentID, appealType) => { let updateBody = { "pinswg_WatchedCase@odata.bind": "/incidents(" + incidentID + ")", @@ -411,10 +418,16 @@ const CaseSummary = (props) => {
- {_.has(detailsObj, "pinswg_startdate") && + {(_.has(detailsObj, "pinswg_startdate") || + _.has( + detailsObj, + "pinswg_applicationacceptedasvalid" + )) && showReps( - detailsObj.pinswg_startdate, - detailsObj.pinswg_finalcommentsduedate + detailsObj.pinswg_startdate || + detailsObj.pinswg_applicationacceptedasvalid, + detailsObj.pinswg_finalcommentsduedate || + detailsObj.pinswg_endofrepresentationperiod ) && ( <> {showRepButton( @@ -457,6 +470,12 @@ const CaseSummary = (props) => { )} + ) : !isLPA && + props.currentView + .caseReference + .appealType == + 846040004 ? ( + "" ) : ( <>
@@ -1054,20 +1073,24 @@ const CaseSummary = (props) => { } function showRepButton(appealType) { + console.log(appealType); switch (appealType) { case 846040012: case 846040013: case 846040014: - case 846040015: + //for ROW case 846040015: case 846040020: case 846040021: case 846040023: case 846040024: return false; + case 846040004: + return isLPA ? true : false; default: return true; } } + function showRepsEnded(startDate, endDate) { let date = new Date(); date = new Date(date.toDateString()); diff --git a/components/case/summaryTypes/pinswg_commonlandid.js b/components/case/summaryTypes/pinswg_commonlandid.js index 34c7e8e9..60b016d7 100644 --- a/components/case/summaryTypes/pinswg_commonlandid.js +++ b/components/case/summaryTypes/pinswg_commonlandid.js @@ -314,13 +314,13 @@ const Pinswg_commonlandid = (props) => {
{_.has( detailsObj, - "pinswg_statementduedate" + "pinswg_statementsduedate" ) ? !_.isEmpty( - detailsObj.pinswg_statementduedate + detailsObj.pinswg_statementsduedate ) ? formatDates( - detailsObj.pinswg_statementduedate + detailsObj.pinswg_statementsduedate ) : t( "case:summary-no-date-entered-label" diff --git a/pages/myportal/advancedsearchresults.js b/pages/myportal/advancedsearchresults.js index 43344cd1..962e16b7 100644 --- a/pages/myportal/advancedsearchresults.js +++ b/pages/myportal/advancedsearchresults.js @@ -29,6 +29,8 @@ import { setLoggedInUserId, } from "../../store/accountDetails/action"; import { setSearch } from "../../store/search/action"; +import { setShowReps } from "../../store/currentView/action"; + import { wrapper } from "../../store/store"; import { setWatchedCases, @@ -81,6 +83,8 @@ export const getServerSideProps = wrapper.getServerSideProps( const { cookies } = req; let loggedInUser = cookies.pinsUser; + const showLoginCheck = process.env.SHOWLOGIN || false; + let thisSession = await getSession(ctx); if (!thisSession) { @@ -109,6 +113,10 @@ export const getServerSideProps = wrapper.getServerSideProps( await getDetails(watchedCases, "myWatchedCases"), ]); + const showLoginCheck = process.env.SHOWLOGIN || false; + const showReps = process.env.SHOWREPRESENTATIONS || false; + store.dispatch(setShowReps(showReps, showLoginCheck)); + store.dispatch(setAccountDetails(accountDetails)); store.dispatch(setSearchResults(searchResultsObj)); store.dispatch(setSearchDetails(searchDetailsObj)); @@ -116,6 +124,11 @@ export const getServerSideProps = wrapper.getServerSideProps( store.dispatch(setWatchedCasesDetails(watchedCasesDetails)); store.dispatch(setSearch(Object.entries(query))); } + return { + props: { + showLoginCheck: showLoginCheck, + }, + }; } ); diff --git a/pages/myportal/case.js b/pages/myportal/case.js index 1357e395..1db5b8f4 100644 --- a/pages/myportal/case.js +++ b/pages/myportal/case.js @@ -82,6 +82,7 @@ const Home = (props) => { } showRepresentations={props.currentView.showReps} currentView={props.currentView} + showLoginCheck={props.currentView.showLogin} />