Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.
Draft
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
6 changes: 3 additions & 3 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ const preview: Preview = {
order: ["Welcome", "Features", "Components", "Primitives", "Shadcn", "Styles", "*"],
},
},
msw: {
handlers,
},
// msw: {
// handlers,
// },
},

loaders: [mswLoader],
Expand Down
9 changes: 7 additions & 2 deletions src/features/checker/apps/Checker.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ const meta = {
component: Checker,
args: {
address: "0x0D1781F0b693b35939A49831A6C799B938Bd2F80",
poolId: "597",
chainId: 11155111,
poolId: "7",
chainId: 10,
},
} satisfies Meta;

Expand All @@ -20,6 +20,11 @@ export default meta;
type Story = StoryObj<typeof Checker>;

export const Default: Story = {
args: {
poolId: "5",
chainId: 10,
},

render(args) {
// New StoryWrapper component
const StoryWrapper = () => {
Expand Down
1 change: 1 addition & 0 deletions src/features/checker/hooks/useApplicationEvaluations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export const useApplicationEvaluations = (
roundId,
applicationId,
);
if (!application || !applicationEvaluations) return undefined;
const data = {
application,
applicationEvaluations: applicationEvaluations,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Meta, StoryObj } from "@storybook/react";

import { handlers } from "@/mocks/handlers";

// import { handlers } from "@/mocks/handlers";
import { CheckerProvider } from "~checker/store";

import { ApplicationEvaluationOverviewPage } from "./ApplicationEvaluationOverviewPage";
Expand Down Expand Up @@ -34,14 +33,15 @@ export default meta;
type Story = StoryObj<typeof ApplicationEvaluationOverviewPage>;

export const Default: Story = {
parameters: {
msw: {
handlers,
},
},
// parameters: {
// msw: {
// handlers,
// },
// },
args: {
chainId: 42161,
poolId: "609",
applicationId: "17",
chainId: 10,
poolId: "7",
applicationId: "1",
address: "0x0D1781F0b693b35939A49831A6C799B938Bd2F80",
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ export default meta;
type Story = StoryObj<typeof SubmitApplicationEvaluationPage>;

export const Default: Story = {
parameters: {
msw: {
handlers,
},
},
// parameters: {
// // msw: {
// // handlers,
// // },
// },
args: {
chainId: 42161,
poolId: "609",
applicationId: "17",
chainId: 10,
poolId: "7",
applicationId: "1",
address: "0x0D1781F0b693b35939A49831A6C799B938Bd2F80",
},
render: (args) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ export default meta;
type Story = StoryObj<typeof ViewApplicationEvaluationsPage>;

export const Default: Story = {
parameters: {
msw: {
handlers,
},
},
// parameters: {
// // msw: {
// // handlers,
// // },
// },
args: {
chainId: 42161,
poolId: "609",
applicationId: "0",
chainId: 10,
poolId: "6",
applicationId: "4",
},
};
3 changes: 2 additions & 1 deletion src/features/checker/services/allo/alloClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
import { GraphQLClient } from "graphql-request";

// Base URL for the GraphQL API
const GS_INDEXER_ENDPOINT = "https://grants-stack-indexer-v2.gitcoin.co/graphql";
const GS_INDEXER_ENDPOINT = "http://localhost:8082/v1/graphql";

// Create a new instance of GraphQLClient
export const graphqlClient = new GraphQLClient(GS_INDEXER_ENDPOINT, {
headers: {
"Content-Type": "application/json",
"x-hasura-admin-secret": "my-admin-secret ",
},
});

Expand Down
7 changes: 4 additions & 3 deletions src/features/checker/services/allo/dataLayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export async function getApplicationsFromIndexer(
});
return {
applications: response.applications as ProjectApplicationForManager[],
roundData: response.round as PoolInfo,
roundData: response.rounds[0] as PoolInfo,
};
} catch (e) {
throw new Error(`Failed to fetch applications data. with error: ${e}`);
Expand All @@ -37,7 +37,8 @@ export async function getApplicationByIdFromIndexer(
roundId,
applicationId,
});
return response.application as ProjectApplication;
//TODO: handle empty ([]) gracefully
return response.applications[0] as ProjectApplication;
} catch (e) {
throw new Error(`Failed to fetch application data. with error: ${e}`);
}
Expand All @@ -55,7 +56,7 @@ export async function getPastApplicationsByApplicationIdFromIndexer(
applicationId,
});

return response.applications[0].project.applications as PastApplication[];
return response.applications[0].project[0].applications as PastApplication[];
} catch (e) {
throw new Error(`Failed to fetch past applications data. with error: ${e}`);
}
Expand Down
17 changes: 6 additions & 11 deletions src/features/checker/services/allo/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ import { gql } from "graphql-request";

export const applicationsForManagerQuery = gql`
query getApplicationsForManager($chainId: Int!, $roundId: String!) {
applications(
first: 1000
filter: { roundId: { equalTo: $roundId }, chainId: { equalTo: $chainId } }
) {
applications(limit: 1000, where: { roundId: { _eq: $roundId }, chainId: { _eq: $chainId } }) {
id
projectId
chainId
Expand All @@ -22,7 +19,7 @@ export const applicationsForManagerQuery = gql`
}
}
}
round(chainId: $chainId, id: $roundId) {
rounds(where: { chainId: { _eq: $chainId }, id: { _eq: $roundId } }) {
roundMetadata
strategyName
strategyAddress
Expand All @@ -42,7 +39,9 @@ export const applicationsForManagerQuery = gql`

export const getApplicationByIdQuery = gql`
query getApplicationById($chainId: Int!, $roundId: String!, $applicationId: String!) {
application(chainId: $chainId, roundId: $roundId, id: $applicationId) {
applications(
where: { chainId: { _eq: $chainId }, roundId: { _eq: $roundId }, id: { _eq: $applicationId } }
) {
id
projectId
chainId
Expand All @@ -69,11 +68,7 @@ export const getPastApplicationsQueryByApplicationId = gql`
$applicationId: String!
) {
applications(
filter: {
chainId: { equalTo: $chainId }
roundId: { equalTo: $roundId }
id: { equalTo: $applicationId }
}
where: { chainId: { _eq: $chainId }, roundId: { _eq: $roundId }, id: { _eq: $applicationId } }
) {
project {
applications {
Expand Down