Skip to content

Commit

Permalink
Merge pull request #1273 from GSA/main
Browse files Browse the repository at this point in the history
Production Deploy 3/6/2024
  • Loading branch information
stvnrlly authored Mar 6, 2024
2 parents 0d94b81 + 9a62c9d commit 92b9a81
Show file tree
Hide file tree
Showing 30 changed files with 372 additions and 347 deletions.
15 changes: 14 additions & 1 deletion app/assets/sass/uswds/_uswds-theme-custom-styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ i.e.
.usa-logo {
font-family: family("sans");
margin: units(4) 0;
@include at-media-max('mobile-lg') {
@include at-media-max('desktop') {
margin: units(4) 0 units(4) units(2);
}
img {
Expand All @@ -43,6 +43,16 @@ i.e.
text-decoration: underline;
}
}
@include at-media-max('desktop') {
padding: 0 units(2);
ul li {
padding-bottom: units(1);
}
}
}
.usa-nav-container {
max-width: 100%;
padding: 0;
}
}

Expand Down Expand Up @@ -345,6 +355,9 @@ td.table-empty-message {
background-image: url(../img/material-icons/description.svg);
}
}
.table-wrapper {
overflow-x: scroll;
}
}

.dashboard-table {
Expand Down
16 changes: 10 additions & 6 deletions app/main/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -1781,12 +1781,16 @@ def __init__(
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
),
],
)
)
Expand Down
22 changes: 13 additions & 9 deletions app/main/views/api_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
),
)


Expand Down Expand Up @@ -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 "",
)

Expand Down
11 changes: 0 additions & 11 deletions app/main/views/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,6 @@ def security():
return render_template("views/security.html", navigation_links=features_nav())


@main.route("/features/terms", endpoint="terms")
@user_is_logged_in
def terms():
return render_template(
"views/terms-of-use.html",
navigation_links=features_nav(),
)


@main.route("/features/using_notify")
@user_is_logged_in
def using_notify():
Expand Down Expand Up @@ -214,15 +205,13 @@ def send_files_by_email():


@main.route("/roadmap", endpoint="old_roadmap")
@main.route("/terms", endpoint="old_terms")
@main.route("/information-security", endpoint="information_security")
@main.route("/using_notify", endpoint="old_using_notify")
@main.route("/information-risk-management", endpoint="information_risk_management")
@main.route("/integration_testing", endpoint="old_integration_testing")
def old_page_redirects():
redirects = {
"main.old_roadmap": "main.roadmap",
"main.old_terms": "main.terms",
"main.information_security": "main.using_notify",
"main.old_using_notify": "main.using_notify",
"main.information_risk_management": "main.security",
Expand Down
22 changes: 12 additions & 10 deletions app/main/views/manage_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
6 changes: 3 additions & 3 deletions app/main/views/performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
28 changes: 16 additions & 12 deletions app/main/views/send.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": ["[email protected]"]
if use_example_as_example
else [current_user.email_address],
"sms": ["12223334444"]
if use_example_as_example
else [current_user.mobile_number],
"email": (
["[email protected]"]
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
Expand Down Expand Up @@ -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"),
)
Expand Down
24 changes: 15 additions & 9 deletions app/main/views/service_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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,
)
)
Expand Down Expand Up @@ -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))
Expand Down
4 changes: 0 additions & 4 deletions app/main/views/sub_navigation_dictionaries.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ def features_nav():
"name": "Security",
"link": "main.security",
},
{
"name": "Terms of use",
"link": "main.terms",
},
]


Expand Down
1 change: 0 additions & 1 deletion app/navigation.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ class HeaderNavigation(Navigation):
"features_sms",
"roadmap",
"security",
"terms",
},
"using_notify": {
"get_started",
Expand Down
4 changes: 0 additions & 4 deletions app/templates/admin_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,6 @@
"href": url_for("main.security"),
"text": "Security"
},
{
"href": url_for("main.terms"),
"text": "Terms of use"
},
]
},
{
Expand Down
Loading

0 comments on commit 92b9a81

Please sign in to comment.