#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' InstanceStatus and WorkItemState field plugins, which build the span in PHP and flatten it with renderInIsolation();
  • orchestra_inbox' InboxController;
  • orchestra_ui' CardColumnsTrait and InstanceReadController;
  • orchestra-instance.html.twig and 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): variables label and classes. Every PHP emitter returns ['#theme' => 'orchestra_status_tag', ...] instead of an html_tag it styles itself, which also lets the two Views fields drop their renderInIsolation() and hand Views a render array.
  • orchestra_card_column (orchestra-card-column.html.twig): variables label and value, 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

Command icon 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

mably created an issue. See original summary.

  • mably committed 8b8ec812 on 1.x
    task: #3613912 One source for the card column and status tag markup,...
mably’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.