Skip to content

Issue 5530/add grant application form#5586

Open
vushu wants to merge 6 commits into
masterfrom
issue-5530/add_grant_application_form
Open

Issue 5530/add grant application form#5586
vushu wants to merge 6 commits into
masterfrom
issue-5530/add_grant_application_form

Conversation

@vushu
Copy link
Copy Markdown
Contributor

@vushu vushu commented May 21, 2026

Sorry about the size of the PR :)

@vushu vushu requested review from Tiggles and hschu12 May 21, 2026 13:06
Comment on lines +199 to +209
let formSections: Grants.FormField[] = [];
if (templateKey === "newProject") {
formSections = templates.flatMap((it) => it.structured.newProject);
}
if (templateKey === "existingProject") {
formSections = templates.flatMap((it) => it.structured.existingProject);
}
if (templateKey === "personalProject") {
formSections = templates.flatMap((it) => it.structured.personalProject);
}
return formSections
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let formSections: Grants.FormField[] = [];
if (templateKey === "newProject") {
formSections = templates.flatMap((it) => it.structured.newProject);
}
if (templateKey === "existingProject") {
formSections = templates.flatMap((it) => it.structured.existingProject);
}
if (templateKey === "personalProject") {
formSections = templates.flatMap((it) => it.structured.personalProject);
}
return formSections
return templates.flatMap((it => it.structured[templateKey] ?? []));

| {type: "Reset"}
;

function extractFormFields(templateKey: string, templates: Grants.Templates[]): Grants.FormField[] {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
function extractFormFields(templateKey: string, templates: Grants.Templates[]): Grants.FormField[] {
function extractFormFields(templateKey: Exclude<keyof Grants.Templates, "type">, templates: Grants.Templates[]): Grants.FormField[] {

Copy link
Copy Markdown
Contributor

@Tiggles Tiggles May 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change might require more work where this function is called, rather than just changing it in the function definition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants