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/20/2024 Production Deploy #2137

Merged
merged 45 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
cf60dd7
e2e best practice
Oct 31, 2024
0bb0d3c
e2e best practice
Oct 31, 2024
e09eabd
Merge branch 'main' into 2073---new-best-practice-side-nav-end2end
Oct 31, 2024
109f3d9
feature flag for testing
Oct 31, 2024
714be40
fix testing
Oct 31, 2024
12c2868
Added link to new guidance page that enables navigating
alexjanousekGSA Nov 4, 2024
e7c82b1
Fixed indent
alexjanousekGSA Nov 4, 2024
5fa9172
Fixing linting errors
alexjanousekGSA Nov 4, 2024
5cbb1f3
Updated route
alexjanousekGSA Nov 4, 2024
7a63fcf
fix a11y errors
Nov 5, 2024
ca96495
revert changes to color:transparent
Nov 5, 2024
c85bbb4
fixing css
Nov 7, 2024
13e9b12
Renamed guides to best practices
alexjanousekGSA Nov 12, 2024
1a14bec
Updated link name and route
alexjanousekGSA Nov 12, 2024
f6fbe1b
Fixed linting error
alexjanousekGSA Nov 12, 2024
c4ee02f
Removed unused navigation link
alexjanousekGSA Nov 13, 2024
b8ea1d8
Fixed error
alexjanousekGSA Nov 13, 2024
6ca902a
Added back guides because its needed
alexjanousekGSA Nov 13, 2024
b9ef8ea
Removed unused code
alexjanousekGSA Nov 13, 2024
3da5fb4
Added subnav to fix css
alexjanousekGSA Nov 13, 2024
50e7f3d
first round of about content
Nov 13, 2024
8d85da8
add testing
Nov 13, 2024
3a52cba
add testing
Nov 13, 2024
c5fa28d
Bump @uswds/uswds from 3.9.0 to 3.10.0
dependabot[bot] Nov 13, 2024
70ecf8f
Added feature flag for route
alexjanousekGSA Nov 14, 2024
55ae37a
note to add youtube video
Nov 14, 2024
63493f2
Merge pull request #2078 from GSA/2069-user-story-add-new-link-to-bes…
alexjanousekGSA Nov 14, 2024
170e06a
merge main
Nov 15, 2024
cd7df2f
flake8
Nov 15, 2024
4b50dfc
Updated documentation.
xlorepdarkhelm Nov 15, 2024
2106f00
Merge pull request #2118 from GSA/ADMIN-2086_Update_README_First_User…
ccostino Nov 15, 2024
2aa5dd0
Added back removed code
alexjanousekGSA Nov 15, 2024
5b48127
Fixed linting error
alexjanousekGSA Nov 15, 2024
c432e43
Updated url
alexjanousekGSA Nov 15, 2024
7390b60
padding change
Nov 15, 2024
dba031d
Bump sass-embedded from 1.80.6 to 1.81.0
dependabot[bot] Nov 15, 2024
0a50913
Merge pull request #2112 from GSA/2101-about-notify
jonathanbobel Nov 18, 2024
9faa0ed
Bump rollup from 4.24.4 to 4.27.3
dependabot[bot] Nov 19, 2024
a740183
Bump playwright from 1.48.2 to 1.49.0
dependabot[bot] Nov 19, 2024
aae1a0d
Merge pull request #2131 from GSA/dependabot/npm_and_yarn/playwright-…
alexjanousekGSA Nov 19, 2024
b0b2132
Merge pull request #2130 from GSA/dependabot/npm_and_yarn/rollup-4.27.3
alexjanousekGSA Nov 19, 2024
1d2abf0
Merge pull request #2121 from GSA/dependabot/npm_and_yarn/sass-embedd…
alexjanousekGSA Nov 19, 2024
f903451
Merge pull request #2113 from GSA/dependabot/npm_and_yarn/uswds/uswds…
alexjanousekGSA Nov 19, 2024
99d934c
Merge pull request #2087 from GSA/1939-accessibility-audit-the-entire…
heyitsmebev Nov 20, 2024
93587f5
Merge pull request #2074 from GSA/2073---new-best-practice-side-nav-e…
heyitsmebev Nov 20, 2024
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": 121,
"line_number": 125,
"is_secret": false
}
],
Expand Down Expand Up @@ -684,5 +684,5 @@
}
]
},
"generated_at": "2024-10-29T19:28:03Z"
"generated_at": "2024-11-14T15:53:44Z"
}
10 changes: 2 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -372,15 +372,9 @@ After you have completed all setup steps, you will be unable to log in, because
will not be a user in the database to link to the login.gov account you are using. So
you will need to create that user in your database using the 'create-test-user' command.

