Skip to content

Commit a3fa361

Browse files
authored
fix: par-799 (#3745)
* fix: par-799 * fix: tests * remove lit from manager
1 parent 1cc8ce2 commit a3fa361

File tree

4 files changed

+49
-13
lines changed

4 files changed

+49
-13
lines changed

packages/common/src/index.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -478,14 +478,15 @@ export function isChainIdSupported(chainId: number) {
478478
}
479479

480480
export function isLitUnavailable(chainId: number) {
481-
return [
482-
4201, // LUKSO_TESTNET,
483-
42, // LUKSO,
484-
713715, // SEI_DEVNET,
485-
1329, // SEI_MAINNET,
486-
1088, // METIS
487-
].includes(chainId);
481+
return true;
482+
// return [
483+
// 4201, // LUKSO_TESTNET,
484+
// 42, // LUKSO,
485+
// 713715, // SEI_DEVNET,
486+
// 1329, // SEI_MAINNET,
487+
// 1088, // METIS
488+
// ].includes(chainId);
488489
}
489490

490491
export * from "./chains";
491-
export * from "./programWhitelist";
492+
export * from "./programWhitelist";

packages/data-layer/src/data-layer.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,8 @@ export class DataLayer {
770770
id: round.strategyAddress,
771771
strategyName: round.strategyName,
772772
},
773+
applicationQuestions:
774+
round.applicationMetadata?.applicationSchema?.questions,
773775
approvedProjects: projects,
774776
uniqueDonorsCount: round.uniqueDonorsCount,
775777
},

packages/data-layer/src/data.types.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { VerifiableCredential } from "@gitcoinco/passport-sdk-types";
22
import { Address } from "viem";
3-
import { RoundApplicationMetadata } from "./roundApplication.types";
3+
import {
4+
RoundApplicationMetadata,
5+
RoundApplicationQuestion,
6+
} from "./roundApplication.types";
47
export type RoundPayoutType =
58
| "allov1.Direct"
69
| "allov1.QF"
@@ -256,6 +259,7 @@ export type RoundWithApplications = Omit<RoundGetRound, "applications"> & {
256259
export type RoundForExplorer = Omit<RoundGetRound, "applications"> & {
257260
applications: (Application & { anchorAddress: Address })[];
258261
uniqueDonorsCount?: number;
262+
applicationMetadata?: RoundApplicationMetadata;
259263
};
260264

261265
export type BaseDonorValues = {
@@ -471,6 +475,8 @@ export interface Round {
471475
info: string;
472476
};
473477
};
478+
479+
applicationQuestions?: RoundApplicationQuestion[];
474480
/**
475481
* Pointer to round metadata in a decentralized storage e.g IPFS, Ceramic etc.
476482
*/

packages/grant-explorer/src/features/round/ViewProjectDetails.tsx

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,13 @@ import { useGap } from "../api/gap";
4242
import { StatList } from "./OSO/ImpactStats";
4343
import { useOSO } from "../api/oso";
4444
import { CheckIcon, ShoppingCartIcon } from "@heroicons/react/24/outline";
45-
import { Application, useDataLayer } from "data-layer";
45+
import {
46+
Application,
47+
BaseQuestion,
48+
Round,
49+
RoundApplicationQuestion,
50+
useDataLayer,
51+
} from "data-layer";
4652
import { DefaultLayout } from "../common/DefaultLayout";
4753
import {
4854
mapApplicationToProject,
@@ -114,9 +120,11 @@ export default function ViewProjectDetails() {
114120
},
115121
dataLayer
116122
);
123+
const { round: roundDetails } = useRoundById(Number(chainId), roundId);
117124

118125
const projectToRender = application && mapApplicationToProject(application);
119126
const round = application && mapApplicationToRound(application);
127+
120128
round && (round.chainId = Number(chainId));
121129
const isSybilDefenseEnabled =
122130
round?.roundMetadata?.quadraticFundingConfig?.sybilDefense === true ||
@@ -207,6 +215,7 @@ export default function ViewProjectDetails() {
207215
<Detail text={description} testID="project-metadata" />
208216
<ApplicationFormAnswers
209217
answers={projectToRender.grantApplicationFormAnswers}
218+
round={roundDetails}
210219
/>
211220
</>
212221
) : (
@@ -234,7 +243,7 @@ export default function ViewProjectDetails() {
234243
),
235244
},
236245
],
237-
[stats, grants, projectToRender, description, isLoading]
246+
[stats, grants, projectToRender, description, impacts, roundDetails]
238247
);
239248

240249
const handleTabChange = (tabIndex: number) => {
@@ -460,9 +469,27 @@ function Detail(props: { text: string; testID: string }) {
460469

461470
function ApplicationFormAnswers(props: {
462471
answers: GrantApplicationFormAnswer[];
472+
round: Round | undefined;
463473
}) {
464-
// only show answers that are not empty and are not marked as hidden
465-
const answers = props.answers.filter((a) => !!a.answer && !a.hidden);
474+
const roundQuestions = props.round?.applicationQuestions as (BaseQuestion &
475+
RoundApplicationQuestion)[];
476+
let answers: GrantApplicationFormAnswer[] = [];
477+
if (roundQuestions) {
478+
answers = roundQuestions
479+
.filter((q) => !q.hidden && !q.encrypted)
480+
.map((q) => ({
481+
...props.answers.find(
482+
(a) =>
483+
a.questionId === q.id && a.question === q.title && a.type === q.type
484+
),
485+
question: q.title,
486+
}))
487+
.filter((a): a is GrantApplicationFormAnswer => !!a.answer);
488+
}
489+
490+
if (answers.length === 0) {
491+
answers = props.answers.filter((a) => !!a.answer && !a.hidden);
492+
}
466493

467494
if (answers.length === 0) {
468495
return null;

0 commit comments

Comments
 (0)