diff --git a/packages/round-manager/src/features/common/useApplicationsByRoundId.tsx b/packages/round-manager/src/features/common/useApplicationsByRoundId.tsx index 156788f47a..113f92d7ee 100644 --- a/packages/round-manager/src/features/common/useApplicationsByRoundId.tsx +++ b/packages/round-manager/src/features/common/useApplicationsByRoundId.tsx @@ -1,5 +1,4 @@ import { useAccount } from "wagmi"; -import { GrantApplication } from "../../features/api/types"; import { useDataLayer } from "data-layer"; import useSWR from "swr"; import { convertApplications } from "../api/utils"; diff --git a/packages/round-manager/src/features/round/ApplicationsApproved.tsx b/packages/round-manager/src/features/round/ApplicationsApproved.tsx index 8d949e95d8..ef15adde9d 100644 --- a/packages/round-manager/src/features/round/ApplicationsApproved.tsx +++ b/packages/round-manager/src/features/round/ApplicationsApproved.tsx @@ -33,7 +33,9 @@ import { errorModalDelayMs } from "../../constants"; import ErrorModal from "../common/ErrorModal"; import { getRoundStrategyType, useAllo } from "common"; -export default function ApplicationsApproved() { +export default function ApplicationsApproved(props: { + roundHasEnded: boolean +}) { const { id } = useParams(); const allo = useAllo(); @@ -177,7 +179,7 @@ const { data: applications, isLoading } = useApplicationsByRoundId(id); return ( <> - {approvedApplications && approvedApplications.length > 0 && ( + {!props.roundHasEnded && approvedApplications && approvedApplications.length > 0 && (
Save in gas fees by approving/rejecting multiple applications at diff --git a/packages/round-manager/src/features/round/ApplicationsRejected.tsx b/packages/round-manager/src/features/round/ApplicationsRejected.tsx index a97c656bec..4c5e9d4f3b 100644 --- a/packages/round-manager/src/features/round/ApplicationsRejected.tsx +++ b/packages/round-manager/src/features/round/ApplicationsRejected.tsx @@ -33,7 +33,9 @@ import ErrorModal from "../common/ErrorModal"; import { errorModalDelayMs } from "../../constants"; import { getRoundStrategyType, useAllo } from "common"; -export default function ApplicationsRejected() { +export default function ApplicationsRejected(props: { + roundHasEnded: boolean; +}) { const { id } = useParams(); const allo = useAllo(); @@ -175,21 +177,24 @@ export default function ApplicationsRejected() { return ( <> - {rejectedApplications && rejectedApplications.length > 0 ? ( -
- - Save in gas fees by approving/rejecting multiple applications at - once. - - {bulkSelectRejected ? ( - setBulkSelectRejected(false)} /> - ) : ( - setBulkSelectRejected(true)} /> + )} +
+ ) : ( +
No Rejected Applications
+ )} + } {!isLoading && rejectedApplications?.map((application, index) => ( diff --git a/packages/round-manager/src/features/round/ApplicationsToApproveReject.tsx b/packages/round-manager/src/features/round/ApplicationsToApproveReject.tsx index a5bb8b77dc..c0b89e02ab 100644 --- a/packages/round-manager/src/features/round/ApplicationsToApproveReject.tsx +++ b/packages/round-manager/src/features/round/ApplicationsToApproveReject.tsx @@ -72,12 +72,14 @@ export async function exportAndDownloadCSV( type Props = { isDirectRound?: boolean; + roundHasEnded: boolean; }; // Approve or reject applications received in bulk, both in QF & direct grants export default function ApplicationsToApproveReject({ isDirectRound = false, + roundHasEnded }: Props) { const { id } = useParams(); const { chainId } = useAccount(); @@ -273,7 +275,7 @@ export default function ApplicationsToApproveReject({ )} )} - {filteredApplications && filteredApplications.length > 0 && ( + {!roundHasEnded && filteredApplications && filteredApplications.length > 0 && (
Save in gas fees by approving/rejecting multiple applications at diff --git a/packages/round-manager/src/features/round/ApplicationsToReview.tsx b/packages/round-manager/src/features/round/ApplicationsToReview.tsx index cd398de1c2..af3de8c7a4 100644 --- a/packages/round-manager/src/features/round/ApplicationsToReview.tsx +++ b/packages/round-manager/src/features/round/ApplicationsToReview.tsx @@ -42,7 +42,9 @@ import { useAccount } from "wagmi"; // Move applications received in direct grants to In Review -export default function ApplicationsToReview() { +export default function ApplicationsToReview(props: { + roundHasEnded: boolean; +}) { const { id } = useParams(); const { chainId } = useAccount(); @@ -239,7 +241,7 @@ export default function ApplicationsToReview() { )} )} - {filteredApplications && filteredApplications.length > 0 && ( + {!props.roundHasEnded && filteredApplications && filteredApplications.length > 0 && (
Save in gas fees by moving multiple applications to "In Review" diff --git a/packages/round-manager/src/features/round/GrantApplications.tsx b/packages/round-manager/src/features/round/GrantApplications.tsx index 8974de9052..fa1f09b113 100644 --- a/packages/round-manager/src/features/round/GrantApplications.tsx +++ b/packages/round-manager/src/features/round/GrantApplications.tsx @@ -21,6 +21,7 @@ function GrantApplications(props: { fetchRoundStatus: ProgressStatus; chainId: string; roundId: string | undefined; + roundHasEnded: boolean; }) { // Filter applications into pending, approved, rejected & in-review const pendingApplications = (props.applications || []) @@ -148,10 +149,11 @@ function GrantApplications(props: { {props.isDirectRound ? ( - + ) : ( )} @@ -159,14 +161,15 @@ function GrantApplications(props: { )} - + - + diff --git a/packages/round-manager/src/features/round/ViewApplicationPage.tsx b/packages/round-manager/src/features/round/ViewApplicationPage.tsx index 7b7d51e5ac..c0486dae09 100644 --- a/packages/round-manager/src/features/round/ViewApplicationPage.tsx +++ b/packages/round-manager/src/features/round/ViewApplicationPage.tsx @@ -492,12 +492,20 @@ export default function ViewApplicationPage() { ? getRoundStrategyType(application.payoutStrategy.strategyName) : undefined; + const hasRoundEnded = round ? moment().isAfter(round?.roundEndTime) : false; + const showReviewButton = () => strategyType === "DirectGrants" && application?.status === "PENDING" && - application?.inReview === false; + application?.inReview === false && + !hasRoundEnded; const showApproveReject = () => { + console.log("showApproveReject", application?.status, hasRoundEnded); + if (hasRoundEnded) { + return false; + } + if (strategyType !== "DirectGrants") { return true; } diff --git a/packages/round-manager/src/features/round/ViewRoundPage.tsx b/packages/round-manager/src/features/round/ViewRoundPage.tsx index 7b2c711e53..eec7ebe9e0 100644 --- a/packages/round-manager/src/features/round/ViewRoundPage.tsx +++ b/packages/round-manager/src/features/round/ViewRoundPage.tsx @@ -69,8 +69,6 @@ export default function ViewRoundPage() { id.toLowerCase() ); - console.log("round", round); - const isRoundFetched = fetchRoundStatus == ProgressStatus.IS_SUCCESS && !error; const { data: applications } = useApplicationsByRoundId(id); @@ -88,6 +86,8 @@ export default function ViewRoundPage() { : true); const roundNotFound = fetchRoundStatus === ProgressStatus.IS_ERROR; + const roundHasEnded = round ? moment().isAfter(round?.roundEndTime) : false; + useEffect(() => { if (roundChainId !== chain?.id) { switchChain({ connector, chainId: roundChainId as number }); @@ -95,7 +95,6 @@ export default function ViewRoundPage() { }, [chain?.id, roundChainId, connector, switchChain]); const strategyName = round?.payoutStrategy.strategyName; - console.log("strategyName", strategyName); const badgeColor = strategyName === "MERKLE" ? "gradient-border-qf" : "gradient-border-direct"; @@ -388,6 +387,7 @@ export default function ViewRoundPage() { fetchRoundStatus={fetchRoundStatus} chainId={`${chain?.id}`} roundId={id} + roundHasEnded={roundHasEnded} /> {!isDirectRound(round) && (