Open two terminals pointing to the api project and then run these commands in the
respective terminals.
Open a terminal pointing to the api project and then run this command.

(Server 1)
env ALLOW_EXPIRED_API_TOKEN=1 make run-flask

(Server 2)
poetry run flask command create-admin-jwt | tail -n 1 | pbcopy
poetry run flask command create-test-user --admin=True;
```poetry run flask command create-test-user --admin=True```

Supply your name, email address, mobile number, and password when prompted. Make sure the email address
is the same one you are using in login.gov and make sure your phone number is in the format 5555555555.
Expand Down
11 changes: 11 additions & 0 deletions app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,17 @@ def _csp(config):


def create_app(application):
application.config["FEATURE_BEST_PRACTICES_ENABLED"] = (
os.getenv("FEATURE_BEST_PRACTICES_ENABLED", "false").lower() == "true"
)

@application.context_processor
def inject_feature_flags():
feature_best_practices_enabled = application.config[
"FEATURE_BEST_PRACTICES_ENABLED"
]
return dict(FEATURE_BEST_PRACTICES_ENABLED=feature_best_practices_enabled)

notify_environment = os.environ["NOTIFY_ENVIRONMENT"]

application.config.from_object(configs[notify_environment])
Expand Down
19 changes: 19 additions & 0 deletions app/assets/sass/uswds/_uswds-theme-custom-styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -897,3 +897,22 @@ li.linked-card:hover svg,
.usa-sidenav__item a {
display: block;
}

.about-icon-list {
display: flex;
width: 24px;
height: 24px;
padding: 2px 1px;
justify-content: center;
align-items: center;
margin-right: 4px;
}

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

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

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


