From fff440a6ff92615aab0f9dc51080a8a5850d8d74 Mon Sep 17 00:00:00 2001 From: Jonathan Bobel Date: Mon, 26 Feb 2024 11:10:50 -0500 Subject: [PATCH 1/7] 1216 - sign-in page redesign with login.gov --- app/templates/views/signin.html | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/app/templates/views/signin.html b/app/templates/views/signin.html index a19376d7c..4ee655127 100644 --- a/app/templates/views/signin.html +++ b/app/templates/views/signin.html @@ -13,7 +13,7 @@ {% block maincolumn_content %}
-
+
{% if again %}

You need to sign in again

@@ -29,9 +29,9 @@ {% else %}

Sign in

{% if login_gov_enabled %} - Sign in with Login.gov -

-

Or:

+

You can access your account by signing in with one of the options below:

+ Sign in with Login.gov +

Or:

{% endif %} {% endif %} @@ -41,6 +41,19 @@ {{ page_footer("Continue", secondary_link=password_reset_url, secondary_link_text="Forgot your password?") }} {% endcall %}
+
+

Notify.gov is changing the Sign in experience to Login.gov on March x, 2024

+

Why are we doing this?

+
    +
  • One single source for signing in: You can use login.gov for other sign in forms within the government
  • +
  • Security: It's really secure and trustworthy
  • +
  • Fast and easy: It's fast and easy
  • +
+
+

Don't have a login.gov account?

+

If you don't have an account already, sign up here:

