mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-01 04:09:46 -04:00
add latest version commit hash to footer (notify-admin-204)
This commit is contained in:
1
.github/workflows/deploy-demo.yml
vendored
1
.github/workflows/deploy-demo.yml
vendored
@@ -54,6 +54,7 @@ jobs:
|
||||
ADMIN_CLIENT_SECRET: ${{ secrets.ADMIN_CLIENT_SECRET }}
|
||||
NEW_RELIC_LICENSE_KEY: ${{ secrets.NEW_RELIC_LICENSE_KEY }}
|
||||
NR_BROWSER_KEY: ${{ secrets.NR_BROWSER_KEY }}
|
||||
COMMIT_HASH: $(git rev-parse --short "$GITHUB_SHA")
|
||||
LOGIN_PEM: ${{ secrets.LOGIN_PEM }}
|
||||
LOGIN_DOT_GOV_CLIENT_ID: "urn:gov:gsa:openidconnect.profiles:sp:sso:gsa:notify-gov"
|
||||
LOGIN_DOT_GOV_USER_INFO_URL: "https://idp.int.identitysandbox.gov/api/openid_connect/userinfo"
|
||||
|
||||
1
.github/workflows/deploy-prod.yml
vendored
1
.github/workflows/deploy-prod.yml
vendored
@@ -54,6 +54,7 @@ jobs:
|
||||
ADMIN_CLIENT_SECRET: ${{ secrets.ADMIN_CLIENT_SECRET }}
|
||||
NEW_RELIC_LICENSE_KEY: ${{ secrets.NEW_RELIC_LICENSE_KEY }}
|
||||
NR_BROWSER_KEY: ${{ secrets.NR_BROWSER_KEY }}
|
||||
COMMIT_HASH: $(git rev-parse --short "$GITHUB_SHA")
|
||||
LOGIN_PEM: ${{ secrets.LOGIN_PEM }}
|
||||
LOGIN_DOT_GOV_CLIENT_ID: "urn:gov:gsa:openidconnect.profiles:sp:sso:gsa:notify-gov"
|
||||
LOGIN_DOT_GOV_USER_INFO_URL: "https://secure.login.gov/api/openid_connect/userinfo"
|
||||
|
||||
2
.github/workflows/deploy.yml
vendored
2
.github/workflows/deploy.yml
vendored
@@ -60,6 +60,7 @@ jobs:
|
||||
ADMIN_CLIENT_SECRET: ${{ secrets.ADMIN_CLIENT_SECRET }}
|
||||
NEW_RELIC_LICENSE_KEY: ${{ secrets.NEW_RELIC_LICENSE_KEY }}
|
||||
NR_BROWSER_KEY: ${{ secrets.NR_BROWSER_KEY }}
|
||||
COMMIT_HASH: $(git rev-parse --short "$GITHUB_SHA")
|
||||
LOGIN_PEM: ${{ secrets.LOGIN_PEM }}
|
||||
LOGIN_DOT_GOV_CLIENT_ID: "urn:gov:gsa:openidconnect.profiles:sp:sso:gsa:notify-gov"
|
||||
LOGIN_DOT_GOV_USER_INFO_URL: "https://idp.int.identitysandbox.gov/api/openid_connect/userinfo"
|
||||
@@ -81,6 +82,7 @@ jobs:
|
||||
--var ADMIN_CLIENT_SECRET="$ADMIN_CLIENT_SECRET"
|
||||
--var NEW_RELIC_LICENSE_KEY="$NEW_RELIC_LICENSE_KEY"
|
||||
--var NR_BROWSER_KEY="$NR_BROWSER_KEY"
|
||||
--var COMMIT_HASH="$COMMIT_HASH"
|
||||
--var LOGIN_PEM="$LOGIN_PEM"
|
||||
--var LOGIN_DOT_GOV_CLIENT_ID="$LOGIN_DOT_GOV_CLIENT_ID"
|
||||
--var LOGIN_DOT_GOV_USER_INFO_URL="$LOGIN_DOT_GOV_USER_INFO_URL"
|
||||
|
||||
@@ -36,6 +36,7 @@ class Config(object):
|
||||
NR_BROWSER_KEY = getenv("NR_BROWSER_KEY")
|
||||
settings = newrelic.agent.global_settings()
|
||||
NR_MONITOR_ON = settings and settings.monitor_mode
|
||||
COMMIT_HASH = getenv("COMMIT_HASH")
|
||||
|
||||
TEMPLATE_PREVIEW_API_HOST = getenv(
|
||||
"TEMPLATE_PREVIEW_API_HOST", "http://localhost:9999"
|
||||
|
||||
@@ -1781,12 +1781,16 @@ class TemplateAndFoldersSelectionForm(Form):
|
||||
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
|
||||
),
|
||||
],
|
||||
)
|
||||
)
|
||||
|
||||
@@ -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
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
@@ -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 "",
|
||||
)
|
||||
|
||||
|
||||
@@ -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():
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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": ["test@example.com"]
|
||||
if use_example_as_example
|
||||
else [current_user.email_address],
|
||||
"sms": ["12223334444"]
|
||||
if use_example_as_example
|
||||
else [current_user.mobile_number],
|
||||
"email": (
|
||||
["test@example.com"]
|
||||
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
|
||||
@@ -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"),
|
||||
)
|
||||
|
||||
@@ -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:
|
||||
@@ -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,
|
||||
)
|
||||
)
|
||||
@@ -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))
|
||||
|
||||
@@ -179,7 +179,9 @@
|
||||
{% if current_service and current_service.research_mode %}
|
||||
{% set meta_suffix = 'Built by the <a href="https://www.gsa.gov/about-us/organization/federal-acquisition-service/technology-transformation-services/tts-solutions" class="usa-link">Technology Transformation Services</a><span id="research-mode" class="research-mode">research mode</span>' %}
|
||||
{% else %}
|
||||
{% set meta_suffix = 'Built by the <a href="https://www.gsa.gov/about-us/organization/federal-acquisition-service/technology-transformation-services/tts-solutions" class="usa-link">Technology Transformation Services</a>' %}
|
||||
{% set commit_hash = ", Latest version: " + config['COMMIT_HASH'] %}
|
||||
{% set long_link = '<a href="https://www.gsa.gov/about-us/organization/federal-acquisition-service/technology-transformation-services/tts-solutions" class="usa-link">Technology Transformation Services</a>' %}
|
||||
{% set meta_suffix = "Built by the " + long_link + commit_hash %}
|
||||
{% endif %}
|
||||
|
||||
{{ usaFooter({
|
||||
@@ -244,7 +246,7 @@
|
||||
{
|
||||
"href": url_for('main.support'),
|
||||
"text": "Contact us"
|
||||
},
|
||||
}
|
||||
]
|
||||
},
|
||||
],
|
||||
|
||||
@@ -47,6 +47,8 @@ applications:
|
||||
REQUESTS_CA_BUNDLE: "/etc/ssl/certs/ca-certificates.crt"
|
||||
NEW_RELIC_CA_BUNDLE_PATH: "/etc/ssl/certs/ca-certificates.crt"
|
||||
|
||||
COMMIT_HASH: ((COMMIT_HASH))
|
||||
|
||||
# login.gov variables
|
||||
|
||||
LOGIN_PEM: ((LOGIN_PEM))
|
||||
|
||||
@@ -862,9 +862,9 @@ def test_should_show_page_if_prefilled_user_is_already_invited(
|
||||
mock_get_invites_for_service,
|
||||
platform_admin_user,
|
||||
):
|
||||
active_user_with_permission_to_other_service[
|
||||
"email_address"
|
||||
] = "user_1@testnotify.gsa.gov"
|
||||
active_user_with_permission_to_other_service["email_address"] = (
|
||||
"user_1@testnotify.gsa.gov"
|
||||
)
|
||||
client_request.login(platform_admin_user)
|
||||
mocker.patch(
|
||||
"app.models.user.user_api_client.get_user",
|
||||
|
||||
@@ -31,9 +31,11 @@ def _folder(name, folder_id=None, parent=None, users_with_permission=None):
|
||||
"name": name,
|
||||
"id": folder_id or str(uuid.uuid4()),
|
||||
"parent_id": parent,
|
||||
"users_with_permission": users_with_permission
|
||||
if users_with_permission is not None
|
||||
else [sample_uuid()],
|
||||
"users_with_permission": (
|
||||
users_with_permission
|
||||
if users_with_permission is not None
|
||||
else [sample_uuid()]
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -905,9 +905,11 @@ def create_service_templates(service_id, number_of_templates=4):
|
||||
"{}_template_{}".format(template_type, template_number),
|
||||
template_type,
|
||||
"{} template {} content".format(template_type, template_number),
|
||||
subject="{} template {} subject".format(template_type, template_number)
|
||||
if template_type == "email"
|
||||
else None,
|
||||
subject=(
|
||||
"{} template {} subject".format(template_type, template_number)
|
||||
if template_type == "email"
|
||||
else None
|
||||
),
|
||||
)
|
||||
)
|
||||
|
||||
@@ -1102,9 +1104,9 @@ def active_user_with_permission_to_other_service(
|
||||
active_user_with_permission_to_two_services["permissions"].pop(SERVICE_ONE_ID)
|
||||
active_user_with_permission_to_two_services["services"].pop(0)
|
||||
active_user_with_permission_to_two_services["name"] = "Service Two User"
|
||||
active_user_with_permission_to_two_services[
|
||||
"email_address"
|
||||
] = "service-two-user@test.gsa.gov"
|
||||
active_user_with_permission_to_two_services["email_address"] = (
|
||||
"service-two-user@test.gsa.gov"
|
||||
)
|
||||
return active_user_with_permission_to_two_services
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user