Skip to content
Open
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
71 changes: 37 additions & 34 deletions app/components/app_child_summary_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,44 +120,47 @@ def call
end
end
if @show_parents && !@child.restricted?
@child.parent_relationships.each do |parent_relationship|
summary_list.with_row do |row|
row.with_key do
parent_relationship.ordinal_label.upcase_first
end
row.with_value do
format_parent_with_relationship(parent_relationship)
end
@child
.parent_relationships
.includes(:parent)
.find_each do |parent_relationship|
summary_list.with_row do |row|
row.with_key do
parent_relationship.ordinal_label.upcase_first
end
row.with_value do
format_parent_with_relationship(parent_relationship)
end

if (
href =
@change_links.dig(
:parent,
parent_relationship.parent_id
)
)
row.with_action(
text: "Edit",
href:,
visually_hidden_text: parent_relationship.ordinal_label
)
end
if (
href =
@change_links.dig(
:parent,
parent_relationship.parent_id
)
)
row.with_action(
text: "Edit",
href:,
visually_hidden_text: parent_relationship.ordinal_label
)
end

if (
href =
@remove_links.dig(
:parent,
parent_relationship.parent_id
)
)
row.with_action(
text: "Remove",
href:,
visually_hidden_text: parent_relationship.ordinal_label
)
if (
href =
@remove_links.dig(
:parent,
parent_relationship.parent_id
)
)
row.with_action(
text: "Remove",
href:,
visually_hidden_text: parent_relationship.ordinal_label
)
end
end
end
end
end
end,
@show_add_parent ? add_parent_button : nil
Expand Down
Loading