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