Merged PR 2442: remove lodash dependecies on _.has

Related work items: #23754
This commit is contained in:
Robert Bond
2026-06-29 13:08:06 +00:00
parent 7b6af58065
commit ff699735c7
85 changed files with 870 additions and 952 deletions
+32 -26
View File
@@ -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) => {
)}
:
</span>
{_.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 && <br />} */}
{_.has(
{hasOwn(
detailsObj,
"pinswg_siteaddressline1"
) &&
detailsObj.pinswg_siteaddressline1 !=
null && <br />}
{_.has(
{hasOwn(
detailsObj,
"pinswg_addressline1"
) &&
detailsObj.pinswg_addressline1 !=
null && <br />}
{_.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 && <br />}
{_.has(
{hasOwn(
detailsObj,
"pinswg_addressline2"
) &&
detailsObj.pinswg_addressline2 !=
null && <br />}
{_.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 && <br />}
{_.has(
{hasOwn(
detailsObj,
"pinswg_addresstown"
) &&
detailsObj.pinswg_addresstown !=
null && <br />}
{_.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 && <br />}
{_.has(
{hasOwn(
detailsObj,
"pinswg_addresscounty"
) &&
detailsObj.pinswg_addresscounty !=
null && <br />}
{_.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) => {
)}
:
</span>
{_.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) => {
)}
:
</span>
{_.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: