diff --git a/packages/builder/src/actions/grantsMetadata.ts b/packages/builder/src/actions/grantsMetadata.ts index ad46f00cd8..0df97270cb 100644 --- a/packages/builder/src/actions/grantsMetadata.ts +++ b/packages/builder/src/actions/grantsMetadata.ts @@ -96,8 +96,9 @@ export const transformAndDispatchProject = }; // todo: should we lowercase the owner addresses? + console.log("project.projectRoles", project.projectRoles); const ownerAddresses: string[] = project.projectRoles - .filter((role: AddressAndRole) => role.role === "OWNER") + .filter((role: AddressAndRole) => role.role === "owner") .map((role) => ethers.utils.getAddress(role.address)); dispatch(projectOwnersLoaded(id, ownerAddresses)); diff --git a/packages/data-layer/src/data-layer.test.ts b/packages/data-layer/src/data-layer.test.ts index 9c0bd838ad..794e3be522 100644 --- a/packages/data-layer/src/data-layer.test.ts +++ b/packages/data-layer/src/data-layer.test.ts @@ -42,7 +42,7 @@ const mockProjects: v2Project[] = [ projectRoles: [ { address: "0xe849b2a694184b8739a04c915518330757cdb18b", - role: "OWNER", + role: "owner", createdAtBlock: "5146499", }, ], diff --git a/packages/grant-explorer/src/features/projects/ViewProject.tsx b/packages/grant-explorer/src/features/projects/ViewProject.tsx index 390e31231f..ec0265c807 100644 --- a/packages/grant-explorer/src/features/projects/ViewProject.tsx +++ b/packages/grant-explorer/src/features/projects/ViewProject.tsx @@ -474,7 +474,7 @@ export default function ViewProject() { const poolId = directAllocationPoolId.toString(); const recipient = project?.projectRoles?.filter( - (role) => role.role === "OWNER" + (role) => role.role === "owner" )[0].address; const nonce = project?.nonce; diff --git a/packages/round-manager/src/features/api/__tests__/program.test.ts b/packages/round-manager/src/features/api/__tests__/program.test.ts index 0ab2d85114..69243d03ad 100644 --- a/packages/round-manager/src/features/api/__tests__/program.test.ts +++ b/packages/round-manager/src/features/api/__tests__/program.test.ts @@ -26,7 +26,6 @@ describe("listPrograms", () => { // createdByAddress: expectedProgram.operatorWallets[0], // }; // const expectedPrograms: Program[] = [expectedProgram]; - // const actualPrograms = await listPrograms("0x0", 1, { // getProgramsByUser: jest.fn().mockResolvedValue({ // programs: [ @@ -48,7 +47,6 @@ describe("listPrograms", () => { // ], // }), // } as unknown as DataLayer); - // expect(actualPrograms).toEqual(expectedPrograms); // }); }); @@ -70,7 +68,7 @@ describe("getProgramById", () => { roles: [ { address: expectedProgram.operatorWallets[0], - role: "OWNER", + role: "owner", createdAtBlock: "0", }, ], diff --git a/packages/round-manager/src/features/program/ViewManageProgram.tsx b/packages/round-manager/src/features/program/ViewManageProgram.tsx index a5892875d8..5784c3ded1 100644 --- a/packages/round-manager/src/features/program/ViewManageProgram.tsx +++ b/packages/round-manager/src/features/program/ViewManageProgram.tsx @@ -18,8 +18,8 @@ import { PlusIcon } from "@heroicons/react/solid"; const sortDataByRole = (data: AddressAndRole[]): AddressAndRole[] => { return data.sort((a, b) => { - if (a.role === "OWNER") return -1; - if (b.role === "OWNER") return 1; + if (a.role === "owner") return -1; + if (b.role === "owner") return 1; return a.role.localeCompare(b.role); }); }; @@ -35,8 +35,8 @@ const filterRoles = (data: AddressAndRole[]): AddressAndRole[] => { // If not included, simply add the current item acc.push(current); } else if ( - acc[existingIndex].role !== "OWNER" && - current.role === "OWNER" + acc[existingIndex].role !== "owner" && + current.role === "owner" ) { // If the existing item is not an Owner but the current is, replace it acc[existingIndex] = current; @@ -64,7 +64,7 @@ export function ViewManageProgram(props: { const isOwner = props.program?.roles?.some( (role) => role.address.toLowerCase() === props.userAddress.toLowerCase() && - role.role === "OWNER" + role.role === "owner" ); // Show Owner role first, then Operator @@ -84,7 +84,7 @@ export function ViewManageProgram(props: { name: "Updating", description: `Updating the team members for the profile`, status: contractUpdatingStatus, - } + }, ]; const handleUpdateTeam = async () => { @@ -192,9 +192,9 @@ export function ViewManageProgram(props: { - {item.role === "OWNER" ? "Owner" : "Member"} + {item.role === "owner" ? "Owner" : "Member"} - {isOwner && item.role !== "OWNER" ? ( + {isOwner && item.role !== "owner" ? ( - ) : - } + ) : ( + + )} ))} diff --git a/packages/round-manager/src/features/round/ViewManageTeam.tsx b/packages/round-manager/src/features/round/ViewManageTeam.tsx index 243fa6e85e..4025fc9a5b 100644 --- a/packages/round-manager/src/features/round/ViewManageTeam.tsx +++ b/packages/round-manager/src/features/round/ViewManageTeam.tsx @@ -19,8 +19,8 @@ import { PlusIcon } from "@heroicons/react/solid"; const sortDataByRole = (data: AddressAndRole[]): AddressAndRole[] => { return data.sort((a, b) => { - if (a.role === "ADMIN") return -1; - if (b.role === "ADMIN") return 1; + if (a.role === "admin") return -1; + if (b.role === "admin") return 1; return a.role.localeCompare(b.role); }); }; @@ -36,8 +36,8 @@ const filterRoles = (data: AddressAndRole[]): AddressAndRole[] => { // If not included, simply add the current item acc.push(current); } else if ( - acc[existingIndex].role !== "ADMIN" && - current.role === "ADMIN" + acc[existingIndex].role !== "admin" && + current.role === "admin" ) { // If the existing item is not an Admin but the current is, replace it acc[existingIndex] = current; @@ -75,7 +75,7 @@ export default function ViewManageTeam(props: { const isAdmin = props.round?.roles?.some( (role) => role.address.toLowerCase() === props.userAddress.toLowerCase() && - role.role === "ADMIN" + role.role === "admin" ); // Show Admin role first, then Operator @@ -90,7 +90,6 @@ export default function ViewManageTeam(props: { const isTeamMembersLoading = indexingStatus == ProgressStatus.IN_PROGRESS; - const progressSteps: ProgressStep[] = [ { name: "Updating", @@ -257,9 +256,9 @@ export default function ViewManageTeam(props: { - {item.role === "ADMIN" ? "Admin" : "Operator"} + {item.role === "admin" ? "Admin" : "Operator"} - {editMode && item.role !== "ADMIN" && ( + {editMode && item.role !== "admin" && ( = {}): Program => ({ roles: [ { address: mockedOperatorWallet, - role: "OWNER", + role: "owner", createdAtBlock: "0", }, ], @@ -72,7 +72,8 @@ export const makeRoundData = (overrides: Partial = {}): Round => { const protocolFeePercentage = 10000; return { id: faker.finance.ethereumAddress(), - strategyName: "allov2.DonationVotingMerkleDistributionDirectTransferStrategy", + strategyName: + "allov2.DonationVotingMerkleDistributionDirectTransferStrategy", chainId: 1, roundMetadata: { name: faker.company.name(), @@ -113,7 +114,7 @@ export const makeRoundData = (overrides: Partial = {}): Round => { roles: [ { address: mockedOperatorWallet, - role: "OWNER", + role: "owner", createdAtBlock: "0", }, ], @@ -140,7 +141,8 @@ export const makeDirectGrantRoundData = ( const protocolFeePercentage = 10000; return { id: faker.finance.ethereumAddress(), - strategyName: "allov2.DonationVotingMerkleDistributionDirectTransferStrategy", + strategyName: + "allov2.DonationVotingMerkleDistributionDirectTransferStrategy", chainId: 1, roundMetadata: { name: faker.company.name(), @@ -181,7 +183,7 @@ export const makeDirectGrantRoundData = ( roles: [ { address: mockedOperatorWallet, - role: "OWNER", + role: "owner", createdAtBlock: "0", }, ],