exlab_wizard.ui.pages.wizard_project#
New Project Wizard (Frontend Spec §4).
Seven steps in a ui.stepper:
LIMS Project picker (Backend §7.2 cache or offline catalogue).
Template Selection.
Equipment Selection.
Variable Form (auto-generated from
copier.yml).README Form (mandatory core fields pinned at top).
Preview (validator gate; Frontend §4 step 6).
Confirm & Create (progress bar, error pane, success card).
The page is split into render-time-only logic (this module) and the controller-side validation, which is delegated to the FastAPI session endpoints. The UI’s per-step validation is for UX immediacy; the backend remains authoritative.
Functions
|
Return |
Return a copy-ready message when disk space is low; else |
|
|
Pre-flight checks for the Preview step (Frontend §10.5.4). |
|
Render the seven-step project wizard. |
Classes
|
Mutable state for the in-flight wizard. |
- class exlab_wizard.ui.pages.wizard_project.ProjectWizardState(active_step='lims_project', selected_lims_short_id=None, lims_project_name='', selected_lims_source='manual', selected_template=None, selected_template_path=None, selected_equipment=None, template_variables=<factory>, readme_fields=<factory>, validator_findings=<factory>, free_disk_bytes=None, plugin_host_ok=True, progress=<factory>, progress_refresh=None)[source]#
Bases:
objectMutable state for the in-flight wizard.
- Parameters:
active_step (
str)lims_project_name (
str)selected_lims_source (
str)plugin_host_ok (
bool)progress (
SessionProgressState)
- progress: SessionProgressState#
- exlab_wizard.ui.pages.wizard_project.can_advance(state)[source]#
Return
Truewhen the active step’s preconditions are satisfied.Centralised here so the Next button enablement and any
Cmd/Ctrl+Entershortcut share a single rule set.- Parameters:
state (
ProjectWizardState)- Return type:
- exlab_wizard.ui.pages.wizard_project.disk_space_pre_flight_message(state)[source]#
Return a copy-ready message when disk space is low; else
None.- Parameters:
state (
ProjectWizardState)- Return type:
- exlab_wizard.ui.pages.wizard_project.preview_step_clear(state)[source]#
Pre-flight checks for the Preview step (Frontend §10.5.4).
- Parameters:
state (
ProjectWizardState)- Return type:
- exlab_wizard.ui.pages.wizard_project.render_project_wizard(*, state=None, templates=None, equipment_ids=None, template_questions=None, template_paths=None, on_resolve=None, lims_projects=None, on_submit=None, on_cancel=None)[source]#
Render the seven-step project wizard.
templatesis the list of project-scope template names the operator can pick from;equipment_idsis the configured equipment list;template_questionsmaps each template name to its parsedcopier.ymlquestions (drives the dynamic Variables step);template_pathsmaps each name to the resolved absolute source path;lims_projectsis the cache / offline-catalogue project list backing the LIMS project picker. Each step binds real inputs intostateso the confirm step’son_submitsees a fully populatedProjectWizardState.on_resolveenables per-instance template resolution: when supplied, the template step re-resolves the offered project templates from the operator’s chosen equipment, so a per-equipment project template shadows a same-named global one. It is called with(equipment_id)and returns aTemplateChoices. Because the equipment step (step 3) follows the template step (step 2), the template panel re-resolves whenever equipment changes (and reflects it on a step-back). Whenon_resolveisNonethe statictemplateslist is used unchanged (the pre-resolver behaviour).Returns the NiceGUI dialog (or, in tests, a payload describing the rendered steps).
- Parameters:
state (
ProjectWizardState|None)template_questions (
dict[str,list[TemplateQuestion]] |None)on_resolve (
Callable[[str|None],TemplateChoices] |None)on_submit (
Callable[[ProjectWizardState],Any] |None)
- Return type: