Skip to content

Move Date column to first position in Donations table#5599

Open
NamHT4Devlop wants to merge 2 commits into
rubyforgood:mainfrom
NamHT4Devlop:fix/5591-donations-date-column-first
Open

Move Date column to first position in Donations table#5599
NamHT4Devlop wants to merge 2 commits into
rubyforgood:mainfrom
NamHT4Devlop:fix/5591-donations-date-column-first

Conversation

@NamHT4Devlop

Copy link
Copy Markdown

Resolves #5591

Description

Moves the Date column to the first position in the Donations table, as requested in the issue — having the date on the left makes the table easier to scan.

Two small related fixes that surfaced while making this change:

  1. Fixed malformed HTML in _donation_row.html.erb: the date and comment <td> elements were never closed, which caused all subsequent cells to be nested inside them. Browsers auto-corrected this silently, but the markup is now valid and matches the header structure.
  2. Made the misc-donation comment spec meaningful (donations_requests_spec.rb:80): that assertion only passed because of the unclosed comment <td> — the string <td>{comment}</td> could never appear. With valid markup, a comment shorter than 140 characters is shown in full (as designed). The spec now uses a 200-character comment so truncation actually occurs and the assertion tests real behavior.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Ran the full suite locally (bundle exec rake): 2837 examples, 0 failures, 1 pending (pre-existing xit).
  • Targeted run: bundle exec rspec spec/requests/donations_requests_spec.rb spec/system/donation_system_spec.rb — all green.
  • bundle exec rubocop and erb_lint clean on all changed files.
  • Verified visually in the browser (screenshots below), logged in as org_admin1@example.com.

Screenshots

Before — Date is the second column (after Source):

Before: Source | Date | Details...

After — Date is the first column:

After: Date | Source | Details...

The Date column was positioned after Source, which made the table
harder to scan. Moving it to be the first column.

Also fixed malformed td nesting in _donation_row partial (the date
and comment cells were never closed, nesting subsequent cells).
The assertion that the full comment is absent from the page only
passed because the Comments <td> was previously unclosed, so the
string '<td>comment</td>' could never appear. With valid markup,
a comment shorter than the 140-character truncation limit is shown
in full (as designed). Use a 200-character comment so truncation
actually occurs and the assertion tests real behavior.
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.

In Donations shift the date column all the way to the left

1 participant