Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/checker past applications query #54

Merged
merged 2 commits into from
Mar 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/nasty-masks-grab.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@gitcoin/ui": patch
---

Fixes past applications query
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export async function getPastApplicationsByApplicationIdFromIndexer(
applicationId,
});

return response.applications[0].project[0].applications as PastApplication[];
return response.applications[0].project.applications as PastApplication[];
} catch (e) {
throw new Error(`Failed to fetch past applications data. with error: ${e}`);
}
Expand Down
9 changes: 9 additions & 0 deletions packages/ui/src/mocks/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { applicationsForManagers } from "./mockData/applicationsForManager";
import { checkerApplicationEvaluations } from "./mockData/checkerApplicationEvaluations";
import { checkerPoolData } from "./mockData/checkerPoolData";
import { getApplicationById } from "./mockData/indexerGetApplicationById";
import { pastApplicationsByApplicationId } from "./mockData/pastApplicationsByApplicationId";

export const taskListHandler = http.get("https://jsonplaceholder.typicode.com/todos", () => {
return HttpResponse.json([
Expand Down Expand Up @@ -43,10 +44,18 @@ export const checkerApplicationEvaluationsHandler = graphql.query(
},
);

export const getPastApplicationsByApplicationIdHandler = graphql.query(
"getPastApplicationsByApplicationId",
() => {
return HttpResponse.json({ data: pastApplicationsByApplicationId });
},
);

export const handlers = [
taskListHandler,
applicationForManagerHandler,
checkerPoolDataHandler,
indexerGetApplicationByIdHandler,
checkerApplicationEvaluationsHandler,
getPastApplicationsByApplicationIdHandler,
];
103 changes: 103 additions & 0 deletions packages/ui/src/mocks/mockData/pastApplicationsByApplicationId.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
export const pastApplicationsByApplicationId = {
applications: [
{
project: {
applications: [
{
id: "8",
roundId: "18",
statusSnapshots: [
{
status: "PENDING",
updatedAt: "2024-05-08T21:50:53.000Z",
updatedAtBlock: "119803138",
},
{
status: "APPROVED",
updatedAt: "2024-05-09T22:11:51.000Z",
updatedAtBlock: "119846967",
},
],
status: "APPROVED",
round: {
roundMetadata: {
name: "HyperLocalizer Round One (Mocked)",
support: {
info: "https://t.me/hyperlocalizer_chat",
type: "Telegram Group Invite Link",
},
roundType: "public",
eligibility: {
description: "Experimental round to fund public goods for local impact",
requirements: [
{
requirement: "Public good that does local impact",
},
],
},
feesAddress: "",
feesPercentage: 0,
programContractAddress:
"0x690ca3292c6b22f71dc881efdc80938eefff014d8cd92fd950819287f758d229",
quadraticFundingConfig: {
matchingCap: true,
sybilDefense: false,
matchingCapAmount: 20,
minDonationThreshold: false,
matchingFundsAvailable: 50,
},
},
},
},
{
id: "1",
roundId: "7",
statusSnapshots: [
{
status: "PENDING",
updatedAt: "2024-03-28T09:44:37.000Z",
updatedAtBlock: "118010150",
},
{
status: "APPROVED",
updatedAt: "2024-03-29T06:35:21.000Z",
updatedAtBlock: "118047672",
},
],
status: "APPROVED",
round: {
roundMetadata: {
name: "Allo 2 🌐♻️ EcoSynthesisX Spring Round on Optimism (Mocked)",
support: {
info: "https://discord.gg/qkSy83uf",
type: "Discord Group Invite Link",
},
roundType: "public",
eligibility: {
description:
"Allo 2 protocol. EcoSynthesisX Spring round as a space for showcase public good projects, foster coordination and bring funding for bigger impact! Experimental approach on public good funding utilizing hyperstructure vision and Gitcoin infrastructure. Open for applications. Our Discord https://discord.gg/qkSy83uf",
requirements: [
{
requirement: "",
},
],
},
feesAddress: "",
feesPercentage: 0,
programContractAddress:
"0x6c2402cc20967444d61900db0a5e4823d78be1eb379ca4942bb90b3d045f6690",
quadraticFundingConfig: {
matchingCap: false,
sybilDefense: false,
minDonationThreshold: true,
matchingFundsAvailable: 1000,
minDonationThresholdAmount: 1,
},
},
},
},
],
},
},
],
};