-
Notifications
You must be signed in to change notification settings - Fork 687
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
Adds option to set and use an organization name #5629
Conversation
539f857
to
a9d57f2
Compare
a9d57f2
to
9942d5f
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.
I focused on reviewing for functionality and making sure I didn't find any bugs. Also here are some followup UX improvements, which I don't believe are blocking, since they have a higher-level scope than the change in this PR:
-
The error message shows up below the field and scrolls the user back to the top of the page so that you probably won't see the error message (it shows up for me when I display the page at 67% normal size). This is also how the error for uploading the logo works: "You can only upload PNG image files" shows up but you are scrolled to the top of the page, so it feels as if it has worked, especially when the error is out of scope.
-
The config options seem out of order to me. For instance, updating the org name and logo seem to go together and like they belong at the top of the page so that it's ordered least-to-most technically advanced, probably: (1) Organization Name, (2) Logo, (3) Submission Preferences, (4) Alerts
-
Another UX improvment that I think could, proabably should, be done in this PR is to explain what setting the org name does. For example, instead of just "Set your organization name" we could say above it something like: "The name of your organization is displayed in the page title and logo alt text for both the Source and Journalist interface."
dev environment
- run
make dev
on this branch - log in to the JI with an admin account, navigate to the Admin > Instance Config page
- clear the organization name field and submit via SET ORGANIZATION NAME
- verify that an error flash message is displayed with text "This field is required"
- update the organization name to a string with more than 64 characters and submit
- verify that an error flash message is displayed warning about the character limit
- update the organization name to a string with HTML code (and well under 64 char limit)
- verify that the page title shows the new organization name with html entities escaped.
- update the organization name to a string with no HTML and less than 64 characters.
- verify that the page title shows the new organization name
- inspect the page logo image and verify that its alt text contains the new organization name
- open the Source Interface homepage and verify that its title is prefixed with the new organization name
- inspect the SI homepage logo image and verify that its alt text contains the new organization name
- navigate to the SI
/lookup
page and verify that its title is prefixed with the new organization name
- for extra QA points, get creative and try to break page rendering with funky organization names!
- i was unsuccessful
staging environment (for apparmor)
- run
make staging
on this branch - log in to the JI with an admin account, navigate to the Admin > Instance Config page, and update the organization name to a string with no HTML and less than 64 characters.
- verify that the
preferences saved
flash message is displayed correctly.
upgrade scenario
- run through the upgrade scenario and verify that the organization name can be set and changed post-upgrade.
- 🌀 IN PROGRESS
I still have the code review to do...
e9e6266
to
8b85cd9
Compare
This has now been addressed. Just one nit to add more space between the blurb and the text box with the organization name. Also you made me think of an enhancement to make (outside of this PR) to add the current name of the organization as placeholder text.
This has now been addressed.
This has now been addressed. As of now I just need more time to finish review of code and to rerun the staging tests, so will update soon! |
vertical space? I thought I added a |
Oh my, this feels very important to call-out in the Admin UI, as needing to follow guidelines we lay forth in the docs. Also nervous about this shipping, before we've resolved how to handle this in the Source UI. I feel they should both deploy, together; as folks need to see how it will be surfaced, before entering in their information. |
@zenmonkeykstop Yeah, I feel that even that small a thing wd need user testing. I don't want to ship things to the Source UI, w/o being validated by users, first. And, tbh, near-term planned pipeline fixes to the SI will open up other opportunities to name the org inline with page text, that will improve user cognition of how SecureDrop works, significantly. I'm THRILLED this was done for Aaron Swartz Day, as this has been a biggy comprehension blocker in groking what this SecureDrop thing is, I feel, for a long time. Looking forward to having a synchronous dialog about this, soon! |
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.
Ran through the test plan again, including the upgrade-scenario and everything works as expected. looks good!
oh, i was so involved with testing this (this test plan took a long time since i had to rebuild staging and rerun through the upgrade plan multiple times) i missed the conversation between nina an zenmonkey... reading backsroll and see that we should chat more first. @emkll what do you think, is this an after-standup sort of discusssion? |
blocked while we discuss whether or not we want to add this feature to the SI
Overall I think the UX changes here are pretty minimal and I'm optimistic we can land this with a bit more discussion. I do think the change of the page title and alt text in the Source Interface has some potentially problematic side effects.
Let's discuss a bit more here on the PR & synchronously. @ninavizz, I'm not sure I agree we would need user research to validate this change, but I do think we need to at least resolve some of the potential side effects. |
|
8b85cd9
to
c3a6407
Compare
Codecov Report
@@ Coverage Diff @@
## develop #5629 +/- ##
===========================================
+ Coverage 85.46% 85.54% +0.07%
===========================================
Files 51 52 +1
Lines 3709 3771 +62
Branches 464 474 +10
===========================================
+ Hits 3170 3226 +56
- Misses 439 440 +1
- Partials 100 105 +5
Continue to review full report at Codecov.
|
d533c90
to
1c297f3
Compare
1c297f3
to
90ca440
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 test plan went fine. It is possible to insert control characters in the organization name, and while they do seem to be properly handled in the UI and the metadata response, they can be problematic elsewhere. Querying the instance_config
table in a SQLite shell can result in some garbled terminal output. I haven't spotted a way this would be more than annoying, but in addition to escaping the name supplied by the admin, maybe we could add a regular expression validator to the form. Something like "^[-:.\w\s]+$"
covers all the current sites in our directory and some random tests of Unicode characters.
I also think we should skip the organization name in the alt text of the site logo. It's misleading if the logo is left at the default. A screenreader will read the organization name in the title of the page, so it's also not strictly necessary.
Testing
dev environment
- run
make dev
on this branch - log in to the JI with an admin account, navigate to the Admin > Instance Config page
- clear the organization name field and submit via SET ORGANIZATION NAME
- verify that an error flash message is displayed with text "This field is required"
- update the organization name to a string with more than 64 characters and submit
- verify that an error flash message is displayed warning about the character limit
- update the organization name to a string with HTML code (and well under 64 char limit)
- verify that the page title shows the new organization name with html entities escaped.
- update the organization name to a string with no HTML and less than 64 characters.
- verify that the page title shows the new organization name
- inspect the page logo image and verify that its alt text contains the new organization name
- open the Source Interface homepage and verify that its title is prefixed with the new organization name
- inspect the SI homepage logo image and verify that its alt text contains the new organization name
- navigate to the SI
/lookup
page and verify that its title is prefixed with the new organization name - navigate to the SI
/metadata
endpoint and verify that that the JSON response is valid and contains anorganization_name
key with value set to the new organization name
- for extra QA points, get creative and try to break page rendering with funky organization names!
staging environment (for apparmor)
- run
make staging
on this branch - log in to the JI with an admin account, navigate to the Admin > Instance Config page, and update the organization name to a string with no HTML and less than 64 characters.
- verify that the
preferences saved
flash message is displayed correctly.
90ca440
to
9eaa227
Compare
It is possible to test for the existence of a custom logo and only update the alt text then, but it seems like overkill and being way too precious about the brand. (There's nothing to stop someone just uploading the current logo as a custom logo, or (more likely) combining the SD logo with their own. Detecting that would be possible but extremely silly.) If you mean just leave it blank altogether, looking at w3c guidelines, specifically https://www.w3.org/WAI/tutorials/images/decision-tree/ would seem to suggest that the best thing to do (as it is an image with a link) would be to have text like " Securedrop: Home", to allow screenreaders to describe the behavior of the link. The only situation where we would just leave it blank is in the case where it was purely decorative. I do like the idea of improving text field sanitisation with a regex to catch non-printing chars - IMO this should be applied to other fields as well, including first/lastnames. I'm inclined to say that it should be a separate PR in that case, as otherwise the testing scope of this one will include all those fields too. |
Yes.
Yes, good call. I'll put in a separate ticket for that. |
4b70745
to
83bbe25
Compare
Status
Ready for review
Description of Changes
Fixes #1575.
organization_name
field to the instance configuration tableTesting
dev environment
make dev
on this branch/lookup
page and verify that its title is prefixed with the new organization name/metadata
endpoint and verify that that the JSON response is valid and contains anorganization_name
key with value set to the new organization namestaging environment (for apparmor)
make staging
on this branchpreferences saved
flash message is displayed correctly.upgrade scenario
Deployment
No special considerations for deployment - there is an added db column which should be handled by migration scripts.
Checklist
If you made changes to the server application code:
Linting (
make lint
) and tests (make test
) pass in the development containerI have written a test plan and validated it for this PR
Choose one of the following: