From f6f4ad45497a9efeb81b26d048d580099a2c09bf Mon Sep 17 00:00:00 2001 From: Jane Kamata Date: Thu, 4 Dec 2025 23:42:21 -0500 Subject: [PATCH 1/2] Adding role authorization back to grant page --- frontend/src/custom/ActionConfirmation.tsx | 2 +- frontend/src/main-page/grants/GrantPage.tsx | 63 +++++++++++-------- .../main-page/grants/grant-list/GrantItem.tsx | 14 ++--- 3 files changed, 46 insertions(+), 33 deletions(-) diff --git a/frontend/src/custom/ActionConfirmation.tsx b/frontend/src/custom/ActionConfirmation.tsx index 7c56b65..0c1abda 100644 --- a/frontend/src/custom/ActionConfirmation.tsx +++ b/frontend/src/custom/ActionConfirmation.tsx @@ -31,7 +31,7 @@ import { IoIosWarning } from "react-icons/io"; borderColor: 'black', borderWidth: '2px' }} - className=" bg-white rounded-lg shadow-2xl p-8 max-w-xl w-full mx-4 transform transition-all duration-300" + className=" bg-white rounded-md shadow-2xl p-8 max-w-xl w-full mx-4 transform transition-all duration-300" onClick={(e) => e.stopPropagation()} > diff --git a/frontend/src/main-page/grants/GrantPage.tsx b/frontend/src/main-page/grants/GrantPage.tsx index 05bc399..98566e2 100644 --- a/frontend/src/main-page/grants/GrantPage.tsx +++ b/frontend/src/main-page/grants/GrantPage.tsx @@ -17,7 +17,8 @@ import { import { toJS } from "mobx"; import { fetchGrants } from "./filter-bar/processGrantData.ts"; - +import { UserStatus } from "../../../../middle-layer/types/UserStatus.ts"; +import { Navigate } from "react-router-dom"; interface GrantPageProps { showOnlyMyGrants?: boolean; //if true, filters grants by user email @@ -50,38 +51,50 @@ function GrantPage({ showOnlyMyGrants = false }: GrantPageProps) { } }, [showNewGrantModal, wasGrantSubmitted]); - return ( -
-
-
+ return user ? ( + user?.position !== UserStatus.Inactive ? ( +
+
setShowNewGrantModal(true)} />
-
-
- +
+
+ +
+
+
+ setSelectedGrant(null)} + currentUserEmail={currentUserEmail} + showOnlyMyGrants={showOnlyMyGrants} + /> +
+
-
-
- setSelectedGrant(null)} - currentUserEmail={currentUserEmail} - showOnlyMyGrants={showOnlyMyGrants} +
+ {showNewGrantModal && ( + { + setShowNewGrantModal(false); + setWasGrantSubmitted(true); + }} + isOpen={showNewGrantModal} /> -
+ )}
-
- {showNewGrantModal && ( - {setShowNewGrantModal(false); setWasGrantSubmitted(true);} } isOpen={showNewGrantModal} /> - )} -
-
+ ) : ( + + ) + ) : ( + ); -} +} export default GrantPage; diff --git a/frontend/src/main-page/grants/grant-list/GrantItem.tsx b/frontend/src/main-page/grants/grant-list/GrantItem.tsx index 3360955..36694c2 100644 --- a/frontend/src/main-page/grants/grant-list/GrantItem.tsx +++ b/frontend/src/main-page/grants/grant-list/GrantItem.tsx @@ -217,7 +217,7 @@ const GrantItem: React.FC = observer( {/*Left column of gray labels */}
{/*Application date and grant start date row*/} -
+
{/*Application date*/}
= observer( className="w-4/5 border-l border-black bg-[#FFCEB6] rounded-r-md" >

{" "} {curGrant.bcan_poc?.POC_name ?? "Unknown"}{" "}

= observer( className="w-4/5 border-l border-black bg-[#FFCEB6] rounded-r-md" >

{" "} {curGrant.grantmaker_poc?.POC_name ?? "Unknown"}

= observer( Scope Documents
Date: Fri, 5 Dec 2025 00:35:48 -0500 Subject: [PATCH 2/2] Random fixes --- frontend/src/main-page/header/AccountInfo.tsx | 1 + frontend/src/main-page/header/styles/AccountInfo.css | 7 ++----- frontend/src/main-page/restricted/RestrictedPage.tsx | 2 +- frontend/src/main-page/users/UserPositionCard.tsx | 2 +- frontend/tailwind.config.ts | 2 +- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/frontend/src/main-page/header/AccountInfo.tsx b/frontend/src/main-page/header/AccountInfo.tsx index b35e54a..b80d4d4 100644 --- a/frontend/src/main-page/header/AccountInfo.tsx +++ b/frontend/src/main-page/header/AccountInfo.tsx @@ -33,6 +33,7 @@ const AccountInfo: React.FC = ({ const handleLogoutClick = () => { logoutUser(); setOpenModal(null); + navigate('login'); }; return createPortal( diff --git a/frontend/src/main-page/header/styles/AccountInfo.css b/frontend/src/main-page/header/styles/AccountInfo.css index c73064b..e2c2894 100644 --- a/frontend/src/main-page/header/styles/AccountInfo.css +++ b/frontend/src/main-page/header/styles/AccountInfo.css @@ -12,15 +12,14 @@ position: absolute; padding: 20px 40px; background-color: white; - border: 3px solid #2d2d2d; - border-radius: 16px; + border: 1px solid #2d2d2d; + border-radius: 8px; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15); z-index: 9999; } .popup-header { color: #000; - font-family: Montserrat; font-size: 22px; font-style: normal; font-weight: 100; @@ -51,7 +50,6 @@ .info-label { color: #646464; - font-family: Montserrat; font-size: 15px; font-style: normal; font-weight: 700; @@ -61,7 +59,6 @@ .info-value { color: #000; -font-family: Montserrat; font-size: 15px; font-style: normal; font-weight: 400; diff --git a/frontend/src/main-page/restricted/RestrictedPage.tsx b/frontend/src/main-page/restricted/RestrictedPage.tsx index 004c3fd..3fe0767 100644 --- a/frontend/src/main-page/restricted/RestrictedPage.tsx +++ b/frontend/src/main-page/restricted/RestrictedPage.tsx @@ -4,7 +4,7 @@ import { ButtonColorOption } from "../../custom/RingButton"; function RestrictedPage() { return ( -
+

So Sorry!

diff --git a/frontend/src/main-page/users/UserPositionCard.tsx b/frontend/src/main-page/users/UserPositionCard.tsx index 9cb5afc..e2a4a63 100644 --- a/frontend/src/main-page/users/UserPositionCard.tsx +++ b/frontend/src/main-page/users/UserPositionCard.tsx @@ -21,7 +21,7 @@ const UserPositionCard = ({ position }: UserPositionCardProps) => { }, [position]); return ( -

+

{position}

); diff --git a/frontend/tailwind.config.ts b/frontend/tailwind.config.ts index 9d00b14..4d78e2c 100644 --- a/frontend/tailwind.config.ts +++ b/frontend/tailwind.config.ts @@ -28,7 +28,7 @@ export default { }, borderRadius: { '4xl': '2rem', - 'md': '15px', + 'md': '0.75rem', }, } },