PhoenixKitProjects. Web. Components. WorkflowStatusFields
(PhoenixKitProjects v0.11.0)
Copy Markdown
View Source
The shared "Workflow status" form section (V125), reused by every form that
edits a project-like record: ProjectFormLive, TemplateFormLive, and
AssignmentFormLive's sub-project mode. A sub-project and a template are both
projects, so they get the same status-source picker a project has.
The component renders the section; the module's plain functions
(available?/0, entity_options/0, preview_for/1, mode_string/1,
apply_mode/3, selected_entity_uuid/1) are the shared logic so each LV's
mount/validate/save stays a thin delegation. The "Generate default" button
emits generate_default_statuses — each LV owns that handler (it knows which
form to update).
Summary
Functions
Folds the translated-titles 3-way choice into the settings JSONB on attrs,
preserving the record's other settings. "" removes the per-record override
(inherit the global default).
True when the optional entities module backs the status feature.
Grouped status-source entity options for the <.select>.
The 3-way translated-titles control value ("true"/"false"/"") for a record.
The status rows the given entity (nil = shared default) would supply.
The status_entity_uuid currently in the form (nil = shared default).
Functions
Folds the translated-titles 3-way choice into the settings JSONB on attrs,
preserving the record's other settings. "" removes the per-record override
(inherit the global default).
True when the optional entities module backs the status feature.
Grouped status-source entity options for the <.select>.
The 3-way translated-titles control value ("true"/"false"/"") for a record.
The status rows the given entity (nil = shared default) would supply.
The status_entity_uuid currently in the form (nil = shared default).
Attributes
statuses_available(:boolean) - Defaults tofalse.field(:any) (required) - thestatus_entity_uuidform field.status_entities(:list) - Defaults to[].status_preview(:list) - Defaults to[].status_translation_mode(:string) - Defaults to"".locked(:boolean) - true once the project has started — its statuses were cemented at start (started_atis the freeze boundary), so the source can no longer change. Defaults tofalse.