Skip to content

Commit

Permalink
Fixed test
Browse files Browse the repository at this point in the history
  • Loading branch information
alexjanousekGSA committed Dec 11, 2024
2 parents be5f789 + 28a6b44 commit dfef520
Show file tree
Hide file tree
Showing 24 changed files with 154 additions and 220 deletions.
4 changes: 4 additions & 0 deletions app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ def _csp(config):
logo_domain = config["LOGO_CDN_DOMAIN"]
return {
"default-src": ["'self'", asset_domain],
"frame-src": [
"https://www.youtube.com",
"https://www.youtube-nocookie.com",
],
"frame-ancestors": "'none'",
"form-action": "'self'",
"script-src": [
Expand Down
28 changes: 28 additions & 0 deletions app/assets/sass/uswds/_uswds-theme-custom-styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,20 @@ td.table-empty-message {
background-position: 0;
}

.folder-heading-template {
background: url(../img/material-icons/wysiwyg.svg) no-repeat;
padding-left: units(4);
display: inline-block;
background-position: 0;
}

.folder-heading-template {
background: url(../img/material-icons/wysiwyg.svg) no-repeat;
padding-left: units(4);
display: inline-block;
background-position: 0;
}

.usa-checkbox .usa-checkbox__label {
+ a.template-list-folder {
margin-left: units(4);
Expand Down Expand Up @@ -272,6 +286,7 @@ td.table-empty-message {
margin-bottom: units(2);
.usa-form-group {
@include u-width('mobile-lg');
margin-top: units(2);
}
input#search {
width: 100%;
Expand Down Expand Up @@ -407,6 +422,11 @@ td.table-empty-message {
background-image: url(../img/material-icons/description.svg);
}
}
.get-started {
border: 1px solid color('gray-90');
padding: units(2);
margin-bottom: units(4);
}
}

.dashboard-table {
Expand Down Expand Up @@ -983,3 +1003,11 @@ li.linked-card:hover svg,
}
}
}

// Send message flow

#breadcrumb-template-folders,
#nav-service-nav span {
font-size: units(3);
font-weight: bold;
}
7 changes: 7 additions & 0 deletions app/main/views/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,13 @@ def guidance_index():
)


@main.route("/contact")
def contact():
return render_template(
"views/contact.html",
)


@main.route("/about")
def about_notify():
return render_template(
Expand Down
2 changes: 1 addition & 1 deletion app/main/views/send.py
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ def all_placeholders_in_session(placeholders):

def get_send_test_page_title(template_type, entering_recipient, name=None):
if entering_recipient:
return "Send ‘{}’".format(name)
return "Select recipients"
return "Personalize this message"


Expand Down
4 changes: 4 additions & 0 deletions app/main/views/sub_navigation_dictionaries.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,8 @@ def about_notify_nav():
},
],
},
{
"name": "Contact",
"link": "main.contact",
},
]
4 changes: 1 addition & 3 deletions app/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
<html lang="{{ htmlLang | default('en') }}" class="{{ htmlClasses }}">
<head>
<title>
{% block pageTitle %}
{% block per_page_title %}{% endblock %} – Notify.gov
{% endblock %}
{% block pageTitle %}{% block per_page_title %}{% endblock %} – Notify.gov{% endblock %}
</title>
{% include "components/head.html" %}
</head>
Expand Down
4 changes: 2 additions & 2 deletions app/templates/components/folder-path.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
template_type,
current_user,
link_current_item=False,
root_element='h1'
root_element='nav'
) %}
<{{ root_element }} class="font-body-lg folder-heading margin-bottom-0"{% if root_element == 'h1' %} id="page-header"{% endif %}>
<{{ root_element }} id="breadcrumb-template-folders" class="navigation-service usa-breadcrumb padding-top-0 padding-bottom-05" aria-label="Template folder path">
{% for folder in folders %}
{% if loop.last and not link_current_item %}
{% if folder.template_type or not folder.id %}
Expand Down
2 changes: 1 addition & 1 deletion app/templates/components/live-search.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
{% endif %}

{% if show %}
<div class="live-search js-header" data-module="live-search" data-targets="{{ target_selector }}">
<div class="live-search js-header margin-top-0" data-module="live-search" data-targets="{{ target_selector }}">
{{ form.search(param_extensions=param_extensions) }}
<div aria-live="polite" class="live-search__status usa-sr-only"></div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions app/templates/components/service_nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
<a href="{{ url_for('.organization_dashboard', org_id=current_service.organization_id) }}" class="usa-link navigation-organization-link">{{ current_service.organization_name }}</a>
{% endif %}
{% endif %}
<div class="font-body-2xl text-bold">
<span>
{{ current_service.name }}
{% if not current_service.active %}
<span class="navigation-service-name navigation-service-type--suspended">Suspended</span>
{% endif %}
</div>
</span>
<a href="{{ url_for('main.choose_account') }}" class="usa-link">Switch service</a>
</div>
</nav>
3 changes: 1 addition & 2 deletions app/templates/views/about/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ <h1>{{page_title}}</h1>
<p>Notify.gov is an easy-to-use, web-based platform. It requires no technical expertise or system integration — users
can create an account and get started within minutes. We take the security and privacy of messaging data seriously
by minimizing data retention and using modern encryption methods.</p>
<!-- add youtube video component here -->
<h2 class="padding-bottom-3">Product Highlights</h2>
<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/fkcy_xbo0Bw?si=qNo94BwL4WCeusy5&amp;start=2" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe> <h2 class="padding-bottom-3">Product Highlights</h2>
{% set product_highlights = [
{
"svg_src": "#send",
Expand Down
25 changes: 25 additions & 0 deletions app/templates/views/contact.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{% extends "base.html" %}

{% set page_title = "Contact" %}

{% block per_page_title %}{{page_title}}{% endblock %}

{% block content_column_content %}
<section class="usa-prose">
<h1>{{page_title}}</h1>
<p>Is your organization interested in using Notify.gov? Find more information at <a href="/join-notify">Join
Notify</a> or contact us at <a href="mailto:[email protected]"
aria-label="contact us at [email protected]">[email protected]</a>.</p>
<p>You can expect a response within one business day.</p>
<div class="usa-summary-box maxw-tablet __web-inspector-hide-shortcut__" role="region"
aria-label="For partnership inquiries">
<div class="usa-summary-box__body">
<div class="usa-summary-box__text">
<p>If you are a current Notify.gov partner and have technical issues or questions, we are available at <a
href="mailto:[email protected]"
aria-label="Email Notify for technical questions at [email protected]">[email protected]</a></p>
</div>
</div>
</div>
</section>
{% endblock %}
4 changes: 2 additions & 2 deletions app/templates/views/dashboard/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<script type="text/javascript" src="{{ asset_url('js/setTimezone.js') }}"></script>


<div class="dashboard margin-bottom-2">
<div class="dashboard margin-top-0 margin-bottom-2">

<h1 class="usa-sr-only">Dashboard</h1>
{% if current_user.has_permissions('manage_templates') and not current_service.all_templates %}
Expand All @@ -22,7 +22,7 @@ <h1 class="usa-sr-only">Dashboard</h1>

{{ ajax_block(partials, updates_url, 'upcoming') }}

<h2 class="font-body-xl margin-top-0">{{ current_service.name }} Dashboard</h2>
<h2 class="font-body-2xl line-height-sans-2 margin-top-0">{{ current_service.name }} Dashboard</h2>

{{ ajax_block(partials, updates_url, 'inbox') }}

Expand Down
10 changes: 6 additions & 4 deletions app/templates/views/dashboard/write-first-messages.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<h2 class="font-body-lg margin-top-0 margin-bottom-1">Get started</h2>
<a class="usa-button margin-bottom-5" href="{{ url_for('.choose_template', service_id=current_service.id) }}">
Create your first template
</a>
<div class="get-started">
<h2 class="font-body-lg margin-top-0 margin-bottom-2">Get started</h2>
<a class="usa-button" href="{{ url_for('.choose_template', service_id=current_service.id) }}">
Create your first template
</a>
</div>
4 changes: 2 additions & 2 deletions app/templates/views/notifications/preview.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{% elif help %}
{{ "Example text message" }}
{% else %}
{{ "Preview" }}
{{ "Preview for sending" }}
{% endif %}
{% endblock %}

Expand Down Expand Up @@ -50,7 +50,7 @@
{% endcall %}
</div>
{% else %}
{{ page_header("Example text message" if help else "Preview") }}
{{ page_header("Example text message" if help else "Preview for sending") }}
{% endif %}

{% if not help %}
Expand Down
19 changes: 7 additions & 12 deletions app/templates/views/templates/choose.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% from "components/folder-path.html" import folder_path, page_title_folder_path %}
{% from "components/folder-path.html" import folder_path %}
{% from "components/pill.html" import pill %}
{% from "components/live-search.html" import live_search %}
{% from "components/form.html" import form_wrapper %}
Expand All @@ -8,11 +8,9 @@

{% extends "withnav_template.html" %}

{% set page_title = 'Templates' %}
{% set page_title = 'Select or create a template' %}

{% block service_page_title %}
{{ page_title_folder_path(template_folder_path) }}
{% endblock %}
{% block service_page_title %}{{page_title}}{% endblock %}

{% block maincolumn_content %}

Expand All @@ -34,14 +32,11 @@
{% else %}

<div class="grid-row flex-column">
<h1 class="font-body-2xl line-height-sans-2 margin-bottom-1 margin-top-0">{{page_title}}</h1>
<div class="{% if current_user.has_permissions('manage_templates') %} grid-col-10 {% else %} grid-col-12 {% endif %}">
<div class="usa-alert usa-alert--slim usa-alert--info">
<div class="usa-alert__body">
<p class="usa-alert__text">
Every message starts with a template. To send, choose or create a template.
</p>
</div>
</div>
<p class="margin-top-0 margin-bottom-4">
Every message starts with a template. To send, choose or create a template.
</p>
{{ folder_path(
folders=template_folder_path,
service_id=current_service.id,
Expand Down
6 changes: 3 additions & 3 deletions app/templates/views/templates/manage-template-folder.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
{% from "components/page-footer.html" import page_footer %}
{% from "components/form.html" import form_wrapper %}

{% block service_page_title %}
{{ page_title_folder_path(template_folder_path) }}
{% endblock %}
{% set page_title = 'Select or create a template' %}

{% block service_page_title %}{{page_title}}{% endblock %}

{% block maincolumn_content %}

Expand Down
12 changes: 6 additions & 6 deletions app/templates/views/templates/template.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{% extends "withnav_template.html" %}
{% from "components/banner.html" import banner_wrapper %}
{% from "components/folder-path.html" import folder_path, page_title_folder_path %}
{% from "components/folder-path.html" import folder_path %}
{% from "components/page-footer.html" import page_footer %}
{% from "components/copy-to-clipboard.html" import copy_to_clipboard %}
{% from "components/components/button/macro.njk" import usaButton %}

{% block service_page_title %}
{{ page_title_folder_path(current_service.get_template_path(template._template)) }}
{% endblock %}
{% set page_title = 'Confirm your template' %}

{% block service_page_title %}{{page_title}}{% endblock %}

{% block maincolumn_content %}

Expand All @@ -32,8 +32,8 @@
{% else %}
<div class="grid-row">
<div class="grid-col-12">
<h1 class="font-body-xl folder-heading margin-top-0">
Review your message
<h1 class="font-body-2xl line-height-sans-2 folder-heading margin-top-0">
{{page_title}}
</h1>
{{ folder_path(
folders=current_service.get_template_path(template._template),
Expand Down
9 changes: 2 additions & 7 deletions app/templates/withnav_template.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
{% extends "base.html" %}

{% block per_page_title %}
{% if current_org.name %}
{% block org_page_title %}{% endblock %} – {{ current_org.name }}
{% else %}
{% block service_page_title %}{% endblock %} – {{ current_service.name }}
{% endif %}
{% endblock %}
{% block per_page_title %}{% if current_org.name %}{% block org_page_title %}{% endblock %} – {{ current_org.name }}{%
else %}{% block service_page_title %}{% endblock %} – {{ current_service.name }}{% endif %}{% endblock %}

{% block main %}
<div class="grid-container">
Expand Down
2 changes: 1 addition & 1 deletion tests/app/main/views/test_accept_invite.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def test_invite_goes_in_session(
("user", "landing_page_title"),
[
(create_active_user_with_permissions(), "Dashboard"),
(create_active_caseworking_user(), "Templates"),
(create_active_caseworking_user(), "Select or create a template"),
],
)
def test_accepting_invite_removes_invite_from_session(
Expand Down
4 changes: 2 additions & 2 deletions tests/app/main/views/test_send.py
Original file line number Diff line number Diff line change
Expand Up @@ -1253,7 +1253,7 @@ def test_send_one_off_has_correct_page_title(
step_index=0,
_follow_redirects=True,
)
assert page.h1.text.strip() == "Send ‘Two week reminder’"
assert page.h1.text.strip() == "Select recipients"

assert len(page.select(".banner-tour")) == 0

Expand Down Expand Up @@ -2712,7 +2712,7 @@ def test_preview_notification_shows_preview(
template_id=fake_uuid,
_expected_status=200,
)
assert page.h1.text.strip() == "Preview"
assert page.h1.text.strip() == "Preview for sending"
assert (page.find_all("a", {"class": "usa-back-link"})[0]["href"]) == url_for(
"main.check_notification",
service_id=service_one["id"],
Expand Down
Loading

0 comments on commit dfef520

Please sign in to comment.