def _s3_credentials_from_env(bucket_prefix):
return {
Expand Down
62 changes: 47 additions & 15 deletions app/main/views/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,23 @@
import secrets
from urllib.parse import unquote

from flask import abort, current_app, redirect, render_template, request, url_for
from flask import (
abort,
current_app,
jsonify,
redirect,
render_template,
request,
url_for,
)
from flask_login import current_user

from app import redis_client, status_api_client
from app.formatters import apply_html_class, convert_markdown_template
from app.main import main
from app.main.views.pricing import CURRENT_SMS_RATE
from app.main.views.sub_navigation_dictionaries import (
about_notify_nav,
best_practices_nav,
features_nav,
using_notify_nav,
Expand All @@ -18,18 +27,33 @@
from notifications_utils.url_safe_token import generate_token


# Hook to check for guidance routes
# Hook to check for feature flags
@main.before_request
def check_guidance_feature():
current_app.logger.warning("best practices 1234")
current_app.logger.warning(current_app.config["FEATURE_BEST_PRACTICES_ENABLED"])
def check_feature_flags():
if (
request.path.startswith("/guides/best-practices")
and not current_app.config.get("FEATURE_BEST_PRACTICES_ENABLED", False)
):
abort(404)

if (
request.path.startswith("/best-practices")
and not current_app.config["FEATURE_BEST_PRACTICES_ENABLED"]
request.path.startswith("/about")
and not current_app.config.get("FEATURE_ABOUT_PAGE_ENABLED", False)
):
abort(404)


@main.route("/test/feature-flags")
def test_feature_flags():
return jsonify(
{
"FEATURE_BEST_PRACTICES_ENABLED": current_app.config[
"FEATURE_BEST_PRACTICES_ENABLED"
]
}
)


@main.route("/")
def index():
if current_user and current_user.is_authenticated:
Expand Down Expand Up @@ -207,7 +231,7 @@ def trial_mode_new():
)


@main.route("/best-practices")
@main.route("/guides/best-practices")
@user_is_logged_in
def best_practices():
return render_template(
Expand All @@ -216,7 +240,7 @@ def best_practices():
)


@main.route("/best-practices/clear-goals")
@main.route("/guides/best-practices/clear-goals")
@user_is_logged_in
def clear_goals():
return render_template(
Expand All @@ -225,7 +249,7 @@ def clear_goals():
)


@main.route("/best-practices/rules-and-regulations")
@main.route("/guides/best-practices/rules-and-regulations")
@user_is_logged_in
def rules_and_regulations():
return render_template(
Expand All @@ -234,7 +258,7 @@ def rules_and_regulations():
)


@main.route("/best-practices/establish-trust")
@main.route("/guides/best-practices/establish-trust")
@user_is_logged_in
def establish_trust():
return render_template(
Expand All @@ -243,7 +267,7 @@ def establish_trust():
)


@main.route("/best-practices/write-for-action")
@main.route("/guides/best-practices/write-for-action")
@user_is_logged_in
def write_for_action():
return render_template(
Expand All @@ -252,7 +276,7 @@ def write_for_action():
)


@main.route("/best-practices/multiple-languages")
@main.route("/guides/best-practices/multiple-languages")
@user_is_logged_in
def multiple_languages():
return render_template(
Expand All @@ -261,7 +285,7 @@ def multiple_languages():
)


@main.route("/best-practices/benchmark-performance")
@main.route("/guides/best-practices/benchmark-performance")
@user_is_logged_in
def benchmark_performance():
return render_template(
Expand All @@ -270,7 +294,7 @@ def benchmark_performance():
)


@main.route("/using-notify/guidance")
@main.route("/guides/using-notify/guidance")
@user_is_logged_in
def guidance_index():
return render_template(
Expand All @@ -282,6 +306,14 @@ def guidance_index():
)


@main.route("/about")
def about_notify():
return render_template(
"views/about/about.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
13 changes: 13 additions & 0 deletions app/main/views/sub_navigation_dictionaries.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ def using_notify_nav():
"name": "Get started",
"link": "main.get_started",
},
{
"name": "Guides",
"link": "main.best_practices",
},
{
"name": "Trial mode",
"link": "main.trial_mode_new",
Expand Down Expand Up @@ -101,3 +105,12 @@ def best_practices_nav():
"link": "main.benchmark_performance",
},
]


def about_notify_nav():
return [
{
"name": "About notify",
"link": "main.about_notify",
},
]
9 changes: 9 additions & 0 deletions app/navigation.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ class HeaderNavigation(Navigation):
"roadmap",
"security",
},
"best_practices": {
"best_practices",
"clear_goals",
"rules_and_regulations",
"establish_trust",
"write_for_action",
"multiple_languages",
"benchmark_performance"
},
"using_notify": {
"get_started",
"using_notify",
Expand Down
2 changes: 1 addition & 1 deletion app/templates/components/folder-path.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<span class="folder-heading-folder">{{ folder.name }}</span>
{% endif %}
{% else %}
<a href="{{ url_for('.choose_template', service_id=service_id, template_type=template_type) }}" title="Templates" class="usa-link {% if loop.length > 2 %}folder-heading-folder-root-truncated{% endif %}">Templates</a>
<a href="{{ url_for('.choose_template', service_id=service_id, template_type=template_type) }}" class="usa-link {% if loop.length > 2 %}folder-heading-folder-root-truncated{% endif %}">Templates</a>
{% endif %}
{% if not loop.last %}{{ folder_path_separator() }}{% endif %}
{% endif %}
Expand Down
Loading
Loading