Wire real CiviCRM DEV custom fields and dynamic option fetching
This commit is contained in:
@@ -78,13 +78,17 @@ export interface FieldConfig {
|
||||
/** Visibility rule. If absent, field is always visible (within its visible section). */
|
||||
visibleWhen?: VisibilityRule;
|
||||
/**
|
||||
* The CiviCRM custom-field reference, if this maps to a custom field on the
|
||||
* Org Engagement Submission activity. Format: `custom_<id>` or
|
||||
* `custom_<group_name>.<field_name>` depending on APIv4 conventions.
|
||||
* The CiviCRM custom-field reference. APIv4 format: `<group_name>.<field_name>`.
|
||||
* Leave undefined for fields that don't write back to Civi (e.g. transient
|
||||
* UI helpers).
|
||||
*/
|
||||
civiField?: string;
|
||||
/**
|
||||
* If this field's options come from a CiviCRM option group, set its ID here.
|
||||
* `/api/data` will fetch the option-group values and embed them in
|
||||
* FormDataPayload.options so the renderer can use real CRM-defined choices.
|
||||
*/
|
||||
optionGroupId?: number;
|
||||
}
|
||||
|
||||
export interface StageSectionConfig {
|
||||
@@ -134,6 +138,12 @@ export interface FormDataPayload {
|
||||
* Fields with no prior value are simply absent from this map.
|
||||
*/
|
||||
prefill: Record<string, unknown>;
|
||||
/**
|
||||
* Option-group values fetched at request time, keyed by option_group_id.
|
||||
* Each entry is a list of {value, label}. The form merges these into
|
||||
* field configs whose `optionGroupId` matches.
|
||||
*/
|
||||
options?: Record<number, SelectOption[]>;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user