#3613906: Move the shared card presentation out of the engine into an orchestra_presentation submodule gave the shared presentation a home. The markup it was meant to hold is still spread across six places, in two languages, and one of them encodes a decision that must not drift: the workflow-authored status leads and the engine state sits under it as the marker.
Who emits it today
The labeled column (orchestra-card__col with its label and value spans):
orchestra_presentation/templates/orchestra-card-row.html.twig, three times (a plain column, the status column, the lifecycle-only column);orchestra_ui/src/CardColumnsTrait.php, in PHP render arrays;orchestra_ui/templates/orchestra-instance.html.twig.
The status tag (orchestra-status-tag plus the author's own classes):
orchestra_views'InstanceStatusandWorkItemStatefield plugins, which build the span in PHP and flatten it withrenderInIsolation();orchestra_inbox'InboxController;orchestra_ui'CardColumnsTraitandInstanceReadController;orchestra-instance.html.twigand the row template.
Proposed
Two theme hooks in orchestra_presentation, which is the one thing both worlds can consume: PHP returns a render array, Twig includes the template.
orchestra_status_tag(orchestra-status-tag.html.twig): variableslabelandclasses. Every PHP emitter returns['#theme' => 'orchestra_status_tag', ...]instead of anhtml_tagit styles itself, which also lets the two Views fields drop theirrenderInIsolation()and hand Views a render array.orchestra_card_column(orchestra-card-column.html.twig): variableslabelandvalue, included by the row template, by the run's page and by the requester's card list.
orchestra_ui's CardColumnsTrait then has nothing left to do and goes away: its two methods become those render arrays.
The status pair (authored tag leading, engine state beneath) stays a decision the row template and the run's page each express, but over one tag partial rather than over three copies of the span.
Notes
- Kernel tests do not enable a module's dependencies, so any test class rendering these must list
orchestra_presentation; the classes that already render a card row do. - A missed emitter is silent: the markup simply loses its classes. Worth a test asserting each surface's rendered output carries
orchestra-status-tag, in the same spirit as the assertion that the engine ships no presentation.
Out of scope
Converting the requester's card list from PHP-built cards to a row template is a bigger change and its own issue. So is the duplicated state-label map (InstanceFilterForm::stateOptions() versus orchestra_views' State field), which is data, not markup.
Issue fork orchestra-3613912
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
mably commented