From 2708434ceac5122c85a1faf9ba43ca2e2cf65ed6 Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Fri, 16 Feb 2024 16:36:42 +0100 Subject: [PATCH 1/7] fix direct round view --- .../round-manager/src/features/round/ViewRoundPage.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/round-manager/src/features/round/ViewRoundPage.tsx b/packages/round-manager/src/features/round/ViewRoundPage.tsx index 9faf3240d0..8f650d39b3 100644 --- a/packages/round-manager/src/features/round/ViewRoundPage.tsx +++ b/packages/round-manager/src/features/round/ViewRoundPage.tsx @@ -51,8 +51,11 @@ import moment from "moment"; import ApplicationsToApproveReject from "./ApplicationsToApproveReject"; import ApplicationsToReview from "./ApplicationsToReview"; -export const isDirectRound = (round: Round) => - round && round.payoutStrategy.strategyName === ROUND_PAYOUT_DIRECT; +export const isDirectRound = (round: Round) => { + return ( + round && round.payoutStrategy.strategyName?.toLowerCase().includes("direct") + ); +}; export default function ViewRoundPage() { datadogLogs.logger.info("====> Route: /round/:id"); From 1a34cc7e9273a0e7196afdc3046cbbf9101bbcd4 Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Fri, 16 Feb 2024 16:46:32 +0100 Subject: [PATCH 2/7] fix: is drect round --- .../src/features/round/ViewRoundPage.tsx | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/packages/round-manager/src/features/round/ViewRoundPage.tsx b/packages/round-manager/src/features/round/ViewRoundPage.tsx index 8f650d39b3..218ce1be8e 100644 --- a/packages/round-manager/src/features/round/ViewRoundPage.tsx +++ b/packages/round-manager/src/features/round/ViewRoundPage.tsx @@ -37,7 +37,6 @@ import { horizontalTabStyles, verticalTabStyles, } from "../common/Utils"; -import { ROUND_PAYOUT_DIRECT, ROUND_PAYOUT_MERKLE } from "common"; import ApplicationsApproved from "./ApplicationsApproved"; import ApplicationsRejected from "./ApplicationsRejected"; import FundContract from "./FundContract"; @@ -314,10 +313,7 @@ export default function ViewRoundPage() { Date: Fri, 16 Feb 2024 16:55:25 +0100 Subject: [PATCH 3/7] fix: application page --- .../round-manager/src/features/round/ViewApplicationPage.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/round-manager/src/features/round/ViewApplicationPage.tsx b/packages/round-manager/src/features/round/ViewApplicationPage.tsx index c79de020e1..e762384a25 100644 --- a/packages/round-manager/src/features/round/ViewApplicationPage.tsx +++ b/packages/round-manager/src/features/round/ViewApplicationPage.tsx @@ -63,12 +63,14 @@ import { getUTCTime, VerifiedCredentialState, } from "common"; -import { renderToHTML, ROUND_PAYOUT_DIRECT } from "common"; +import { renderToHTML } from "common"; import { useDebugMode } from "../../hooks"; import { getPayoutRoundDescription } from "../common/Utils"; import moment from "moment"; import ApplicationDirectPayout from "./ApplicationDirectPayout"; +const ROUND_PAYOUT_DIRECT = "DIRECT"; + type Status = "done" | "current" | "rejected" | "approved" | undefined; export const IAM_SERVER = From aab4b8fb10d8e022834fdafe8ec5fb73dcb6017c Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Fri, 16 Feb 2024 16:58:29 +0100 Subject: [PATCH 4/7] better fix --- .../src/features/round/ViewRoundPage.tsx | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/packages/round-manager/src/features/round/ViewRoundPage.tsx b/packages/round-manager/src/features/round/ViewRoundPage.tsx index 218ce1be8e..1aa62c18de 100644 --- a/packages/round-manager/src/features/round/ViewRoundPage.tsx +++ b/packages/round-manager/src/features/round/ViewRoundPage.tsx @@ -50,11 +50,11 @@ import moment from "moment"; import ApplicationsToApproveReject from "./ApplicationsToApproveReject"; import ApplicationsToReview from "./ApplicationsToReview"; -export const isDirectRound = (round: Round) => { - return ( - round && round.payoutStrategy.strategyName?.toLowerCase().includes("direct") - ); -}; +const ROUND_PAYOUT_DIRECT = "DIRECT"; +const ROUND_PAYOUT_MERKLE = "MERKLE"; + +export const isDirectRound = (round: Round) => + round && round.payoutStrategy.strategyName === ROUND_PAYOUT_DIRECT; export default function ViewRoundPage() { datadogLogs.logger.info("====> Route: /round/:id"); @@ -313,7 +313,10 @@ export default function ViewRoundPage() { Date: Fri, 16 Feb 2024 17:06:09 +0100 Subject: [PATCH 5/7] fix :test --- packages/round-manager/src/test-utils.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/round-manager/src/test-utils.tsx b/packages/round-manager/src/test-utils.tsx index 4370c935c5..e69cd92284 100644 --- a/packages/round-manager/src/test-utils.tsx +++ b/packages/round-manager/src/test-utils.tsx @@ -43,7 +43,10 @@ import { } from "./features/api/types"; import { IAM_SERVER } from "./features/round/ViewApplicationPage"; import moment from "moment"; -import { ROUND_PAYOUT_DIRECT, ROUND_PAYOUT_MERKLE } from "common"; +import { + ROUND_PAYOUT_DIRECT_OLD as ROUND_PAYOUT_DIRECT, + ROUND_PAYOUT_MERKLE_OLD as ROUND_PAYOUT_MERKLE, +} from "common"; export const mockedOperatorWallet = faker.finance.ethereumAddress(); From d6e834320da51cdffb4d16f565d422f8ed2c6c0a Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Fri, 16 Feb 2024 17:10:59 +0100 Subject: [PATCH 6/7] fix all occurrences --- packages/round-manager/src/features/common/Utils.ts | 11 ++++++++--- .../src/features/round/ViewApplicationPage.tsx | 3 +-- .../src/features/round/ViewRoundPage.tsx | 7 ++++--- .../round/__tests__/ApplicationDirectPayout.test.tsx | 2 +- .../round/__tests__/ApplicationsToReview.test.tsx | 2 +- .../round/__tests__/ViewApplicationPage.test.tsx | 2 +- 6 files changed, 16 insertions(+), 11 deletions(-) diff --git a/packages/round-manager/src/features/common/Utils.ts b/packages/round-manager/src/features/common/Utils.ts index bd6fffd1d2..d9e4bf43f9 100644 --- a/packages/round-manager/src/features/common/Utils.ts +++ b/packages/round-manager/src/features/common/Utils.ts @@ -1,4 +1,9 @@ -import { ROUND_PAYOUT_DIRECT, ROUND_PAYOUT_MERKLE } from "common"; +import { + ROUND_PAYOUT_DIRECT, + ROUND_PAYOUT_MERKLE, + ROUND_PAYOUT_DIRECT_OLD, + ROUND_PAYOUT_MERKLE_OLD, +} from "common"; export const verticalTabStyles = (selected: boolean) => selected @@ -13,11 +18,11 @@ export const horizontalTabStyles = (selected: boolean) => export const getPayoutRoundDescription = (key: string) => { switch (key) { case ROUND_PAYOUT_MERKLE: + case ROUND_PAYOUT_MERKLE_OLD: return "Quadratic Funding"; - break; case ROUND_PAYOUT_DIRECT: + case ROUND_PAYOUT_DIRECT_OLD: return "Direct Grant"; - break; default: return key; break; diff --git a/packages/round-manager/src/features/round/ViewApplicationPage.tsx b/packages/round-manager/src/features/round/ViewApplicationPage.tsx index e762384a25..9d378640c9 100644 --- a/packages/round-manager/src/features/round/ViewApplicationPage.tsx +++ b/packages/round-manager/src/features/round/ViewApplicationPage.tsx @@ -68,8 +68,7 @@ import { useDebugMode } from "../../hooks"; import { getPayoutRoundDescription } from "../common/Utils"; import moment from "moment"; import ApplicationDirectPayout from "./ApplicationDirectPayout"; - -const ROUND_PAYOUT_DIRECT = "DIRECT"; +import { ROUND_PAYOUT_DIRECT_OLD as ROUND_PAYOUT_DIRECT } from "common"; type Status = "done" | "current" | "rejected" | "approved" | undefined; diff --git a/packages/round-manager/src/features/round/ViewRoundPage.tsx b/packages/round-manager/src/features/round/ViewRoundPage.tsx index 1aa62c18de..4f65a7cde8 100644 --- a/packages/round-manager/src/features/round/ViewRoundPage.tsx +++ b/packages/round-manager/src/features/round/ViewRoundPage.tsx @@ -49,9 +49,10 @@ import { RoundDates, parseRoundDates } from "../common/parseRoundDates"; import moment from "moment"; import ApplicationsToApproveReject from "./ApplicationsToApproveReject"; import ApplicationsToReview from "./ApplicationsToReview"; - -const ROUND_PAYOUT_DIRECT = "DIRECT"; -const ROUND_PAYOUT_MERKLE = "MERKLE"; +import { + ROUND_PAYOUT_DIRECT_OLD as ROUND_PAYOUT_DIRECT, + ROUND_PAYOUT_MERKLE_OLD as ROUND_PAYOUT_MERKLE, +} from "common"; export const isDirectRound = (round: Round) => round && round.payoutStrategy.strategyName === ROUND_PAYOUT_DIRECT; diff --git a/packages/round-manager/src/features/round/__tests__/ApplicationDirectPayout.test.tsx b/packages/round-manager/src/features/round/__tests__/ApplicationDirectPayout.test.tsx index bbd36b4c94..5b26e02427 100644 --- a/packages/round-manager/src/features/round/__tests__/ApplicationDirectPayout.test.tsx +++ b/packages/round-manager/src/features/round/__tests__/ApplicationDirectPayout.test.tsx @@ -9,7 +9,7 @@ import { import "@testing-library/jest-dom/extend-expect"; import ApplicationDirectPayout from "../ApplicationDirectPayout"; import { makeGrantApplicationData, makeRoundData } from "../../../test-utils"; -import { ROUND_PAYOUT_DIRECT } from "common"; +import { ROUND_PAYOUT_DIRECT_OLD as ROUND_PAYOUT_DIRECT } from "common"; import { useWallet } from "../../common/Auth"; import { useDisconnect, useNetwork, useSwitchNetwork } from "wagmi"; diff --git a/packages/round-manager/src/features/round/__tests__/ApplicationsToReview.test.tsx b/packages/round-manager/src/features/round/__tests__/ApplicationsToReview.test.tsx index f4f6a2117d..9f43e71cad 100644 --- a/packages/round-manager/src/features/round/__tests__/ApplicationsToReview.test.tsx +++ b/packages/round-manager/src/features/round/__tests__/ApplicationsToReview.test.tsx @@ -27,7 +27,7 @@ import { // eslint-disable-next-line @typescript-eslint/no-unused-vars import { ApplicationStatus, ProgressStatus } from "../../api/types"; import { errorModalDelayMs } from "../../../constants"; -import { ROUND_PAYOUT_DIRECT } from "common"; +import { ROUND_PAYOUT_DIRECT_OLD as ROUND_PAYOUT_DIRECT } from "common"; jest.mock("../../api/application"); jest.mock("../../common/Auth", () => ({ diff --git a/packages/round-manager/src/features/round/__tests__/ViewApplicationPage.test.tsx b/packages/round-manager/src/features/round/__tests__/ViewApplicationPage.test.tsx index ba1951a2c4..658624b319 100644 --- a/packages/round-manager/src/features/round/__tests__/ViewApplicationPage.test.tsx +++ b/packages/round-manager/src/features/round/__tests__/ViewApplicationPage.test.tsx @@ -36,7 +36,7 @@ import { import { GrantApplication, ProgressStatus } from "../../api/types"; import { errorModalDelayMs } from "../../../constants"; import moment from "moment"; -import { ROUND_PAYOUT_DIRECT } from "common"; +import { ROUND_PAYOUT_DIRECT_OLD as ROUND_PAYOUT_DIRECT } from "common"; jest.mock("../../api/application"); jest.mock("../../common/Auth"); From 8d467cf9b4778bc00bbb5f56f3cdb9434fa05fdd Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Fri, 16 Feb 2024 17:16:25 +0100 Subject: [PATCH 7/7] fix program test --- .../src/features/program/__tests__/ViewProgramPage.test.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/round-manager/src/features/program/__tests__/ViewProgramPage.test.tsx b/packages/round-manager/src/features/program/__tests__/ViewProgramPage.test.tsx index 26c2271a70..30db454b30 100644 --- a/packages/round-manager/src/features/program/__tests__/ViewProgramPage.test.tsx +++ b/packages/round-manager/src/features/program/__tests__/ViewProgramPage.test.tsx @@ -10,7 +10,10 @@ import { import { faker } from "@faker-js/faker"; import { Program, ProgressStatus } from "../../api/types"; import { formatUTCDateAsISOString } from "common"; -import { ROUND_PAYOUT_DIRECT, ROUND_PAYOUT_MERKLE } from "common"; +import { + ROUND_PAYOUT_DIRECT_OLD as ROUND_PAYOUT_DIRECT, + ROUND_PAYOUT_MERKLE_OLD as ROUND_PAYOUT_MERKLE, +} from "common"; const programId = faker.datatype.number().toString(); const useParamsFn = () => ({ id: programId });