feat(files): show assigned pipeline info on file status and detail views
The file detail page (/files/{id}/detail) and file view page (/files/{id})
previously showed no information about which processing pipeline was used.
Changes:
- _STEP_TYPE_TO_STAGES mapping: pipeline step_type → Celery log stage keys
(with maintenance comment requiring updates when new step types are added)
- _ALWAYS_SHOW_STAGES: stages always visible regardless of pipeline
- _resolve_pipeline(db, file_record): resolves the pipeline for a file —
uses explicit pipeline_id when set, falls back to active system default
- _compute_processing_flow: new pipeline_steps parameter; when provided,
filters flow graph to only show stages for the pipeline's enabled steps
(+ always-show stages + any stage that actually ran). Also adds
convert_to_pdf to the flow stage catalogue.
- file_detail_page: passes pipeline_info + pipeline-filtered flow_data
- file_view_page: passes pipeline_info
Templates:
- file_detail.html: 'Processing Pipeline' detail row with name link and
colour-coded badge (System Default / System / Custom)
- file_view.html: 'Pipeline' info row in sidebar with (default)/(custom) tag
Tests:
- TestPipelineInfoInViews with 14 tests covering _resolve_pipeline,
_compute_processing_flow filtering, completeness assertion for
_STEP_TYPE_TO_STAGES, and HTTP-level view tests
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
@@ -301,6 +301,21 @@
|
||||
<span class="info-key">Hash</span>
|
||||
<span class="info-val" style="font-size:0.7rem;">{{ file.filehash[:32] }}…</span>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<span class="info-key">Pipeline</span>
|
||||
<span class="info-val">
|
||||
{% if pipeline_info %}
|
||||
<a href="/pipelines" style="text-decoration:none;color:inherit;font-weight:500;" aria-label="View pipeline management for {{ pipeline_info.name }}">{{ pipeline_info.name }}</a>
|
||||
{% if not pipeline_info.is_explicit %}
|
||||
<span style="font-size:0.7em;color:#7c3aed;" title="System default pipeline applied automatically">(default)</span>
|
||||
{% elif not pipeline_info.is_system %}
|
||||
<span style="font-size:0.7em;color:#059669;" title="Custom user-defined pipeline">(custom)</span>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<span style="color:#9ca3af;font-style:italic;">Standard</span>
|
||||
{% endif %}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Actions -->
|
||||
|
||||
Reference in New Issue
Block a user