Merged PR 2442: remove lodash dependecies on _.has
Related work items: #23754
This commit is contained in:
@@ -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