-
Notifications
You must be signed in to change notification settings - Fork 691
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
Add explanatory text for authenticator reset buttons in Journalist/Admin interface #3274
Add explanatory text for authenticator reset buttons in Journalist/Admin interface #3274
Conversation
I am yet to write the tests. Just wanted to ensure this works. @redshiftzero it's completely in sass. So no JS. 😄 |
Okay. But I think if possible I should still add functional tests for on hover to check for the tooltip. |
d0918f2
to
e7b60a0
Compare
Codecov Report
@@ Coverage Diff @@
## develop #3274 +/- ##
========================================
Coverage 85.76% 85.76%
========================================
Files 34 34
Lines 2157 2157
Branches 238 238
========================================
Hits 1850 1850
Misses 250 250
Partials 57 57 Continue to review full report at Codecov.
|
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 looks good, but I wonder if we should bump the opacity of the background just a little more to help with accessibility. The text box text collides a bit with the text above it and could make it hard to read on bad screens.
This isn't a blocker, however. Maybe someone with more UX experiences could comment.
@heartsucker I can remove or adjust the box-shadow of the tooltip or make the tooltip a little bit above. What do you think? I will check out myself |
I'm not a frontend person enough to be able to give a good recommendation, but my gut tells me that it could be done in a way that makes the text more readable. That's not so helpful, I know :( |
e7b60a0
to
5ab9b74
Compare
@heartsucker updated the opacity of the tooltip to improve accessibility. I didn't notice it before. My apologies. |
@SaptakS I just pulled your latest changes and confirmed that the change is more readable. However, there were test failures. (Not sure if you can see this link)
The above As a note to other reviewers, this does not work on mobile (no hover) and even if it did, the text does not wrap and is chopped off. Related: #1450. |
@SaptakS: Just checking in, do you still have time/interest to work on this, or would you prefer for it to be taken over by someone else? |
5ab9b74
to
8df6000
Compare
@eloquence I have rebased and fixed the merge conflicts. Working on getting the tests fixed now. |
You're the best, thanks for picking this back up again :) |
2e3a589
to
de13a49
Compare
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.
The rebase is clean and the tooltips look good! Just one thing to fix in the functional tests so that they work for locales other than English...
Makes sense.. I will update to use gettext. |
@zenmonkeykstop Just adding I am not sure what is the best thing to do in this case because I don't see any similar implementation of sorts. Should I add app context to the pagelayout? |
'#button-reset-two-factor-' + type + ' span')[0].text | ||
|
||
assert explanatory_tooltip_opacity == '1' | ||
assert explanatory_tooltip_content == tooltip_text |
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 assert will fail if the tests are run against a language other than English. Currently tests that assert the value of a string are only run if the default language is English, and skipped otherwise, like so:
if not hasattr(self, "accept_languages"):
assert explanatory_tooltip_content == tooltip_text
This will allow the page-layout tests to run successfully, while also allowing the functional tests to run against different language settings.
(This probably means we have less functional test coverage for other locales, so it doesn't seem ideal, but that's a problem for another PR.)
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.
Makes sense. I will put this in place for now and maybe can check for the locale skipping part in a different PR.
Sorry @SaptakS, my proposed solution wasn't that great! I removed that review and added another more in line with how text asserts in other functional tests are being handled. |
@zenmonkeykstop I have pushed the changes according to your suggestion. I am not sure what is the CircleCI failure related to. It seems to be related to the source interface, though mine is related to journalist tests. |
@SaptakS I don't think the CI failures are related to your code. Looks like a couple of unrelated new CI tests are failing. |
Hi @SaptakS , a fix was pushed for the CI issue that is still affecting this PR. If you do one more rebase against develop and resolve the conflicts introduced in |
dfe9716
to
4714f72
Compare
Shows explanatory text using tooltips above the buttons in Reset authenticator buttons thus reducing the button label texts.
Used ActionChains to move the cursor to the buttons. Then used execution_script to get the opacity property of the pseudo element :after of the button using a js code and verified that the opacity is 1 which means it is visible.
Since the pseudo element :after is difficult to track using selenium executescript which throws errors often, so I am replacing by a simpler span DOM element with a class tooltip
4714f72
to
21f4927
Compare
21f4927
to
1f1eb8f
Compare
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 looks amazing. Thank you. 🌈 Approved.
Status
Ready for review
Description of Changes
Fixes #1572 .
Changes proposed in this pull request:
Testing
How should the reviewer test this PR?
/account/account
endpointChecklist
If you made changes to the server application code:
make ci-lint
) and tests (make -C securedrop test
) pass in the development containerIf you made changes to
securedrop-admin
:make -C admin test
) pass in the admin development containerIf you made changes to the system configuration:
If you made changes to documentation:
make docs-lint
) passed locally