Skip to content

Commit 4d78de3

Browse files
integrate checker (#3730)
* enable sync with checker on pool creation and apply * add in review Applicaitons Button * wire in view application * fix route * show only checker
1 parent a3fa361 commit 4d78de3

File tree

6 files changed

+50
-282
lines changed

6 files changed

+50
-282
lines changed

packages/builder/src/components/grants/ApplicationCard.tsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { useEffect } from "react";
1010
import { useDispatch, useSelector } from "react-redux";
1111
import { Link } from "react-router-dom";
1212
import { loadRound } from "../../actions/rounds";
13-
import { roundApplicationViewPath } from "../../routes";
1413
import { ApplicationCardType, RoundSupport } from "../../types";
1514
import {
1615
formatDate,
@@ -196,6 +195,9 @@ export default function ApplicationCard({
196195
return null;
197196
}
198197

198+
const applicationViewLink = `https://beta.checker.gitcoin.co/view/application/
199+
${applicationData.chainId}/${applicationData.roundID}/${applicationData.application.id}`;
200+
199201
return (
200202
<Box
201203
p={2}
@@ -241,13 +243,7 @@ export default function ApplicationCard({
241243
</a>
242244
</p>
243245
)}
244-
<Link
245-
to={roundApplicationViewPath(
246-
applicationData.chainId.toString(),
247-
applicationData.roundID,
248-
applicationData.application.metadataCid || ""
249-
)}
250-
>
246+
<Link to={applicationViewLink} target="_blank">
251247
<Button
252248
backgroundColor="purple.100"
253249
color="purple.600"

packages/builder/src/components/rounds/ViewApplication.tsx

Lines changed: 0 additions & 262 deletions
This file was deleted.

packages/builder/src/index.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import NewProject from "./components/grants/New";
2323
import Project from "./components/grants/Show";
2424
import RoundApply from "./components/rounds/Apply";
2525
import RoundShow from "./components/rounds/Show";
26-
import ViewApplication from "./components/rounds/ViewApplication";
2726
import history from "./history";
2827
import reportWebVitals from "./reportWebVitals";
2928
import { slugs } from "./routes";
@@ -138,10 +137,6 @@ root.render(
138137
path={slugs.roundApplication}
139138
element={<RoundApply />}
140139
/>
141-
<Route
142-
path={slugs.roundApplicationView}
143-
element={<ViewApplication />}
144-
/>
145140
<Route path="*" element={<PageNotFound />} />
146141
</Routes>
147142
</Layout>

packages/builder/src/routes.tsx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ export const slugs = {
66
newGrant: `/projects/new`,
77
round: `/chains/:chainId/rounds/:roundId`,
88
roundApplication: `/chains/:chainId/rounds/:roundId/apply`,
9-
roundApplicationView: `/chains/:chainId/rounds/:roundId/view/:ipfsHash`,
109
};
1110

1211
export const rootPath = () => slugs.root;
@@ -39,9 +38,3 @@ export const roundApplicationPathForProject = (
3938
roundId: string,
4039
projectId: string
4140
) => `/round/${chainId}/${roundId}/${projectId}`;
42-
43-
export const roundApplicationViewPath = (
44-
chainId: string,
45-
roundId: string,
46-
ipfsHash: string
47-
) => `/chains/${chainId}/rounds/${roundId}/view/${ipfsHash}`;

packages/common/src/allo/backends/allo-v2.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,19 @@ export class AlloV2 implements Allo {
630630
blockNumber: receipt.blockNumber,
631631
});
632632

633+
// sync pool with checker
634+
await fetch("https://api.checker.gitcoin.co/api/pools", {
635+
method: "POST",
636+
headers: {
637+
"Content-Type": "application/json",
638+
},
639+
body: JSON.stringify({
640+
alloPoolId: parseInt(poolCreatedEvent.poolId, 10).toString(),
641+
chainId: this.chainId,
642+
skipEvaluation: false,
643+
}),
644+
});
645+
633646
emit("indexingStatus", success(void 0));
634647

635648
return success({
@@ -749,6 +762,19 @@ export class AlloV2 implements Allo {
749762
blockNumber: receipt.blockNumber,
750763
});
751764

765+
// sync pool with checker
766+
await fetch("https://api.checker.gitcoin.co/api/pools", {
767+
method: "POST",
768+
headers: {
769+
"Content-Type": "application/json",
770+
},
771+
body: JSON.stringify({
772+
alloPoolId: args.roundId.toString(),
773+
chainId: this.chainId,
774+
skipEvaluation: false,
775+
}),
776+
});
777+
752778
emit("indexingStatus", success(null));
753779

754780
return success(args.projectId);

0 commit comments

Comments
 (0)