From 001c7ad6fa104599026a91605abc35bbc821c05f Mon Sep 17 00:00:00 2001 From: Robert Bond Date: Thu, 25 Jun 2026 14:47:05 +0000 Subject: [PATCH] Merged PR 2436: adjsuted condition to include pinswg_startdate in showrepbutton adjsuted condition to include pinswg_startdate in showrepbutton Related work items: #23998 --- components/search/repsonresults.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/components/search/repsonresults.js b/components/search/repsonresults.js index 051c3f18..b145f2b3 100644 --- a/components/search/repsonresults.js +++ b/components/search/repsonresults.js @@ -1,6 +1,5 @@ import useTranslation from "next-translate/useTranslation"; import { useRouter } from "next/router"; -import _ from "lodash"; import Link from "next/link"; import { resolveRepresentationWindow, @@ -21,6 +20,8 @@ const RepsOnResults = (props) => { detailsObj?.pinswg_speacialistcaseprocess || detailsObj?.pinswg_specialistcaseprocess; const representationWindow = resolveRepresentationWindow(detailsObj); + const hasOwn = (obj, key) => + Object.prototype.hasOwnProperty.call(obj || {}, key); function showRepButton(appealType) { if (!canShowRepresentationButtonForAppealType(appealType)) { @@ -78,9 +79,10 @@ const RepsOnResults = (props) => { return ( <>
- {(_.has(detailsObj, "pinswg_startdate") || - _.has(detailsObj, "pinswg_applicationacceptedasvalid") || - _.has(detailsObj, "pinswg_consultationopen")) && + {(hasOwn(detailsObj, "pinswg_startdate") || + hasOwn(detailsObj, "pinswg_startdates") || + hasOwn(detailsObj, "pinswg_applicationacceptedasvalid") || + hasOwn(detailsObj, "pinswg_consultationopen")) && ((representationWindow.hasStartDate && representationWindow.isOpen) || isRepresentationWindowOpen( @@ -158,7 +160,7 @@ const RepsOnResults = (props) => { )} )}{" "} - {_.has(detailsObj, "pinswg_startdate") && + {hasOwn(detailsObj, "pinswg_startdate") && (detailsObj.pinswg_startdate != null || detailsObj.pinswg_finalcommentsduedate != null) && isRepresentationWindowClosed(