diff --git a/actions/azurestorage.js b/actions/azurestorage.js index 932e26e6..c4fe4db9 100644 --- a/actions/azurestorage.js +++ b/actions/azurestorage.js @@ -1,7 +1,7 @@ import { DefaultAzureCredential } from "@azure/identity"; import _ from "lodash"; import { hashAPIPath, consoleLogger } from "."; -import { getDocumentTypeFromFilename } from "../components/utils"; +import { getDocumentTypeFromFilename, hasOwn } from "../components/utils"; const { ContainerClient, @@ -316,7 +316,7 @@ export const createBlob = async (formContent, containerName, caseref) => { formContent = JSON.parse(formContent); let caseID = ""; - caseID = _.has(formContent, "pinswg_name") + caseID = hasOwn(formContent, "pinswg_name") ? formContent.pinswg_name : caseref; diff --git a/actions/core/env.js b/actions/core/env.js index 6966f917..68a4cd10 100644 --- a/actions/core/env.js +++ b/actions/core/env.js @@ -5,7 +5,7 @@ export const BASE_URL = ? window.apiRoot : process.env.API_ROOT || `http://localhost:${port}`; -export const API_PATH = "/api/data/v8.2/"; +export const API_PATH = "/api/data/v9.2/"; export const WEBAPI_URL = process.env.RELAY_ROOT || diff --git a/actions/core/logger.js b/actions/core/logger.js index 13d35389..ced3b23e 100644 --- a/actions/core/logger.js +++ b/actions/core/logger.js @@ -1,4 +1,4 @@ -import _ from "lodash"; +import { hasOwn } from "../../components/utils"; const MASK = "[REDACTED]"; @@ -50,44 +50,38 @@ export const consoleLogger = (err) => { redactSensitive(err) + "\n\n/////////////////////////////////////////////////\n" ); - var errStr = - "\n\n/////////////////////////////////////////////////\nServer Error " + - "\n" + - (_.has(err, "name") ? "Name: " + err.name + "\n" : "") + - (_.has(err, "code") ? "Code: " + err.code + "\n" : "") + - (_.has(err, "query") ? "Query: " + err.query + "\n" : "") + - (_.has(err, "message") ? "Message: " + err.message + "\n" : "") + - (_.has(err, "request.url") - ? "request.url: " + err.request.url + "\n" + + const errStr = + "\n\n/////////////////////////////////////////////////\nServer Error\n" + + (hasOwn(err, "name") ? `Name: ${err.name}\n` : "") + + (hasOwn(err, "code") ? `Code: ${err.code}\n` : "") + + (hasOwn(err, "query") ? `Query: ${err.query}\n` : "") + + (hasOwn(err, "message") ? `Message: ${err.message}\n` : "") + + (err?.request?.url ? `request.url: ${err.request.url}\n` : "") + + (err?.response?.status ? `Status: ${err.response.status}\n` : "") + + (err?.response?.statusText + ? `StatusText: ${err.response.statusText}\n` : "") + - (_.has(err, "response.status") ? "Status: " + err.code + "\n" : "") + - (_.has(err, "response.statusText") - ? "\nStatusText: " + err.response.status + "\n" + (err?.response?.request?.socket?.remoteAddress + ? `Request IP: ${err.response.request.socket.remoteAddress}\n` : "") + - (_.has(err, "response.request.socket.remoteAddress") - ? "\nRequest IP: " + - err.response.request.socket.remoteAddress + - "\n" + (err?.response?.data?.error?.message + ? `Message: ${redactSensitive(err.response.data.error.message)}\n` : "") + - (_.has(err, "response.data.error.message") - ? "\nMessage: " + - redactSensitive(err.response.data.error.message) + - "\n" + (err?.response?.config?.url + ? `Request URL: ${redactSensitive(err.response.config.url)}\n` : "") + - (_.has(err, "response.config.url") - ? "\nRequest URL: " + redactSensitive(err.config.url) + "\n" + (err?.response?.headers?.date + ? `Request Time: ${err.response.headers.date}\n` : "") + - (_.has(err, "response.headers.date") - ? "\nRequest Time: " + err.response.headers.date + "\n" + (err?.config?.url + ? `Axios config url: ${redactSensitive(err.config.url)}\n` : "") + - (_.has(err, "config.url") - ? "\nAxios config url: " + redactSensitive(err.config.url) + "\n" + (err?.message + ? `Axios message: ${redactSensitive(err.message)}\n` : "") + - (_.has(err, "config.url") - ? "\nAxios message url: " + redactSensitive(err.message) + "\n" - : "") + - (_.has(err, "config.data") - ? "\nRequest payload: " + redactSensitive(err.config.data) + "\n" + (err?.config?.data + ? `Request payload: ${redactSensitive(err.config.data)}\n` : "") + "\n/////////////////////////////////////////////////\n"; diff --git a/components/addresssearchresults.js b/components/addresssearchresults.js index c4f4a8b2..76cde7e8 100644 --- a/components/addresssearchresults.js +++ b/components/addresssearchresults.js @@ -3,6 +3,7 @@ import Link from "next/link"; import { useRouter } from "next/router"; import CRMError from "./crmError"; import SearchResults from "./search/addresssearchresults"; +import { hasOwn } from "./utils"; export default function Search(props) { const { @@ -12,14 +13,14 @@ export default function Search(props) { myportal, watchedCases, isLinkedCase, - showLoginCheck, + showLoginCheck } = props; let { t } = useTranslation(); const router = useRouter(); const { locale } = router; - var hasError = _.has(searchResultsObj.searchResultsObj, "errorCode") + var hasError = hasOwn(searchResultsObj.searchResultsObj, "errorCode") ? true : false; diff --git a/components/admin/tabs/appeals.js b/components/admin/tabs/appeals.js index 2fb81863..d7fd0c3b 100644 --- a/components/admin/tabs/appeals.js +++ b/components/admin/tabs/appeals.js @@ -12,7 +12,7 @@ import { setSearchDetails } from "../../../store/searchOutput/action"; -import { getDetailsProxy, getSearchDetailsPaged } from "../../utils"; +import { getDetailsProxy, getSearchDetailsPaged, hasOwn } from "../../utils"; import { getAdvancedSearchPaged } from "../../../actions/services/searchService"; import { getNewAppealsPage } from "../../../actions/services/adminService"; import { @@ -306,7 +306,7 @@ function AppealsTab(props) { )} : - {_.has( + {hasOwn( detailsObj, "pinswg_projectlocation" ) @@ -325,7 +325,7 @@ function AppealsTab(props) { )[0] : "" : ""} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddressline1" ) @@ -335,52 +335,52 @@ function AppealsTab(props) { {/* {detailsObj.pinswg_siteaddressline1 != null &&
} */} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddressline1" ) && detailsObj.pinswg_siteaddressline1 != null &&
} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddressline1" ) ? detailsObj.pinswg_siteaddressline2 : ""} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddressline2" ) && detailsObj.pinswg_siteaddressline2 != null &&
} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddresstown" ) ? detailsObj.pinswg_siteaddresstown : ""} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddresstown" ) && detailsObj.pinswg_siteaddresstown != null &&
} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddresscounty" ) ? detailsObj.pinswg_siteaddresscounty : ""} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddresscounty" ) && detailsObj.pinswg_siteaddresscounty != null &&
} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddresspostcode" ) @@ -398,7 +398,7 @@ function AppealsTab(props) { ? item.pinswg_appellantfirstname + " " + item.pinswg_appellantlastname - : _.has(detailsObj, [ + : hasOwn(detailsObj, [ "_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue" ]) ? detailsObj[ @@ -413,7 +413,7 @@ function AppealsTab(props) { )} : - {_.has(item, [ + {hasOwn(item, [ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ]) ? router.locale == "cy" diff --git a/components/admin/tabs/documents.js b/components/admin/tabs/documents.js index 007bec94..122b194f 100644 --- a/components/admin/tabs/documents.js +++ b/components/admin/tabs/documents.js @@ -5,7 +5,7 @@ import { useRouter } from "next/router"; import { useCallback, useEffect, useRef, useState } from "react"; import { connect } from "react-redux"; import transLookup from "../../../data/lookuptranslations.json"; -import { formatDates, getDocLink } from "../../utils"; +import { formatDates, getDocLink, hasOwn } from "../../utils"; import PaginationControl from "../../../components/case/pagination"; import DocumentLink from "../../utils/downloads"; import { useDownloadQueue } from "../../utils/downloadmanager"; @@ -754,7 +754,7 @@ const DocumentsTab = (props) => { // )} // : // - // {_.has( + // {hasOwn( // detailsObj, // "pinswg_name" // ) @@ -789,7 +789,7 @@ const DocumentsTab = (props) => { )} : - {_.has( + {hasOwn( detailsObj, "pinswg_name" ) @@ -805,7 +805,7 @@ const DocumentsTab = (props) => { )} : - {_.has( + {hasOwn( detailsObj, "pinswg_name" ) @@ -848,7 +848,7 @@ const DocumentsTab = (props) => { : - {_.has( + {hasOwn( detailsObj, "createdon" ) diff --git a/components/case/documents.js b/components/case/documents.js index 29325ada..d52d2036 100644 --- a/components/case/documents.js +++ b/components/case/documents.js @@ -5,7 +5,7 @@ import { useRouter } from "next/router"; import { useCallback, useEffect, useRef, useState } from "react"; import { connect } from "react-redux"; import transLookup from "../../data/lookuptranslations.json"; -import { formatDates, getDocLink } from "../utils"; +import { formatDates, getDocLink, hasOwn } from "../utils"; import PaginationControl from "./pagination"; import { sendGAEvent } from "@next/third-parties/google"; @@ -349,7 +349,7 @@ const DocumentDetails = (props) => { )} : - {_.has( + {hasOwn( detailsObj, "pinswg_name" ) @@ -364,7 +364,7 @@ const DocumentDetails = (props) => { )} : - {_.has( + {hasOwn( detailsObj, "pinswg_name" ) @@ -405,7 +405,7 @@ const DocumentDetails = (props) => { : - {_.has( + {hasOwn( detailsObj, "pinswg_latestpublisheddate" ) @@ -785,7 +785,7 @@ const DocumentDetails = (props) => { )} : - {_.has( + {hasOwn( detailsObj, "pinswg_name" ) @@ -801,7 +801,7 @@ const DocumentDetails = (props) => { )} : - {_.has( + {hasOwn( detailsObj, "pinswg_name" ) @@ -844,7 +844,7 @@ const DocumentDetails = (props) => { : - {_.has( + {hasOwn( detailsObj, "pinswg_latestpublisheddate" ) diff --git a/components/case/representation/representationCompleteSubmit.js b/components/case/representation/representationCompleteSubmit.js index 67011a7e..6e024bf3 100644 --- a/components/case/representation/representationCompleteSubmit.js +++ b/components/case/representation/representationCompleteSubmit.js @@ -1,4 +1,3 @@ -import _ from "lodash"; import useTranslation from "next-translate/useTranslation"; import { useRouter } from "next/router"; import { useState } from "react"; @@ -13,6 +12,7 @@ import { bytesToSize, getThumbnailIconByExtension, formatDates, + hasOwn, updateLinks, getDocLink } from "../../utils"; @@ -399,7 +399,7 @@ const RepCompleteSubmit = (props) => { */} - {_.has( + {hasOwn( repFormData, "representationOnBehalfOf" ) && ( diff --git a/components/case/representation/representationDetails.js b/components/case/representation/representationDetails.js index a3931833..66e1dda7 100644 --- a/components/case/representation/representationDetails.js +++ b/components/case/representation/representationDetails.js @@ -1,6 +1,7 @@ import { JSONPath as jsonpath } from "jsonpath-plus"; import useTranslation from "next-translate/useTranslation"; import { useRouter } from "next/router"; +import { hasOwn } from "../../utils"; const RepDetails = (props) => { let { t } = useTranslation(); @@ -17,8 +18,8 @@ const RepDetails = (props) => { ? props.myRepresentations.myRepresentations : props.searchResultsObj.searchDetailsObj : props.currentType == "watchedCases" - ? props.props.props.props.watchedCases.watchedCasesDetails - : props.props.props.searchResultsObj.searchDetailsObj; + ? props.props.props.props.watchedCases.watchedCasesDetails + : props.props.props.searchResultsObj.searchDetailsObj; var detailsObj = {}; @@ -31,7 +32,7 @@ const RepDetails = (props) => { detailsObj = jsonpath({ path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]', json: setCaseDetailsObj, - eval: true, + eval: true }); detailsObj = detailsObj[0]; @@ -61,34 +62,43 @@ const RepDetails = (props) => { {t("case:summary-site-address-label")}
- {_.has(detailsObj, "pinswg_siteaddressline1") + {hasOwn(detailsObj, "pinswg_siteaddressline1") ? detailsObj.pinswg_siteaddressline1 : ""} - {_.has(detailsObj, "pinswg_siteaddressline1") && + {hasOwn( + detailsObj, + "pinswg_siteaddressline1" + ) && detailsObj.pinswg_siteaddressline1 != null &&
} - {_.has(detailsObj, "pinswg_siteaddressline2") + {hasOwn(detailsObj, "pinswg_siteaddressline2") ? detailsObj.pinswg_siteaddressline2 : ""} - {_.has(detailsObj, "pinswg_siteaddressline2") && + {hasOwn( + detailsObj, + "pinswg_siteaddressline2" + ) && detailsObj.pinswg_siteaddressline2 != null &&
} - {_.has(detailsObj, "pinswg_siteaddresstown") + {hasOwn(detailsObj, "pinswg_siteaddresstown") ? detailsObj.pinswg_siteaddresstown : ""} - {_.has(detailsObj, "pinswg_siteaddresstown") && + {hasOwn(detailsObj, "pinswg_siteaddresstown") && detailsObj.pinswg_siteaddresstown != null &&
} - {_.has(detailsObj, "pinswg_siteaddresscounty") + {hasOwn(detailsObj, "pinswg_siteaddresscounty") ? detailsObj.pinswg_siteaddresscounty : ""} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddresscounty" ) && detailsObj.pinswg_siteaddresscounty != null &&
} - {_.has(detailsObj, "pinswg_siteaddresspostcode") + {hasOwn( + detailsObj, + "pinswg_siteaddresspostcode" + ) ? detailsObj.pinswg_siteaddresspostcode : ""}
diff --git a/components/case/representation/representationLPADetails.js b/components/case/representation/representationLPADetails.js index 1015f95e..b686eaea 100644 --- a/components/case/representation/representationLPADetails.js +++ b/components/case/representation/representationLPADetails.js @@ -1,6 +1,7 @@ import { JSONPath as jsonpath } from "jsonpath-plus"; import useTranslation from "next-translate/useTranslation"; import { useRouter } from "next/router"; +import { hasOwn } from "../../utils"; const RepLPADetails = (props) => { let { t } = useTranslation(); @@ -15,15 +16,15 @@ const RepLPADetails = (props) => { ? props.props.myRepresentations.myRepresentations : props.searchResultsObj.searchDetailsObj : props.currentType == "watchedCases" - ? props.props.props.watchedCases.watchedCasesDetails - : props.props.searchResultsObj.searchDetailsObj; + ? props.props.props.watchedCases.watchedCasesDetails + : props.props.searchResultsObj.searchDetailsObj; var detailsObj = {}; detailsObj = jsonpath({ path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]', json: setCaseDetailsObj, - eval: true, + eval: true }); detailsObj = detailsObj[0]; @@ -51,34 +52,43 @@ const RepLPADetails = (props) => { {t("case:summary-site-address-label")}
- {_.has(detailsObj, "pinswg_siteaddressline1") + {hasOwn(detailsObj, "pinswg_siteaddressline1") ? detailsObj.pinswg_siteaddressline1 : ""} - {_.has(detailsObj, "pinswg_siteaddressline1") && + {hasOwn( + detailsObj, + "pinswg_siteaddressline1" + ) && detailsObj.pinswg_siteaddressline1 != null &&
} - {_.has(detailsObj, "pinswg_siteaddressline2") + {hasOwn(detailsObj, "pinswg_siteaddressline2") ? detailsObj.pinswg_siteaddressline2 : ""} - {_.has(detailsObj, "pinswg_siteaddressline2") && + {hasOwn( + detailsObj, + "pinswg_siteaddressline2" + ) && detailsObj.pinswg_siteaddressline2 != null &&
} - {_.has(detailsObj, "pinswg_siteaddresstown") + {hasOwn(detailsObj, "pinswg_siteaddresstown") ? detailsObj.pinswg_siteaddresstown : ""} - {_.has(detailsObj, "pinswg_siteaddresstown") && + {hasOwn(detailsObj, "pinswg_siteaddresstown") && detailsObj.pinswg_siteaddresstown != null &&
} - {_.has(detailsObj, "pinswg_siteaddresscounty") + {hasOwn(detailsObj, "pinswg_siteaddresscounty") ? detailsObj.pinswg_siteaddresscounty : ""} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddresscounty" ) && detailsObj.pinswg_siteaddresscounty != null &&
} - {_.has(detailsObj, "pinswg_siteaddresspostcode") + {hasOwn( + detailsObj, + "pinswg_siteaddresspostcode" + ) ? detailsObj.pinswg_siteaddresspostcode : ""}
diff --git a/components/case/representation/representationQuestionnairesCheck/representationLPAQuestionnaireCheck_s78.js b/components/case/representation/representationQuestionnairesCheck/representationLPAQuestionnaireCheck_s78.js index ad949d1f..0a274c29 100644 --- a/components/case/representation/representationQuestionnairesCheck/representationLPAQuestionnaireCheck_s78.js +++ b/components/case/representation/representationQuestionnairesCheck/representationLPAQuestionnaireCheck_s78.js @@ -1,6 +1,5 @@ -import _ from "lodash"; import useTranslation from "next-translate/useTranslation"; -import { formatDates, updateLinks } from "../../../utils"; +import { formatDates, hasOwn, updateLinks } from "../../../utils"; let RepLPAQuestionnaireCheck_s78 = (props) => { let { t } = useTranslation(); @@ -11,7 +10,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => { showQuestionnaireSection, setShowQuestionnaireSection, setRepresentationSubmit, - questionnaireCount, + questionnaireCount } = props; let repFormData = formObj.representationForm.values; @@ -22,7 +21,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => { <> {showQuestionnaireSection} - {_.has(repFormData, "procedureType") && ( + {hasOwn(repFormData, "procedureType") && ( <>
@@ -84,7 +83,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => { )} )} - {_.has(repFormData, "enterToView") && ( + {hasOwn(repFormData, "enterToView") && ( <>
@@ -117,7 +116,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
)} - {_.has(repFormData, "enterNeighbouringLandToViewSite") && ( + {hasOwn(repFormData, "enterNeighbouringLandToViewSite") && ( <>
@@ -160,7 +159,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
@@ -187,7 +186,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => { )} )} - {_.has(repFormData, "enterNeighbouringLandAccessRequired") && ( + {hasOwn(repFormData, "enterNeighbouringLandAccessRequired") && ( <>
@@ -231,7 +230,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
@@ -258,7 +257,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => { )} )} - {_.has(repFormData, "healthAndSafetyIssues") && ( + {hasOwn(repFormData, "healthAndSafetyIssues") && ( <>
@@ -301,7 +300,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
@@ -337,11 +336,11 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
- {_.has(repFormData, "LPAcontactDetails") ? ( + {hasOwn(repFormData, "LPAcontactDetails") ? (
) : ( @@ -378,11 +377,11 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
- {_.has(repFormData, "LPAcaseFileAndReps") ? ( + {hasOwn(repFormData, "LPAcaseFileAndReps") ? (
) : ( @@ -419,11 +418,11 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
- {_.has(repFormData, "LPAldpAndMap") ? ( + {hasOwn(repFormData, "LPAldpAndMap") ? (
) : ( @@ -460,11 +459,11 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
- {_.has(repFormData, "LPAlocalGuidance") ? ( + {hasOwn(repFormData, "LPAlocalGuidance") ? (
) : ( @@ -493,7 +492,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
- {_.has(repFormData, "LPAintentionToSubmitFullStatement") && ( + {hasOwn(repFormData, "LPAintentionToSubmitFullStatement") && ( <>
@@ -526,7 +525,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
)} - {_.has(repFormData, "AONB") && ( + {hasOwn(repFormData, "AONB") && ( <>
@@ -558,7 +557,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
)} - {_.has(repFormData, "ROW") && ( + {hasOwn(repFormData, "ROW") && ( <>
@@ -600,7 +599,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
@@ -627,7 +626,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => { )} )} - {_.has(repFormData, "conservationArea") && ( + {hasOwn(repFormData, "conservationArea") && ( <>
@@ -670,7 +669,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
@@ -697,7 +696,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => { )} )} - {_.has(repFormData, "affectListedBuilding") && ( + {hasOwn(repFormData, "affectListedBuilding") && ( <>
@@ -740,7 +739,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
@@ -767,7 +766,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => { )} )} - {_.has(repFormData, "TPO") && ( + {hasOwn(repFormData, "TPO") && ( <>
@@ -810,7 +809,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
@@ -837,7 +836,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => { )} )} - {_.has(repFormData, "natureConservationSite") && ( + {hasOwn(repFormData, "natureConservationSite") && ( <>
@@ -880,7 +879,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
@@ -907,7 +906,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => { )} )} - {_.has(repFormData, "protectedSpecies") && ( + {hasOwn(repFormData, "protectedSpecies") && ( <>
@@ -950,7 +949,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
@@ -977,7 +976,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => { )} )} - {_.has(repFormData, "gypsyTravellerInvolvment") && ( + {hasOwn(repFormData, "gypsyTravellerInvolvment") && ( <>
@@ -1010,7 +1009,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
)} - {_.has(repFormData, "governmentDepartmentComments") && ( + {hasOwn(repFormData, "governmentDepartmentComments") && ( <>
@@ -1053,7 +1052,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
@@ -1080,7 +1079,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => { )} )} - {_.has(repFormData, "developmentNotBeginLaterThanFiveYears") && ( + {hasOwn(repFormData, "developmentNotBeginLaterThanFiveYears") && ( <>
@@ -1113,7 +1112,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
)} - {_.has(repFormData, "developmentCarriedOutInAccordance") && ( + {hasOwn(repFormData, "developmentCarriedOutInAccordance") && ( <>
@@ -1156,7 +1155,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
@@ -1183,7 +1182,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => { )} )} - {_.has(repFormData, "developmentNotTakePlaceBiodiversity") && ( + {hasOwn(repFormData, "developmentNotTakePlaceBiodiversity") && ( <>
@@ -1216,7 +1215,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
)} - {_.has(repFormData, "developmentNotTakePlaceBroadband") && ( + {hasOwn(repFormData, "developmentNotTakePlaceBroadband") && ( <>
@@ -1259,7 +1258,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
@@ -1286,7 +1285,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => { )} )} - {_.has(repFormData, "developmentAnyOtherConditions") && ( + {hasOwn(repFormData, "developmentAnyOtherConditions") && ( <>
@@ -1329,7 +1328,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
@@ -1356,7 +1355,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => { )} )} - {_.has(repFormData, "copyOfApplicantsCertificate") && ( + {hasOwn(repFormData, "copyOfApplicantsCertificate") && ( <>
@@ -1399,7 +1398,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
@@ -1426,7 +1425,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => { )} )} - {_.has(repFormData, "advertismentGiven") && ( + {hasOwn(repFormData, "advertismentGiven") && ( <>
@@ -1469,7 +1468,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
@@ -1496,7 +1495,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => { )} )} - {_.has(repFormData, "copyOfLetterOfAppealNotification") && ( + {hasOwn(repFormData, "copyOfLetterOfAppealNotification") && ( <>
@@ -1539,7 +1538,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
@@ -1566,7 +1565,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => { )} )} - {_.has(repFormData, "lpaEIAOS") && ( + {hasOwn(repFormData, "lpaEIAOS") && ( <>
@@ -1609,7 +1608,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
@@ -1636,7 +1635,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => { )} )} - {_.has(repFormData, "advertismentConsentDiscontinuanceNotice") && ( + {hasOwn(repFormData, "advertismentConsentDiscontinuanceNotice") && ( <>
@@ -1681,7 +1680,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
@@ -1708,7 +1707,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => { )} )} - {_.has(repFormData, "detailsOfOtherAppeals") && ( + {hasOwn(repFormData, "detailsOfOtherAppeals") && ( <>
@@ -1751,7 +1750,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
@@ -1778,7 +1777,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => { )} )} - {_.has(repFormData, "detailsOfPreviousAppeals") && ( + {hasOwn(repFormData, "detailsOfPreviousAppeals") && ( <>
@@ -1821,7 +1820,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
@@ -1848,7 +1847,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => { )} )} - {_.has(repFormData, "otherRelevantInformation") && ( + {hasOwn(repFormData, "otherRelevantInformation") && ( <>
@@ -1891,7 +1890,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
@@ -1918,7 +1917,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => { )} )} - {_.has(repFormData, "signedDate") && ( + {hasOwn(repFormData, "signedDate") && ( <>
@@ -1950,7 +1949,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
)} - {_.has(repFormData, "caseOfficer") && ( + {hasOwn(repFormData, "caseOfficer") && ( <>
@@ -1983,7 +1982,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
)} - {_.has(repFormData, "onBehalfOfLPA") && ( + {hasOwn(repFormData, "onBehalfOfLPA") && ( <>
diff --git a/components/case/summary.js b/components/case/summary.js index 56622557..f79b3a93 100644 --- a/components/case/summary.js +++ b/components/case/summary.js @@ -32,7 +32,7 @@ import { import { signIn, useSession } from "next-auth/react"; import { destroyCookie, parseCookies, setCookie } from "nookies"; -import { getFormCollectionByID, getDetailsProxy } from "../utils"; +import { getFormCollectionByID, getDetailsProxy, hasOwn } from "../utils"; import { getLivePublishedEvent, isEventLiveNow @@ -639,7 +639,7 @@ const CaseSummary = (props) => {
{detailsObj.pinswg_agentcontactname != null && - (_.has( + (hasOwn( detailsObj, "pinswg_agentcontactname" ) ? ( @@ -650,7 +650,7 @@ const CaseSummary = (props) => { )}
- {_.has( + {hasOwn( detailsObj, "pinswg_agentcontactname" ) @@ -694,103 +694,103 @@ const CaseSummary = (props) => { )[0] : "" : ""} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddressline1" ) ? detailsObj.pinswg_siteaddressline1 : ""} - {_.has( + {hasOwn( detailsObj, "pinswg_addressline1" ) ? detailsObj.pinswg_addressline1 : ""} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddressline1" ) && detailsObj.pinswg_siteaddressline1 != null &&
} - {_.has( + {hasOwn( detailsObj, "pinswg_addressline1" ) && detailsObj.pinswg_addressline1 != null &&
} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddressline2" ) ? detailsObj.pinswg_siteaddressline2 : ""} - {_.has( + {hasOwn( detailsObj, "pinswg_addressline2" ) ? detailsObj.pinswg_addressline2 : ""} - {_.has( + {hasOwn( detailsObj, "pinswg_addressline2" ) && detailsObj.pinswg_addressline2 != null &&
} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddresstown" ) ? detailsObj.pinswg_siteaddresstown : ""} - {_.has( + {hasOwn( detailsObj, "pinswg_addresstown" ) ? detailsObj.pinswg_addresstown : ""} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddresstown" ) && detailsObj.pinswg_siteaddresstown != null &&
} - {_.has( + {hasOwn( detailsObj, "pinswg_addresstown" ) && detailsObj.pinswg_addresstown != null &&
} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddresscounty" ) ? detailsObj.pinswg_siteaddresscounty : ""} - {_.has( + {hasOwn( detailsObj, "pinswg_addresscounty" ) ? detailsObj.pinswg_addresscounty : ""} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddresscounty" ) && detailsObj.pinswg_siteaddresscounty != null &&
} - {_.has( + {hasOwn( detailsObj, "pinswg_addresscounty" ) && detailsObj.pinswg_addresscounty != null &&
} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddresspostcode" ) ? detailsObj.pinswg_siteaddresspostcode : ""} - {_.has( + {hasOwn( detailsObj, "pinswg_postcode" ) @@ -1444,7 +1444,7 @@ const CaseSummary = (props) => {
- {_.has( + {hasOwn( detailsObj, "pinswg_startdate" ) && @@ -1577,103 +1577,103 @@ const CaseSummary = (props) => { )[0] : "" : ""} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddressline1" ) ? detailsObj.pinswg_siteaddressline1 : ""} - {_.has( + {hasOwn( detailsObj, "pinswg_addressline1" ) ? detailsObj.pinswg_addressline1 : ""} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddressline1" ) && detailsObj.pinswg_siteaddressline1 != null &&
} - {_.has( + {hasOwn( detailsObj, "pinswg_addressline1" ) && detailsObj.pinswg_addressline1 != null &&
} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddressline2" ) ? detailsObj.pinswg_siteaddressline2 : ""} - {_.has( + {hasOwn( detailsObj, "pinswg_addressline2" ) ? detailsObj.pinswg_addressline2 : ""} - {_.has( + {hasOwn( detailsObj, "pinswg_addressline2" ) && detailsObj.pinswg_addressline2 != null &&
} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddresstown" ) ? detailsObj.pinswg_siteaddresstown : ""} - {_.has( + {hasOwn( detailsObj, "pinswg_addresstown" ) ? detailsObj.pinswg_addresstown : ""} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddresstown" ) && detailsObj.pinswg_siteaddresstown != null &&
} - {_.has( + {hasOwn( detailsObj, "pinswg_addresstown" ) && detailsObj.pinswg_addresstown != null &&
} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddresscounty" ) ? detailsObj.pinswg_siteaddresscounty : ""} - {_.has( + {hasOwn( detailsObj, "pinswg_addresscounty" ) ? detailsObj.pinswg_addresscounty : ""} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddresscounty" ) && detailsObj.pinswg_siteaddresscounty != null &&
} - {_.has( + {hasOwn( detailsObj, "pinswg_addresscounty" ) && detailsObj.pinswg_addresscounty != null &&
} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddresspostcode" ) ? detailsObj.pinswg_siteaddresspostcode : ""} - {_.has( + {hasOwn( detailsObj, "pinswg_postcode" ) @@ -1710,7 +1710,7 @@ const CaseSummary = (props) => { Screening start date {" "}
- {_.has( + {hasOwn( detailsObj, "pinswg_screeningstartdate" ) @@ -1733,7 +1733,7 @@ const CaseSummary = (props) => { EIA target date {" "}
- {_.has( + {hasOwn( detailsObj, "pinswg_eiatargetdate" ) @@ -1761,7 +1761,7 @@ const CaseSummary = (props) => { Target Extended {" "}
- {_.has( + {hasOwn( detailsObj, "pinswg_targetextended" ) @@ -1786,7 +1786,7 @@ const CaseSummary = (props) => { Date {" "}
- {_.has( + {hasOwn( detailsObj, "pinswg_directionissueddate" ) @@ -1816,7 +1816,7 @@ const CaseSummary = (props) => { )}
- {_.has( + {hasOwn( detailsObj, "pinswg_eiarequired" ) @@ -1852,7 +1852,7 @@ const CaseSummary = (props) => { Scoping Start Date {" "}
- {_.has( + {hasOwn( detailsObj, "pinswg_scopingstartdate" ) @@ -1875,7 +1875,7 @@ const CaseSummary = (props) => { Scoping Target Date {" "}
- {_.has( + {hasOwn( detailsObj, "pinswg_scopingtargetdate" ) @@ -1903,7 +1903,7 @@ const CaseSummary = (props) => { Extended
- {_.has( + {hasOwn( detailsObj, "pinswg_scopingtargetextended" ) @@ -1928,7 +1928,7 @@ const CaseSummary = (props) => { Issued Date {" "}
- {_.has( + {hasOwn( detailsObj, "pinswg_scopingoutcomeissueddate" ) diff --git a/components/case/summaryTypes/pinswg_advertsid.js b/components/case/summaryTypes/pinswg_advertsid.js index 15f4e299..5b738251 100644 --- a/components/case/summaryTypes/pinswg_advertsid.js +++ b/components/case/summaryTypes/pinswg_advertsid.js @@ -6,6 +6,7 @@ import transLookup from "../../../data/lookuptranslations.json"; import SummaryCard from "../summary/components/SummaryCard"; import SummaryRow from "../summary/components/SummaryRow"; import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue"; +import { hasOwn } from "../../utils"; const Pinswg_advertsid = (props) => { let { t } = useTranslation(); @@ -192,7 +193,7 @@ const Pinswg_advertsid = (props) => { {t("case:summary-case-link-status-label")}
- {_.has(casesObj, ["numberofchildincidents"]) + {hasOwn(casesObj, ["numberofchildincidents"]) ? casesObj.numberofchildincidents > 0 ? t( "case:summary-case-link-status-linked" @@ -231,7 +232,7 @@ const Pinswg_advertsid = (props) => { { : t( "case:summary-no-date-entered-label" ) - : _.has(detailsObj, "pinswg_startdates") + : hasOwn(detailsObj, "pinswg_startdates") ? !_.isEmpty(detailsObj.pinswg_startdates) ? formatDates( detailsObj.pinswg_startdates @@ -256,7 +257,7 @@ const Pinswg_advertsid = (props) => { "case:summary-questionnaire-due-date-label" )} value={ - _.has(detailsObj, "pinswg_questionnaireduedate") + hasOwn(detailsObj, "pinswg_questionnaireduedate") ? !_.isEmpty( detailsObj.pinswg_questionnaireduedate ) @@ -275,7 +276,7 @@ const Pinswg_advertsid = (props) => { "case:summary-interested-party-date-label" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_otherpartiesstatement" ) @@ -288,7 +289,7 @@ const Pinswg_advertsid = (props) => { : t( "case:summary-no-date-entered-label" ) - : _.has( + : hasOwn( detailsObj, "pinswg_otherpartiesstatements" ) @@ -308,7 +309,7 @@ const Pinswg_advertsid = (props) => { { { { let { t } = useTranslation(); @@ -170,7 +171,7 @@ const Pinswg_callinss77id = (props) => { {t("case:summary-case-link-status-label")}
- {_.has(casesObj, ["numberofchildincidents"]) + {hasOwn(casesObj, ["numberofchildincidents"]) ? casesObj.numberofchildincidents > 0 ? t( "case:summary-case-link-status-linked" @@ -209,7 +210,7 @@ const Pinswg_callinss77id = (props) => { { : t( "case:summary-no-date-entered-label" ) - : _.has(detailsObj, "pinswg_startdates") + : hasOwn(detailsObj, "pinswg_startdates") ? !_.isEmpty(detailsObj.pinswg_startdates) ? formatDates( detailsObj.pinswg_startdates @@ -233,7 +234,7 @@ const Pinswg_callinss77id = (props) => { "case:summary-questionnaire-due-date-label" )} value={ - _.has(detailsObj, "pinswg_questionnaireduedate") + hasOwn(detailsObj, "pinswg_questionnaireduedate") ? !_.isEmpty( detailsObj.pinswg_questionnaireduedate ) @@ -253,7 +254,7 @@ const Pinswg_callinss77id = (props) => { )}
- {_.has( + {hasOwn( detailsObj, "pinswg_dateexportedtoiss" ) @@ -275,7 +276,7 @@ const Pinswg_callinss77id = (props) => { { "case:summary-interested-party-date-label" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_otherpartiesstatement" ) @@ -306,7 +307,7 @@ const Pinswg_callinss77id = (props) => { : t( "case:summary-no-date-entered-label" ) - : _.has( + : hasOwn( detailsObj, "pinswg_otherpartiesstatements" ) @@ -327,7 +328,7 @@ const Pinswg_callinss77id = (props) => { "case:summary-applicant-final-comments-date-label" )} value={ - _.has(detailsObj, "pinswg_finalcommentsduedate") + hasOwn(detailsObj, "pinswg_finalcommentsduedate") ? !_.isEmpty( detailsObj.pinswg_finalcommentsduedate ) @@ -347,7 +348,7 @@ const Pinswg_callinss77id = (props) => { )}
- {_.has( + {hasOwn( detailsObj, "pinswg_proofsofevidencewrittenstatementsofeviden" ) @@ -368,7 +369,7 @@ const Pinswg_callinss77id = (props) => { { { { let { t } = useTranslation(); @@ -170,7 +171,7 @@ const Pinswg_commonlandid = (props) => { {t("case:summary-case-link-status-label")}
- {_.has(casesObj, ["numberofchildincidents"]) + {hasOwn(casesObj, ["numberofchildincidents"]) ? casesObj.numberofchildincidents > 0 ? t( "case:summary-case-link-status-linked" @@ -234,7 +235,7 @@ const Pinswg_commonlandid = (props) => { { : t( "case:summary-no-date-entered-label" ) - : _.has(detailsObj, "pinswg_startdates") + : hasOwn(detailsObj, "pinswg_startdates") ? !_.isEmpty(detailsObj.pinswg_startdates) ? formatDates( detailsObj.pinswg_startdates @@ -259,7 +260,7 @@ const Pinswg_commonlandid = (props) => { "case:summary-questionnaire-due-date-label" )} value={ - _.has(detailsObj, "pinswg_questionnaireduedate") + hasOwn(detailsObj, "pinswg_questionnaireduedate") ? !_.isEmpty( detailsObj.pinswg_questionnaireduedate ) @@ -276,7 +277,7 @@ const Pinswg_commonlandid = (props) => { { "case:summary-interested-party-date-label" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_otherpartiesstatement" ) @@ -308,7 +309,7 @@ const Pinswg_commonlandid = (props) => { : t( "case:summary-no-date-entered-label" ) - : _.has( + : hasOwn( detailsObj, "pinswg_otherpartiesstatements" ) @@ -330,7 +331,7 @@ const Pinswg_commonlandid = (props) => { "case:summary-applicant-final-comments-date-label" )} value={ - _.has(detailsObj, "pinswg_finalcommentsduedate") + hasOwn(detailsObj, "pinswg_finalcommentsduedate") ? !_.isEmpty( detailsObj.pinswg_finalcommentsduedate ) @@ -350,7 +351,7 @@ const Pinswg_commonlandid = (props) => { )}
- {_.has( + {hasOwn( detailsObj, "pinswg_proofsofevidencewrittenstatementsofeviden" ) @@ -371,7 +372,7 @@ const Pinswg_commonlandid = (props) => { { { { let { t } = useTranslation(); @@ -170,7 +171,7 @@ const Pinswg_communityinfrastructurelevyid = (props) => { {t("case:summary-case-link-status-label")}
- {_.has(casesObj, ["numberofchildincidents"]) + {hasOwn(casesObj, ["numberofchildincidents"]) ? casesObj.numberofchildincidents > 0 ? t( "case:summary-case-link-status-linked" @@ -209,7 +210,7 @@ const Pinswg_communityinfrastructurelevyid = (props) => { { : t( "case:summary-no-date-entered-label" ) - : _.has(detailsObj, "pinswg_startdates") + : hasOwn(detailsObj, "pinswg_startdates") ? !_.isEmpty(detailsObj.pinswg_startdates) ? formatDates( detailsObj.pinswg_startdates @@ -233,7 +234,7 @@ const Pinswg_communityinfrastructurelevyid = (props) => { "case:summary-interested-party-date-label" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_otherpartiesstatement" ) @@ -246,7 +247,7 @@ const Pinswg_communityinfrastructurelevyid = (props) => { : t( "case:summary-no-date-entered-label" ) - : _.has( + : hasOwn( detailsObj, "pinswg_otherpartiesstatements" ) @@ -268,7 +269,7 @@ const Pinswg_communityinfrastructurelevyid = (props) => { "case:summary-applicant-final-comments-date-label" )} value={ - _.has(detailsObj, "pinswg_finalcommentsduedate") + hasOwn(detailsObj, "pinswg_finalcommentsduedate") ? !_.isEmpty( detailsObj.pinswg_finalcommentsduedate ) @@ -285,7 +286,7 @@ const Pinswg_communityinfrastructurelevyid = (props) => { { { { let { t } = useTranslation(); @@ -155,7 +156,9 @@ const Pinswg_compulsorypurchaseordersid = (props) => { {t("case:summary-case-link-status-label")}
- {_.has(casesObj, ["numberofchildincidents"]) + {hasOwn(casesObj, [ + "numberofchildincidents" + ]) ? casesObj.numberofchildincidents > 0 ? t( "case:summary-case-link-status-linked" @@ -219,7 +222,7 @@ const Pinswg_compulsorypurchaseordersid = (props) => { { : t( "case:summary-no-date-entered-label" ) - : _.has(detailsObj, "pinswg_startdates") + : hasOwn(detailsObj, "pinswg_startdates") ? !_.isEmpty(detailsObj.pinswg_startdates) ? formatDates( detailsObj.pinswg_startdates @@ -244,7 +247,10 @@ const Pinswg_compulsorypurchaseordersid = (props) => { "case:summary-questionnaire-due-date-label" )} value={ - _.has(detailsObj, "pinswg_questionnaireduedate") + hasOwn( + detailsObj, + "pinswg_questionnaireduedate" + ) ? !_.isEmpty( detailsObj.pinswg_questionnaireduedate ) @@ -261,7 +267,7 @@ const Pinswg_compulsorypurchaseordersid = (props) => { { "case:summary-interested-party-date-label" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_otherpartiesstatement" ) @@ -293,7 +299,7 @@ const Pinswg_compulsorypurchaseordersid = (props) => { : t( "case:summary-no-date-entered-label" ) - : _.has( + : hasOwn( detailsObj, "pinswg_otherpartiesstatements" ) @@ -315,7 +321,10 @@ const Pinswg_compulsorypurchaseordersid = (props) => { "case:summary-applicant-final-comments-date-label" )} value={ - _.has(detailsObj, "pinswg_finalcommentsduedate") + hasOwn( + detailsObj, + "pinswg_finalcommentsduedate" + ) ? !_.isEmpty( detailsObj.pinswg_finalcommentsduedate ) @@ -335,7 +344,7 @@ const Pinswg_compulsorypurchaseordersid = (props) => { )}
- {_.has( + {hasOwn( detailsObj, "pinswg_proofsofevidencewrittenstatementsofeviden" ) @@ -356,7 +365,7 @@ const Pinswg_compulsorypurchaseordersid = (props) => { { { { "case:summary-case-officer-label" )} value={ - _.has(casesObj, "_ownerid_value") + hasOwn(casesObj, "_ownerid_value") ? casesObj[ "_ownerid_value@OData.Community.Display.V1.FormattedValue" ] @@ -276,7 +277,7 @@ const Pinswg_dnsid = (props) => { "case:summary-start-event-date-label" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_startdateofevent" ) @@ -299,7 +300,7 @@ const Pinswg_dnsid = (props) => { "case:summary-event-date-label" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_dateeventrequested" ) @@ -355,7 +356,7 @@ const Pinswg_dnsid = (props) => { "case:summary-decision-date-label" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_dateofdecision" ) @@ -381,7 +382,7 @@ const Pinswg_dnsid = (props) => { )}
- {_.has(casesObj, [ + {hasOwn(casesObj, [ "numberofchildincidents" ]) ? casesObj.numberofchildincidents > @@ -447,7 +448,7 @@ const Pinswg_dnsid = (props) => { "case:summary-valid-notice-of-intention-to-submit-an-application" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_validnoticeofintentiontosubmitanapplicati" ) @@ -470,7 +471,7 @@ const Pinswg_dnsid = (props) => { "case:summary-written-acceptance-of-notice" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_writtenacceptanceofnotification" ) @@ -493,7 +494,7 @@ const Pinswg_dnsid = (props) => { "case:summary-deadline-for-submission-of-application" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_deadlineforsubmissionofapplication" ) @@ -516,7 +517,7 @@ const Pinswg_dnsid = (props) => { "case:summary-date-of-submission-of-application" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_dateofsubmissionofapplication" ) @@ -534,7 +535,7 @@ const Pinswg_dnsid = (props) => { ) } /> - {_.has( + {hasOwn( detailsObj, "pinswg_applicationacceptedasvalid" ) && @@ -558,7 +559,7 @@ const Pinswg_dnsid = (props) => { } /> )} - {_.has( + {hasOwn( detailsObj, "pinswg_applicationrejectedasinvalid" ) && @@ -587,7 +588,7 @@ const Pinswg_dnsid = (props) => { "case:summary-end-of-representation-period" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_endofrepresentationperiod" ) @@ -606,7 +607,7 @@ const Pinswg_dnsid = (props) => { } /> - {_.has( + {hasOwn( detailsObj, "pinswg_dateofrequesttovarytheapplication" ) && @@ -631,14 +632,14 @@ const Pinswg_dnsid = (props) => { /> )} - {_.has( + {hasOwn( detailsObj, "pinswg_confirmrequesttovaryapplication" ) && !_.isEmpty( detailsObj.pinswg_confirmrequesttovaryapplication ) && - (_.has( + (hasOwn( detailsObj, "pinswg_rejectrequesttovaryapplication" ) && @@ -664,14 +665,14 @@ const Pinswg_dnsid = (props) => { ) : ( "" ))} - {_.has( + {hasOwn( detailsObj, "pinswg_rejectrequesttovaryapplication" ) && !_.isEmpty( detailsObj.pinswg_rejectrequesttovaryapplication ) && - (_.has( + (hasOwn( detailsObj, "pinswg_confirmrequesttovaryapplication" ) && @@ -697,7 +698,7 @@ const Pinswg_dnsid = (props) => { ) : ( "" ))} - {_.has( + {hasOwn( detailsObj, "pinswg_suspensionstartdates" ) && @@ -727,7 +728,7 @@ const Pinswg_dnsid = (props) => { "case:summary-suspension-end-dates" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_suspensionenddates" ) @@ -748,7 +749,7 @@ const Pinswg_dnsid = (props) => { { {/* { "case:summary-inspector-report-submission-to-welsh-government" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_inspectorreportsubmittedtowelshgovernment" ) @@ -810,7 +811,7 @@ const Pinswg_dnsid = (props) => { ) } /> - {_.has( + {hasOwn( detailsObj, "pinswg_withdrawndate" ) && diff --git a/components/case/summaryTypes/pinswg_electricityactid.js b/components/case/summaryTypes/pinswg_electricityactid.js index c4ba9e7c..96756565 100644 --- a/components/case/summaryTypes/pinswg_electricityactid.js +++ b/components/case/summaryTypes/pinswg_electricityactid.js @@ -6,6 +6,7 @@ import transLookup from "../../../data/lookuptranslations.json"; import SummaryCard from "../summary/components/SummaryCard"; import SummaryRow from "../summary/components/SummaryRow"; import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue"; +import { hasOwn } from "../../utils"; const Pinswg_electricityactid = (props) => { let { t } = useTranslation(); @@ -133,7 +134,7 @@ const Pinswg_electricityactid = (props) => { {" "} {/* {casesObj.caseDetails.caseOfficer || ""} */} - {_.has(casesObj, "_ownerid_value") + {hasOwn(casesObj, "_ownerid_value") ? casesObj[ "_ownerid_value@OData.Community.Display.V1.FormattedValue" ] @@ -244,7 +245,7 @@ const Pinswg_electricityactid = (props) => { )}
- {_.has(casesObj, [ + {hasOwn(casesObj, [ "numberofchildincidents" ]) ? casesObj.numberofchildincidents > @@ -336,7 +337,7 @@ const Pinswg_electricityactid = (props) => { "case:summary-event-date-label" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_dateeventrequested" ) @@ -359,7 +360,7 @@ const Pinswg_electricityactid = (props) => { "case:summary-decision-date-label" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_casedecisiondate" ) @@ -383,7 +384,7 @@ const Pinswg_electricityactid = (props) => { "case:summary-application-accepted-as-valid" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_applicationacceptedasvalid" ) @@ -406,7 +407,7 @@ const Pinswg_electricityactid = (props) => { "case:summary-application-rejected-as-invalid" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_applicationrejectedasinvalid" ) @@ -429,7 +430,7 @@ const Pinswg_electricityactid = (props) => { "case:summary-confirm-request-to-vary-application" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_confirmrequesttovaryapplication" ) @@ -452,7 +453,7 @@ const Pinswg_electricityactid = (props) => { "case:summary-date-of-decisions" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_dateofdecision" ) @@ -475,7 +476,7 @@ const Pinswg_electricityactid = (props) => { "case:summary-date-of-request-to-vary" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_dateofrequesttovarytheapplication" ) @@ -498,7 +499,7 @@ const Pinswg_electricityactid = (props) => { "case:summary-date-of-submission-of-application" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_dateofsubmissionofapplication" ) @@ -521,7 +522,7 @@ const Pinswg_electricityactid = (props) => { "case:summary-date-project-published-to-website" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_dateprojectpublishedonwebsite" ) @@ -544,7 +545,7 @@ const Pinswg_electricityactid = (props) => { "case:summary-deadline-for-submission-of-application" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_deadlineforsubmissionofapplication" ) @@ -567,7 +568,7 @@ const Pinswg_electricityactid = (props) => { "case:summary-end-of-representation-period" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_endofrepresentationperiod" ) @@ -590,7 +591,7 @@ const Pinswg_electricityactid = (props) => { "case:summary-inspector-report-submission-to-welsh-government" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_inspectorreportsubmittedtowelshgovernment" ) @@ -613,7 +614,7 @@ const Pinswg_electricityactid = (props) => { "case:summary-procedure-confirmed" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_procedureconfirmed" ) @@ -636,7 +637,7 @@ const Pinswg_electricityactid = (props) => { "case:summary-reject-request-to-vary-application" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_rejectrequesttovaryapplication" ) @@ -657,7 +658,7 @@ const Pinswg_electricityactid = (props) => { { "case:summary-suspension-dates" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_suspensiondates" ) @@ -703,7 +704,7 @@ const Pinswg_electricityactid = (props) => { "case:summary-suspension-end-dates" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_suspensionenddates" ) @@ -726,7 +727,7 @@ const Pinswg_electricityactid = (props) => { "case:summary-suspension-start-dates" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_suspensionstartdates" ) @@ -749,7 +750,7 @@ const Pinswg_electricityactid = (props) => { "case:summary-valid-notice-of-intention-to-submit-an-application" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_validnoticeofintentiontosubmitanapplicati" ) @@ -770,7 +771,7 @@ const Pinswg_electricityactid = (props) => { { "case:summary-written-acceptance-of-notice" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_writtenacceptanceofnotification" ) diff --git a/components/case/summaryTypes/pinswg_enforcementlistedbuildingconseid.js b/components/case/summaryTypes/pinswg_enforcementlistedbuildingconseid.js index 0002b178..b2ee71f0 100644 --- a/components/case/summaryTypes/pinswg_enforcementlistedbuildingconseid.js +++ b/components/case/summaryTypes/pinswg_enforcementlistedbuildingconseid.js @@ -6,6 +6,7 @@ import transLookup from "../../../data/lookuptranslations.json"; import SummaryCard from "../summary/components/SummaryCard"; import SummaryRow from "../summary/components/SummaryRow"; import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue"; +import { hasOwn } from "../../utils"; const Pinswg_enforcementlistedbuildingconseid = (props) => { let { t } = useTranslation(); @@ -170,7 +171,7 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => { {t("case:summary-case-link-status-label")}
- {_.has(casesObj, ["numberofchildincidents"]) + {hasOwn(casesObj, ["numberofchildincidents"]) ? casesObj.numberofchildincidents > 0 ? t( "case:summary-case-link-status-linked" @@ -209,7 +210,7 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => { { : t( "case:summary-no-date-entered-label" ) - : _.has(detailsObj, "pinswg_startdates") + : hasOwn(detailsObj, "pinswg_startdates") ? !_.isEmpty(detailsObj.pinswg_startdates) ? formatDates( detailsObj.pinswg_startdates @@ -234,7 +235,7 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => { "case:summary-questionnaire-due-date-label" )} value={ - _.has(detailsObj, "pinswg_questionnaireduedate") + hasOwn(detailsObj, "pinswg_questionnaireduedate") ? !_.isEmpty( detailsObj.pinswg_questionnaireduedate ) @@ -251,7 +252,7 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => { { "case:summary-interested-party-date-label" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_otherpartiesstatement" ) @@ -283,7 +284,7 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => { : t( "case:summary-no-date-entered-label" ) - : _.has( + : hasOwn( detailsObj, "pinswg_otherpartiesstatements" ) @@ -305,7 +306,7 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => { "case:summary-applicant-final-comments-date-label" )} value={ - _.has(detailsObj, "pinswg_finalcommentsduedate") + hasOwn(detailsObj, "pinswg_finalcommentsduedate") ? !_.isEmpty( detailsObj.pinswg_finalcommentsduedate ) @@ -325,7 +326,7 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => { )}
- {_.has( + {hasOwn( detailsObj, "pinswg_proofsofevidencewrittenstatementsofeviden" ) @@ -346,7 +347,7 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => { { { { let { t } = useTranslation(); @@ -170,7 +171,7 @@ const Pinswg_enforcementnoticeappeals174id = (props) => { {t("case:summary-case-link-status-label")}
- {_.has(casesObj, ["numberofchildincidents"]) + {hasOwn(casesObj, ["numberofchildincidents"]) ? casesObj.numberofchildincidents > 0 ? t( "case:summary-case-link-status-linked" @@ -209,7 +210,7 @@ const Pinswg_enforcementnoticeappeals174id = (props) => { { : t( "case:summary-no-date-entered-label" ) - : _.has(detailsObj, "pinswg_startdates") + : hasOwn(detailsObj, "pinswg_startdates") ? !_.isEmpty(detailsObj.pinswg_startdates) ? formatDates( detailsObj.pinswg_startdates @@ -234,7 +235,7 @@ const Pinswg_enforcementnoticeappeals174id = (props) => { "case:summary-questionnaire-due-date-label" )} value={ - _.has(detailsObj, "pinswg_questionnaireduedate") + hasOwn(detailsObj, "pinswg_questionnaireduedate") ? !_.isEmpty( detailsObj.pinswg_questionnaireduedate ) @@ -251,7 +252,7 @@ const Pinswg_enforcementnoticeappeals174id = (props) => { { "case:summary-interested-party-date-label" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_otherpartiesstatement" ) @@ -283,7 +284,7 @@ const Pinswg_enforcementnoticeappeals174id = (props) => { : t( "case:summary-no-date-entered-label" ) - : _.has( + : hasOwn( detailsObj, "pinswg_otherpartiesstatements" ) @@ -305,7 +306,7 @@ const Pinswg_enforcementnoticeappeals174id = (props) => { "case:summary-applicant-final-comments-date-label" )} value={ - _.has(detailsObj, "pinswg_finalcommentsduedate") + hasOwn(detailsObj, "pinswg_finalcommentsduedate") ? !_.isEmpty( detailsObj.pinswg_finalcommentsduedate ) @@ -322,7 +323,7 @@ const Pinswg_enforcementnoticeappeals174id = (props) => { label={t( "case:summary-inquiry-evidence-date-label" )} - value={_.has( + value={hasOwn( detailsObj, "pinswg_proofsofevidencewrittenstatementsofeviden" ) @@ -342,7 +343,7 @@ const Pinswg_enforcementnoticeappeals174id = (props) => { { { { let { t } = useTranslation(); @@ -170,7 +171,7 @@ const Pinswg_environmentalpermittingid = (props) => { {t("case:summary-case-link-status-label")}
- {_.has(casesObj, ["numberofchildincidents"]) + {hasOwn(casesObj, ["numberofchildincidents"]) ? casesObj.numberofchildincidents > 0 ? t( "case:summary-case-link-status-linked" @@ -234,7 +235,7 @@ const Pinswg_environmentalpermittingid = (props) => { { : t( "case:summary-no-date-entered-label" ) - : _.has(detailsObj, "pinswg_startdates") + : hasOwn(detailsObj, "pinswg_startdates") ? !_.isEmpty(detailsObj.pinswg_startdates) ? formatDates( detailsObj.pinswg_startdates @@ -259,7 +260,7 @@ const Pinswg_environmentalpermittingid = (props) => { "case:summary-questionnaire-due-date-label" )} value={ - _.has(detailsObj, "pinswg_questionnaireduedate") + hasOwn(detailsObj, "pinswg_questionnaireduedate") ? !_.isEmpty( detailsObj.pinswg_questionnaireduedate ) @@ -276,7 +277,7 @@ const Pinswg_environmentalpermittingid = (props) => { { "case:summary-interested-party-date-label" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_otherpartiesstatement" ) @@ -308,7 +309,7 @@ const Pinswg_environmentalpermittingid = (props) => { : t( "case:summary-no-date-entered-label" ) - : _.has( + : hasOwn( detailsObj, "pinswg_otherpartiesstatements" ) @@ -330,7 +331,7 @@ const Pinswg_environmentalpermittingid = (props) => { "case:summary-applicant-final-comments-date-label" )} value={ - _.has(detailsObj, "pinswg_finalcommentsduedate") + hasOwn(detailsObj, "pinswg_finalcommentsduedate") ? !_.isEmpty( detailsObj.pinswg_finalcommentsduedate ) @@ -347,7 +348,7 @@ const Pinswg_environmentalpermittingid = (props) => { label={t( "case:summary-inquiry-evidence-date-label" )} - value={_.has( + value={hasOwn( detailsObj, "pinswg_proofsofevidencewrittenstatementsofeviden" ) @@ -367,7 +368,7 @@ const Pinswg_environmentalpermittingid = (props) => { { { { let { t } = useTranslation(); @@ -133,7 +134,7 @@ const Pinswg_harbourrevisionorderid = (props) => { {" "} {/* {casesObj.caseDetails.caseOfficer || ""} */} - {_.has(casesObj, "_ownerid_value") + {hasOwn(casesObj, "_ownerid_value") ? casesObj[ "_ownerid_value@OData.Community.Display.V1.FormattedValue" ] @@ -223,7 +224,7 @@ const Pinswg_harbourrevisionorderid = (props) => { )}
- {_.has(casesObj, [ + {hasOwn(casesObj, [ "numberofchildincidents" ]) ? casesObj.numberofchildincidents > @@ -315,7 +316,7 @@ const Pinswg_harbourrevisionorderid = (props) => { "case:summary-event-date-label" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_dateeventrequested" ) @@ -338,7 +339,7 @@ const Pinswg_harbourrevisionorderid = (props) => { "case:summary-decision-date-label" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_casedecisiondate" ) @@ -362,7 +363,7 @@ const Pinswg_harbourrevisionorderid = (props) => { "case:summary-application-accepted-as-valid" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_applicationacceptedasvalid" ) @@ -385,7 +386,7 @@ const Pinswg_harbourrevisionorderid = (props) => { "case:summary-application-rejected-as-invalid" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_applicationrejectedasinvalid" ) @@ -408,7 +409,7 @@ const Pinswg_harbourrevisionorderid = (props) => { "case:summary-confirm-request-to-vary-application" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_confirmrequesttovaryapplication" ) @@ -431,7 +432,7 @@ const Pinswg_harbourrevisionorderid = (props) => { "case:summary-date-of-decisions" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_dateofdecision" ) @@ -454,7 +455,7 @@ const Pinswg_harbourrevisionorderid = (props) => { "case:summary-date-of-request-to-vary" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_dateofrequesttovarytheapplication" ) @@ -477,7 +478,7 @@ const Pinswg_harbourrevisionorderid = (props) => { "case:summary-date-of-submission-of-application" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_dateofsubmissionofapplication" ) @@ -500,7 +501,7 @@ const Pinswg_harbourrevisionorderid = (props) => { "case:summary-date-project-published-to-website" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_dateprojectpublishedonwebsite" ) @@ -523,7 +524,7 @@ const Pinswg_harbourrevisionorderid = (props) => { "case:summary-deadline-for-submission-of-application" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_deadlineforsubmissionofapplication" ) @@ -546,7 +547,7 @@ const Pinswg_harbourrevisionorderid = (props) => { "case:summary-end-of-representation-period" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_endofrepresentationperiod" ) @@ -569,7 +570,7 @@ const Pinswg_harbourrevisionorderid = (props) => { "case:summary-inspector-report-submission-to-welsh-government" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_inspectorreportsubmittedtowelshgovernment" ) @@ -592,7 +593,7 @@ const Pinswg_harbourrevisionorderid = (props) => { "case:summary-procedure-confirmed" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_procedureconfirmed" ) @@ -615,7 +616,7 @@ const Pinswg_harbourrevisionorderid = (props) => { "case:summary-reject-request-to-vary-application" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_rejectrequesttovaryapplication" ) @@ -636,7 +637,7 @@ const Pinswg_harbourrevisionorderid = (props) => { { "case:summary-suspension-dates" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_suspensiondates" ) @@ -682,7 +683,7 @@ const Pinswg_harbourrevisionorderid = (props) => { "case:summary-suspension-end-dates" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_suspensionenddates" ) @@ -705,7 +706,7 @@ const Pinswg_harbourrevisionorderid = (props) => { "case:summary-suspension-start-dates" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_suspensionstartdates" ) @@ -728,7 +729,7 @@ const Pinswg_harbourrevisionorderid = (props) => { "case:summary-valid-notice-of-intention-to-submit-an-application" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_validnoticeofintentiontosubmitanapplicati" ) @@ -749,7 +750,7 @@ const Pinswg_harbourrevisionorderid = (props) => { { "case:summary-written-acceptance-of-notice" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_writtenacceptanceofnotification" ) diff --git a/components/case/summaryTypes/pinswg_hedgeshedgerowstreepreservatioid.js b/components/case/summaryTypes/pinswg_hedgeshedgerowstreepreservatioid.js index a8d9b7e1..44ba98cd 100644 --- a/components/case/summaryTypes/pinswg_hedgeshedgerowstreepreservatioid.js +++ b/components/case/summaryTypes/pinswg_hedgeshedgerowstreepreservatioid.js @@ -6,6 +6,7 @@ import transLookup from "../../../data/lookuptranslations.json"; import SummaryCard from "../summary/components/SummaryCard"; import SummaryRow from "../summary/components/SummaryRow"; import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue"; +import { hasOwn } from "../../utils"; const Pinswg_hedgeshedgerowstreepreservatioid = (props) => { let { t } = useTranslation(); @@ -191,7 +192,7 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => { {t("case:summary-case-link-status-label")}
- {_.has(casesObj, ["numberofchildincidents"]) + {hasOwn(casesObj, ["numberofchildincidents"]) ? casesObj.numberofchildincidents > 0 ? t( "case:summary-case-link-status-linked" @@ -255,7 +256,7 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => { { : t( "case:summary-no-date-entered-label" ) - : _.has(detailsObj, "pinswg_startdates") + : hasOwn(detailsObj, "pinswg_startdates") ? !_.isEmpty(detailsObj.pinswg_startdates) ? formatDates( detailsObj.pinswg_startdates @@ -280,7 +281,7 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => { "case:summary-questionnaire-due-date-label" )} value={ - _.has(detailsObj, "pinswg_questionnaireduedate") + hasOwn(detailsObj, "pinswg_questionnaireduedate") ? !_.isEmpty( detailsObj.pinswg_questionnaireduedate ) @@ -297,7 +298,7 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => { { "case:summary-interested-party-date-label" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_otherpartiesstatement" ) @@ -329,7 +330,7 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => { : t( "case:summary-no-date-entered-label" ) - : _.has( + : hasOwn( detailsObj, "pinswg_otherpartiesstatements" ) @@ -351,7 +352,7 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => { "case:summary-applicant-final-comments-date-label" )} value={ - _.has(detailsObj, "pinswg_finalcommentsduedate") + hasOwn(detailsObj, "pinswg_finalcommentsduedate") ? !_.isEmpty( detailsObj.pinswg_finalcommentsduedate ) @@ -368,7 +369,7 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => { label={t( "case:summary-inquiry-evidence-date-label" )} - value={_.has( + value={hasOwn( detailsObj, "pinswg_proofsofevidencewrittenstatementsofeviden" ) @@ -388,7 +389,7 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => { { { { let { t } = useTranslation(); @@ -151,7 +152,7 @@ const Pinswg_householderappealhasid = (props) => { {t("case:summary-case-link-status-label")}
- {_.has(casesObj, ["numberofchildincidents"]) + {hasOwn(casesObj, ["numberofchildincidents"]) ? casesObj.numberofchildincidents > 0 ? t( "case:summary-case-link-status-linked" @@ -190,7 +191,7 @@ const Pinswg_householderappealhasid = (props) => { { : t( "case:summary-no-date-entered-label" ) - : _.has(detailsObj, "pinswg_startdates") + : hasOwn(detailsObj, "pinswg_startdates") ? !_.isEmpty(detailsObj.pinswg_startdates) ? formatDates( detailsObj.pinswg_startdates @@ -215,7 +216,7 @@ const Pinswg_householderappealhasid = (props) => { "case:summary-questionnaire-due-date-label" )} value={ - _.has(detailsObj, "pinswg_questionnaireduedate") + hasOwn(detailsObj, "pinswg_questionnaireduedate") ? !_.isEmpty( detailsObj.pinswg_questionnaireduedate ) @@ -232,7 +233,7 @@ const Pinswg_householderappealhasid = (props) => { { "case:summary-interested-party-date-label" )} value={ - _.has(detailsObj, "pinswg_otherpartiesstmt") + hasOwn(detailsObj, "pinswg_otherpartiesstmt") ? !_.isEmpty( detailsObj.pinswg_otherpartiesstmt ) @@ -261,7 +262,7 @@ const Pinswg_householderappealhasid = (props) => { : t( "case:summary-no-date-entered-label" ) - : _.has( + : hasOwn( detailsObj, "pinswg_otherpartiesstmt" ) @@ -280,7 +281,7 @@ const Pinswg_householderappealhasid = (props) => { { { { let { t } = useTranslation(); @@ -170,7 +171,7 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => { {t("case:summary-case-link-status-label")}
- {_.has(casesObj, ["numberofchildincidents"]) + {hasOwn(casesObj, ["numberofchildincidents"]) ? casesObj.numberofchildincidents > 0 ? t( "case:summary-case-link-status-linked" @@ -209,7 +210,7 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => { { : t( "case:summary-no-date-entered-label" ) - : _.has(detailsObj, "pinswg_startdates") + : hasOwn(detailsObj, "pinswg_startdates") ? !_.isEmpty(detailsObj.pinswg_startdates) ? formatDates( detailsObj.pinswg_startdates @@ -234,7 +235,7 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => { "case:summary-questionnaire-due-date-label" )} value={ - _.has(detailsObj, "pinswg_questionnaireduedate") + hasOwn(detailsObj, "pinswg_questionnaireduedate") ? !_.isEmpty( detailsObj.pinswg_questionnaireduedate ) @@ -251,7 +252,7 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => { { "case:summary-interested-party-date-label" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_otherpartiesstatement" ) @@ -283,7 +284,7 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => { : t( "case:summary-no-date-entered-label" ) - : _.has( + : hasOwn( detailsObj, "pinswg_otherpartiesstatements" ) @@ -305,7 +306,7 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => { "case:summary-applicant-final-comments-date-label" )} value={ - _.has(detailsObj, "pinswg_finalcommentsduedate") + hasOwn(detailsObj, "pinswg_finalcommentsduedate") ? !_.isEmpty( detailsObj.pinswg_finalcommentsduedate ) @@ -322,7 +323,7 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => { label={t( "case:summary-inquiry-evidence-date-label" )} - value={_.has( + value={hasOwn( detailsObj, "pinswg_proofsofevidencewrittenstatementsofeviden" ) @@ -342,7 +343,7 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => { { { { let { t } = useTranslation(); @@ -153,7 +154,7 @@ const Pinswg_ldpid = (props) => { {t("case:summary-case-link-status-label")}
- {_.has(casesObj, ["numberofchildincidents"]) + {hasOwn(casesObj, ["numberofchildincidents"]) ? casesObj.numberofchildincidents > 0 ? t( "case:summary-case-link-status-linked" @@ -192,7 +193,7 @@ const Pinswg_ldpid = (props) => { { : t( "case:summary-no-date-entered-label" ) - : _.has(detailsObj, "pinswg_startdates") + : hasOwn(detailsObj, "pinswg_startdates") ? !_.isEmpty(detailsObj.pinswg_startdates) ? formatDates( detailsObj.pinswg_startdates @@ -217,7 +218,7 @@ const Pinswg_ldpid = (props) => { "case:summary-questionnaire-due-date-label" )} value={ - _.has(detailsObj, "pinswg_questionnaireduedate") + hasOwn(detailsObj, "pinswg_questionnaireduedate") ? !_.isEmpty( detailsObj.pinswg_questionnaireduedate ) @@ -234,7 +235,7 @@ const Pinswg_ldpid = (props) => { { "case:summary-interested-party-date-label" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_otherpartiesstatement" ) @@ -266,7 +267,7 @@ const Pinswg_ldpid = (props) => { : t( "case:summary-no-date-entered-label" ) - : _.has( + : hasOwn( detailsObj, "pinswg_otherpartiesstatements" ) @@ -288,7 +289,7 @@ const Pinswg_ldpid = (props) => { "case:summary-applicant-final-comments-date-label" )} value={ - _.has(detailsObj, "pinswg_finalcommentsduedate") + hasOwn(detailsObj, "pinswg_finalcommentsduedate") ? !_.isEmpty( detailsObj.pinswg_finalcommentsduedate ) @@ -305,7 +306,7 @@ const Pinswg_ldpid = (props) => { label={t( "case:summary-inquiry-evidence-date-label" )} - value={_.has( + value={hasOwn( detailsObj, "pinswg_proofsofevidencewrittenstatementsofeviden" ) @@ -325,7 +326,7 @@ const Pinswg_ldpid = (props) => { { { { let { t } = useTranslation(); @@ -170,7 +171,7 @@ const Pinswg_listedbuildingandconservationrid = (props) => { {t("case:summary-case-link-status-label")}
- {_.has(casesObj, ["numberofchildincidents"]) + {hasOwn(casesObj, ["numberofchildincidents"]) ? casesObj.numberofchildincidents > 0 ? t( "case:summary-case-link-status-linked" @@ -209,7 +210,7 @@ const Pinswg_listedbuildingandconservationrid = (props) => { { : t( "case:summary-no-date-entered-label" ) - : _.has(detailsObj, "pinswg_startdates") + : hasOwn(detailsObj, "pinswg_startdates") ? !_.isEmpty(detailsObj.pinswg_startdates) ? formatDates( detailsObj.pinswg_startdates @@ -234,7 +235,7 @@ const Pinswg_listedbuildingandconservationrid = (props) => { "case:summary-questionnaire-due-date-label" )} value={ - _.has(detailsObj, "pinswg_questionnaireduedate") + hasOwn(detailsObj, "pinswg_questionnaireduedate") ? !_.isEmpty( detailsObj.pinswg_questionnaireduedate ) @@ -251,7 +252,7 @@ const Pinswg_listedbuildingandconservationrid = (props) => { { "case:summary-interested-party-date-label" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_otherpartiesstatement" ) @@ -283,7 +284,7 @@ const Pinswg_listedbuildingandconservationrid = (props) => { : t( "case:summary-no-date-entered-label" ) - : _.has( + : hasOwn( detailsObj, "pinswg_otherpartiesstatements" ) @@ -305,7 +306,7 @@ const Pinswg_listedbuildingandconservationrid = (props) => { "case:summary-applicant-final-comments-date-label" )} value={ - _.has(detailsObj, "pinswg_finalcommentsduedate") + hasOwn(detailsObj, "pinswg_finalcommentsduedate") ? !_.isEmpty( detailsObj.pinswg_finalcommentsduedate ) @@ -322,7 +323,7 @@ const Pinswg_listedbuildingandconservationrid = (props) => { label={t( "case:summary-inquiry-evidence-date-label" )} - value={_.has( + value={hasOwn( detailsObj, "pinswg_proofsofevidencewrittenstatementsofeviden" ) @@ -342,7 +343,7 @@ const Pinswg_listedbuildingandconservationrid = (props) => { { { { let { t } = useTranslation(); @@ -170,7 +171,7 @@ const Pinswg_maintenanceoflands217id = (props) => { {t("case:summary-case-link-status-label")}
- {_.has(casesObj, ["numberofchildincidents"]) + {hasOwn(casesObj, ["numberofchildincidents"]) ? casesObj.numberofchildincidents > 0 ? t( "case:summary-case-link-status-linked" @@ -209,7 +210,7 @@ const Pinswg_maintenanceoflands217id = (props) => { { : t( "case:summary-no-date-entered-label" ) - : _.has(detailsObj, "pinswg_startdates") + : hasOwn(detailsObj, "pinswg_startdates") ? !_.isEmpty(detailsObj.pinswg_startdates) ? formatDates( detailsObj.pinswg_startdates @@ -234,7 +235,7 @@ const Pinswg_maintenanceoflands217id = (props) => { "case:summary-questionnaire-due-date-label" )} value={ - _.has(detailsObj, "pinswg_questionnaireduedate") + hasOwn(detailsObj, "pinswg_questionnaireduedate") ? !_.isEmpty( detailsObj.pinswg_questionnaireduedate ) @@ -251,7 +252,7 @@ const Pinswg_maintenanceoflands217id = (props) => { { "case:summary-interested-party-date-label" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_otherpartiesstatement" ) @@ -283,7 +284,7 @@ const Pinswg_maintenanceoflands217id = (props) => { : t( "case:summary-no-date-entered-label" ) - : _.has( + : hasOwn( detailsObj, "pinswg_otherpartiesstatements" ) @@ -305,7 +306,7 @@ const Pinswg_maintenanceoflands217id = (props) => { "case:summary-applicant-final-comments-date-label" )} value={ - _.has(detailsObj, "pinswg_finalcommentsduedate") + hasOwn(detailsObj, "pinswg_finalcommentsduedate") ? !_.isEmpty( detailsObj.pinswg_finalcommentsduedate ) @@ -322,7 +323,7 @@ const Pinswg_maintenanceoflands217id = (props) => { label={t( "case:summary-inquiry-evidence-date-label" )} - value={_.has( + value={hasOwn( detailsObj, "pinswg_proofsofevidencewrittenstatementsofeviden" ) @@ -342,7 +343,7 @@ const Pinswg_maintenanceoflands217id = (props) => { { { { let { t } = useTranslation(); @@ -170,7 +171,7 @@ const Pinswg_miscellaneouscasewordid = (props) => { {t("case:summary-case-link-status-label")}
- {_.has(casesObj, ["numberofchildincidents"]) + {hasOwn(casesObj, ["numberofchildincidents"]) ? casesObj.numberofchildincidents > 0 ? t( "case:summary-case-link-status-linked" @@ -234,7 +235,7 @@ const Pinswg_miscellaneouscasewordid = (props) => { { : t( "case:summary-no-date-entered-label" ) - : _.has(detailsObj, "pinswg_startdates") + : hasOwn(detailsObj, "pinswg_startdates") ? !_.isEmpty(detailsObj.pinswg_startdates) ? formatDates( detailsObj.pinswg_startdates @@ -259,7 +260,7 @@ const Pinswg_miscellaneouscasewordid = (props) => { "case:summary-questionnaire-due-date-label" )} value={ - _.has(detailsObj, "pinswg_questionnaireduedate") + hasOwn(detailsObj, "pinswg_questionnaireduedate") ? !_.isEmpty( detailsObj.pinswg_questionnaireduedate ) @@ -276,7 +277,7 @@ const Pinswg_miscellaneouscasewordid = (props) => { { "case:summary-interested-party-date-label" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_otherpartiesstatement" ) @@ -308,7 +309,7 @@ const Pinswg_miscellaneouscasewordid = (props) => { : t( "case:summary-no-date-entered-label" ) - : _.has( + : hasOwn( detailsObj, "pinswg_otherpartiesstatements" ) @@ -330,7 +331,7 @@ const Pinswg_miscellaneouscasewordid = (props) => { "case:summary-applicant-final-comments-date-label" )} value={ - _.has(detailsObj, "pinswg_finalcommentsduedate") + hasOwn(detailsObj, "pinswg_finalcommentsduedate") ? !_.isEmpty( detailsObj.pinswg_finalcommentsduedate ) @@ -347,7 +348,7 @@ const Pinswg_miscellaneouscasewordid = (props) => { label={t( "case:summary-inquiry-evidence-date-label" )} - value={_.has( + value={hasOwn( detailsObj, "pinswg_proofsofevidencewrittenstatementsofeviden" ) @@ -367,7 +368,7 @@ const Pinswg_miscellaneouscasewordid = (props) => { { { { let { t } = useTranslation(); @@ -120,7 +121,7 @@ const Pinswg_nonvalidationid = (props) => { { : t( "case:summary-no-date-entered-label" ) - : _.has(detailsObj, "pinswg_startdates") + : hasOwn(detailsObj, "pinswg_startdates") ? !_.isEmpty(detailsObj.pinswg_startdates) ? formatDates( detailsObj.pinswg_startdates @@ -143,7 +144,7 @@ const Pinswg_nonvalidationid = (props) => { { let { t } = useTranslation(); @@ -170,7 +174,7 @@ const Pinswg_planningappeals78id = (props) => { { {t("case:summary-case-link-status-label")}
- {_.has(casesObj, ["numberofchildincidents"]) + {hasOwn(casesObj, [ + "numberofchildincidents" + ]) ? casesObj.numberofchildincidents > 0 ? t( "case:summary-case-link-status-linked" @@ -228,7 +234,7 @@ const Pinswg_planningappeals78id = (props) => { { : t( "case:summary-no-date-entered-label" ) - : _.has(detailsObj, "pinswg_startdates") + : hasOwn(detailsObj, "pinswg_startdates") ? !_.isEmpty(detailsObj.pinswg_startdates) ? formatDates( detailsObj.pinswg_startdates @@ -253,7 +259,10 @@ const Pinswg_planningappeals78id = (props) => { "case:summary-questionnaire-due-date-label" )} value={ - _.has(detailsObj, "pinswg_questionnaireduedate") + hasOwn( + detailsObj, + "pinswg_questionnaireduedate" + ) ? !_.isEmpty( detailsObj.pinswg_questionnaireduedate ) @@ -272,7 +281,7 @@ const Pinswg_planningappeals78id = (props) => { "case:summary-statement-interested-party-due-date-label" )} value={ - _.has(detailsObj, "pinswg_statementduedate") + hasOwn(detailsObj, "pinswg_statementduedate") ? !_.isEmpty( detailsObj.pinswg_statementduedate ) @@ -291,7 +300,7 @@ const Pinswg_planningappeals78id = (props) => { "case:summary-interested-party-date-label" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_otherpartiesstatement" ) @@ -304,7 +313,7 @@ const Pinswg_planningappeals78id = (props) => { : t( "case:summary-no-date-entered-label" ) - : _.has( + : hasOwn( detailsObj, "pinswg_otherpartiesstatements" ) @@ -326,7 +335,10 @@ const Pinswg_planningappeals78id = (props) => { { "case:summary-inquiry-evidence-date-label" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_proofsofevidencewrittenstatementsofeviden" ) @@ -365,7 +377,7 @@ const Pinswg_planningappeals78id = (props) => { {/* { { { let { t } = useTranslation(); @@ -170,7 +171,7 @@ const Pinswg_planningconditionss73s79id = (props) => { {t("case:summary-case-link-status-label")}
- {_.has(casesObj, ["numberofchildincidents"]) + {hasOwn(casesObj, ["numberofchildincidents"]) ? casesObj.numberofchildincidents > 0 ? t( "case:summary-case-link-status-linked" @@ -209,7 +210,7 @@ const Pinswg_planningconditionss73s79id = (props) => { { : t( "case:summary-no-date-entered-label" ) - : _.has(detailsObj, "pinswg_startdates") + : hasOwn(detailsObj, "pinswg_startdates") ? !_.isEmpty(detailsObj.pinswg_startdates) ? formatDates( detailsObj.pinswg_startdates @@ -234,7 +235,7 @@ const Pinswg_planningconditionss73s79id = (props) => { "case:summary-questionnaire-due-date-label" )} value={ - _.has(detailsObj, "pinswg_questionnaireduedate") + hasOwn(detailsObj, "pinswg_questionnaireduedate") ? !_.isEmpty( detailsObj.pinswg_questionnaireduedate ) @@ -251,7 +252,7 @@ const Pinswg_planningconditionss73s79id = (props) => { { "case:summary-interested-party-date-label" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_otherpartiesstatement" ) @@ -283,7 +284,7 @@ const Pinswg_planningconditionss73s79id = (props) => { : t( "case:summary-no-date-entered-label" ) - : _.has( + : hasOwn( detailsObj, "pinswg_otherpartiesstatements" ) @@ -305,7 +306,7 @@ const Pinswg_planningconditionss73s79id = (props) => { "case:summary-applicant-final-comments-date-label" )} value={ - _.has(detailsObj, "pinswg_finalcommentsduedate") + hasOwn(detailsObj, "pinswg_finalcommentsduedate") ? !_.isEmpty( detailsObj.pinswg_finalcommentsduedate ) @@ -323,7 +324,7 @@ const Pinswg_planningconditionss73s79id = (props) => { "case:summary-inquiry-evidence-date-label" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_proofsofevidencewrittenstatementsofeviden" ) @@ -344,7 +345,7 @@ const Pinswg_planningconditionss73s79id = (props) => { { { { let { t } = useTranslation(); @@ -170,7 +171,7 @@ const Pinswg_planningobligationappeals106id = (props) => { {t("case:summary-case-link-status-label")}
- {_.has(casesObj, ["numberofchildincidents"]) + {hasOwn(casesObj, ["numberofchildincidents"]) ? casesObj.numberofchildincidents > 0 ? t( "case:summary-case-link-status-linked" @@ -209,7 +210,7 @@ const Pinswg_planningobligationappeals106id = (props) => { { : t( "case:summary-no-date-entered-label" ) - : _.has(detailsObj, "pinswg_startdates") + : hasOwn(detailsObj, "pinswg_startdates") ? !_.isEmpty(detailsObj.pinswg_startdates) ? formatDates( detailsObj.pinswg_startdates @@ -234,7 +235,7 @@ const Pinswg_planningobligationappeals106id = (props) => { "case:summary-questionnaire-due-date-label" )} value={ - _.has(detailsObj, "pinswg_questionnaireduedate") + hasOwn(detailsObj, "pinswg_questionnaireduedate") ? !_.isEmpty( detailsObj.pinswg_questionnaireduedate ) @@ -251,7 +252,7 @@ const Pinswg_planningobligationappeals106id = (props) => { { "case:summary-interested-party-date-label" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_otherpartiesstatement" ) @@ -283,7 +284,7 @@ const Pinswg_planningobligationappeals106id = (props) => { : t( "case:summary-no-date-entered-label" ) - : _.has( + : hasOwn( detailsObj, "pinswg_otherpartiesstatements" ) @@ -305,7 +306,7 @@ const Pinswg_planningobligationappeals106id = (props) => { "case:summary-applicant-final-comments-date-label" )} value={ - _.has(detailsObj, "pinswg_finalcommentsduedate") + hasOwn(detailsObj, "pinswg_finalcommentsduedate") ? !_.isEmpty( detailsObj.pinswg_finalcommentsduedate ) @@ -322,7 +323,7 @@ const Pinswg_planningobligationappeals106id = (props) => { label={t( "case:summary-inquiry-evidence-date-label" )} - value={_.has( + value={hasOwn( detailsObj, "pinswg_proofsofevidencewrittenstatementsofeviden" ) @@ -342,7 +343,7 @@ const Pinswg_planningobligationappeals106id = (props) => { { { { let { t } = useTranslation(); @@ -191,7 +192,7 @@ const Pinswg_rowid = (props) => { {t("case:summary-case-link-status-label")}
- {_.has(casesObj, ["numberofchildincidents"]) + {hasOwn(casesObj, ["numberofchildincidents"]) ? casesObj.numberofchildincidents > 0 ? t( "case:summary-case-link-status-linked" @@ -255,7 +256,7 @@ const Pinswg_rowid = (props) => { { : t( "case:summary-no-date-entered-label" ) - : _.has(detailsObj, "pinswg_startdates") + : hasOwn(detailsObj, "pinswg_startdates") ? !_.isEmpty(detailsObj.pinswg_startdates) ? formatDates( detailsObj.pinswg_startdates @@ -280,7 +281,7 @@ const Pinswg_rowid = (props) => { "case:summary-questionnaire-due-date-label" )} value={ - _.has(detailsObj, "pinswg_questionnaireduedate") + hasOwn(detailsObj, "pinswg_questionnaireduedate") ? !_.isEmpty( detailsObj.pinswg_questionnaireduedate ) @@ -297,7 +298,7 @@ const Pinswg_rowid = (props) => { { "case:summary-interested-party-date-label" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_otherpartiesstatement" ) @@ -329,7 +330,7 @@ const Pinswg_rowid = (props) => { : t( "case:summary-no-date-entered-label" ) - : _.has( + : hasOwn( detailsObj, "pinswg_otherpartiesstatements" ) @@ -351,7 +352,7 @@ const Pinswg_rowid = (props) => { "case:summary-applicant-final-comments-date-label" )} value={ - _.has(detailsObj, "pinswg_finalcommentsduedate") + hasOwn(detailsObj, "pinswg_finalcommentsduedate") ? !_.isEmpty( detailsObj.pinswg_finalcommentsduedate ) @@ -368,7 +369,7 @@ const Pinswg_rowid = (props) => { label={t( "case:summary-inquiry-evidence-date-label" )} - value={_.has( + value={hasOwn( detailsObj, "pinswg_proofsofevidencewrittenstatementsofeviden" ) @@ -388,7 +389,7 @@ const Pinswg_rowid = (props) => { { { { "case:summary-case-officer-label" )} value={ - _.has(casesObj, "_ownerid_value") + hasOwn(casesObj, "_ownerid_value") ? casesObj[ "_ownerid_value@OData.Community.Display.V1.FormattedValue" ] @@ -349,7 +350,7 @@ const Pinswg_sipscase = (props) => { value={ - _.has( + hasOwn( detailsObj, "pinswg_startdateofevent" ) @@ -375,7 +376,7 @@ const Pinswg_sipscase = (props) => { value={ - _.has( + hasOwn( detailsObj, "pinswg_dateeventrequested" ) @@ -431,7 +432,7 @@ const Pinswg_sipscase = (props) => { "case:summary-decision-date-label" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_dateofdecision" ) @@ -457,7 +458,7 @@ const Pinswg_sipscase = (props) => { )}
- {_.has(casesObj, [ + {hasOwn(casesObj, [ "numberofchildincidents" ]) ? casesObj.numberofchildincidents > @@ -570,7 +571,7 @@ const Pinswg_sipscase = (props) => { "case:summary-valid-notice-of-intention-to-submit-an-application" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_validnoticeofintentiontosubmit" ) @@ -593,7 +594,7 @@ const Pinswg_sipscase = (props) => { "case:summary-written-acceptance-of-notice" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_writtenacceptanceofnotification" ) @@ -616,7 +617,7 @@ const Pinswg_sipscase = (props) => { "case:summary-deadline-for-submission-of-application" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_deadlineforsubmissionofapplication" ) @@ -665,7 +666,7 @@ const Pinswg_sipscase = (props) => { "case:summary-validation-deadline-extension" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_validationdeadlineextension" ) @@ -693,7 +694,7 @@ const Pinswg_sipscase = (props) => { "case:summary-case-suspension-start-date" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_casesuspensionstartdate" ) @@ -721,7 +722,7 @@ const Pinswg_sipscase = (props) => { "case:summary-case-suspension-end-date" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_casesuspensionenddate" ) @@ -772,7 +773,7 @@ const Pinswg_sipscase = (props) => { "case:summary-report-issued-to-welsh-ministers" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_reportissuedtowelshministers" ) @@ -800,7 +801,7 @@ const Pinswg_sipscase = (props) => { "case:summary-decision-issued-to-applicant" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_decisionissuedtoapplicant" ) @@ -828,7 +829,7 @@ const Pinswg_sipscase = (props) => { "case:summary-decision-outcome" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_decisionoutcome" ) @@ -872,7 +873,7 @@ const Pinswg_sipscase = (props) => { "case:summary-post-decision-redetermination-label" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_redetermination@OData.Community.Display.V1.FormattedValue" ) @@ -902,7 +903,7 @@ const Pinswg_sipscase = (props) => { "case:summary-post-decision-redetermination-deadline-label" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_redeterminationconsultationdeadline" ) @@ -937,7 +938,7 @@ const Pinswg_sipscase = (props) => { value={ - _.has( + hasOwn( detailsObj, "pinswg_screeningstartdate" ) @@ -963,7 +964,7 @@ const Pinswg_sipscase = (props) => { value={ - _.has( + hasOwn( detailsObj, "pinswg_eiatargetdate" ) @@ -994,7 +995,7 @@ const Pinswg_sipscase = (props) => { value={ - _.has( + hasOwn( detailsObj, "pinswg_targetextended" ) @@ -1021,7 +1022,7 @@ const Pinswg_sipscase = (props) => { value={ - _.has( + hasOwn( detailsObj, "pinswg_directionissueddate" ) @@ -1054,7 +1055,7 @@ const Pinswg_sipscase = (props) => { value={ - _.has( + hasOwn( detailsObj, "pinswg_eiarequired" ) @@ -1089,7 +1090,7 @@ const Pinswg_sipscase = (props) => { value={ - _.has( + hasOwn( detailsObj, "pinswg_scopingstartdate" ) @@ -1115,7 +1116,7 @@ const Pinswg_sipscase = (props) => { value={ - _.has( + hasOwn( detailsObj, "pinswg_scopingtargetdate" ) @@ -1145,7 +1146,7 @@ const Pinswg_sipscase = (props) => { value={ - _.has( + hasOwn( detailsObj, "pinswg_scopingtargetextended" ) @@ -1172,7 +1173,7 @@ const Pinswg_sipscase = (props) => { value={ - _.has( + hasOwn( detailsObj, "pinswg_scopingoutcomeissueddate" ) @@ -1203,7 +1204,7 @@ const Pinswg_sipscase = (props) => { value={ - _.has( + hasOwn( detailsObj, "pinswg_dateofsubmissionofapplication" ) @@ -1223,7 +1224,7 @@ const Pinswg_sipscase = (props) => { } /> - {_.has( + {hasOwn( detailsObj, "pinswg_applicationacceptedasvalid" ) && @@ -1252,7 +1253,7 @@ const Pinswg_sipscase = (props) => { /> )} - {_.has( + {hasOwn( detailsObj, "pinswg_applicationrejectedasinvalid" ) && @@ -1289,7 +1290,7 @@ const Pinswg_sipscase = (props) => { value={ - _.has( + hasOwn( detailsObj, "pinswg_endofrepresentationperiod" ) @@ -1310,7 +1311,7 @@ const Pinswg_sipscase = (props) => { /> - {_.has( + {hasOwn( detailsObj, "pinswg_dateofrequesttovarytheapplication" ) && @@ -1340,14 +1341,14 @@ const Pinswg_sipscase = (props) => { /> )} - {_.has( + {hasOwn( detailsObj, "pinswg_confirmrequesttovaryapplication" ) && !_.isEmpty( detailsObj.pinswg_confirmrequesttovaryapplication ) && - (_.has( + (hasOwn( detailsObj, "pinswg_rejectrequesttovaryapplication" ) && @@ -1378,14 +1379,14 @@ const Pinswg_sipscase = (props) => { ) : ( "" ))} - {_.has( + {hasOwn( detailsObj, "pinswg_rejectrequesttovaryapplication" ) && !_.isEmpty( detailsObj.pinswg_rejectrequesttovaryapplication ) && - (_.has( + (hasOwn( detailsObj, "pinswg_confirmrequesttovaryapplication" ) && @@ -1416,7 +1417,7 @@ const Pinswg_sipscase = (props) => { ) : ( "" ))} - {_.has( + {hasOwn( detailsObj, "pinswg_suspensionstartdates" ) && @@ -1457,7 +1458,7 @@ const Pinswg_sipscase = (props) => { value={ - _.has( + hasOwn( detailsObj, "pinswg_suspensionenddates" ) @@ -1485,7 +1486,7 @@ const Pinswg_sipscase = (props) => { value={ - _.has( + hasOwn( detailsObj, "pinswg_reportdueby" ) @@ -1511,7 +1512,7 @@ const Pinswg_sipscase = (props) => { value={ - _.has( + hasOwn( detailsObj, "pinswg_suspensiondates" ) @@ -1539,7 +1540,7 @@ const Pinswg_sipscase = (props) => { value={ - _.has( + hasOwn( detailsObj, "pinswg_inspectorreportsubmittedtowelshgovernment" ) @@ -1559,7 +1560,7 @@ const Pinswg_sipscase = (props) => { } /> - {_.has( + {hasOwn( detailsObj, "pinswg_withdrawndate" ) && diff --git a/components/case/summaryTypes/pinswg_transportandworkactid.js b/components/case/summaryTypes/pinswg_transportandworkactid.js index f6aaaa65..9c1b417d 100644 --- a/components/case/summaryTypes/pinswg_transportandworkactid.js +++ b/components/case/summaryTypes/pinswg_transportandworkactid.js @@ -5,6 +5,7 @@ import { useRouter } from "next/router"; import transLookup from "../../../data/lookuptranslations.json"; import SummaryCard from "../summary/components/SummaryCard"; import SummaryRow from "../summary/components/SummaryRow"; +import { hasOwn } from "../../utils"; const Pinswg_transportandworkactid = (props) => { let { t } = useTranslation(); @@ -62,11 +63,10 @@ const Pinswg_transportandworkactid = (props) => {
{ ] + '")].value_cy', json: transLookup, - eval: true, + eval: true }) : casesObj[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" @@ -84,18 +84,13 @@ const Pinswg_transportandworkactid = (props) => { t( "case:summary-no-date-entered-label" ) - } - /> { t( "case:summary-to-be-confirmed-label" ) - } - /> { detailsObj.pinswg_recommendation + '")].value_cy', json: transLookup, - eval: true, + eval: true }) : detailsObj.pinswg_recommendation || t( "case:summary-no-date-entered-label" ) - - } - - /> {detailsObj.pinswg_webaddress != null && ( { detailsObj.pinswg_webaddress + '")].value_cy', json: transLookup, - eval: true, + eval: true }) : detailsObj.pinswg_webaddress || t( "case:summary-no-date-entered-label" ) - } - /> )}
@@ -185,12 +163,11 @@ const Pinswg_transportandworkactid = (props) => {
{ : t( "case:summary-no-date-entered-label" ) - } - /> { : t( "case:summary-no-date-entered-label" ) - } - /> { : t( "case:summary-no-date-entered-label" ) - - } - - /> { : t( "case:summary-no-date-entered-label" ) - } - /> { : t( "case:summary-no-date-entered-label" ) - } - /> { : t( "case:summary-no-date-entered-label" ) - } - /> { : t( "case:summary-no-date-entered-label" ) - } - /> { : t( "case:summary-no-date-entered-label" ) - } - /> { : t( "case:summary-no-date-entered-label" ) - } - /> { : t( "case:summary-no-date-entered-label" ) - } - /> { : t( "case:summary-no-date-entered-label" ) - } - /> { : t( "case:summary-no-date-entered-label" ) - } - /> { : t( "case:summary-no-date-entered-label" ) - } - /> { : t( "case:summary-no-date-entered-label" ) - } - /> { : t( "case:summary-no-date-entered-label" ) - } - /> { : t( "case:summary-no-date-entered-label" ) - } - /> { : t( "case:summary-no-date-entered-label" ) - } - /> { : t( "case:summary-no-date-entered-label" ) - } - /> { : t( "case:summary-no-date-entered-label" ) - } - /> { : t( "case:summary-no-date-entered-label" ) - } - /> { : t( "case:summary-no-date-entered-label" ) - } - />
diff --git a/components/case/summaryTypes/pinswg_wayleaveid.js b/components/case/summaryTypes/pinswg_wayleaveid.js index c5b043bd..3ffc6328 100644 --- a/components/case/summaryTypes/pinswg_wayleaveid.js +++ b/components/case/summaryTypes/pinswg_wayleaveid.js @@ -6,6 +6,7 @@ import transLookup from "../../../data/lookuptranslations.json"; import SummaryCard from "../summary/components/SummaryCard"; import SummaryRow from "../summary/components/SummaryRow"; import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue"; +import { hasOwn } from "../../utils"; const Pinswg_wayleaveid = (props) => { let { t } = useTranslation(); @@ -170,7 +171,7 @@ const Pinswg_wayleaveid = (props) => { {t("case:summary-case-link-status-label")}
- {_.has(casesObj, ["numberofchildincidents"]) + {hasOwn(casesObj, ["numberofchildincidents"]) ? casesObj.numberofchildincidents > 0 ? t( "case:summary-case-link-status-linked" @@ -234,7 +235,7 @@ const Pinswg_wayleaveid = (props) => { { : t( "case:summary-no-date-entered-label" ) - : _.has(detailsObj, "pinswg_startdates") + : hasOwn(detailsObj, "pinswg_startdates") ? !_.isEmpty(detailsObj.pinswg_startdates) ? formatDates( detailsObj.pinswg_startdates @@ -259,7 +260,7 @@ const Pinswg_wayleaveid = (props) => { "case:summary-questionnaire-due-date-label" )} value={ - _.has(detailsObj, "pinswg_questionnaireduedate") + hasOwn(detailsObj, "pinswg_questionnaireduedate") ? !_.isEmpty( detailsObj.pinswg_questionnaireduedate ) @@ -276,7 +277,7 @@ const Pinswg_wayleaveid = (props) => { { "case:summary-interested-party-date-label" )} value={ - _.has( + hasOwn( detailsObj, "pinswg_otherpartiesstatement" ) @@ -308,7 +309,7 @@ const Pinswg_wayleaveid = (props) => { : t( "case:summary-no-date-entered-label" ) - : _.has( + : hasOwn( detailsObj, "pinswg_otherpartiesstatements" ) @@ -330,7 +331,7 @@ const Pinswg_wayleaveid = (props) => { "case:summary-applicant-final-comments-date-label" )} value={ - _.has(detailsObj, "pinswg_finalcommentsduedate") + hasOwn(detailsObj, "pinswg_finalcommentsduedate") ? !_.isEmpty( detailsObj.pinswg_finalcommentsduedate ) @@ -347,7 +348,7 @@ const Pinswg_wayleaveid = (props) => { label={t( "case:summary-inquiry-evidence-date-label" )} - value={_.has( + value={hasOwn( detailsObj, "pinswg_proofsofevidencewrittenstatementsofeviden" ) @@ -367,7 +368,7 @@ const Pinswg_wayleaveid = (props) => { { { { let { t } = useTranslation(); @@ -9,7 +10,7 @@ const CRMError = (props) => { const router = useRouter(); const { locale } = router; - const errorSwitch = _.has(props, "whichError") + const errorSwitch = hasOwn(props, "whichError") ? "LPAData" : "searchResultsObj"; diff --git a/components/dnssearchresults.js b/components/dnssearchresults.js index 7c2956d8..9da025da 100644 --- a/components/dnssearchresults.js +++ b/components/dnssearchresults.js @@ -2,6 +2,7 @@ import useTranslation from "next-translate/useTranslation"; import { useRouter } from "next/router"; import CRMError from "./crmError"; import DNSSearchResults from "./search/dnssearchresults"; +import { hasOwn } from "./utils"; export default function Search(props) { const { @@ -18,7 +19,7 @@ export default function Search(props) { const router = useRouter(); const { locale } = router; - var hasError = _.has(searchResultsObj.searchResultsObj, "errorCode") + var hasError = hasOwn(searchResultsObj.searchResultsObj, "errorCode") ? true : false; diff --git a/components/elements/fields/dateFieldPicker.js b/components/elements/fields/dateFieldPicker.js index cbfeba11..3e24b04e 100644 --- a/components/elements/fields/dateFieldPicker.js +++ b/components/elements/fields/dateFieldPicker.js @@ -4,6 +4,7 @@ import useTranslation from "next-translate/useTranslation"; import { Field } from "redux-form"; import { RenderDatePicker } from "./renderDatePicker"; import { validateField } from "../validationUtils"; +import { hasOwn } from "../../utils"; const dateDiffInDays = (a, b) => { const _MS_PER_DAY = 1000 * 60 * 60 * 24; @@ -31,7 +32,7 @@ export function DateFieldPicker(props) { const showIfHasParentShowValue = parentField != false && !_.isEmpty(formProps[form]) && - _.has(formProps[form].values, parentField) && + hasOwn(formProps[form].values, parentField) && formProps[form].values[parentField] == parentFieldShowOnValue; const requiredMessage = t("newappeal:is-required-label"); diff --git a/components/elements/fields/decimalField.js b/components/elements/fields/decimalField.js index 772e9a5a..1b423b74 100644 --- a/components/elements/fields/decimalField.js +++ b/components/elements/fields/decimalField.js @@ -5,7 +5,7 @@ import { Field } from "redux-form"; import { RenderTextfield } from "./renderTextfield"; import { RenderDecimalField } from "./renderDecimalField"; import { validateField } from "../validationUtils"; - +import { hasOwn } from "../../utils"; const isVisibleByInclusion = ({ parentField, form, @@ -14,7 +14,7 @@ const isVisibleByInclusion = ({ }) => parentField != false && !_.isEmpty(formProps[form]) && - _.has(formProps[form].values, parentField) && + hasOwn(formProps[form].values, parentField) && parentFieldShowOnValue.indexOf( formProps[form].values[parentField].toString() ) > -1; diff --git a/components/elements/fields/fieldArrayForm.js b/components/elements/fields/fieldArrayForm.js index 0728bcf7..23416b35 100644 --- a/components/elements/fields/fieldArrayForm.js +++ b/components/elements/fields/fieldArrayForm.js @@ -3,7 +3,7 @@ import _ from "lodash"; import { FieldArray, change } from "redux-form"; import { useDispatch } from "react-redux"; import { RenderSubFields } from "./renderSubFields"; - +import { hasOwn } from "../../utils"; export const FieldArrayForm = (props) => { const { name, @@ -19,7 +19,7 @@ export const FieldArrayForm = (props) => { var showIfHasParentShowValue = parentField != false && !_.isEmpty(formProps[form]) && - _.has(formProps[form].values, parentField) && + hasOwn(formProps[form].values, parentField) && parentFieldShowOnValue.indexOf( formProps[form].values[parentField].toString() ) > -1; diff --git a/components/elements/fields/numericField.js b/components/elements/fields/numericField.js index 6bd17454..5d938947 100644 --- a/components/elements/fields/numericField.js +++ b/components/elements/fields/numericField.js @@ -4,7 +4,7 @@ import useTranslation from "next-translate/useTranslation"; import { Field } from "redux-form"; import { RenderTextfield } from "./renderTextfield"; import { validateField } from "../validationUtils"; - +import { hasOwn } from "../../utils"; const isVisibleByInclusion = ({ parentField, form, @@ -13,7 +13,7 @@ const isVisibleByInclusion = ({ }) => parentField != false && !_.isEmpty(formProps[form]) && - _.has(formProps[form].values, parentField) && + hasOwn(formProps[form].values, parentField) && parentFieldShowOnValue.indexOf( formProps[form].values[parentField].toString() ) > -1; diff --git a/components/elements/fields/radioField.js b/components/elements/fields/radioField.js index 80eae158..195b79a8 100644 --- a/components/elements/fields/radioField.js +++ b/components/elements/fields/radioField.js @@ -4,6 +4,7 @@ import useTranslation from "next-translate/useTranslation"; import { Field } from "redux-form"; import { RenderRadio } from "./renderRadio"; import { validateField } from "../validationUtils"; +import { hasOwn } from "../../utils"; const isVisibleByInclusion = ({ parentField, @@ -13,7 +14,7 @@ const isVisibleByInclusion = ({ }) => parentField != false && !_.isEmpty(formProps[form]) && - _.has(formProps[form].values, parentField) && + hasOwn(formProps[form].values, parentField) && parentFieldShowOnValue.indexOf( formProps[form].values[parentField].toString() ) > -1; diff --git a/components/elements/fields/yesNoField.js b/components/elements/fields/yesNoField.js index d768979b..14a49517 100644 --- a/components/elements/fields/yesNoField.js +++ b/components/elements/fields/yesNoField.js @@ -4,6 +4,7 @@ import useTranslation from "next-translate/useTranslation"; import { useRouter } from "next/router"; import { Field } from "redux-form"; import { RenderYesNo } from "./renderYesNo"; +import { hasOwn } from "../../utils"; export function YesNofield(props) { const router = useRouter(); @@ -17,7 +18,7 @@ export function YesNofield(props) { const showIfHasParentShowValue = parentField != false && !_.isEmpty(formProps[form]) && - _.has(formProps[form].values, parentField) && + hasOwn(formProps[form].values, parentField) && parentFieldShowOnValue.indexOf( formProps[form].values[parentField].toString() ) > -1; @@ -36,7 +37,7 @@ export function YesNofield(props) { validate={[required]} errorMsg={t("newappeal:select-an-option-label")} component={RenderYesNo} - inline={_.has(props, "inline") ? props.inline : "true"} + inline={hasOwn(props, "inline") ? props.inline : "true"} requiredDocumentLabel={props.requiredDocumentLabel} requiredDocumentValue={props.requiredDocumentValue} setDocumentsList={props.setDocumentsList} @@ -54,7 +55,7 @@ export function YesNofield(props) { validate={[required]} errorMsg={t("newappeal:select-an-option-label")} component={RenderYesNo} - inline={_.has(props, "inline") ? props.inline : "true"} + inline={hasOwn(props, "inline") ? props.inline : "true"} requiredDocumentLabel={props.requiredDocumentLabel} requiredDocumentValue={props.requiredDocumentValue} setDocumentsList={props.setDocumentsList} diff --git a/components/elements/index.js b/components/elements/index.js index 550f8d17..28bffaa8 100644 --- a/components/elements/index.js +++ b/components/elements/index.js @@ -1,4 +1,5 @@ import _ from "lodash"; +import { hasOwn } from "../utils"; import useTranslation from "next-translate/useTranslation"; import { useRouter } from "next/router"; import React, { useEffect } from "react"; @@ -40,7 +41,7 @@ const getValidationMessages = (t) => ({ const hasParentFieldValue = ({ parentField, form, formProps }) => parentField != false && !_.isEmpty(formProps[form]) && - _.has(formProps[form].values, parentField); + hasOwn(formProps[form].values, parentField); const isVisibleByEquality = ({ parentField, diff --git a/components/myportal.js b/components/myportal.js index 6b31f3e5..c787dbd5 100644 --- a/components/myportal.js +++ b/components/myportal.js @@ -4,8 +4,7 @@ import Link from "next/link"; import { useRouter } from "next/router"; import TimeOut from "../components/timeout"; import AwaitingSubmissionFromBlob from "./myportal/awaitingsubmissionfromblob"; - -import _ from "lodash"; +import { hasOwn } from "./utils"; import Dns from "./myportal/dns"; import MakeNewAppeal from "./myportal/makenewappeal"; import MyCases from "./myportal/mycases"; @@ -133,7 +132,7 @@ const MyPortal = (props) => { )} */} {!isLPA && - _.has(props.awaitingSubmission, [ + hasOwnhas(props.awaitingSubmission, [ "awaitingSubmissionFromBlob", "@odata.count" ]) && diff --git a/components/myportal/viewall.js b/components/myportal/viewall.js index 87001271..15af643e 100644 --- a/components/myportal/viewall.js +++ b/components/myportal/viewall.js @@ -20,7 +20,11 @@ import { } from "../../actions/services/portalService"; import { splitWatchedCasesBySubmissionState } from "../../lib/domain/dashboard-policy"; import { consoleLogger } from "../../actions/core/logger"; -import { getDetailsProxy, getFormCollectionByID } from "../../components/utils"; +import { + getDetailsProxy, + getFormCollectionByID, + hasOwn +} from "../../components/utils"; import transLookup from "../../data/lookuptranslations.json"; import { setAwaitingSubmissionFromBlob } from "../../store/awaitingSubmission/action"; import { @@ -469,7 +473,7 @@ const ViewAllResults = (props) => { {isAwaitingSubmissionDetails ? formatDates(item.createdon) - : _.has(detailsObj, [ + : hasOwn(detailsObj, [ "_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue" ]) ? detailsObj[ @@ -488,7 +492,7 @@ const ViewAllResults = (props) => { {t("search:searchresults-authority-label")}: {isAwaitingSubmissionDetails && - _.has(resultItem, "pinswg_lpaname") + hasOwn(resultItem, "pinswg_lpaname") ? router.locale === "cy" ? jsonpath({ path: @@ -500,7 +504,7 @@ const ViewAllResults = (props) => { }) : resultItem.pinswg_lpaname || "N/A" : ""} - {_.has(resultItem, [ + {hasOwn(resultItem, [ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ]) ? router.locale === "cy" @@ -518,7 +522,7 @@ const ViewAllResults = (props) => { "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] || "N/A" : ""} - {_.has(searchDetailsObj[key], [ + {hasOwn(searchDetailsObj[key], [ "_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue" ]) ? router.locale === "cy" @@ -541,7 +545,7 @@ const ViewAllResults = (props) => { "_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue" ] || "N/A" : ""} - {_.has(resultItem, [ + {hasOwn(resultItem, [ "_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue" ]) ? router.locale === "cy" @@ -621,7 +625,7 @@ const ViewAllResults = (props) => { : getFormCollectionByID( searchDetailsObj[key].appealType ).value)} - {_.has( + {hasOwn( searchDetailsObj[key], "_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue" )} diff --git a/components/newappeal/aboutyou.js b/components/newappeal/aboutyou.js index 3016fdea..619f05fe 100644 --- a/components/newappeal/aboutyou.js +++ b/components/newappeal/aboutyou.js @@ -313,7 +313,7 @@ function Radiofield(props) { //debugger; // parentField != false && // !_.isEmpty(formProps[form]) && - // _.has(formProps[form].values, parentField) && + // hasOwn(formProps[form].values, parentField) && // parentFieldShowOnValue.indexOf( // formProps[form].values[parentField].toString() // ) > -1; diff --git a/components/newappeal/buildsection.js b/components/newappeal/buildsection.js index d9ec5ca7..75742a9d 100644 --- a/components/newappeal/buildsection.js +++ b/components/newappeal/buildsection.js @@ -21,7 +21,12 @@ import { setNewAppealProgress, setFileCount } from "../../store/appealType/action"; -import { getFormCollectionByID, getProgressObj, updateLinks } from "../utils"; +import { + getFormCollectionByID, + getProgressObj, + updateLinks, + hasOwn +} from "../utils"; import BuildRow from "./buildrow"; import { parseXml, @@ -436,7 +441,7 @@ let BuildSection = (props) => { data-module="govuk-button" onClick={() => { getErrors(); - let valuesObj = _.has( + let valuesObj = hasOwn( legacyFormState[props.form], "values" ) diff --git a/components/newappeal/createCase.js b/components/newappeal/createCase.js index fa9f9822..390a1ab4 100644 --- a/components/newappeal/createCase.js +++ b/components/newappeal/createCase.js @@ -13,7 +13,7 @@ import { setAppealTypeID, setAppealTypeTitle } from "../../store/appealType/action"; -import { getFormCollectionByID } from "../utils"; +import { getFormCollectionByID, hasOwn } from "../utils"; import Aboutyou from "./aboutyou"; const RenderLPAList = ({ @@ -310,7 +310,7 @@ function Radiofield(props) { //debugger; // parentField != false && // !_.isEmpty(formProps[form]) && - // _.has(formProps[form].values, parentField) && + // hasOwn(formProps[form].values, parentField) && // parentFieldShowOnValue.indexOf( // formProps[form].values[parentField].toString() // ) > -1; @@ -491,7 +491,7 @@ let CreateCase = (props) => { var showIfHasParentShowValue = parentField != false && !_.isEmpty(formProps[form]) && - _.has(formProps[form].values, parentField) && + hasOwn(formProps[form].values, parentField) && parentFieldShowOnValue.indexOf( formProps[form].values[parentField].toString() ) > -1; diff --git a/components/search/addresssearchresults.js b/components/search/addresssearchresults.js index e476bfe5..918f1854 100644 --- a/components/search/addresssearchresults.js +++ b/components/search/addresssearchresults.js @@ -20,7 +20,7 @@ import { setWatchedCasesDetails } from "../../store/watchedCases/action"; -import { getDetailsProxy } from "../utils"; +import { getDetailsProxy, hasOwn } from "../utils"; import PaginationControl from "./pagination"; import { signIn, useSession } from "next-auth/react"; @@ -410,7 +410,7 @@ const SearchResults = (props) => { )} : - {_.has( + {hasOwn( detailsObj, "pinswg_projectlocation" ) @@ -433,7 +433,7 @@ const SearchResults = (props) => { highlightQuery ) : ""} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddressline1" ) @@ -442,7 +442,7 @@ const SearchResults = (props) => { highlightQuery ) : ""} - {_.has( + {hasOwn( detailsObj, "pinswg_addressline1" ) @@ -453,19 +453,19 @@ const SearchResults = (props) => { : ""} {/* {detailsObj.pinswg_siteaddressline1 != null &&
} */} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddressline1" ) && detailsObj.pinswg_siteaddressline1 != null &&
} - {_.has( + {hasOwn( detailsObj, "pinswg_addressline1" ) && detailsObj.pinswg_addressline1 != null &&
} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddressline1" ) @@ -474,7 +474,7 @@ const SearchResults = (props) => { highlightQuery ) : ""} - {_.has( + {hasOwn( detailsObj, "pinswg_addressline1" ) @@ -483,19 +483,19 @@ const SearchResults = (props) => { highlightQuery ) : ""} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddressline2" ) && detailsObj.pinswg_siteaddressline2 != null &&
} - {_.has( + {hasOwn( detailsObj, "pinswg_addressline2" ) && detailsObj.pinswg_addressline2 != null &&
} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddresstown" ) @@ -504,25 +504,28 @@ const SearchResults = (props) => { highlightQuery ) : ""} - {_.has(detailsObj, "pinswg_addresstown") + {hasOwn( + detailsObj, + "pinswg_addresstown" + ) ? highlightText( detailsObj.pinswg_addresstown, highlightQuery ) : ""} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddresstown" ) && detailsObj.pinswg_siteaddresstown != null &&
} - {_.has( + {hasOwn( detailsObj, "pinswg_addresstown" ) && detailsObj.pinswg_addresstown != null &&
} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddresscounty" ) @@ -531,7 +534,7 @@ const SearchResults = (props) => { highlightQuery ) : ""} - {_.has( + {hasOwn( detailsObj, "pinswg_addresscounty" ) @@ -540,19 +543,19 @@ const SearchResults = (props) => { highlightQuery ) : ""} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddresscounty" ) && detailsObj.pinswg_siteaddresscounty != null &&
} - {_.has( + {hasOwn( detailsObj, "pinswg_addresscounty" ) && detailsObj.pinswg_addresscounty != null &&
} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddresspostcode" ) @@ -561,7 +564,7 @@ const SearchResults = (props) => { highlightQuery ) : ""} - {_.has(detailsObj, "pinswg_postcode") + {hasOwn(detailsObj, "pinswg_postcode") ? highlightText( detailsObj.pinswg_postcode, highlightQuery @@ -575,9 +578,10 @@ const SearchResults = (props) => { )} : - {_.has(detailsObj, [ + {hasOwn( + detailsObj, "_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue" - ]) + ) ? detailsObj[ "_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue" ] @@ -590,9 +594,10 @@ const SearchResults = (props) => { )} : - {_.has(item, [ + {hasOwn( + item, "_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue" - ]) + ) ? router.locale == "cy" ? jsonpath({ path: @@ -608,9 +613,10 @@ const SearchResults = (props) => { "_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue" ] || "N/A" : ""} - {_.has(item, [ + {hasOwn( + item, "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" - ]) + ) ? router.locale == "cy" ? jsonpath({ path: diff --git a/components/search/dnssearchresults.js b/components/search/dnssearchresults.js index 6dc5a024..25095bfe 100644 --- a/components/search/dnssearchresults.js +++ b/components/search/dnssearchresults.js @@ -1,5 +1,4 @@ import { JSONPath as jsonpath } from "jsonpath-plus"; -import _ from "lodash"; import useTranslation from "next-translate/useTranslation"; import Link from "next/link"; import { useRouter } from "next/router"; @@ -35,7 +34,7 @@ import { setWatchedCases, setWatchedCasesDetails } from "../../store/watchedCases/action"; -import { getDetailsProxy, getSearchDetailsPaged } from "../utils"; +import { getDetailsProxy, getSearchDetailsPaged, hasOwn } from "../utils"; import { signIn, useSession } from "next-auth/react"; const DNSSearchResults = (props) => { @@ -489,7 +488,7 @@ const DNSSearchResults = (props) => { )} : - {_.has( + {hasOwn( detailsObj, "pinswg_projectlocation" ) @@ -528,55 +527,55 @@ const DNSSearchResults = (props) => { : "" : ""} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddressline1" ) ? detailsObj.pinswg_siteaddressline1 : ""} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddressline1" ) && detailsObj.pinswg_siteaddressline1 != null &&
} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddressline2" ) ? detailsObj.pinswg_siteaddressline2 : ""} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddressline2" ) && detailsObj.pinswg_siteaddressline2 != null &&
} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddressline1" ) ? detailsObj.pinswg_siteaddresstown : ""} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddresstown" ) && detailsObj.pinswg_siteaddresstown != null &&
} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddressline1" ) ? detailsObj.pinswg_siteaddresscounty : ""} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddresscounty" ) && detailsObj.pinswg_siteaddresscounty != null &&
} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddressline1" ) @@ -590,9 +589,10 @@ const DNSSearchResults = (props) => { )} : - {_.has(detailsObj, [ + {hasOwn( + detailsObj, "_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue" - ]) + ) ? detailsObj[ "_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue" ] @@ -605,9 +605,10 @@ const DNSSearchResults = (props) => { )} : - {_.has(detailsObj, [ + {hasOwn( + detailsObj, "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" - ]) + ) ? router.locale == "cy" ? jsonpath({ path: diff --git a/components/search/searchresults.js b/components/search/searchresults.js index 8d052db3..12e2a76f 100644 --- a/components/search/searchresults.js +++ b/components/search/searchresults.js @@ -1,5 +1,4 @@ import { JSONPath as jsonpath } from "jsonpath-plus"; -import _ from "lodash"; import useTranslation from "next-translate/useTranslation"; import Link from "next/link"; import { useRouter } from "next/router"; @@ -27,7 +26,7 @@ import { setWatchedCasesDetails } from "../../store/watchedCases/action"; -import { getDetailsProxy, getSearchDetailsPaged } from "../utils"; +import { getDetailsProxy, getSearchDetailsPaged, hasOwn } from "../utils"; import PaginationControl from "./pagination"; import { signIn, useSession } from "next-auth/react"; @@ -485,7 +484,7 @@ const SearchResults = (props) => { )} : - {_.has( + {hasOwn( detailsObj, "pinswg_projectlocation" ) @@ -521,7 +520,7 @@ const SearchResults = (props) => { // )[0] // : "" ""} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddressline1" ) @@ -531,52 +530,52 @@ const SearchResults = (props) => { {/* {detailsObj.pinswg_siteaddressline1 != null &&
} */} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddressline1" ) && detailsObj.pinswg_siteaddressline1 != null &&
} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddressline1" ) ? detailsObj.pinswg_siteaddressline2 : ""} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddressline2" ) && detailsObj.pinswg_siteaddressline2 != null &&
} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddresstown" ) ? detailsObj.pinswg_siteaddresstown : ""} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddresstown" ) && detailsObj.pinswg_siteaddresstown != null &&
} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddresscounty" ) ? detailsObj.pinswg_siteaddresscounty : ""} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddresscounty" ) && detailsObj.pinswg_siteaddresscounty != null &&
} - {_.has( + {hasOwn( detailsObj, "pinswg_siteaddresspostcode" ) @@ -594,9 +593,10 @@ const SearchResults = (props) => { ? item.pinswg_appellantfirstname + " " + item.pinswg_appellantlastname - : _.has(detailsObj, [ + : hasOwn( + detailsObj, "_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue" - ]) + ) ? detailsObj[ "_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue" ] @@ -609,9 +609,10 @@ const SearchResults = (props) => { )} : - {_.has(item, [ + {hasOwn( + item, "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" - ]) + ) ? router.locale == "cy" ? jsonpath({ path: diff --git a/components/searchresults.js b/components/searchresults.js index 61fa54a2..0e1b6cd1 100644 --- a/components/searchresults.js +++ b/components/searchresults.js @@ -3,6 +3,7 @@ import Link from "next/link"; import { useRouter } from "next/router"; import CRMError from "./crmError"; import SearchResults from "./search/searchresults"; +import { hasOwn } from "./utils"; export default function Search(props) { const { @@ -12,14 +13,14 @@ export default function Search(props) { myportal, watchedCases, isLinkedCase, - showLoginCheck, + showLoginCheck } = props; let { t } = useTranslation(); const router = useRouter(); const { locale } = router; - var hasError = _.has(searchResultsObj.searchResultsObj, "errorCode") + var hasError = hasOwn(searchResultsObj.searchResultsObj, "errorCode") ? true : false; diff --git a/components/utils/index.js b/components/utils/index.js index 8e8ad905..5340474e 100644 --- a/components/utils/index.js +++ b/components/utils/index.js @@ -13,6 +13,10 @@ import data from "../../data/collections.json"; import xpath from "xpath"; +export function hasOwn(obj, key) { + return obj != null && Object.prototype.hasOwnProperty.call(obj, key); +} + /* * Get the lookup collection by the appeal type entity * @param String formtype - string from appeal entity name @@ -372,10 +376,10 @@ export const getProgressObj = ( "totalFields": formObj[key].fieldsTotal, "allFieldsComplete": titleList[key].value == "Upload documents" - ? (_.has(props.props.appealType.fileList, "value") && + ? (hasOwn(props.props.appealType.fileList, "value") && props.props.appealType.fileList.value.length > 0) || - (_.has(props.props.form.appealForm, "values") && + (hasOwn(props.props.form.appealForm, "values") && Object.keys( props.props.form.appealForm.values ).filter((k) => k.startsWith("pinswg_fileUpload")) diff --git a/pages/addresssearch.js b/pages/addresssearch.js index fac16d56..7e00459b 100644 --- a/pages/addresssearch.js +++ b/pages/addresssearch.js @@ -1,4 +1,3 @@ -import _ from "lodash"; import useTranslation from "next-translate/useTranslation"; import Head from "next/head"; import { useRouter } from "next/router"; @@ -10,6 +9,7 @@ import CRMError from "../components/crmError"; import Footer from "../components/footer"; import Header from "../components/header"; import ServiceBanner from "../components/servicebanner"; +import { hasOwn } from "../components/utils"; const Home = (props) => { const { footerLinks, pages } = props; @@ -20,8 +20,8 @@ const Home = (props) => { const { appealtypes } = router.query; var hasError = - _.has(props.LPAData.LPAData, "errorCode") || - _.has(props.appealType.appealType, "errorCode") + hasOwn(props.LPAData.LPAData, "errorCode") || + hasOwn(props.appealType.appealType, "errorCode") ? true : false; @@ -120,7 +120,7 @@ const mapStateToProps = (state) => { appealType: state.appealType, LPAData: state.LPAData, //form: state.form, - accountDetails: state.accountDetails, + accountDetails: state.accountDetails }; }; diff --git a/pages/advancedsearch.js b/pages/advancedsearch.js index 1e58e479..a4f89d5e 100644 --- a/pages/advancedsearch.js +++ b/pages/advancedsearch.js @@ -1,4 +1,3 @@ -import _ from "lodash"; import useTranslation from "next-translate/useTranslation"; import Head from "next/head"; import { useRouter } from "next/router"; @@ -19,6 +18,7 @@ import { setLPA, setCaseStatus } from "../store/lpa/action"; import { wrapper } from "../store/store"; import ServiceBanner from "../components/servicebanner"; import { getCaseStatus } from "../actions/services/caseDirectService"; +import { hasOwn } from "../components/utils"; const Home = (props) => { const { footerLinks, pages } = props; @@ -29,8 +29,8 @@ const Home = (props) => { const { appealtypes } = router.query; var hasError = - _.has(props.LPAData.LPAData, "errorCode") || - _.has(props.appealType.appealType, "errorCode") + hasOwn(props.LPAData.LPAData, "errorCode") || + hasOwn(props.appealType.appealType, "errorCode") ? true : false; diff --git a/pages/api/admin/getlatestdocuments_api.js b/pages/api/admin/getlatestdocuments_api.js index a699550a..6ab5db21 100644 --- a/pages/api/admin/getlatestdocuments_api.js +++ b/pages/api/admin/getlatestdocuments_api.js @@ -17,10 +17,10 @@ import axios from "axios"; import CryptoJS from "crypto-js"; -import _ from "lodash"; import { azureHeadersPagedCustom } from "../../../actions/core/headers"; import { consoleLogger } from "../../../actions/core/logger"; import { getToken } from "../../../actions/core/token"; +import { hasOwn } from "../../../components/utils"; import { hashAPIPath } from "../../../actions/core/hash"; import { respondError, respondSuccess } from "../middleware/apiResponse"; const WORDKEY = process.env.HASHKEY; @@ -152,9 +152,9 @@ export default async function ApiProxy(req, res) { let dataStr; - _.has(data, "@odata.nextLink") == true && + hasOwn(data, "@odata.nextLink") == true && ((dataStr = JSON.stringify(data["@odata.nextLink"])), - (data["@odata.nextLink"] = dataStr.split("/v8.2/")[1])); + (data["@odata.nextLink"] = dataStr.split("/v9.2/")[1])); return respondSuccess(res, data); } catch (error) { consoleLogger(error); diff --git a/pages/api/admin/getnewappeals_api.js b/pages/api/admin/getnewappeals_api.js index 01c321eb..64c8254e 100644 --- a/pages/api/admin/getnewappeals_api.js +++ b/pages/api/admin/getnewappeals_api.js @@ -16,11 +16,11 @@ */ import axios from "axios"; -import _ from "lodash"; import { azureHeadersPagedCustom } from "../../../actions/core/headers"; import { getToken } from "../../../actions/core/token"; import { consoleLogger } from "../../../actions/core/logger"; import { hashAPIPath } from "../../../actions/core/hash"; +import { hasOwn } from "../../../components/utils"; import { respondError, respondSuccess } from "../middleware/apiResponse"; const WEBAPI_URL = @@ -60,9 +60,9 @@ export default async function ApiProxy(req, res) { ); let dataStr; - _.has(data, "@odata.nextLink") == true && + hasOwn(data, "@odata.nextLink") == true && ((dataStr = JSON.stringify(data["@odata.nextLink"])), - (data["@odata.nextLink"] = dataStr.split("/v8.2/")[1])); + (data["@odata.nextLink"] = dataStr.split("/v9.2/")[1])); return respondSuccess(res, data); } catch (error) { consoleLogger(error); diff --git a/pages/api/endpoint/getadvancedsearchpaged_api.js b/pages/api/endpoint/getadvancedsearchpaged_api.js index 286cddfb..a998a2d3 100644 --- a/pages/api/endpoint/getadvancedsearchpaged_api.js +++ b/pages/api/endpoint/getadvancedsearchpaged_api.js @@ -47,10 +47,10 @@ // * description: Success // */ -import _ from "lodash"; import { azureHeadersPagedCustom } from "../../../actions/core/headers"; import { respondError } from "../middleware/apiResponse"; import { relayGet } from "../middleware/relayForwarding"; +import { hasOwn } from "../../../components/utils"; import { RELAY_POLICY_SEARCH_PAGED } from "../middleware/relayPolicyPresets"; export default async function ApiProxy(req, res) { @@ -109,7 +109,7 @@ export default async function ApiProxy(req, res) { var queryString = ""; queryString += - _.has(searchString, "q") && searchString.q != null + hasOwn(searchString, "q") && searchString.q != null ? "(contains(title, '" + searchString.q.replace(/\'/g, "''") + "') or contains(ticketnumber,'" + @@ -118,25 +118,25 @@ export default async function ApiProxy(req, res) { : ""; queryString += - _.has(searchString, "lpaRef") && searchString.lpaRef != null + hasOwn(searchString, "lpaRef") && searchString.lpaRef != null ? "(contains(pinswg_lpareference, '" + searchString.lpaRef.replace(/\'/g, "''") + "')) and" : ""; queryString += - (_.has(searchString, "lpa") || _.has(searchString, "LPA")) && + (hasOwn(searchString, "lpa") || hasOwn(searchString, "LPA")) && searchString.lpa != null ? " _pinswg_associatedlpa_value eq " + searchString.lpa + " and" : ""; queryString += - _.has(searchString, "apt") && searchString.apt != null + hasOwn(searchString, "apt") && searchString.apt != null ? " pinswg_appealcasetype eq " + searchString.apt + " and" : ""; queryString += - _.has(searchString, "statuscode") && searchString.statuscode != null + hasOwn(searchString, "statuscode") && searchString.statuscode != null ? " statuscode eq " + searchString.statuscode + " and" : ""; @@ -152,7 +152,7 @@ export default async function ApiProxy(req, res) { ? "&$skiptoken=" + ('') : ""); - if (_.has(searchString, "projecttype")) { + if (hasOwn(searchString, "projecttype")) { const sipsFilters = [ "pinswg_sips_pinswg_sipsprojecttype/any(pt: pt/pinswg_sipsprojecttypeid eq " + searchString.projecttype + @@ -215,7 +215,7 @@ export default async function ApiProxy(req, res) { relayPolicy, transformData: (data) => { let dataStr; - _.has(data, "@odata.nextLink") === true && + hasOwn(data, "@odata.nextLink") === true && ((dataStr = JSON.stringify(data["@odata.nextLink"])), (data["@odata.nextLink"] = dataStr.split("/v9.2/")[1])); diff --git a/pages/api/endpoint/getbasicdnssearch_api.js b/pages/api/endpoint/getbasicdnssearch_api.js index 2c583f2a..39aee011 100644 --- a/pages/api/endpoint/getbasicdnssearch_api.js +++ b/pages/api/endpoint/getbasicdnssearch_api.js @@ -16,8 +16,8 @@ * description: Success */ -import _ from "lodash"; import { azureHeadersPaged } from "../../../actions/core/headers"; +import { hasOwn } from "../../../components/utils"; import { respondError } from "../middleware/apiResponse"; import { relayGet } from "../middleware/relayForwarding"; @@ -30,9 +30,9 @@ export default async function ApiProxy(req, res) { res, requestOptionsBuilder: (accessToken) => azureHeadersPaged(accessToken), transformData: (data) => { - if (_.has(data, "@odata.nextLink") === true) { + if (hasOwn(data, "@odata.nextLink") === true) { const dataStr = JSON.stringify(data["@odata.nextLink"]); - data["@odata.nextLink"] = dataStr.split("/v8.2/")[1]; + data["@odata.nextLink"] = dataStr.split("/v9.2/")[1]; } return data; diff --git a/pages/api/endpoint/getbasicdnssearchdetailspaged_api.js b/pages/api/endpoint/getbasicdnssearchdetailspaged_api.js index 79334b1f..81b2b1cd 100644 --- a/pages/api/endpoint/getbasicdnssearchdetailspaged_api.js +++ b/pages/api/endpoint/getbasicdnssearchdetailspaged_api.js @@ -9,9 +9,9 @@ * 200: * description: Success */ -import _ from "lodash"; import { azureHeadersPaged } from "../../../actions/core/headers"; import { getSelectQuery } from "../../../actions/selectQueryTypes"; +import { hasOwn } from "../../../components/utils"; import { respondError } from "../middleware/apiResponse"; import { relayGet } from "../middleware/relayForwarding"; @@ -41,9 +41,9 @@ export default async function ApiProxy(req, res) { res, requestOptionsBuilder: (accessToken) => azureHeadersPaged(accessToken), transformData: (data) => { - if (_.has(data, "@odata.nextLink") === true) { + if (hasOwn(data, "@odata.nextLink") === true) { const dataStr = JSON.stringify(data["@odata.nextLink"]); - data["@odata.nextLink"] = dataStr.split("/v8.2/")[1]; + data["@odata.nextLink"] = dataStr.split("/v9.2/")[1]; } return data; diff --git a/pages/api/endpoint/getbasicdnssearchpaged_api.js b/pages/api/endpoint/getbasicdnssearchpaged_api.js index 76336faa..b43a624f 100644 --- a/pages/api/endpoint/getbasicdnssearchpaged_api.js +++ b/pages/api/endpoint/getbasicdnssearchpaged_api.js @@ -41,8 +41,7 @@ * 200: * description: Success */ - -import _ from "lodash"; +import { hasOwn } from "../../../components/utils"; import { azureHeadersPagedCustom } from "../../../actions/core/headers"; import { respondError } from "../middleware/apiResponse"; import { relayGet } from "../middleware/relayForwarding"; @@ -96,9 +95,9 @@ export default async function ApiProxy(req, res) { requestOptionsBuilder: (accessToken) => azureHeadersPagedCustom(accessToken, showNumberOfRecords), transformData: (data) => { - if (_.has(data, "@odata.nextLink") === true) { + if (hasOwn(data, "@odata.nextLink") === true) { const dataStr = JSON.stringify(data["@odata.nextLink"]); - data["@odata.nextLink"] = dataStr.split("/v8.2/")[1]; + data["@odata.nextLink"] = dataStr.split("/v9.2/")[1]; } return data; diff --git a/pages/api/endpoint/getbasicdnsurlsearch_api.js b/pages/api/endpoint/getbasicdnsurlsearch_api.js index e2155985..f96009ac 100644 --- a/pages/api/endpoint/getbasicdnsurlsearch_api.js +++ b/pages/api/endpoint/getbasicdnsurlsearch_api.js @@ -16,8 +16,8 @@ * description: Success */ -import _ from "lodash"; import { azureHeadersPaged } from "../../../actions/core/headers"; +import { hasOwn } from "../../../components/utils"; import { respondError } from "../middleware/apiResponse"; import { relayGet } from "../middleware/relayForwarding"; @@ -47,9 +47,9 @@ export default async function ApiProxy(req, res) { requestOptionsBuilder: (accessToken) => azureHeadersPaged(accessToken), transformData: (data) => { let dataStr; - _.has(data, "@odata.nextLink") === true && + hasOwn(data, "@odata.nextLink") === true && ((dataStr = JSON.stringify(data["@odata.nextLink"])), - (data["@odata.nextLink"] = dataStr.split("/v8.2/")[1])); + (data["@odata.nextLink"] = dataStr.split("/v9.2/")[1])); return data; }, diff --git a/pages/api/endpoint/getbasicsearchdetailspaged_api.js b/pages/api/endpoint/getbasicsearchdetailspaged_api.js index 21d8090d..05b11425 100644 --- a/pages/api/endpoint/getbasicsearchdetailspaged_api.js +++ b/pages/api/endpoint/getbasicsearchdetailspaged_api.js @@ -29,10 +29,10 @@ * description: Success */ -import _ from "lodash"; import { azureHeaders, azureHeadersPaged } from "../../../actions/core/headers"; import { getSelectQuery } from "../../../actions/selectQueryTypes"; import { getNavigationPropertyByPrimaryAttribute } from "../../../components/utils"; +import { hasOwn } from "../../../components/utils"; import { respondError, respondSuccess } from "../middleware/apiResponse"; import { relayGetData } from "../middleware/relayForwarding"; @@ -138,7 +138,7 @@ export default async function ApiProxy(req, res) { additionalLPAs })); - if (_.has(data, "@odata.nextLink") === true) { + if (hasOwn(data, "@odata.nextLink") === true) { const dataStr = JSON.stringify(data["@odata.nextLink"]); data["@odata.nextLink"] = dataStr.split("/v9.2/")[1]; } diff --git a/pages/api/endpoint/getbasicsearchpaged_api.js b/pages/api/endpoint/getbasicsearchpaged_api.js index 4652aa50..8cce4ab8 100644 --- a/pages/api/endpoint/getbasicsearchpaged_api.js +++ b/pages/api/endpoint/getbasicsearchpaged_api.js @@ -42,10 +42,10 @@ * description: Success */ -import _ from "lodash"; import { azureHeadersPagedCustom } from "../../../actions/core/headers"; import { respondError } from "../middleware/apiResponse"; import { relayGet } from "../middleware/relayForwarding"; +import { hasOwn } from "../../../components/utils"; import { RELAY_POLICY_SEARCH_PAGED } from "../middleware/relayPolicyPresets"; export default async function ApiProxy(req, res) { @@ -121,9 +121,9 @@ export default async function ApiProxy(req, res) { azureHeadersPagedCustom(accessToken, showNumberOfRecords), relayPolicy, transformData: (data) => { - if (_.has(data, "@odata.nextLink") === true) { + if (hasOwn(data, "@odata.nextLink") === true) { const dataStr = JSON.stringify(data["@odata.nextLink"]); - data["@odata.nextLink"] = dataStr.split("/v8.2/")[1]; + data["@odata.nextLink"] = dataStr.split("/v9.2/")[1]; } return data; diff --git a/pages/api/endpoint/getcase_api.js b/pages/api/endpoint/getcase_api.js index 253590df..051e06ac 100644 --- a/pages/api/endpoint/getcase_api.js +++ b/pages/api/endpoint/getcase_api.js @@ -10,7 +10,7 @@ * description: Success */ -import _ from "lodash"; +import { hasOwn } from "../../../components/utils"; import { respondError } from "../middleware/apiResponse"; import { relayGet } from "../middleware/relayForwarding"; @@ -34,9 +34,9 @@ export default async function ApiProxy(req, res) { queryUrl, res, transformData: (data) => { - if (_.has(data, "@odata.nextLink") === true) { + if (hasOwn(data, "@odata.nextLink") === true) { const dataStr = JSON.stringify(data["@odata.nextLink"]); - data["@odata.nextLink"] = dataStr.split("/v8.2/")[1]; + data["@odata.nextLink"] = dataStr.split("/v9.2/")[1]; } return data; diff --git a/pages/api/endpoint/getcasebyid_api.js b/pages/api/endpoint/getcasebyid_api.js index a0c064aa..81c4ff9e 100644 --- a/pages/api/endpoint/getcasebyid_api.js +++ b/pages/api/endpoint/getcasebyid_api.js @@ -10,7 +10,7 @@ * description: Success */ -import _ from "lodash"; +import { hasOwn } from "../../../components/utils"; import { respondError } from "../middleware/apiResponse"; import { relayGet } from "../middleware/relayForwarding"; @@ -31,9 +31,9 @@ export default async function ApiProxy(req, res) { queryUrl, res, transformData: (data) => { - if (_.has(data, "@odata.nextLink") === true) { + if (hasOwn(data, "@odata.nextLink") === true) { const dataStr = JSON.stringify(data["@odata.nextLink"]); - data["@odata.nextLink"] = dataStr.split("/v8.2/")[1]; + data["@odata.nextLink"] = dataStr.split("/v9.2/")[1]; } return [data]; diff --git a/pages/api/endpoint/getdnslist_api.js b/pages/api/endpoint/getdnslist_api.js index ab1439f3..5330efa4 100644 --- a/pages/api/endpoint/getdnslist_api.js +++ b/pages/api/endpoint/getdnslist_api.js @@ -1,5 +1,5 @@ -import _ from "lodash"; import { azureHeaders } from "../../../actions/core/headers"; +import { hasOwn } from "../../../components/utils"; import { respondError } from "../middleware/apiResponse"; import { relayGet } from "../middleware/relayForwarding"; @@ -14,9 +14,9 @@ export default async function ApiProxy(req, res) { transformData: (data) => { let dataStr; - _.has(data, "@odata.nextLink") === true && + hasOwn(data, "@odata.nextLink") === true && ((dataStr = JSON.stringify(data["@odata.nextLink"])), - (data["@odata.nextLink"] = dataStr.split("/v8.2/")[1])); + (data["@odata.nextLink"] = dataStr.split("/v9.2/")[1])); return data; }, diff --git a/pages/api/endpoint/getpartsavedappeal_api.js b/pages/api/endpoint/getpartsavedappeal_api.js index 6e2eff3f..890a8ba4 100644 --- a/pages/api/endpoint/getpartsavedappeal_api.js +++ b/pages/api/endpoint/getpartsavedappeal_api.js @@ -1,5 +1,5 @@ -import _ from "lodash"; import { azureHeadersPaged } from "../../../actions/core/headers"; +import { hasOwn } from "../../../components/utils"; import { respondError } from "../middleware/apiResponse"; import { relayGet } from "../middleware/relayForwarding"; @@ -29,9 +29,9 @@ export default async function ApiProxy(req, res) { requestOptionsBuilder: (accessToken) => azureHeadersPaged(accessToken), transformData: (data) => { let dataStr; - _.has(data, "@odata.nextLink") === true && + hasOwn(data, "@odata.nextLink") === true && ((dataStr = JSON.stringify(data["@odata.nextLink"])), - (data["@odata.nextLink"] = dataStr.split("/v8.2/")[1])); + (data["@odata.nextLink"] = dataStr.split("/v9.2/")[1])); return data; }, diff --git a/pages/api/endpoint/getsearchdocumentdetails_api.js b/pages/api/endpoint/getsearchdocumentdetails_api.js index c4183476..a7bc10a6 100644 --- a/pages/api/endpoint/getsearchdocumentdetails_api.js +++ b/pages/api/endpoint/getsearchdocumentdetails_api.js @@ -19,6 +19,7 @@ import CryptoJS from "crypto-js"; import _ from "lodash"; import { azureHeadersPaged } from "../../../actions/core/headers"; +import { hasOwn } from "../../../components/utils"; import { respondError } from "../middleware/apiResponse"; import { relayGet } from "../middleware/relayForwarding"; @@ -70,9 +71,9 @@ export default async function ApiProxy(req, res) { ); }); - if (_.has(data, "@odata.nextLink") === true) { + if (hasOwn(data, "@odata.nextLink") === true) { const dataStr = JSON.stringify(data["@odata.nextLink"]); - data["@odata.nextLink"] = dataStr.split("/v8.2/")[1]; + data["@odata.nextLink"] = dataStr.split("/v9.2/")[1]; } return data; diff --git a/pages/api/endpoint/getsearchdocumentdetailspaged_api.js b/pages/api/endpoint/getsearchdocumentdetailspaged_api.js index 9a00218c..22f9818a 100644 --- a/pages/api/endpoint/getsearchdocumentdetailspaged_api.js +++ b/pages/api/endpoint/getsearchdocumentdetailspaged_api.js @@ -43,8 +43,8 @@ */ import CryptoJS from "crypto-js"; -import _ from "lodash"; import { azureHeadersPagedCustom } from "../../../actions/core/headers"; +import { hasOwn } from "../../../components/utils"; import { respondError } from "../middleware/apiResponse"; import { relayGet } from "../middleware/relayForwarding"; @@ -175,9 +175,9 @@ export default async function ApiProxy(req, res) { ); }); - if (_.has(data, "@odata.nextLink") === true) { + if (hasOwn(data, "@odata.nextLink") === true) { const dataStr = JSON.stringify(data["@odata.nextLink"]); - data["@odata.nextLink"] = dataStr.split("/v8.2/")[1]; + data["@odata.nextLink"] = dataStr.split("/v9.2/")[1]; } return data; diff --git a/pages/api/file/createcaseinvolvement_api.js b/pages/api/file/createcaseinvolvement_api.js index a1761dc9..1b224e5d 100644 --- a/pages/api/file/createcaseinvolvement_api.js +++ b/pages/api/file/createcaseinvolvement_api.js @@ -45,7 +45,7 @@ export default async function ApiProxy(req, res) { const crmUrl = "https://" + process.env.CRMURL; const data = { - "@odata.id": crmUrl + "/api/data/v8.2/contacts(" + contactid + ")" + "@odata.id": crmUrl + "/api/data/v9.2/contacts(" + contactid + ")" }; const config = { diff --git a/pages/api/forms.txt b/pages/api/forms.txt index 11b30e1d..b4df7d2f 100644 --- a/pages/api/forms.txt +++ b/pages/api/forms.txt @@ -30,4 +30,4 @@ pinswg_ldp pinswg_maintenanceoflands217 pinswg_electricityact -https://devcrm2016.llcdt.gov.wales/DVPINS/api/data/v8.2/EntityDefinitions(LogicalName='incident')/Attributes(LogicalName='pinswg_appealcasetype')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?$select=LogicalName&$expand=GlobalOptionSet($select=Options) \ No newline at end of file +https://devcrm2016.llcdt.gov.wales/DVPINS/api/data/v9.2/EntityDefinitions(LogicalName='incident')/Attributes(LogicalName='pinswg_appealcasetype')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?$select=LogicalName&$expand=GlobalOptionSet($select=Options) \ No newline at end of file diff --git a/pages/dns/index.js b/pages/dns/index.js index 202362a0..c6b19d3a 100644 --- a/pages/dns/index.js +++ b/pages/dns/index.js @@ -9,9 +9,8 @@ import Footer from "../../components/footer"; import Header from "../../components/header"; import { wrapper } from "../../store/store"; -import _ from "lodash"; import Breadcrumbs from "../../components/breadcrumbs"; -import { getSearchDetails } from "../../components/utils"; +import { getSearchDetails, hasOwn } from "../../components/utils"; import { setSearch } from "../../store/search/action"; import { setSearchDetails, @@ -58,7 +57,7 @@ export const getServerSideProps = wrapper.getServerSideProps( ); let searchResultsObj = await getDNSList(); - if (_.has(searchResultsObj, "status") != false) { + if (hasOwn(searchResultsObj, "status") != false) { if (searchResultsObj.status == 400) { return { redirect: { diff --git a/pages/dnsapplications.js b/pages/dnsapplications.js index 774eb176..ccec96a9 100644 --- a/pages/dnsapplications.js +++ b/pages/dnsapplications.js @@ -12,7 +12,7 @@ import CookieBanner from "../components/cookieBanner"; import DNSSearchResults from "../components/dnssearchresults"; import Footer from "../components/footer"; import Header from "../components/header"; -import { getSearchDetails } from "../components/utils"; +import { getSearchDetails, hasOwn } from "../components/utils"; import { setSearch } from "../store/search/action"; import { setSearchDetails, @@ -143,7 +143,7 @@ export const getServerSideProps = wrapper.getServerSideProps( const showMapCheck = process.env.SHOWMAPS || false; const mapTarget = process.env.MAP_TARGET || "pedw-dev"; - // if (_.has(searchResultsObj, "status") == true) { + // if (hasOwn(searchResultsObj, "status") == true) { // return { // redirect: { // //destination: "/dns-not-found", diff --git a/pages/index.js b/pages/index.js index 087374ed..16f1b749 100644 --- a/pages/index.js +++ b/pages/index.js @@ -18,6 +18,7 @@ import AIPolicyNotice from "../components/AIPolicyNotice"; import { setContainerID } from "../store/accountDetails/action"; import { setShowReps } from "../store/currentView/action"; import { wrapper } from "../store/store"; +import { hasOwn } from "../components/utils"; const Home = (props) => { const { @@ -49,7 +50,7 @@ const Home = (props) => { hasLoginCode == false ? "" //console.log("no session") - : _.has(loggedInUserId, "value") + : hasOwn(loggedInUserId, "value") ? _.isEmpty(loggedInUserId.value) ? router.replace({ pathname: diff --git a/pages/myportal/addresssearch.js b/pages/myportal/addresssearch.js index a649a7d5..63d5141a 100644 --- a/pages/myportal/addresssearch.js +++ b/pages/myportal/addresssearch.js @@ -1,5 +1,4 @@ //import fs from "fs"; -import _ from "lodash"; import useTranslation from "next-translate/useTranslation"; import Head from "next/head"; import { useRouter } from "next/router"; @@ -12,6 +11,7 @@ import Header from "../../components/header"; import Search from "../../components/myportal/addresssearch"; import ServiceBanner from "../../components/myportal/servicebanner"; import TimeOut from "../../components/timeout"; +import { hasOwn } from "../../components/utils"; const Home = (props) => { const { footerLinks, pages } = props; @@ -22,8 +22,8 @@ const Home = (props) => { const { appealtypes } = router.query; var hasError = - _.has(props.LPAData.LPAData, "errorCode") || - _.has(props.appealType.appealType, "errorCode") + hasOwn(props.LPAData.LPAData, "errorCode") || + hasOwn(props.appealType.appealType, "errorCode") ? true : false; @@ -123,7 +123,7 @@ const mapStateToProps = (state) => { appealType: state.appealType, LPAData: state.LPAData, //form: state.form, - accountDetails: state.accountDetails, + accountDetails: state.accountDetails }; }; diff --git a/pages/myportal/advancedsearch.js b/pages/myportal/advancedsearch.js index 4287368a..f5f7d68a 100644 --- a/pages/myportal/advancedsearch.js +++ b/pages/myportal/advancedsearch.js @@ -1,4 +1,3 @@ -import _ from "lodash"; import { getSession } from "next-auth/react"; import useTranslation from "next-translate/useTranslation"; import Head from "next/head"; @@ -28,6 +27,7 @@ import { setLPA, setCaseStatus } from "../../store/lpa/action"; import { wrapper } from "../../store/store"; import ServiceBanner from "../../components/myportal/servicebanner"; import { getCaseStatus } from "../../actions/services/caseDirectService"; +import { hasOwn } from "../../components/utils"; const Home = (props) => { const { footerLinks, pages } = props; @@ -38,8 +38,8 @@ const Home = (props) => { const { appealtypes } = router.query; var hasError = - _.has(props.LPAData.LPAData, "errorCode") || - _.has(props.appealType.appealType, "errorCode") + hasOwn(props.LPAData.LPAData, "errorCode") || + hasOwn(props.appealType.appealType, "errorCode") ? true : false; diff --git a/pages/newappeal/index.js b/pages/newappeal/index.js index bd256ded..50582e20 100644 --- a/pages/newappeal/index.js +++ b/pages/newappeal/index.js @@ -1,7 +1,6 @@ import useTranslation from "next-translate/useTranslation"; import Head from "next/head"; import { getSession, useSession } from "next-auth/react"; -import _ from "lodash"; import { useRouter } from "next/router"; import { connect } from "react-redux"; @@ -148,15 +147,6 @@ export const getServerSideProps = wrapper.getServerSideProps( let thisSession = await getSession(ctx); //console.log("nextAuth Session:", thisSession); - // if (_.has(thisSession, "user") == false) { - // return { - // redirect: { - // destination: "/error", - // permanent: false, - // }, - // }; - // } - if (!thisSession) { console.log("not has sesssion......."); return { diff --git a/pages/searchresults.js b/pages/searchresults.js index 35ff09ed..db386f45 100644 --- a/pages/searchresults.js +++ b/pages/searchresults.js @@ -1,4 +1,3 @@ -import _ from "lodash"; import useTranslation from "next-translate/useTranslation"; import Head from "next/head"; import { useRouter } from "next/router"; @@ -132,34 +131,6 @@ export const getServerSideProps = wrapper.getServerSideProps( const showLoginCheck = process.env.SHOWLOGIN || false; const showReps = process.env.SHOWREPRESENTATIONS || false; store.dispatch(setShowReps(showReps, showLoginCheck)); - - // let searchResultsObj = await getBasicSearch(query.q); - - // searchResultsObj = - // searchResultsObj.status == 502 - // ? { - // value: [], - // errorCode: searchResultsObj.status, - // errorMsg: searchResultsObj.statusText, - // } - // : searchResultsObj; - - // if (_.has(searchResultsObj, "status") == true) { - // return { - // redirect: { - // //destination: "/dns-not-found", - // destination: "/error", - // permanent: false, - // }, - // }; - // } else { - // // const searchDetailsObj = await getSearchDetails(searchResultsObj); - - // store.dispatch(setSearchResults(searchResultsObj)); - // // store.dispatch(setSearchDetails(searchDetailsObj)); - // store.dispatch(setSearch(query.q)); - // } - store.dispatch(setSearch(query?.q || "")); return { props: { diff --git a/tests/phase19/service-behaviour.test.cjs b/tests/phase19/service-behaviour.test.cjs index 184a2ca9..442d9236 100644 --- a/tests/phase19/service-behaviour.test.cjs +++ b/tests/phase19/service-behaviour.test.cjs @@ -164,7 +164,7 @@ test("getdnslist_api still returns 200 and preserves nextLink transform", async data: { value: [{ id: 1 }], "@odata.nextLink": - "https://example.test/v8.2/incidents?$skiptoken=abc" + "https://example.test/v9.2/incidents?$skiptoken=abc" } }) }, diff --git a/tests/phase20/service-behaviour.test.cjs b/tests/phase20/service-behaviour.test.cjs index 5352e909..50534935 100644 --- a/tests/phase20/service-behaviour.test.cjs +++ b/tests/phase20/service-behaviour.test.cjs @@ -74,7 +74,7 @@ test("getbasicdnssearch_api still returns 200 and preserves nextLink transform", data: { value: [{ id: 1 }], "@odata.nextLink": - "https://example.test/v8.2/incidents?$skiptoken=dns" + "https://example.test/v9.2/incidents?$skiptoken=dns" } }) }, @@ -116,7 +116,7 @@ test("getbasicdnsurlsearch_api valid searchString still returns 200", async () = data: { value: [{ id: 1 }], "@odata.nextLink": - "https://example.test/v8.2/incidents?$skiptoken=url" + "https://example.test/v9.2/incidents?$skiptoken=url" } }) },