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 useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import _ from "lodash";
|
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import {
|
import {
|
||||||
resolveRepresentationWindow,
|
resolveRepresentationWindow,
|
||||||
@@ -21,6 +20,8 @@ const RepsOnResults = (props) => {
|
|||||||
detailsObj?.pinswg_speacialistcaseprocess ||
|
detailsObj?.pinswg_speacialistcaseprocess ||
|
||||||
detailsObj?.pinswg_specialistcaseprocess;
|
detailsObj?.pinswg_specialistcaseprocess;
|
||||||
const representationWindow = resolveRepresentationWindow(detailsObj);
|
const representationWindow = resolveRepresentationWindow(detailsObj);
|
||||||
|
const hasOwn = (obj, key) =>
|
||||||
|
Object.prototype.hasOwnProperty.call(obj || {}, key);
|
||||||
|
|
||||||
function showRepButton(appealType) {
|
function showRepButton(appealType) {
|
||||||
if (!canShowRepresentationButtonForAppealType(appealType)) {
|
if (!canShowRepresentationButtonForAppealType(appealType)) {
|
||||||
@@ -78,9 +79,10 @@ const RepsOnResults = (props) => {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<br />
|
<br />
|
||||||
{(_.has(detailsObj, "pinswg_startdate") ||
|
{(hasOwn(detailsObj, "pinswg_startdate") ||
|
||||||
_.has(detailsObj, "pinswg_applicationacceptedasvalid") ||
|
hasOwn(detailsObj, "pinswg_startdates") ||
|
||||||
_.has(detailsObj, "pinswg_consultationopen")) &&
|
hasOwn(detailsObj, "pinswg_applicationacceptedasvalid") ||
|
||||||
|
hasOwn(detailsObj, "pinswg_consultationopen")) &&
|
||||||
((representationWindow.hasStartDate &&
|
((representationWindow.hasStartDate &&
|
||||||
representationWindow.isOpen) ||
|
representationWindow.isOpen) ||
|
||||||
isRepresentationWindowOpen(
|
isRepresentationWindowOpen(
|
||||||
@@ -158,7 +160,7 @@ const RepsOnResults = (props) => {
|
|||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
)}{" "}
|
)}{" "}
|
||||||
{_.has(detailsObj, "pinswg_startdate") &&
|
{hasOwn(detailsObj, "pinswg_startdate") &&
|
||||||
(detailsObj.pinswg_startdate != null ||
|
(detailsObj.pinswg_startdate != null ||
|
||||||
detailsObj.pinswg_finalcommentsduedate != null) &&
|
detailsObj.pinswg_finalcommentsduedate != null) &&
|
||||||
isRepresentationWindowClosed(
|
isRepresentationWindowClosed(
|
||||||
|
|||||||
Reference in New Issue
Block a user