Skip to content

Commit

Permalink
fix direct round view (#2954)
Browse files Browse the repository at this point in the history
* fix direct round view

* fix: is drect round

* fix: application page

* better fix

* fix :test

* fix all occurrences

* fix program test
  • Loading branch information
boudra authored Feb 16, 2024
1 parent 58caabd commit a35db33
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 10 deletions.
11 changes: 8 additions & 3 deletions packages/round-manager/src/features/common/Utils.ts
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,12 @@ 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";
import { ROUND_PAYOUT_DIRECT_OLD as ROUND_PAYOUT_DIRECT } from "common";

type Status = "done" | "current" | "rejected" | "approved" | undefined;

Expand Down
5 changes: 4 additions & 1 deletion packages/round-manager/src/features/round/ViewRoundPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -50,6 +49,10 @@ import { RoundDates, parseRoundDates } from "../common/parseRoundDates";
import moment from "moment";
import ApplicationsToApproveReject from "./ApplicationsToApproveReject";
import ApplicationsToReview from "./ApplicationsToReview";
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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", () => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
5 changes: 4 additions & 1 deletion packages/round-manager/src/test-utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit a35db33

Please sign in to comment.