Skip to content

cleanup erb#23360

Merged
toy merged 1 commit into
devfrom
cleanup-modules-backlogs-erb
May 26, 2026
Merged

cleanup erb#23360
toy merged 1 commit into
devfrom
cleanup-modules-backlogs-erb

Conversation

@toy
Copy link
Copy Markdown
Contributor

@toy toy commented May 26, 2026

Ticket

Part of https://community.openproject.org/wp/74386

What are you trying to accomplish?

Cleanup erb

Merge checklist

  • Added/updated tests
  • Added/updated documentation in Lookbook (patterns, previews, etc)
  • Tested major browsers (Chrome, Firefox, Edge, ...)

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR cleans up four Backlogs ERB templates by consolidating mixed <% ... %> / <%= ... %> tags into single <%= ... %> expression blocks that call ViewComponent slot APIs in plain Ruby. The visual output and component behavior are unchanged; the change purely improves readability and consistency with the prior-art style already used in other OpenProject ERB files (e.g., backlog_component.html.erb, meetings/header_component.html.erb).

Changes:

  • Replaced verbose interleaved ERB tags with single expression blocks invoking slot setters as Ruby method calls.
  • Inlined the inbox_container local in inbox_component.html.erb into the container: argument.
  • Used last-expression-as-content style (e.g., t(".label_start_sprint")) for slot button labels, matching existing patterns.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
modules/backlogs/app/components/backlogs/sprint_page_header_component.html.erb Collapses page header slot configuration into one <%= render ... %> block.
modules/backlogs/app/components/backlogs/sprint_component.html.erb Rewrites sprint card list, action buttons, and menu groups using a single Ruby expression block.
modules/backlogs/app/components/backlogs/inbox_component.html.erb Rewrites inbox list rendering, inlines inbox_container, and converts truncation/show-more handling to a Ruby block.
modules/backlogs/app/components/backlogs/bucket_component.html.erb Rewrites bucket list, header menu, and empty state slots into a single Ruby expression block.

Copy link
Copy Markdown
Contributor

@myabc myabc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine. AFAICT SprintComponent can be made into one contiguous block.

@toy
Copy link
Copy Markdown
Contributor Author

toy commented May 26, 2026

Looks fine. AFAICT SprintComponent can be made into one contiguous block.

If not for the:

<% header.with_description(display: :flex, direction: :column, classes: "row-gap-2") do %>
  <%= render(Primer::Alpha::Stack.new(direction: :horizontal, align: :center)) do %>
    <%= render(Backlogs::SprintStatusBadgeComponent.new(sprint:)) %>

    <%= render(Primer::Beta::Text.new(classes: "velocity", aria: { live: "polite" })) do %>
      <%= story_points_total %>&nbsp;<%= t(:"backlogs.points_label", count: story_points_total) %>
    <% end %>

    <% if sprint.date_range_set? %>
      <%= render(Primer::Beta::Text.new(role: :group, ml: :auto, mr: 2)) do %>
        <%= render(Primer::Beta::Octicon.new(:calendar, size: :small, mr: 1)) %>
        <%= format_date_range([sprint.start_date, sprint.finish_date]) %>
      <% end %>
    <% end %>
  <% end %>
<% end %>

@toy toy merged commit b9eda79 into dev May 26, 2026
13 checks passed
@toy toy deleted the cleanup-modules-backlogs-erb branch May 26, 2026 15:37
@github-actions github-actions Bot locked and limited conversation to collaborators May 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants