Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/GSA/notifications-admin int…
Browse files Browse the repository at this point in the history
…o 974-content-personalization
  • Loading branch information
jonathanbobel committed Mar 13, 2024
2 parents 067b637 + e914885 commit 8d9c030
Show file tree
Hide file tree
Showing 46 changed files with 1,208 additions and 472 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
![notify-logo](https://github.com/GSA/notifications-admin/assets/4156602/31b74039-4d87-4f89-a35e-71e9f3152342)

# Notify.gov Admin UI

This is the Notify front-end for government users and admins. To see it in
Expand Down
8 changes: 4 additions & 4 deletions app/assets/sass/uswds/_legacy-styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@
}
}

.sms-message-sender {
margin: units(1) 0 0;
.sms-message-sender, .sms-message-file-name, .sms-message-scheduler, .sms-message-template, .sms-message-sender {
margin:0.25rem 0 0;
}

.sms-message-recipient {
color: color('gray-cool-90');
margin: 0 0 units(1);
margin: units(1) 0 units(1);
}

.sms-message-status {
Expand Down Expand Up @@ -131,7 +131,7 @@
&-label,
&-button-label {
font-weight: bold;
font-size: 19px;
font-size: 19px;
display: block;
margin: 0 0 10px 0;
}
Expand Down
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
22 changes: 15 additions & 7 deletions app/main/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -1226,7 +1226,11 @@ class CsvUploadForm(StripWhitespaceForm):
validators=[
DataRequired(message="Please pick a file"),
CsvFileValidator(),
FileSize(max_size=10e6, message="File must be smaller than 10Mb"), # 10Mb
FileSize(
max_size=10e6,
message="File must be smaller than 10Mb. If you are trying to upload an Excel file, \
please export the contents in the CSV format and then try again.",
), # 10Mb
],
)

Expand Down Expand Up @@ -1781,12 +1785,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
10 changes: 7 additions & 3 deletions app/main/views/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,12 +276,16 @@ def get_status_filters(service, message_type, statistics):
}
else:
stats = statistics[message_type]
stats["sending"] = stats["requested"] - stats["delivered"] - stats["failed"]

if stats.get("failure") is not None:
stats["failed"] = stats["failure"]

stats["pending"] = stats["requested"] - stats["delivered"] - stats["failed"]

filters = [
# key, label, option
("requested", "total", "sending,delivered,failed"),
("sending", "pending", "pending"),
("pending", "pending", "pending"),
("delivered", "delivered", "delivered"),
("failed", "failed", "failed"),
]
Expand All @@ -296,7 +300,7 @@ def get_status_filters(service, message_type, statistics):
message_type=message_type,
status=option,
),
stats[key],
stats.get(key),
)
for key, label, option in filters
]
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)
Loading

0 comments on commit 8d9c030

Please sign in to comment.