Skip to content

Commit

Permalink
Show changed keys of info request event in details.
Browse files Browse the repository at this point in the history
Fixes #7189.
  • Loading branch information
dracos committed Sep 10, 2023
1 parent 8d4511c commit 0f3aae0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 6 additions & 2 deletions app/views/request/details.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
:site_name => site_name, :contact_path => help_contact_path) %>
</p>

<% columns = ['id', 'event_type', 'created_at', 'described_state', 'calculated_state', 'last_described_at' ] %>
<% columns = ['id', 'event_type', 'details', 'created_at', 'described_state', 'calculated_state', 'last_described_at' ] %>

<table>
<thead>
Expand All @@ -41,7 +41,11 @@
<tr class="<%= cycle('odd', 'even') %>">
<% for column in columns %>
<td data-label="<%= column %>"><%
d = info_request_event.send(column)
if column == 'details'
d = info_request_event.params_diff[:new].keys().join(', ')
else
d = info_request_event.send(column)
end
if column == 'event_type' and d == 'edit'
d = 'edit metadata'
end
Expand Down
4 changes: 3 additions & 1 deletion spec/views/request/details.html.erb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
end

it "should show the request" do
FactoryBot.create(:info_request_event,
FactoryBot.create(
:info_request_event,
event_type: 'edit',
info_request: mock_request,
params: {
Expand All @@ -19,5 +20,6 @@
assign :info_request, mock_request
render
expect(rendered).to have_content('edit metadata')
expect(rendered).to have_content('allow_new_responses_from')
end
end

0 comments on commit 0f3aae0

Please sign in to comment.