New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix styles for polls table and polls dates #5499
Open
javierm
wants to merge
7
commits into
master
Choose a base branch
from
fix_poll_styles
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains 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
This code isn't used since commit 5fdbc7b.
This is consistent with the way we've got partials to render debates, proposals and legislation processes on their index pages. Note that, while adding the tests for the status icon, we're keeping one system test because it also tests the process of voting. We're adding a new, similar component test, where the voter is created in the database, so all possible statuses are tested in the component.
We were using a redundant `elsif` instead of an `else`. We were also using a negative condition in the main `if`, which made the code a bit harder to read. Since we usually use `current_user` instead of `user_signed_in?`, we're also changing that for consistency.Extract component to render the status of a poll
We accidentally introduced a typo in commit f497227 which caused the dates to be rendered outside the element where the dates styles are applied.
The rows in these tables were using the styles from the `.poll` selector, and the `position: relative` property defined there caused the inner borders to disappear. So we're adding the `public` class to the selector; this way, it doesn't affect elements in the admin section. Even though it's only necessary to add the `.public` prefix to the `.poll` selector in one place in order to fix this issue, we're doing it everywhere for consistency.
javierm
force-pushed
the
fix_poll_styles
branch
from
April 22, 2024 17:08
7bfe99d
to
90b785e
Compare
When this code was added, in commit 1a20a3c, we had no validation rules checking the presence of the start and end dates of a poll. Now we do, so we don't have to check this condition in the view.
Since we were using `I18n.t`, our monkey-patch of the `t` helper wasn't being applied. Note that polls with no start or end date are invalid, so I don't think it makes sense to write a test for the `polls.no_dates` scenario. I wonder whether we should remove the code for this condition.
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.
Objectives
Visual Changes
Before these changes
After these changes