Skip to content
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

Display "Forgot you codename?" codename-hint link only on initial login #6130

Conversation

DrGFreeman
Copy link
Contributor

@DrGFreeman DrGFreeman commented Oct 8, 2021

Status

Ready for review

Description of Changes

Fixes #5101.

Changes proposed in this pull request:

Display the "Forgot you codename?" link to the codename-hint section in the /submit flashed message only on the source's initial login (i.e. do not display the link after the source logged in using their codename).

Add functional test to verify the above behavior. Also include verification of the first submission specific message.

Testing

Verify link does not show on second login - from /logout

  1. Access the Source Interface and click "GET STARTED".
  2. Take note of the codename on /generate and click "SUBMIT DOCUMENTS".
  3. On /lookup, click "LOGOUT".
  4. On /logout click "LOG IN".
  5. Enter the codename noted in 2 and click "CONTINUE".
  6. On /lookup enter a message and click "SUBMIT".
    • Verify that the flashed message does not include the "Forgot you codename?" link
      image

Verify link does not show on second login - from /

  1. Access the Source Interface and click "GET STARTED".
  2. Take note of the codename on /generate and click "SUBMIT DOCUMENTS".
  3. On /lookup, click "LOGOUT".
  4. Click on the SecureDrop logo to return to /.
  5. On / click "LOG IN".
  6. Enter the codename noted in 2 and click "CONTINUE".
  7. On /lookup enter a message and click "SUBMIT".
    • Verify that the flashed message does not include the "Forgot you codename?" link.
      image

Verify link shows on first login

  1. Access the Source Interface and click "GET STARTED".
  2. Take note of the codename on /generate and click "SUBMIT DOCUMENTS".
  3. On /lookup enter a message and click "SUBMIT".
    • Verify that the flashed message includes the "Forgot you codename?" link.
      image

Deployment

Any special considerations for deployment? Consider both:

  1. Upgrading existing production instances.
  2. New installs.

N/A.

Checklist

If you made changes to the server application code:

  • Linting (make lint) and tests (make test) pass in the development container

If you made changes to securedrop-admin:

  • Linting and tests (make -C admin test) pass in the admin development container

If you made changes to the system configuration:

If you added or removed a file deployed with the application:

  • I have updated AppArmor rules to include the change

If you made non-trivial code changes:

  • I have written a test plan and validated it for this PR

Choose one of the following:

  • I have opened a PR in the docs repo for these changes, or will do so later
  • I would appreciate help with the documentation
  • These changes do not require documentation

If you added or updated a production code dependency:

Production code dependencies are defined in:

  • admin/requirements.in
  • admin/requirements-ansible.in
  • securedrop/requirements/python3/securedrop-app-code-requirements.in

If you changed another requirements.in file that applies only to development
or testing environments, then no diff review is required, and you can skip
(remove) this section.

Choose one of the following:

  • I have performed a diff review and pasted the contents to the packaging wiki
  • I would like someone else to do the diff review

@DrGFreeman DrGFreeman force-pushed the 5101-submit-codename-link-first-login-only branch from 0cf9432 to 1962bf2 Compare October 15, 2021 03:43
@DrGFreeman DrGFreeman marked this pull request as ready for review October 15, 2021 03:46
@DrGFreeman DrGFreeman requested a review from a team as a code owner October 15, 2021 03:46
@DrGFreeman
Copy link
Contributor Author

Added functional tests, rebased to develop and set status to "Ready for review".

@eloquence eloquence added this to Ready for Review in SecureDrop Team Board Oct 15, 2021
@DrGFreeman DrGFreeman force-pushed the 5101-submit-codename-link-first-login-only branch from 1962bf2 to e54d0c5 Compare October 20, 2021 11:42
@DrGFreeman
Copy link
Contributor Author

Rebased to develop following version 2.1.0 release.

@conorsch
Copy link
Contributor

Hey there, thanks @DrGFreeman! I believe @creviera expressed an interest in reviewing this, so I'm tagging her in here. Likely next week sometime, given our current schedule.

@@ -1,8 +1,10 @@
<section class="message">
<h2>{{ gettext('Success!') }}</h2>
<p>{{ gettext('Thank you for sending this information to us. Please check back later for replies.') }}
{% if new_user_codename %}
<a href="#codename-hint">
{{ gettext('Forgot your codename?') }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] this would look better on a new line

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @creviera, thanks for the review. Just to be sure, you mean moving the "Forgot your codename?" item on a separate line like this?

image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup, looks great!

sssoleileraaa
sssoleileraaa previously approved these changes Oct 25, 2021
Copy link
Contributor

@sssoleileraaa sssoleileraaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works as expected, just one nitpicky comment, so i'll let this sit for a few after approving

Testing

Verify link does not show on second login - from /logout

  1. Access the Source Interface and click "GET STARTED".
  2. Take note of the codename on /generate and click "SUBMIT DOCUMENTS".
  3. On /lookup, click "LOGOUT".
  4. On /logout click "LOG IN".
  5. Enter the codename noted in 2 and click "CONTINUE".
  6. On /lookup enter a message and click "SUBMIT".
    • Verify that the flashed message does not include the "Forgot you codename?" link
      image

Verify link does not show on second login - from /

  1. Access the Source Interface and click "GET STARTED".
  2. Take note of the codename on /generate and click "SUBMIT DOCUMENTS".
  3. On /lookup, click "LOGOUT".
  4. Click on the SecureDrop logo to return to /.
  5. On / click "LOG IN".
  6. Enter the codename noted in 2 and click "CONTINUE".
  7. On /lookup enter a message and click "SUBMIT".
    • Verify that the flashed message does not include the "Forgot you codename?" link.
      image

Verify link shows on first login

  1. Access the Source Interface and click "GET STARTED".
  2. Take note of the codename on /generate and click "SUBMIT DOCUMENTS".
  3. On /lookup enter a message and click "SUBMIT".
    • Verify that the flashed message includes the "Forgot you codename?" link.
      image

@sssoleileraaa sssoleileraaa moved this from Ready for Review to Under Review in SecureDrop Team Board Oct 25, 2021
Display the "Forgot you codename?" link to the codename-hint section
only on the source's initial login.

Ref. freedomofpress#5101
Add functional test to verify the composition of the notification
message displayed when a source submits a message.
@DrGFreeman
Copy link
Contributor Author

DrGFreeman commented Oct 27, 2021

Moved "Forgot your codename?" text to new line (screenshot below) as per @creviera's suggestion & rebased to develop.

image

Copy link
Contributor

@sssoleileraaa sssoleileraaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! i also created a separate but related follow-up issue (needs discussion): #6155

@sssoleileraaa sssoleileraaa merged commit da2d0b7 into freedomofpress:develop Oct 27, 2021
SecureDrop Team Board automation moved this from Under Review to Done Oct 27, 2021
@eaon eaon mentioned this pull request Feb 11, 2022
35 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Codename hint link visible in flash message but codename hint not displayed
3 participants