Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#51277] Use system argument to specify ul id in Primer::Beta::BorderBoxes #14281

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions app/components/op_primer/component_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,6 @@ def component_collection(**, &)
render(OpPrimer::ComponentCollectionComponent.new(**), &)
end

# There is currently no available system argument for setting an id on the
# rendered <ul> tag that houses the row slots on Primer::Beta::BorderBox components.
# Setting an id is required to be able to uniquely identify a target for
# TurboStream +insert+ actions and being able to prepend and append to it.
def border_box_with_id(id, **, &)
border_box = Primer::Beta::BorderBox.new(**)

new_list_arguments = border_box.instance_variable_get(:@list_arguments)
.merge(id:)

border_box.instance_variable_set(:@list_arguments, new_list_arguments)

render(border_box, &)
end

def border_box_row(wrapper_arguments, &)
if container
container.with_row(**wrapper_arguments, &)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
data: { 'test-selector': 'op-share-wp-active-list',
controller: 'work-packages--share--bulk-selection',
application_target: 'dynamic' }) do
border_box_with_id(insert_target_modifier_id) do |border_box|
render(Primer::Beta::BorderBox.new(list_id: insert_target_modifier_id)) do |border_box|
border_box.with_header(color: :muted, data: { 'test-selector': 'op-share-wp-header' }) do
grid_layout('op-share-wp-modal-body--header', tag: :div, align_items: :center) do |header_grid|
header_grid.with_area(:counter, tag: :div) do
Expand Down
Loading