From 326ae12c308c2cd8e16a5728f57b52382094ec83 Mon Sep 17 00:00:00 2001 From: Sucheta Mukherjee Date: Thu, 18 Jan 2024 13:28:05 -0500 Subject: [PATCH] adds a check for total infringements and scheduled raesons according to which the + button will rendered --- src/components/UserProfile/BlueSquareLayout.jsx | 2 +- src/components/UserProfile/BlueSquares/BlueSquare.jsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/UserProfile/BlueSquareLayout.jsx b/src/components/UserProfile/BlueSquareLayout.jsx index 6d2f9f169d..c5d5b94b7e 100644 --- a/src/components/UserProfile/BlueSquareLayout.jsx +++ b/src/components/UserProfile/BlueSquareLayout.jsx @@ -188,7 +188,7 @@ const BlueSquareLayout = props => { ) : null} - + {/* Replaces Schedule Blue Square button when there are more than 5 blue squares or scheduled reasons - by Sucheta */}
{ diff --git a/src/components/UserProfile/BlueSquares/BlueSquare.jsx b/src/components/UserProfile/BlueSquares/BlueSquare.jsx index 94a023aa7e..51e1501273 100644 --- a/src/components/UserProfile/BlueSquares/BlueSquare.jsx +++ b/src/components/UserProfile/BlueSquares/BlueSquare.jsx @@ -8,7 +8,7 @@ import { formatDateFromDescriptionString } from 'utils/formatDateFromDescription const BlueSquare = (props) => { const isInfringementAuthorizer = props.hasPermission('infringementAuthorizer'); const canPutUserProfileImportantInfo = props.hasPermission('putUserProfileImportantInfo'); - const { blueSquares, handleBlueSquare, isInfringementMoreThanFive } = props; + const { blueSquares, handleBlueSquare, isInfringementMoreThanFive, numberOfReasons, infringementsNum } = props; return (
@@ -52,7 +52,7 @@ const BlueSquare = (props) => { : null}
- {isInfringementAuthorizer && !isInfringementMoreThanFive &&( + {isInfringementAuthorizer && (!(infringementsNum >= 5 || numberOfReasons >= 5 || (infringementsNum + numberOfReasons >= 5 ))) && (
{ handleBlueSquare(true, 'addBlueSquare', '');