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

11/26/2024 Production Deploy #2157

Merged
merged 27 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .ds.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
"filename": "app/config.py",
"hashed_secret": "577a4c667e4af8682ca431857214b3a920883efc",
"is_verified": false,
"line_number": 125,
"line_number": 123,
"is_secret": false
}
],
Expand Down Expand Up @@ -684,5 +684,5 @@
}
]
},
"generated_at": "2024-11-14T15:53:44Z"
"generated_at": "2024-11-21T23:08:45Z"
}
1 change: 1 addition & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ jobs:
inputs: requirements.txt
ignore-vulns: |
PYSEC-2024-60
PYSEC-2022-43162
- name: Run npm audit
run: make npm-audit

Expand Down
1 change: 1 addition & 0 deletions app/assets/images/alarm.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions app/assets/images/alert.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions app/assets/images/calendar.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 1 addition & 5 deletions app/assets/sass/uswds/_uswds-theme-custom-styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,7 @@ li.linked-card:hover svg,
display: block;
}

.about-icon-list {
.icon-list {
display: flex;
width: 24px;
height: 24px;
Expand All @@ -908,10 +908,6 @@ li.linked-card:hover svg,
margin-right: 4px;
}

.usa-icon-list__content{
padding-left: 0;
}

.indented-paragraph {
margin-left: calc(24px + 4px);
margin-top: 4px;
Expand Down
4 changes: 1 addition & 3 deletions app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,7 @@ class Config(object):
getenv("FEATURE_BEST_PRACTICES_ENABLED", "false") == "true"
)

FEATURE_ABOUT_PAGE_ENABLED = (
getenv("FEATURE_ABOUT_PAGE_ENABLED", "false") == "true"
)
FEATURE_ABOUT_PAGE_ENABLED = getenv("FEATURE_ABOUT_PAGE_ENABLED", "false") == "true"


def _s3_credentials_from_env(bucket_prefix):
Expand Down
26 changes: 20 additions & 6 deletions app/main/views/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,13 @@
# Hook to check for feature flags
@main.before_request
def check_feature_flags():
if (
request.path.startswith("/guides/best-practices")
and not current_app.config.get("FEATURE_BEST_PRACTICES_ENABLED", False)
if request.path.startswith("/guides/best-practices") and not current_app.config.get(
"FEATURE_BEST_PRACTICES_ENABLED", False
):
abort(404)

if (
request.path.startswith("/about")
and not current_app.config.get("FEATURE_ABOUT_PAGE_ENABLED", False)
if request.path.startswith("/about") and not current_app.config.get(
"FEATURE_ABOUT_PAGE_ENABLED", False
):
abort(404)

Expand Down Expand Up @@ -314,6 +312,22 @@ def about_notify():
)


@main.route("/about/security")
def about_security():
return render_template(
"views/about/security.html",
navigation_links=about_notify_nav(),
)


@main.route("/about/why-text-messaging")
def why_text_messaging():
return render_template(
"views/about/why-text-messaging.html",
navigation_links=about_notify_nav(),
)


@main.route("/using-notify/guidance/create-and-send-messages")
@user_is_logged_in
def create_and_send_messages():
Expand Down
81 changes: 41 additions & 40 deletions app/main/views/sub_navigation_dictionaries.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
from flask import current_app


def features_nav():
return [
{
Expand All @@ -22,46 +25,20 @@ def features_nav():


def using_notify_nav():
return [
{
"name": "Get started",
"link": "main.get_started",
},
{
"name": "Guides",
"link": "main.best_practices",
},
{
"name": "Trial mode",
"link": "main.trial_mode_new",
},
{
"name": "Tracking usage",
"link": "main.pricing",
},
{
"name": "Delivery status",
"link": "main.message_status",
},
{
"name": "Guidance",
"link": "main.guidance_index",
# "sub_navigation_items": [
# {
# "name": "Formatting",
# "link": "main.edit_and_format_messages",
# },
# {
# "name": "Send files by email",
# "link": "main.send_files_by_email",
# },
# ]
# {
# "name": "API documentation",
# "link": "main.documentation",
# },
},
nav_items = [
{"name": "Get started", "link": "main.get_started"},
{"name": "Guides", "link": "main.best_practices"},
{"name": "Trial mode", "link": "main.trial_mode_new"},
{"name": "Tracking usage", "link": "main.pricing"},
{"name": "Delivery Status", "link": "main.message_status"},
{"name": "Guidance", "link": "main.guidance_index"},
]
if not current_app.config.get("FEATURE_BEST_PRACTICES_ENABLED"):
nav_items = [
item for item in nav_items if item["link"] != "main.best_practices"
]

return nav_items


def best_practices_nav():
Expand Down Expand Up @@ -110,7 +87,31 @@ def best_practices_nav():
def about_notify_nav():
return [
{
"name": "About notify",
"name": "About Notify",
"link": "main.about_notify",
"sub_navigation_items": [
{
"name": "Why text messaging",
"link": "main.why_text_messaging",
"sub_sub_navigation_items": [
{
"name": "Reach people using a common method",
"link": "main.why_text_messaging#reach-people-using-a-common-method",
},
{
"name": "Improve customer experience",
"link": "main.why_text_messaging#improve-customer-experience",
},
{
"name": "What texting is best for",
"link": "main.why_text_messaging#what-texting-is-best-for",
},
],
},
{
"name": "Security",
"link": "main.about_security",
},
],
},
]
2 changes: 1 addition & 1 deletion app/navigation.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class HeaderNavigation(Navigation):
"establish_trust",
"write_for_action",
"multiple_languages",
"benchmark_performance"
"benchmark_performance",
},
"using_notify": {
"get_started",
Expand Down
15 changes: 14 additions & 1 deletion app/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,20 @@
<ul class="usa-sidenav__sublist" role="menu">
{% for sub_item in item.sub_navigation_items %}
<li role="menuitem">
<a href="{{ url_for(sub_item.link.split('#')[0]) }}#{{ sub_item.link.split('#')[1] }}">{{ sub_item.name }}</a>
<a href="{{ url_for(sub_item.link.split('#')[0]) }}#{{ sub_item.link.split('#')[1] }}">
{{ sub_item.name }}
</a>
{% if sub_item.sub_sub_navigation_items %}
<ul class="usa-sidenav__sublist usa-sidenav__sub-sublist" role="menu">
{% for sub_sub_item in sub_item.sub_sub_navigation_items %}
<li role="menuitem">
<a href="{{ url_for(sub_sub_item.link.split('#')[0]) }}#{{ sub_sub_item.link.split('#')[1] }}">
{{ sub_sub_item.name }}
</a>
</li>
{% endfor %}
</ul>
{% endif %}
</li>
{% endfor %}
</ul>
Expand Down
Loading