Merged PR 2436: adjsuted condition to include pinswg_startdate in showrepbutton
adjsuted condition to include pinswg_startdate in showrepbutton Related work items: #23998
This commit is contained in:
@@ -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 (
|
||||
<>
|
||||
<br />
|
||||
{(_.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(
|
||||
|
||||
Reference in New Issue
Block a user