Improve Availability date on annual report#5571
Open
stefannibrasil wants to merge 5 commits into
Open
Conversation
2 tasks
The annual report shows a number of months until the current year's report is available. It's confusing because it shows the availability in months. In December, for example, it says it is 0 months until the report is available. We want to instead display the date when the report will be available -- which is the first day of the following year, i.e., January 1, 2027.
6442d24 to
20f4bf6
Compare
dorner
requested changes
May 21, 2026
| <div class="row"> | ||
| <div class="col-md-12 mb-2"> | ||
| <h5 class="mb-1">Reports are available at the end of every year.</h5> | ||
| <span class="text-muted"> <%= "#{@actual_year} (available in #{pluralize(@month_remaining_to_report, 'month')})" %> </span> |
Collaborator
There was a problem hiding this comment.
You can remove the @month_remaining_to_report instance variable now.
| <div class="col-md-12 mb-2"> | ||
| <h5 class="mb-1">Reports are available at the end of every year.</h5> | ||
| <span class="text-muted"> <%= "#{@actual_year} (available in #{pluralize(@month_remaining_to_report, 'month')})" %> </span> | ||
| <span class="text-muted"> <%= "#{@actual_year} (available in #{available_date})" %> </span> |
Collaborator
There was a problem hiding this comment.
This should be "available on", not "available in".
| RSpec.describe Reports::AnnualReportsHelper, type: :helper do | ||
| describe "#available_date" do | ||
| it "returns the first day of the following year with a custom date format" do | ||
| travel_to Time.zone.local(2026, 0o1, 0o1) |
Collaborator
There was a problem hiding this comment.
Probably should have a few edge cases here. I'd probably use
- Jan 1
- Dec 31
- Some time in between
Contributor
Author
There was a problem hiding this comment.
Good idea! The original test was for January 1st, so I added coverage for Dec 31 and a date during the year in ab6799a
| expect(response).to have_http_status(:success) | ||
| end | ||
|
|
||
| it "displays the first day of the following year as the date when the report will be available" do |
Collaborator
There was a problem hiding this comment.
I'd make this explicit, i.e. use travel_to and check the actual date rather than just re-typing the code used.
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 #5570
Description
The annual report shows a number of months until the current year's report is available:
But it's confusing depending on when this page is accessed. In December, for example, it says it is 0 months until the report is available:
We want to instead display the date when the report will be available -- which is the first day of the following year, i.e., January 1, 2027.
Type of change
How Has This Been Tested?
Screenshots
How it looks now: