Skip to content

Commit

Permalink
Merge pull request #14037 from ncounter/fix-arrow-up
Browse files Browse the repository at this point in the history
Set proper collapsed state on loading
  • Loading branch information
ncounter committed Mar 20, 2023
2 parents 5bc5d36 + 7a11caf commit dd3872b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/api/app/components/diff_list_component.html.haml
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
- diff_list.each_with_index do |(name, file_info), file_index|
- state = file_info['state']
- expanded = expand?(name, state)
.accordion.mb-2{ id: "diff-list-#{name.parameterize}" }
.accordion-item
%h2.accordion-header
%button.accordion-button.text-bg-light{ type: 'button', data: { 'bs-toggle': 'collapse',
'bs-target': "#diff-item-#{name.parameterize}" },
aria: { expanded: 'true', controls: "diff-item-#{name.parameterize}" } }
aria: { expanded: 'true', controls: "diff-item-#{name.parameterize}" },
class: expanded ? '' : 'collapsed' }
- if (old_file = file_info['old'])
= changed_filename(old_file['name'], name, state)
- else
= name
%span.badge.ms-1{ class: badge_for_state(state) }= state.capitalize
.accordion-collapse.collapse{ class: expand?(name, state) ? 'show' : '', id: "diff-item-#{name.parameterize}", 'data-object': view_id }
.accordion-collapse.collapse{ class: expanded ? 'show' : '', id: "diff-item-#{name.parameterize}", 'data-object': view_id }
= render(DiffComponent.new(diff: file_info.dig('diff', '_content'), file_index:, commentable:))

0 comments on commit dd3872b

Please sign in to comment.