Drop in-form Framework Stage field; align section labels with Civi
The current_stage readonly field is removed from Stage 0 — the activity- derived stage value already displays in the SubmissionContextHeader, so showing it again in-card was redundant. current_stage remains in form state (RHF defaults from /api/data) because every Stage 1-5 visibleWhen rule and the journey rail still key off it; it just isn't rendered. Section labels for Stages 1-5 updated to match the CiviCRM Stage option group labels exactly (ampersand instead of 'and'; Stage 2 corrected from 'Feasibility' to 'Grow & Plan'). Stage 0 keeps its 'Check-in (organizing)' label since it represents the always-visible core fields, not the Inquiry stage rank. Also folded in: in-progress visibleWhen additions on several Stage 0 fields and commented-out field stubs from your working tree.
This commit is contained in:
159
config/form.ts
159
config/form.ts
@@ -50,16 +50,10 @@ const stage0: StageSectionConfig = {
|
|||||||
intro:
|
intro:
|
||||||
"Core check-in fields. These are visible at every stage and capture the data we follow over time across the lifecycle of the co-op.",
|
"Core check-in fields. These are visible at every stage and capture the data we follow over time across the lifecycle of the co-op.",
|
||||||
fields: [
|
fields: [
|
||||||
// current_stage is a UI-only readonly field. Its value is sourced by
|
// `current_stage` is still tracked in form state (it gates every Stage
|
||||||
// /api/data from the most recent Check-in (organizing) activity whose
|
// 1–5 visibleWhen rule and feeds the journey rail), but it is no longer
|
||||||
// Stage custom field is non-empty (staff create these manually when an
|
// rendered as an in-card field — the SubmissionContextHeader displays
|
||||||
// org transitions). The form never writes Stage back to the activity —
|
// the activity-derived Stage value as readonly above the cards.
|
||||||
// org-owner submissions create activities with Stage left null.
|
|
||||||
{
|
|
||||||
name: "current_stage",
|
|
||||||
label: "Framework Stage",
|
|
||||||
type: "readonly",
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: "Peer_Group_Participation",
|
name: "Peer_Group_Participation",
|
||||||
label: "Peer Group Participation",
|
label: "Peer Group Participation",
|
||||||
@@ -67,6 +61,7 @@ const stage0: StageSectionConfig = {
|
|||||||
civiField: `${G0}.Peer_Group_Participation`,
|
civiField: `${G0}.Peer_Group_Participation`,
|
||||||
optionGroupId: 140,
|
optionGroupId: 140,
|
||||||
help: "Is this co-op currently participating in Peer Learning Groups?",
|
help: "Is this co-op currently participating in Peer Learning Groups?",
|
||||||
|
visibleWhen: []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Internal_Startup_Assessment",
|
name: "Internal_Startup_Assessment",
|
||||||
@@ -74,6 +69,7 @@ const stage0: StageSectionConfig = {
|
|||||||
type: "select",
|
type: "select",
|
||||||
civiField: `${G0}.Internal_Startup_Assessment`,
|
civiField: `${G0}.Internal_Startup_Assessment`,
|
||||||
optionGroupId: 132,
|
optionGroupId: 132,
|
||||||
|
visibleWhen: []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Internal_Startup_Assessment_Date",
|
name: "Internal_Startup_Assessment_Date",
|
||||||
@@ -81,6 +77,7 @@ const stage0: StageSectionConfig = {
|
|||||||
type: "date",
|
type: "date",
|
||||||
civiField: `${G0}.Internal_Startup_Assessment_Date`,
|
civiField: `${G0}.Internal_Startup_Assessment_Date`,
|
||||||
help: "Date of the latest Internal Startup Assessment rating.",
|
help: "Date of the latest Internal Startup Assessment rating.",
|
||||||
|
visibleWhen: []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Member_Goal_for_current_Stage",
|
name: "Member_Goal_for_current_Stage",
|
||||||
@@ -101,31 +98,31 @@ const stage0: StageSectionConfig = {
|
|||||||
label: "Total members at opening",
|
label: "Total members at opening",
|
||||||
type: "number",
|
type: "number",
|
||||||
civiField: `${G0}.Total_members_at_opening`,
|
civiField: `${G0}.Total_members_at_opening`,
|
||||||
visibleWhen: visibleAtOrAfter(S.Stabilize),
|
visibleWhen: visibleAtOrAfter(S.Stabilize),
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "Volunteers_Helping_In_Store",
|
|
||||||
label: "Volunteers Helping In Store",
|
|
||||||
type: "select",
|
|
||||||
civiField: `${G0}.Volunteers_Helping_In_Store`,
|
|
||||||
optionGroupId: 141,
|
|
||||||
help: "Does this co-op use volunteers for day-to-day operations? (Not occasional events.)",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "Work_from_Members",
|
|
||||||
label: "Work from Members",
|
|
||||||
type: "select",
|
|
||||||
civiField: `${G0}.Work_from_Members`,
|
|
||||||
optionGroupId: 142,
|
|
||||||
help: "Does this co-op require work from members (e.g. annual hours)?",
|
|
||||||
},
|
},
|
||||||
|
// {
|
||||||
|
// name: "Volunteers_Helping_In_Store",
|
||||||
|
// label: "Volunteers Helping In Store",
|
||||||
|
// type: "select",
|
||||||
|
// civiField: `${G0}.Volunteers_Helping_In_Store`,
|
||||||
|
// optionGroupId: 141,
|
||||||
|
// help: "Does this co-op use volunteers for day-to-day operations? (Not occasional events.)",
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "Work_from_Members",
|
||||||
|
// label: "Work from Members",
|
||||||
|
// type: "select",
|
||||||
|
// civiField: `${G0}.Work_from_Members`,
|
||||||
|
// optionGroupId: 142,
|
||||||
|
// help: "Does this co-op require work from members (e.g. annual hours)?",
|
||||||
|
// },
|
||||||
{
|
{
|
||||||
name: "Total_square_ft",
|
name: "Total_square_ft",
|
||||||
label: "Total square ft",
|
label: "Total square ft",
|
||||||
type: "number",
|
type: "number",
|
||||||
civiField: `${G0}.Total_square_ft`,
|
civiField: `${G0}.Total_square_ft`,
|
||||||
step: 1,
|
step: 1,
|
||||||
visibleWhen: visibleAtOrAfter(S.BusinessFeasibility, S.StoreImplementation, S.Stabilize),
|
visibleWhen: visibleAtOrAfter(S.BusinessFeasibility, S.StoreImplementation, S.Stabilize),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Retail_sq_ft",
|
name: "Retail_sq_ft",
|
||||||
@@ -133,34 +130,34 @@ const stage0: StageSectionConfig = {
|
|||||||
type: "number",
|
type: "number",
|
||||||
civiField: `${G0}.Retail_sq_ft`,
|
civiField: `${G0}.Retail_sq_ft`,
|
||||||
step: 1,
|
step: 1,
|
||||||
visibleWhen: visibleAtOrAfter(S.BusinessFeasibility, S.StoreImplementation, S.Stabilize),
|
visibleWhen: visibleAtOrAfter(S.BusinessFeasibility, S.StoreImplementation, S.Stabilize),
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "Latest_Sources_and_Uses_doc",
|
|
||||||
label: "Latest Sources and Uses doc",
|
|
||||||
type: "file",
|
|
||||||
civiField: `${G0}.Latest_Sources_and_Uses_doc`,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "Latest_Pro_Forma_doc",
|
|
||||||
label: "Latest Pro Forma doc",
|
|
||||||
type: "file",
|
|
||||||
civiField: `${G0}.Latest_Pro_Forma_doc`,
|
|
||||||
},
|
|
||||||
{ name: "Projected_Year_1_Sales", label: "Projected Year 1 Sales", type: "currency", civiField: `${G0}.Projected_Year_1_Sales` },
|
|
||||||
{ name: "Projected_Year_2_Sales", label: "Projected Year 2 Sales", type: "currency", civiField: `${G0}.Projected_Year_2_Sales` },
|
|
||||||
{ name: "Projected_Year_3_Sales", label: "Projected Year 3 Sales", type: "currency", civiField: `${G0}.Projected_Year_3_Sales` },
|
|
||||||
{
|
|
||||||
name: "Projected_sales_at_maturity",
|
|
||||||
label: "Projected sales once established",
|
|
||||||
type: "currency",
|
|
||||||
civiField: `${G0}.Projected_sales_at_maturity`,
|
|
||||||
},
|
},
|
||||||
|
// {
|
||||||
|
// name: "Latest_Sources_and_Uses_doc",
|
||||||
|
// label: "Latest Sources and Uses doc",
|
||||||
|
// type: "file",
|
||||||
|
// civiField: `${G0}.Latest_Sources_and_Uses_doc`,
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "Latest_Pro_Forma_doc",
|
||||||
|
// label: "Latest Pro Forma doc",
|
||||||
|
// type: "file",
|
||||||
|
// civiField: `${G0}.Latest_Pro_Forma_doc`,
|
||||||
|
// },
|
||||||
|
// { name: "Projected_Year_1_Sales", label: "Projected Year 1 Sales", type: "currency", civiField: `${G0}.Projected_Year_1_Sales` },
|
||||||
|
// { name: "Projected_Year_2_Sales", label: "Projected Year 2 Sales", type: "currency", civiField: `${G0}.Projected_Year_2_Sales` },
|
||||||
|
// { name: "Projected_Year_3_Sales", label: "Projected Year 3 Sales", type: "currency", civiField: `${G0}.Projected_Year_3_Sales` },
|
||||||
|
// {
|
||||||
|
// name: "Projected_sales_at_maturity",
|
||||||
|
// label: "Projected sales once established",
|
||||||
|
// type: "currency",
|
||||||
|
// civiField: `${G0}.Projected_sales_at_maturity`,
|
||||||
|
// },
|
||||||
{
|
{
|
||||||
name: "FTEs",
|
name: "FTEs",
|
||||||
label: "Projected FTEs",
|
label: "Projected FTEs",
|
||||||
type: "number",
|
type: "number",
|
||||||
visibleWhen: visibleAtOrAfter(S.BusinessFeasibility, S.StoreImplementation, S.Stabilize),
|
visibleWhen: visibleAtOrAfter(S.BusinessFeasibility, S.StoreImplementation, S.Stabilize),
|
||||||
civiField: `${G0}.FTEs`,
|
civiField: `${G0}.FTEs`,
|
||||||
step: 0.1,
|
step: 0.1,
|
||||||
help: "Number of full-time equivalent (FTE) employees planned to work at the store.",
|
help: "Number of full-time equivalent (FTE) employees planned to work at the store.",
|
||||||
@@ -171,30 +168,52 @@ const stage0: StageSectionConfig = {
|
|||||||
type: "number",
|
type: "number",
|
||||||
civiField: `${G0}.Actual_FTE`,
|
civiField: `${G0}.Actual_FTE`,
|
||||||
step: 0.1,
|
step: 0.1,
|
||||||
visibleWhen: visibleAtOrAfter(S.Stabilize),
|
visibleWhen: visibleAtOrAfter(S.Stabilize),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Total_cost_of_project",
|
name: "Total_cost_of_project",
|
||||||
label: "Total cost of project",
|
label: "Total cost of project",
|
||||||
type: "currency",
|
type: "currency",
|
||||||
visibleWhen: visibleAtOrAfter(S.Stabilize),
|
visibleWhen: visibleAtOrAfter(S.Stabilize),
|
||||||
civiField: `${G0}.Total_cost_of_project`,
|
civiField: `${G0}.Total_cost_of_project`,
|
||||||
},
|
},
|
||||||
{ name: "Member_equity_total", label: "Member equity total needed", type: "currency", civiField: `${G0}.Member_equity_total` },
|
{
|
||||||
{ name: "Member_equity_raised", label: "Member equity raised", type: "currency", visibleWhen: visibleAtOrAfter(S.Stabilize), civiField: `${G0}.Member_equity_raised` },
|
name: "Member_equity_total",
|
||||||
{ name: "Member_loans_total", label: "Member loans total needed", type: "currency", civiField: `${G0}.Member_loans_total` },
|
label: "Member equity total needed",
|
||||||
{ name: "Member_loans_raised", label: "Member loans raised", type: "currency", visibleWhen: visibleAtOrAfter(S.Stabilize), civiField: `${G0}.Member_loans_raised` },
|
type: "currency",
|
||||||
{
|
civiField: `${G0}.Member_equity_total`
|
||||||
name: "Member_preferred_shares_total",
|
},
|
||||||
label: "Member preferred shares total needed",
|
{
|
||||||
type: "currency",
|
name: "Member_equity_raised",
|
||||||
civiField: `${G0}.Member_preferred_shares_total`,
|
label: "Member equity raised",
|
||||||
},
|
type: "currency",
|
||||||
|
visibleWhen: visibleAtOrAfter(S.Stabilize),
|
||||||
|
civiField: `${G0}.Member_equity_raised`
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Member_loans_total",
|
||||||
|
label: "Member loans total needed",
|
||||||
|
type: "currency",
|
||||||
|
civiField: `${G0}.Member_loans_total`
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Member_loans_raised",
|
||||||
|
label: "Member loans raised",
|
||||||
|
type: "currency",
|
||||||
|
visibleWhen: visibleAtOrAfter(S.Stabilize),
|
||||||
|
civiField: `${G0}.Member_loans_raised`
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// name: "Member_preferred_shares_total",
|
||||||
|
// label: "Member preferred shares total needed",
|
||||||
|
// type: "currency",
|
||||||
|
// civiField: `${G0}.Member_preferred_shares_total`,
|
||||||
|
// },
|
||||||
{
|
{
|
||||||
name: "Member_preferred_shares_raised",
|
name: "Member_preferred_shares_raised",
|
||||||
label: "Member preferred shares raised",
|
label: "Member preferred shares raised",
|
||||||
type: "currency",
|
type: "currency",
|
||||||
visibleWhen: visibleAtOrAfter(S.Stabilize),
|
visibleWhen: visibleAtOrAfter(S.Stabilize),
|
||||||
civiField: `${G0}.Member_preferred_shares_raised`,
|
civiField: `${G0}.Member_preferred_shares_raised`,
|
||||||
},
|
},
|
||||||
{ name: "Bank_debt_total", label: "Bank debt total needed", type: "currency", civiField: `${G0}.Bank_debt_total` },
|
{ name: "Bank_debt_total", label: "Bank debt total needed", type: "currency", civiField: `${G0}.Bank_debt_total` },
|
||||||
@@ -211,7 +230,7 @@ const stage0: StageSectionConfig = {
|
|||||||
const stage1: StageSectionConfig = {
|
const stage1: StageSectionConfig = {
|
||||||
rank: 1,
|
rank: 1,
|
||||||
id: "stage_1",
|
id: "stage_1",
|
||||||
label: "Stage 1 — Convene and Prepare",
|
label: "Stage 1 — Convene & Prepare",
|
||||||
visibleWhen: visibleAtOrAfter(S.Organizing, S.Feasibility, S.BusinessFeasibility, S.StoreImplementation, S.Stabilize),
|
visibleWhen: visibleAtOrAfter(S.Organizing, S.Feasibility, S.BusinessFeasibility, S.StoreImplementation, S.Stabilize),
|
||||||
fields: [
|
fields: [
|
||||||
{
|
{
|
||||||
@@ -269,7 +288,7 @@ const stage1: StageSectionConfig = {
|
|||||||
const stage2: StageSectionConfig = {
|
const stage2: StageSectionConfig = {
|
||||||
rank: 2,
|
rank: 2,
|
||||||
id: "stage_2",
|
id: "stage_2",
|
||||||
label: "Stage 2 — Feasibility",
|
label: "Stage 2 — Grow & Plan",
|
||||||
visibleWhen: visibleAtOrAfter(S.Feasibility, S.BusinessFeasibility, S.StoreImplementation, S.Stabilize),
|
visibleWhen: visibleAtOrAfter(S.Feasibility, S.BusinessFeasibility, S.StoreImplementation, S.Stabilize),
|
||||||
fields: [
|
fields: [
|
||||||
{ name: "Market_Study_Date", label: "Market Study Date", type: "date", civiField: `${G2}.Market_Study_Date` },
|
{ name: "Market_Study_Date", label: "Market Study Date", type: "date", civiField: `${G2}.Market_Study_Date` },
|
||||||
@@ -319,7 +338,7 @@ const stage2: StageSectionConfig = {
|
|||||||
const stage3: StageSectionConfig = {
|
const stage3: StageSectionConfig = {
|
||||||
rank: 3,
|
rank: 3,
|
||||||
id: "stage_3",
|
id: "stage_3",
|
||||||
label: "Stage 3 — Connect and Gather",
|
label: "Stage 3 — Connect & Gather",
|
||||||
visibleWhen: visibleAtOrAfter(S.BusinessFeasibility, S.StoreImplementation, S.Stabilize),
|
visibleWhen: visibleAtOrAfter(S.BusinessFeasibility, S.StoreImplementation, S.Stabilize),
|
||||||
fields: [
|
fields: [
|
||||||
{
|
{
|
||||||
@@ -393,7 +412,7 @@ const stage3: StageSectionConfig = {
|
|||||||
const stage4: StageSectionConfig = {
|
const stage4: StageSectionConfig = {
|
||||||
rank: 4,
|
rank: 4,
|
||||||
id: "stage_4",
|
id: "stage_4",
|
||||||
label: "Stage 4 — Excite and Build",
|
label: "Stage 4 — Excite & Build",
|
||||||
visibleWhen: visibleAtOrAfter(S.StoreImplementation, S.Stabilize),
|
visibleWhen: visibleAtOrAfter(S.StoreImplementation, S.Stabilize),
|
||||||
fields: [
|
fields: [
|
||||||
{ name: "Projected_Opening_Date", label: "Projected Opening Date", type: "date", civiField: `${G4}.Projected_Opening_Date` },
|
{ name: "Projected_Opening_Date", label: "Projected Opening Date", type: "date", civiField: `${G4}.Projected_Opening_Date` },
|
||||||
@@ -537,12 +556,12 @@ const Y1_TARGET_FIELDS = [
|
|||||||
const stage5: StageSectionConfig = {
|
const stage5: StageSectionConfig = {
|
||||||
rank: 5,
|
rank: 5,
|
||||||
id: "stage_5",
|
id: "stage_5",
|
||||||
label: "Stage 5 — Fulfill and Stabilize",
|
label: "Stage 5 — Fulfill & Stabilize",
|
||||||
visibleWhen: visibleAtOrAfter(S.Stabilize),
|
visibleWhen: visibleAtOrAfter(S.Stabilize),
|
||||||
fields: [
|
fields: [
|
||||||
{ name: "Date_Opened", label: "Date Opened", type: "date", civiField: `${G5}.Date_Opened` },
|
{ name: "Date_Opened", label: "Date Opened", type: "date", civiField: `${G5}.Date_Opened` },
|
||||||
{ name: "Y1_Actual_Sales", label: "Y1 Actual Sales", type: "currency", civiField: `${G5}.Y1_Actual_Sales` }
|
{ name: "Y1_Actual_Sales", label: "Y1 Actual Sales", type: "currency", civiField: `${G5}.Y1_Actual_Sales` }
|
||||||
],
|
] as FieldConfig[],
|
||||||
// STAGE_5_FIELDS,
|
// STAGE_5_FIELDS,
|
||||||
// matrixGroups: [
|
// matrixGroups: [
|
||||||
// {
|
// {
|
||||||
|
|||||||
Reference in New Issue
Block a user