Merged PR 2442: remove lodash dependecies on _.has
Related work items: #23754
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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) => {
|
||||
)}
|
||||
:
|
||||
</span>
|
||||
{_.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 && <br />}
|
||||
{_.has(
|
||||
{hasOwn(
|
||||
detailsObj,
|
||||
"pinswg_siteaddressline2"
|
||||
)
|
||||
? detailsObj.pinswg_siteaddressline2
|
||||
: ""}
|
||||
{_.has(
|
||||
{hasOwn(
|
||||
detailsObj,
|
||||
"pinswg_siteaddressline2"
|
||||
) &&
|
||||
detailsObj.pinswg_siteaddressline2 !=
|
||||
null && <br />}
|
||||
{_.has(
|
||||
{hasOwn(
|
||||
detailsObj,
|
||||
"pinswg_siteaddressline1"
|
||||
)
|
||||
? detailsObj.pinswg_siteaddresstown
|
||||
: ""}
|
||||
{_.has(
|
||||
{hasOwn(
|
||||
detailsObj,
|
||||
"pinswg_siteaddresstown"
|
||||
) &&
|
||||
detailsObj.pinswg_siteaddresstown !=
|
||||
null && <br />}
|
||||
{_.has(
|
||||
{hasOwn(
|
||||
detailsObj,
|
||||
"pinswg_siteaddressline1"
|
||||
)
|
||||
? detailsObj.pinswg_siteaddresscounty
|
||||
: ""}
|
||||
{_.has(
|
||||
{hasOwn(
|
||||
detailsObj,
|
||||
"pinswg_siteaddresscounty"
|
||||
) &&
|
||||
detailsObj.pinswg_siteaddresscounty !=
|
||||
null && <br />}
|
||||
{_.has(
|
||||
{hasOwn(
|
||||
detailsObj,
|
||||
"pinswg_siteaddressline1"
|
||||
)
|
||||
@@ -590,9 +589,10 @@ const DNSSearchResults = (props) => {
|
||||
)}
|
||||
:
|
||||
</span>
|
||||
{_.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) => {
|
||||
)}
|
||||
:
|
||||
</span>
|
||||
{_.has(detailsObj, [
|
||||
{hasOwn(
|
||||
detailsObj,
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
])
|
||||
)
|
||||
? router.locale == "cy"
|
||||
? jsonpath({
|
||||
path:
|
||||
|
||||
@@ -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) => {
|
||||
)}
|
||||
:
|
||||
</span>
|
||||
{_.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 && <br />} */}
|
||||
|
||||
{_.has(
|
||||
{hasOwn(
|
||||
detailsObj,
|
||||
"pinswg_siteaddressline1"
|
||||
) &&
|
||||
detailsObj.pinswg_siteaddressline1 !=
|
||||
null && <br />}
|
||||
|
||||
{_.has(
|
||||
{hasOwn(
|
||||
detailsObj,
|
||||
"pinswg_siteaddressline1"
|
||||
)
|
||||
? detailsObj.pinswg_siteaddressline2
|
||||
: ""}
|
||||
|
||||
{_.has(
|
||||
{hasOwn(
|
||||
detailsObj,
|
||||
"pinswg_siteaddressline2"
|
||||
) &&
|
||||
detailsObj.pinswg_siteaddressline2 !=
|
||||
null && <br />}
|
||||
{_.has(
|
||||
{hasOwn(
|
||||
detailsObj,
|
||||
"pinswg_siteaddresstown"
|
||||
)
|
||||
? detailsObj.pinswg_siteaddresstown
|
||||
: ""}
|
||||
{_.has(
|
||||
{hasOwn(
|
||||
detailsObj,
|
||||
"pinswg_siteaddresstown"
|
||||
) &&
|
||||
detailsObj.pinswg_siteaddresstown !=
|
||||
null && <br />}
|
||||
|
||||
{_.has(
|
||||
{hasOwn(
|
||||
detailsObj,
|
||||
"pinswg_siteaddresscounty"
|
||||
)
|
||||
? detailsObj.pinswg_siteaddresscounty
|
||||
: ""}
|
||||
{_.has(
|
||||
{hasOwn(
|
||||
detailsObj,
|
||||
"pinswg_siteaddresscounty"
|
||||
) &&
|
||||
detailsObj.pinswg_siteaddresscounty !=
|
||||
null && <br />}
|
||||
{_.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) => {
|
||||
)}
|
||||
:
|
||||
</span>
|
||||
{_.has(item, [
|
||||
{hasOwn(
|
||||
item,
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
])
|
||||
)
|
||||
? router.locale == "cy"
|
||||
? jsonpath({
|
||||
path:
|
||||
|
||||
Reference in New Issue
Block a user