Move Date column to first position in Donations table#5599
Open
NamHT4Devlop wants to merge 2 commits into
Open
Move Date column to first position in Donations table#5599NamHT4Devlop wants to merge 2 commits into
NamHT4Devlop wants to merge 2 commits into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
_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.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
How Has This Been Tested?
bundle exec rake): 2837 examples, 0 failures, 1 pending (pre-existingxit).bundle exec rspec spec/requests/donations_requests_spec.rb spec/system/donation_system_spec.rb— all green.bundle exec rubocopanderb_lintclean on all changed files.org_admin1@example.com.Screenshots
Before — Date is the second column (after Source):
After — Date is the first column: