Skip to content

Commit

Permalink
integrate checker (#3730)
Browse files Browse the repository at this point in the history
* enable sync with checker on pool creation and apply

* add in review Applicaitons Button

* wire in view application

* fix route

* show only checker
  • Loading branch information
thelostone-mc authored Jan 15, 2025
1 parent a3fa361 commit 4d78de3
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 282 deletions.
12 changes: 4 additions & 8 deletions packages/builder/src/components/grants/ApplicationCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { useEffect } from "react";
import { useDispatch, useSelector } from "react-redux";
import { Link } from "react-router-dom";
import { loadRound } from "../../actions/rounds";
import { roundApplicationViewPath } from "../../routes";
import { ApplicationCardType, RoundSupport } from "../../types";
import {
formatDate,
Expand Down Expand Up @@ -196,6 +195,9 @@ export default function ApplicationCard({
return null;
}

const applicationViewLink = `https://beta.checker.gitcoin.co/view/application/
${applicationData.chainId}/${applicationData.roundID}/${applicationData.application.id}`;

return (
<Box
p={2}
Expand Down Expand Up @@ -241,13 +243,7 @@ export default function ApplicationCard({
</a>
</p>
)}
<Link
to={roundApplicationViewPath(
applicationData.chainId.toString(),
applicationData.roundID,
applicationData.application.metadataCid || ""
)}
>
<Link to={applicationViewLink} target="_blank">
<Button
backgroundColor="purple.100"
color="purple.600"
Expand Down
262 changes: 0 additions & 262 deletions packages/builder/src/components/rounds/ViewApplication.tsx

This file was deleted.

5 changes: 0 additions & 5 deletions packages/builder/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import NewProject from "./components/grants/New";
import Project from "./components/grants/Show";
import RoundApply from "./components/rounds/Apply";
import RoundShow from "./components/rounds/Show";
import ViewApplication from "./components/rounds/ViewApplication";
import history from "./history";
import reportWebVitals from "./reportWebVitals";
import { slugs } from "./routes";
Expand Down Expand Up @@ -138,10 +137,6 @@ root.render(
path={slugs.roundApplication}
element={<RoundApply />}
/>
<Route
path={slugs.roundApplicationView}
element={<ViewApplication />}
/>
<Route path="*" element={<PageNotFound />} />
</Routes>
</Layout>
Expand Down
7 changes: 0 additions & 7 deletions packages/builder/src/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export const slugs = {
newGrant: `/projects/new`,
round: `/chains/:chainId/rounds/:roundId`,
roundApplication: `/chains/:chainId/rounds/:roundId/apply`,
roundApplicationView: `/chains/:chainId/rounds/:roundId/view/:ipfsHash`,
};

export const rootPath = () => slugs.root;
Expand Down Expand Up @@ -39,9 +38,3 @@ export const roundApplicationPathForProject = (
roundId: string,
projectId: string
) => `/round/${chainId}/${roundId}/${projectId}`;

export const roundApplicationViewPath = (
chainId: string,
roundId: string,
ipfsHash: string
) => `/chains/${chainId}/rounds/${roundId}/view/${ipfsHash}`;
26 changes: 26 additions & 0 deletions packages/common/src/allo/backends/allo-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,19 @@ export class AlloV2 implements Allo {
blockNumber: receipt.blockNumber,
});

// sync pool with checker
await fetch("https://api.checker.gitcoin.co/api/pools", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
alloPoolId: parseInt(poolCreatedEvent.poolId, 10).toString(),
chainId: this.chainId,
skipEvaluation: false,
}),
});

emit("indexingStatus", success(void 0));

return success({
Expand Down Expand Up @@ -749,6 +762,19 @@ export class AlloV2 implements Allo {
blockNumber: receipt.blockNumber,
});

// sync pool with checker
await fetch("https://api.checker.gitcoin.co/api/pools", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
alloPoolId: args.roundId.toString(),
chainId: this.chainId,
skipEvaluation: false,
}),
});

emit("indexingStatus", success(null));

return success(args.projectId);
Expand Down
Loading

0 comments on commit 4d78de3

Please sign in to comment.