Skip to content

Reorder and relabel transfer action buttons to Undo (5560)#5604

Open
augustocbx wants to merge 1 commit into
rubyforgood:mainfrom
augustocbx:5560-reorder-rename-transfer-action-buttons
Open

Reorder and relabel transfer action buttons to Undo (5560)#5604
augustocbx wants to merge 1 commit into
rubyforgood:mainfrom
augustocbx:5560-reorder-rename-transfer-action-buttons

Conversation

@augustocbx

@augustocbx augustocbx commented Jun 16, 2026

Copy link
Copy Markdown

Resolves #5560

Description

On the Inventory Transfers index, the action buttons were in a different order than the rest of the system and the destructive action was labeled "Delete", even though it actually reverses (undoes) the transfer and restores the original inventory counts.

This change brings the transfers row in line with the rest of the app and the issue's acceptance criteria:

  • Reorders the buttons so View comes before the destructive action.
  • Renames the destructive button from Delete to Undo.
  • Updates its icon to the undo icon.
  • Updates the confirmation prompt to "Are you sure you want to undo this transfer?".

Only the view partial changed; the underlying destroy/TransferDestroyService behavior is untouched.

Type of change

  • Bug fix / consistency fix (non-breaking change which makes behavior consistent with the rest of the system)

How Has This Been Tested?

  • Added spec/requests/transfers_request_spec.rb (written first, watched fail, now passing):
    • asserts the View button is rendered before the Undo button
    • asserts the destructive action is labeled "Undo" with the fa-undo icon and no longer uses fa-trash
    • asserts the confirmation wording is "Are you sure you want to undo this transfer?"
  • Updated the two existing system tests in spec/system/transfer_system_spec.rb that clicked the "Delete" button to click "Undo".

Commands run:

bundle exec rspec spec/requests/transfers_request_spec.rb
# 3 examples, 0 failures

bundle exec rspec spec/system/transfer_system_spec.rb -e "can delete a transfer to undo" -e "shows a error when deleting a transfer"
# 2 examples, 0 failures

bundle exec rubocop spec/requests/transfers_request_spec.rb spec/system/transfer_system_spec.rb
# no offenses

bundle exec erb_lint app/views/transfers/_transfer_row.html.erb
# No errors were found in ERB files

Screenshots

Before
transfer_buttons_before

After
transfer_buttons_after

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

On Inventory Transfers, the action buttons are in a different order than in the rest of the system. Switch them app/views/transfers/index.

1 participant