Skip to content

Commit

Permalink
Merge pull request #5014 from someykoku/4984-request-cancellation-fix
Browse files Browse the repository at this point in the history
Resolves #4984 Request cancellation - improve wording and fix button styling
  • Loading branch information
cielf authored Feb 16, 2025
2 parents 08b2175 + 33074e3 commit a62eac9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/views/requests/cancelation/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<% content_for :title, "Do you want to cancel request #{@request.id}?" %>
<% content_for :title, "Do you want to cancel request #{@request.partner.name}?" %>
<span class='text-red-600 text-4xl'>
Do you want to cancel request #<%= @request.id %>?
Do you want to cancel the request made for <%= @request.partner.name %> by <%= @request.requester.email %> on <%= @request.created_at.to_fs(:distribution_date) %>, with comment: <%= @request.comments %>?
</span>
</div>
<div class="col-sm-6">
Expand Down Expand Up @@ -35,7 +35,7 @@
</div>

<div class='flex flex-row justify-end'>
<%= f.submit 'Yes. Cancel Request', class: 'bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded mt-2' %>
<%= f.submit 'Yes. Cancel Request', class: 'btn btn-primary' %>
</div>
<% end %>
</div>
Expand Down
9 changes: 9 additions & 0 deletions spec/system/request_system_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,15 @@
expect(request.reload.discarded_at).not_to eq(nil)
expect(request.reload.discard_reason).to eq(reason)
end

it 'should show the partners name, requesters email, request date, comments' do
click_on 'Cancel'

expect(page).to have_content request.partner.name
expect(page).to have_content request.partner.email
expect(page).to have_content("January 1 2020")
expect(page).to have_content request.comments
end
end
end
end

0 comments on commit a62eac9

Please sign in to comment.