Add sync-help-from-civi script + field-group rendering

Two additions, both touching the form-config story:

1. scripts/sync-help-from-civi.mjs

   Diffs per-field help text in config/form.ts against CustomField rows
   in CiviCRM and (with --write) updates the file in place. Reads env
   from .env.local via Node's --env-file flag. Run as `npm run sync-help`
   or `npm run sync-help -- --write`. A --debug mode prints the parser's
   field list without calling Civi.

   Rationale: this form is low-traffic and help text doesn't change
   often once in production. A manual one-off sync is leaner than
   coupling every page load (or every build) to a Civi API call.

2. fieldGroups: visual clustering of related fields within a section

   New optional FieldGroupConfig overlay on StageSectionConfig — pure
   presentation, names existing fields by name so submit/visibility
   logic walks them unchanged. StageSection.tsx pulls grouped fields
   out of the standalone per-field grid and renders each group as its
   own bordered card with an optional heading. Stage 2 now clusters
   Market Study, Pro Forma, Business Plan, and Board Self Assessment
   (each a date + upload pair) into their own cards.
This commit is contained in:
Joel Brock
2026-05-21 12:27:22 -07:00
parent 9460e8320f
commit 2ca2d378a4
5 changed files with 499 additions and 4 deletions
+23
View File
@@ -365,6 +365,29 @@ const stage2: StageSectionConfig = {
help: "What governance system does your board use, or how do you make decisions?",
},
] as FieldConfig[],
// Visual clustering — each pair (date + upload) reads as one item.
fieldGroups: [
{
id: "market_study",
label: "Market Study",
fields: ["Market_Study_Date", "Market_Study_Upload"],
},
{
id: "pro_forma",
label: "Pro Forma",
fields: ["Pro_Forma_date_completed", "Pro_Forma_Upload"],
},
{
id: "business_plan",
label: "Business Plan",
fields: ["Business_Plan", "Business_Plan_Upload"],
},
{
id: "board_self_assessment",
label: "Board Self Assessment",
fields: ["Board_Self_Assessment", "Board_Self_Assessment_Upload"],
},
],
};
// Stage 3 — Connect & Gather