-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Shield: Country Rules #3828
Shield: Country Rules #3828
Conversation
<span | ||
id={"country-#{rule.id}"} | ||
class="mr-4 cursor-help border-b border-dotted border-gray-400" | ||
title={"Added at #{rule.updated_at} by #{rule.added_by}"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be an UTC timestamp, not the users local time, will this cause confusion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, I'll use site's timezone.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh wait, this only renders a date
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
assert element_exists?( | ||
resp, | ||
~s/button[phx-click="remove-country-rule"][phx-value-rule-id="#{r2.id}"]#remove-country-rule-#{r2.id}/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is clunky. Idea: Should we add a custom attribute to this element, e.g. data-test-remove-rule="123"
? IMO this would make tests much easier to write and follow and would allow for separation of concerns.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only for the sake of test selectors? I think using phx-
attributes is meaningful because it implies LV picks them up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about I make this more readable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And simplify+test Timezone module; an input timestamp converted to UTC can never be ambiguous.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Something to consider as a follow-up: It might be worth adding the VPN nation as a separate entity on top of the countries dropdown.
Changes
This is very similar to #3761 - allows users to store up to 30 country codes that will be rejected on ingestion against the geolocation classification.
Migration will be extracted to a separate PR.
Notable differences/changes:
Global bugfix: ComboBox resumes suggestions popup after hitting Escape while typing
Extra:
Plausible.Timezone
module was simplified + tests were addedTests
Changelog
Documentation
Dark mode