+ Create Login.gov account +
{% endblock %} From d5f40dffe1ef3bd31a05aafe943d97add4272a17 Mon Sep 17 00:00:00 2001 From: Jonathan Bobel Date: Tue, 27 Feb 2024 11:53:51 -0500 Subject: [PATCH 2/7] Commit before merge --- app/assets/javascripts/loginAlert.js | 35 ++++++++++++++ .../uswds/_uswds-theme-custom-styles.scss | 6 +++ app/main/forms.py | 16 ++++--- app/main/views/api_keys.py | 22 +++++---- app/main/views/manage_users.py | 22 +++++---- app/main/views/performance.py | 6 +-- app/main/views/send.py | 28 ++++++----- app/main/views/service_settings.py | 24 ++++++---- app/templates/views/signin.html | 10 +++- gulpfile.js | 1 + tests/app/main/views/test_accept_invite.py | 6 +-- tests/app/main/views/test_manage_users.py | 6 +-- tests/app/main/views/test_template_folders.py | 8 ++-- tests/conftest.py | 14 +++--- tests/javascripts/loginAlert.test.js | 48 +++++++++++++++++++ 15 files changed, 187 insertions(+), 65 deletions(-) create mode 100644 app/assets/javascripts/loginAlert.js create mode 100644 tests/javascripts/loginAlert.test.js diff --git a/app/assets/javascripts/loginAlert.js b/app/assets/javascripts/loginAlert.js new file mode 100644 index 000000000..67ed439ae --- /dev/null +++ b/app/assets/javascripts/loginAlert.js @@ -0,0 +1,35 @@ +(function (window) { + +// Set the target date (10 days before March 15th, 2024) + const targetDate = new Date("April 9, 2024 00:00:00").getTime(); + + // Function to update the countdown display + function updateCountdown() { + const now = new Date().getTime(); + const difference = targetDate - now; + + // Time calculations for days only + const days = Math.floor(difference / (1000 * 60 * 60 * 24)); + + // Visibility logic + if (days < 0) { + // Hide if more than 10 days away OR if already past the date + document.getElementById("countdown-container").style.display = "none"; + } else { + // Show if 10 days or less remaining + document.getElementById("countdown-container").style.display = "block"; + document.getElementById("countdown").innerHTML = days + " days "; + } + + } + + // Expose the updateCountdown function to the outside world + window.updateCountdown = updateCountdown; + + // Initial display update + updateCountdown(); + + // Update the countdown every second (inside the IIFE) + setInterval(updateCountdown, 1000); + +})(window); diff --git a/app/assets/sass/uswds/_uswds-theme-custom-styles.scss b/app/assets/sass/uswds/_uswds-theme-custom-styles.scss index addf9cc7a..05cfab466 100644 --- a/app/assets/sass/uswds/_uswds-theme-custom-styles.scss +++ b/app/assets/sass/uswds/_uswds-theme-custom-styles.scss @@ -552,3 +552,9 @@ details form { .edit-textbox-error-mt { margin-top: 1.5rem; } + +// Login page + +#countdown-container { + display: none; // Hide the countdown timer +} diff --git a/app/main/forms.py b/app/main/forms.py index c01ce8fcc..2e6655cc5 100644 --- a/app/main/forms.py +++ b/app/main/forms.py @@ -1781,12 +1781,16 @@ class TemplateAndFoldersSelectionForm(Form): None, [ # ('email', 'Email') if 'email' in available_template_types else None, - ("sms", "Start with a blank template") - if "sms" in available_template_types - else None, - ("copy-existing", "Copy an existing template") - if allow_adding_copy_of_template - else None, + ( + ("sms", "Start with a blank template") + if "sms" in available_template_types + else None + ), + ( + ("copy-existing", "Copy an existing template") + if allow_adding_copy_of_template + else None + ), ], ) ) diff --git a/app/main/views/api_keys.py b/app/main/views/api_keys.py index 4f8c3b29e..8cb28ba59 100644 --- a/app/main/views/api_keys.py +++ b/app/main/views/api_keys.py @@ -168,12 +168,14 @@ def api_callbacks(service_id): return render_template( "views/api/callbacks.html", - received_text_messages_callback=received_text_messages_callback["url"] - if received_text_messages_callback - else None, - delivery_status_callback=delivery_status_callback["url"] - if delivery_status_callback - else None, + received_text_messages_callback=( + received_text_messages_callback["url"] + if received_text_messages_callback + else None + ), + delivery_status_callback=( + delivery_status_callback["url"] if delivery_status_callback else None + ), ) @@ -262,9 +264,11 @@ def received_text_messages_callback(service_id): received_text_messages_callback = get_received_text_messages_callback() form = CallbackForm( - url=received_text_messages_callback.get("url") - if received_text_messages_callback - else "", + url=( + received_text_messages_callback.get("url") + if received_text_messages_callback + else "" + ), bearer_token=dummy_bearer_token if received_text_messages_callback else "", ) diff --git a/app/main/views/manage_users.py b/app/main/views/manage_users.py index 4ab20f363..1b80c659e 100644 --- a/app/main/views/manage_users.py +++ b/app/main/views/manage_users.py @@ -122,16 +122,18 @@ def edit_user_permissions(service_id, user_id): form = form_class.from_user( user, service_id, - folder_permissions=None - if user.platform_admin - else [ - f["id"] - for f in current_service.all_template_folders - if user.has_template_folder_permission(f) - ], - all_template_folders=None - if user.platform_admin - else current_service.all_template_folders, + folder_permissions=( + None + if user.platform_admin + else [ + f["id"] + for f in current_service.all_template_folders + if user.has_template_folder_permission(f) + ] + ), + all_template_folders=( + None if user.platform_admin else current_service.all_template_folders + ), ) if form.validate_on_submit(): diff --git a/app/main/views/performance.py b/app/main/views/performance.py index 13445967b..1d2a4d1bc 100644 --- a/app/main/views/performance.py +++ b/app/main/views/performance.py @@ -34,8 +34,8 @@ def performance(): stats["average_percentage_under_10_seconds"] = mean( [row["percentage_under_10_seconds"] for row in stats["processing_time"]] or [0] ) - stats[ - "count_of_live_services_and_organizations" - ] = status_api_client.get_count_of_live_services_and_organizations() + stats["count_of_live_services_and_organizations"] = ( + status_api_client.get_count_of_live_services_and_organizations() + ) return render_template("views/performance.html", **stats) diff --git a/app/main/views/send.py b/app/main/views/send.py index 4332c7ddb..6c786e3ac 100644 --- a/app/main/views/send.py +++ b/app/main/views/send.py @@ -52,12 +52,14 @@ def get_example_csv_fields(column_headers, use_example_as_example, submitted_fie def get_example_csv_rows(template, use_example_as_example=True, submitted_fields=False): return { - "email": ["test@example.com"] - if use_example_as_example - else [current_user.email_address], - "sms": ["12223334444"] - if use_example_as_example - else [current_user.mobile_number], + "email": ( + ["test@example.com"] + if use_example_as_example + else [current_user.email_address] + ), + "sms": ( + ["12223334444"] if use_example_as_example else [current_user.mobile_number] + ), }[template.template_type] + get_example_csv_fields( ( placeholder @@ -511,12 +513,14 @@ def _check_messages(service_id, template_id, upload_id, preview_row): template=template, max_initial_rows_shown=50, max_errors_shown=50, - guestlist=itertools.chain.from_iterable( - [user.name, user.mobile_number, user.email_address] - for user in Users(service_id) - ) - if current_service.trial_mode - else None, + guestlist=( + itertools.chain.from_iterable( + [user.name, user.mobile_number, user.email_address] + for user in Users(service_id) + ) + if current_service.trial_mode + else None + ), remaining_messages=remaining_messages, allow_international_sms=current_service.has_permission("international_sms"), ) diff --git a/app/main/views/service_settings.py b/app/main/views/service_settings.py index 1cac1410c..628ac59e5 100644 --- a/app/main/views/service_settings.py +++ b/app/main/views/service_settings.py @@ -477,9 +477,11 @@ def service_edit_email_reply_to(service_id, reply_to_email_id): current_service.id, reply_to_email_id=reply_to_email_id, email_address=form.email_address.data, - is_default=True - if reply_to_email_address["is_default"] - else form.is_default.data, + is_default=( + True + if reply_to_email_address["is_default"] + else form.is_default.data + ), ) return redirect(url_for(".service_email_reply_to", service_id=service_id)) try: @@ -499,9 +501,11 @@ def service_edit_email_reply_to(service_id, reply_to_email_id): ".service_verify_reply_to_address", service_id=service_id, notification_id=notification_id, - is_default=True - if reply_to_email_address["is_default"] - else form.is_default.data, + is_default=( + True + if reply_to_email_address["is_default"] + else form.is_default.data + ), replace=reply_to_email_id, ) ) @@ -702,9 +706,11 @@ def service_edit_sms_sender(service_id, sms_sender_id): service_api_client.update_sms_sender( current_service.id, sms_sender_id=sms_sender_id, - sms_sender=sms_sender["sms_sender"] - if is_inbound_number - else form.sms_sender.data.replace("\r", ""), + sms_sender=( + sms_sender["sms_sender"] + if is_inbound_number + else form.sms_sender.data.replace("\r", "") + ), is_default=True if sms_sender["is_default"] else form.is_default.data, ) return redirect(url_for(".service_sms_senders", service_id=service_id)) diff --git a/app/templates/views/signin.html b/app/templates/views/signin.html index 4ee655127..398a39274 100644 --- a/app/templates/views/signin.html +++ b/app/templates/views/signin.html @@ -13,8 +13,16 @@ {% block maincolumn_content %}
+
+
+

+ You have left to use login.gov to sign in +

+
+
+
+
- {% if again %}

You need to sign in again

{% if other_device %} diff --git a/gulpfile.js b/gulpfile.js index 6828bcaf1..79f976035 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -123,6 +123,7 @@ const javascripts = () => { paths.src + 'javascripts/homepage.js', paths.src + 'javascripts/timeoutPopup.js', paths.src + 'javascripts/date.js', + paths.src + 'javascripts/loginAlert.js', paths.src + 'javascripts/main.js', ]) .pipe(plugins.prettyerror()) diff --git a/tests/app/main/views/test_accept_invite.py b/tests/app/main/views/test_accept_invite.py index 1deeca299..900ff4bf5 100644 --- a/tests/app/main/views/test_accept_invite.py +++ b/tests/app/main/views/test_accept_invite.py @@ -218,7 +218,7 @@ def test_if_existing_user_accepts_twice_they_redirect_to_sign_in( assert ( page.h1.string, - page.select("main p")[0].text.strip(), + page.select("main p")[1].text.strip(), ) == ( "You need to sign in again", "We signed you out because you have not used Notify for a while.", @@ -332,7 +332,7 @@ def test_existing_user_of_service_get_redirected_to_signin( assert ( page.h1.string, - page.select("main p")[0].text.strip(), + page.select("main p")[1].text.strip(), ) == ( "You need to sign in again", "We signed you out because you have not used Notify for a while.", @@ -421,7 +421,7 @@ def test_existing_signed_out_user_accept_invite_redirects_to_sign_in( assert mock_accept_invite.call_count == 1 assert ( page.h1.string, - page.select("main p")[0].text.strip(), + page.select("main p")[1].text.strip(), ) == ( "You need to sign in again", "We signed you out because you have not used Notify for a while.", diff --git a/tests/app/main/views/test_manage_users.py b/tests/app/main/views/test_manage_users.py index 9bdabf925..c3d128155 100644 --- a/tests/app/main/views/test_manage_users.py +++ b/tests/app/main/views/test_manage_users.py @@ -862,9 +862,9 @@ def test_should_show_page_if_prefilled_user_is_already_invited( mock_get_invites_for_service, platform_admin_user, ): - active_user_with_permission_to_other_service[ - "email_address" - ] = "user_1@testnotify.gsa.gov" + active_user_with_permission_to_other_service["email_address"] = ( + "user_1@testnotify.gsa.gov" + ) client_request.login(platform_admin_user) mocker.patch( "app.models.user.user_api_client.get_user", diff --git a/tests/app/main/views/test_template_folders.py b/tests/app/main/views/test_template_folders.py index fae020e58..0bf2fcb08 100644 --- a/tests/app/main/views/test_template_folders.py +++ b/tests/app/main/views/test_template_folders.py @@ -31,9 +31,11 @@ def _folder(name, folder_id=None, parent=None, users_with_permission=None): "name": name, "id": folder_id or str(uuid.uuid4()), "parent_id": parent, - "users_with_permission": users_with_permission - if users_with_permission is not None - else [sample_uuid()], + "users_with_permission": ( + users_with_permission + if users_with_permission is not None + else [sample_uuid()] + ), } diff --git a/tests/conftest.py b/tests/conftest.py index 6c4f94b4f..4c2ceeea9 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -904,9 +904,11 @@ def create_service_templates(service_id, number_of_templates=4): "{}_template_{}".format(template_type, template_number), template_type, "{} template {} content".format(template_type, template_number), - subject="{} template {} subject".format(template_type, template_number) - if template_type == "email" - else None, + subject=( + "{} template {} subject".format(template_type, template_number) + if template_type == "email" + else None + ), ) ) @@ -1101,9 +1103,9 @@ def active_user_with_permission_to_other_service( active_user_with_permission_to_two_services["permissions"].pop(SERVICE_ONE_ID) active_user_with_permission_to_two_services["services"].pop(0) active_user_with_permission_to_two_services["name"] = "Service Two User" - active_user_with_permission_to_two_services[ - "email_address" - ] = "service-two-user@test.gsa.gov" + active_user_with_permission_to_two_services["email_address"] = ( + "service-two-user@test.gsa.gov" + ) return active_user_with_permission_to_two_services diff --git a/tests/javascripts/loginAlert.test.js b/tests/javascripts/loginAlert.test.js new file mode 100644 index 000000000..4bb0d3eaa --- /dev/null +++ b/tests/javascripts/loginAlert.test.js @@ -0,0 +1,48 @@ +beforeAll(() => { + jest.spyOn(global, 'setTimeout'); + const sessionTimerModule = require('../../app/assets/javascripts/loginAlert.js'); + window.GOVUK.modules.start(); +}); + +jest.useFakeTimers(); +const targetDate = new Date("March 5, 2024 00:00:00"); // Reference point + +test('Hides the countdown if more than 10 days away', () => { + jest.setSystemTime(targetDate.getTime() - 12 * 24 * 60 * 60 * 1000); // 12 days before + + window.updateCountdown(); // Update the countdown display + + expect(document.getElementById("countdown-container").style.display).toBe("none"); +}); + +test('Shows the countdown if 10 days or less away', () => { + jest.setSystemTime(targetDate.getTime() - 8 * 24 * 60 * 60 * 1000); + + window.updateCountdown(); + + expect(document.getElementById("countdown-container").style.display).toBe("block"); +}); + +test('Displays the correct number of days', () => { + jest.setSystemTime(targetDate.getTime() - 5 * 24 * 60 * 60 * 1000); + + window.updateCountdown(); + + expect(document.getElementById("countdown").textContent).toBe("5 days "); +}); + +test('Hides the countdown if the target date has passed', () => { + jest.setSystemTime(targetDate.getTime() + 2 * 24 * 60 * 60 * 1000); + + window.updateCountdown(); + + expect(document.getElementById("countdown-container").style.display).toBe("none"); +}); + +test('Displays "Countdown Complete!" when the countdown finishes', () => { + jest.setSystemTime(targetDate.getTime()); + + window.updateCountdown(); + + expect(document.getElementById("countdown").textContent).toBe("Countdown Complete!"); +}); From 507973f9ae52514353adeffbc81a9e6c1451be82 Mon Sep 17 00:00:00 2001 From: Jonathan Bobel Date: Fri, 1 Mar 2024 09:34:25 -0500 Subject: [PATCH 3/7] Edited the test, updated content --- app/assets/javascripts/loginAlert.js | 2 +- app/templates/views/signin.html | 22 +++++++++++++--------- tests/javascripts/loginAlert.test.js | 22 +++++++++++++--------- 3 files changed, 27 insertions(+), 19 deletions(-) diff --git a/app/assets/javascripts/loginAlert.js b/app/assets/javascripts/loginAlert.js index 67ed439ae..1f3281788 100644 --- a/app/assets/javascripts/loginAlert.js +++ b/app/assets/javascripts/loginAlert.js @@ -12,7 +12,7 @@ const days = Math.floor(difference / (1000 * 60 * 60 * 24)); // Visibility logic - if (days < 0) { + if (days < 0 || days > 10) { // Hide if more than 10 days away OR if already past the date document.getElementById("countdown-container").style.display = "none"; } else { diff --git a/app/templates/views/signin.html b/app/templates/views/signin.html index 398a39274..8773fba24 100644 --- a/app/templates/views/signin.html +++ b/app/templates/views/signin.html @@ -13,10 +13,11 @@ {% block maincolumn_content %}
-
+
+

Login.gov is required by April 9, 2024

- You have left to use login.gov to sign in + You have left to use Login.gov to sign in

@@ -50,17 +51,20 @@ {% endcall %}
-

Notify.gov is changing the Sign in experience to Login.gov on March x, 2024

+

Notify.gov is changing the sign-in experience to Login.gov effective
April 9, 2024

Why are we doing this?

    -
  • One single source for signing in: You can use login.gov for other sign in forms within the government
  • -
  • Security: It's really secure and trustworthy
  • -
  • Fast and easy: It's fast and easy
  • +
  • Enhanced security: Login.gov is really secure and trustworthy
  • +
  • One single source for signing in: You can use Login.gov for other services within the federal government
  • +
  • 2FA flexibility: Login.gov supports multiple methods for users to verify their identity.
  • +
+

What do I need to do?

+
    +
  • If you have a Login.gov account, start using it to sign in to Notify today.
  • +
  • If you don’t have a Login.gov account, you must create one by April 9, 2024 to continue to access Notify.
-

Don't have a login.gov account?

-

If you don't have an account already, sign up here:

- Create Login.gov account + Create Login.gov account
diff --git a/tests/javascripts/loginAlert.test.js b/tests/javascripts/loginAlert.test.js index 4bb0d3eaa..895aa3647 100644 --- a/tests/javascripts/loginAlert.test.js +++ b/tests/javascripts/loginAlert.test.js @@ -1,11 +1,23 @@ beforeAll(() => { jest.spyOn(global, 'setTimeout'); + + document.body.innerHTML = ` +
+
+

Login.gov is required by April 9, 2024

+

+ You have left to use Login.gov to sign in +

+
+
+ ` + const sessionTimerModule = require('../../app/assets/javascripts/loginAlert.js'); window.GOVUK.modules.start(); }); jest.useFakeTimers(); -const targetDate = new Date("March 5, 2024 00:00:00"); // Reference point +const targetDate = new Date("April 9, 2024 00:00:00"); // Reference point test('Hides the countdown if more than 10 days away', () => { jest.setSystemTime(targetDate.getTime() - 12 * 24 * 60 * 60 * 1000); // 12 days before @@ -38,11 +50,3 @@ test('Hides the countdown if the target date has passed', () => { expect(document.getElementById("countdown-container").style.display).toBe("none"); }); - -test('Displays "Countdown Complete!" when the countdown finishes', () => { - jest.setSystemTime(targetDate.getTime()); - - window.updateCountdown(); - - expect(document.getElementById("countdown").textContent).toBe("Countdown Complete!"); -}); From 81d89f464a9468baff0d6be69e3744e330dec4b1 Mon Sep 17 00:00:00 2001 From: Jonathan Bobel Date: Mon, 4 Mar 2024 09:51:13 -0500 Subject: [PATCH 4/7] small responsive styling change --- app/templates/views/signin.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/templates/views/signin.html b/app/templates/views/signin.html index 8773fba24..1b8201275 100644 --- a/app/templates/views/signin.html +++ b/app/templates/views/signin.html @@ -50,7 +50,7 @@ {{ page_footer("Continue", secondary_link=password_reset_url, secondary_link_text="Forgot your password?") }} {% endcall %}
-
+

Notify.gov is changing the sign-in experience to Login.gov effective
April 9, 2024

Why are we doing this?

    From 0ae369d54bc9b644db8a8ab0f33299642ac67814 Mon Sep 17 00:00:00 2001 From: Jonathan Bobel Date: Tue, 12 Mar 2024 13:27:37 -0400 Subject: [PATCH 5/7] Updated the date to April 16th instead of April 9 --- app/assets/javascripts/loginAlert.js | 2 +- app/templates/views/signin.html | 6 +++--- tests/javascripts/loginAlert.test.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/loginAlert.js b/app/assets/javascripts/loginAlert.js index 1f3281788..84c2ee6a8 100644 --- a/app/assets/javascripts/loginAlert.js +++ b/app/assets/javascripts/loginAlert.js @@ -1,7 +1,7 @@ (function (window) { // Set the target date (10 days before March 15th, 2024) - const targetDate = new Date("April 9, 2024 00:00:00").getTime(); + const targetDate = new Date("April 16, 2024 00:00:00").getTime(); // Function to update the countdown display function updateCountdown() { diff --git a/app/templates/views/signin.html b/app/templates/views/signin.html index 1b8201275..e3e478a91 100644 --- a/app/templates/views/signin.html +++ b/app/templates/views/signin.html @@ -15,7 +15,7 @@
    -

    Login.gov is required by April 9, 2024

    +

    Login.gov is required by April 16, 2024

    You have left to use Login.gov to sign in

    @@ -51,7 +51,7 @@ {% endcall %}
    -

    Notify.gov is changing the sign-in experience to Login.gov effective
    April 9, 2024

    +

    Notify.gov is changing the sign-in experience to Login.gov effective
    April 16, 2024

    Why are we doing this?

    • Enhanced security: Login.gov is really secure and trustworthy
    • @@ -61,7 +61,7 @@

      What do I need to do?

      • If you have a Login.gov account, start using it to sign in to Notify today.
      • -
      • If you don’t have a Login.gov account, you must create one by April 9, 2024 to continue to access Notify.
      • +
      • If you don’t have a Login.gov account, you must create one by April 16, 2024 to continue to access Notify.
      Create Login.gov account diff --git a/tests/javascripts/loginAlert.test.js b/tests/javascripts/loginAlert.test.js index 895aa3647..085434b6a 100644 --- a/tests/javascripts/loginAlert.test.js +++ b/tests/javascripts/loginAlert.test.js @@ -4,7 +4,7 @@ beforeAll(() => { document.body.innerHTML = `
      -

      Login.gov is required by April 9, 2024

      +

      Login.gov is required by April 16, 2024

      You have left to use Login.gov to sign in

      @@ -17,7 +17,7 @@ beforeAll(() => { }); jest.useFakeTimers(); -const targetDate = new Date("April 9, 2024 00:00:00"); // Reference point +const targetDate = new Date("April 16, 2024 00:00:00"); // Reference point test('Hides the countdown if more than 10 days away', () => { jest.setSystemTime(targetDate.getTime() - 12 * 24 * 60 * 60 * 1000); // 12 days before From 429a456704d6f6e7fcdd54406ce3518f6ebf1156 Mon Sep 17 00:00:00 2001 From: Jonathan Bobel Date: Tue, 12 Mar 2024 13:37:44 -0400 Subject: [PATCH 6/7] Updating conditional logic --- app/templates/views/signin.html | 36 ++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/app/templates/views/signin.html b/app/templates/views/signin.html index e3e478a91..6b4952b0c 100644 --- a/app/templates/views/signin.html +++ b/app/templates/views/signin.html @@ -12,6 +12,7 @@ {% block maincolumn_content %} +{% if login_gov_enabled %}
      @@ -22,6 +23,7 @@
      +{% endif %}
      {% if again %} @@ -50,22 +52,24 @@ {{ page_footer("Continue", secondary_link=password_reset_url, secondary_link_text="Forgot your password?") }} {% endcall %}
      -
      -

      Notify.gov is changing the sign-in experience to Login.gov effective
      April 16, 2024

      -

      Why are we doing this?

      -
        -
      • Enhanced security: Login.gov is really secure and trustworthy
      • -
      • One single source for signing in: You can use Login.gov for other services within the federal government
      • -
      • 2FA flexibility: Login.gov supports multiple methods for users to verify their identity.
      • -
      -

      What do I need to do?

      -
        -
      • If you have a Login.gov account, start using it to sign in to Notify today.
      • -
      • If you don’t have a Login.gov account, you must create one by April 16, 2024 to continue to access Notify.
      • -
      -
      - Create Login.gov account + {% if login_gov_enabled %} +
      +

      Notify.gov is changing the sign-in experience to Login.gov effective
      April 16, 2024

      +

      Why are we doing this?

      +
        +
      • Enhanced security: Login.gov is really secure and trustworthy
      • +
      • One single source for signing in: You can use Login.gov for other services within the federal government
      • +
      • 2FA flexibility: Login.gov supports multiple methods for users to verify their identity.
      • +
      +

      What do I need to do?

      +
        +
      • If you have a Login.gov account, start using it to sign in to Notify today.
      • +
      • If you don’t have a Login.gov account, you must create one by April 16, 2024 to continue to access Notify.
      • +
      +
      + Create Login.gov account +
      -
      +{% endif %} {% endblock %} From 7deaf7146363d3844131ccf612d922bb4045767a Mon Sep 17 00:00:00 2001 From: Jonathan Bobel Date: Tue, 12 Mar 2024 14:29:16 -0400 Subject: [PATCH 7/7] Updated test --- tests/app/main/views/test_accept_invite.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/app/main/views/test_accept_invite.py b/tests/app/main/views/test_accept_invite.py index 900ff4bf5..1deeca299 100644 --- a/tests/app/main/views/test_accept_invite.py +++ b/tests/app/main/views/test_accept_invite.py @@ -218,7 +218,7 @@ def test_if_existing_user_accepts_twice_they_redirect_to_sign_in( assert ( page.h1.string, - page.select("main p")[1].text.strip(), + page.select("main p")[0].text.strip(), ) == ( "You need to sign in again", "We signed you out because you have not used Notify for a while.", @@ -332,7 +332,7 @@ def test_existing_user_of_service_get_redirected_to_signin( assert ( page.h1.string, - page.select("main p")[1].text.strip(), + page.select("main p")[0].text.strip(), ) == ( "You need to sign in again", "We signed you out because you have not used Notify for a while.", @@ -421,7 +421,7 @@ def test_existing_signed_out_user_accept_invite_redirects_to_sign_in( assert mock_accept_invite.call_count == 1 assert ( page.h1.string, - page.select("main p")[1].text.strip(), + page.select("main p")[0].text.strip(), ) == ( "You need to sign in again", "We signed you out because you have not used Notify for a while.",