mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-24 16:24:08 -04:00
Formatting and linting changes
This commit is contained in:
@@ -16,9 +16,7 @@ class Config(object):
|
||||
API_PUBLIC_WS_URL = getenv("API_PUBLIC_WS_URL", "localhost")
|
||||
|
||||
ADMIN_BASE_URL = getenv("ADMIN_BASE_URL", "http://localhost:6012")
|
||||
HEADER_COLOUR = (
|
||||
"#81878b" # mix of dark-grey and mid-grey
|
||||
)
|
||||
HEADER_COLOUR = "#81878b" # mix of dark-grey and mid-grey
|
||||
LOGO_CDN_DOMAIN = (
|
||||
"static-logos.notifications.service.gov.uk" # TODO use our own CDN
|
||||
)
|
||||
|
||||
@@ -73,7 +73,9 @@ def invite_user(service_id, user_id=None):
|
||||
else:
|
||||
user_to_invite = None
|
||||
|
||||
service_has_email_auth = current_service.has_permission(ServicePermission.EMAIL_AUTH)
|
||||
service_has_email_auth = current_service.has_permission(
|
||||
ServicePermission.EMAIL_AUTH
|
||||
)
|
||||
if not service_has_email_auth:
|
||||
form.login_authentication.data = "sms_auth"
|
||||
|
||||
@@ -116,7 +118,9 @@ def invite_user(service_id, user_id=None):
|
||||
@main.route("/services/<uuid:service_id>/users/<uuid:user_id>", methods=["GET", "POST"])
|
||||
@user_has_permissions(ServicePermission.MANAGE_SERVICE)
|
||||
def edit_user_permissions(service_id, user_id):
|
||||
service_has_email_auth = current_service.has_permission(ServicePermission.EMAIL_AUTH)
|
||||
service_has_email_auth = current_service.has_permission(
|
||||
ServicePermission.EMAIL_AUTH
|
||||
)
|
||||
user = current_service.get_team_member(user_id)
|
||||
|
||||
mobile_number = None
|
||||
|
||||
@@ -94,7 +94,9 @@ def view_notification(service_id, notification_id, error_message=None):
|
||||
updated_at=notification["sent_at"],
|
||||
help=get_help_argument(),
|
||||
notification_id=notification["id"],
|
||||
can_receive_inbound=(current_service.has_permission(ServicePermission.INBOUND_SMS)),
|
||||
can_receive_inbound=(
|
||||
current_service.has_permission(ServicePermission.INBOUND_SMS)
|
||||
),
|
||||
sent_with_test_key=(notification.get("key_type") == KEY_TYPE_TEST),
|
||||
back_link=back_link,
|
||||
)
|
||||
|
||||
@@ -560,7 +560,9 @@ def _check_messages(service_id, template_id, upload_id, preview_row, **kwargs):
|
||||
max_errors_shown=50,
|
||||
guestlist=allow_list,
|
||||
remaining_messages=remaining_messages,
|
||||
allow_international_sms=current_service.has_permission(ServicePermission.INTERNATIONAL_SMS),
|
||||
allow_international_sms=current_service.has_permission(
|
||||
ServicePermission.INTERNATIONAL_SMS
|
||||
),
|
||||
)
|
||||
|
||||
if request.args.get("from_test"):
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% from "components/select-input.html" import select, select_list, select_nested, select_wrapper, select_input %}
|
||||
|
||||
{% macro radios(field, hint=None, disable=[], option_hints={}, hide_legend=False, inline=False) %}
|
||||
{{ select(field, hint, disable, option_hints, hide_legend, input="radio", inline=inline) }}
|
||||
{% macro radios(field, hint=None, disable=[], option_hints={}, hide_legend=False, inline=False, legend_style="text") %}
|
||||
{{ select(field, hint, disable, option_hints, hide_legend, legend_style=legend_style, input="radio", inline=inline) }}
|
||||
{% endmacro %}
|
||||
|
||||
|
||||
|
||||
@@ -45,7 +45,11 @@
|
||||
<fieldset id="{{ field.id }}" class="usa-fieldset" {% if inline %}class="inline"{% endif %}>
|
||||
<legend class="{{ 'usa-legend' if not hide_legend else '' }}{% if legend_style != 'text' %} {{ legend_style }}{% endif %}">
|
||||
{% if hide_legend %}<span class="usa-sr-only">{% endif %}
|
||||
{{ field.label.text|safe }}
|
||||
{% if legend_style == 'usa-legend--large' %}
|
||||
<h1>{{ field.label.text|safe }}</h1>
|
||||
{% else %}
|
||||
{{ field.label.text|safe }}
|
||||
{% endif %}
|
||||
{% if hide_legend %}</span>{% endif %}
|
||||
{% if hint %}
|
||||
<span class="form-hint">
|
||||
|
||||
@@ -20,17 +20,15 @@
|
||||
|
||||
{% call form_wrapper() %}
|
||||
{{ form.key_name }}
|
||||
<div class="api-key-radios margin-top-5">
|
||||
{% if current_service.trial_mode %}
|
||||
{{ radios(
|
||||
form.key_type,
|
||||
disable=['normal'],
|
||||
option_hints={'normal': 'Not available because your service is in <a class="usa-link" href="/features/trial-mode">trial mode</a>'|safe}
|
||||
) }}
|
||||
{% else %}
|
||||
{{ radios(form.key_type) }}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if current_service.trial_mode %}
|
||||
{{ radios(
|
||||
form.key_type,
|
||||
disable=['normal'],
|
||||
option_hints={'normal': 'Not available because your service is in <a class="usa-link" href="/features/trial-mode">trial mode</a>'|safe}
|
||||
) }}
|
||||
{% else %}
|
||||
{{ radios(form.key_type) }}
|
||||
{% endif %}
|
||||
{{ page_footer('Continue') }}
|
||||
{% endcall %}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
<div class="grid-row">
|
||||
{% call form_wrapper() %}
|
||||
{{ radios(form.sender) }}
|
||||
{{ radios(form.sender, legend_style='usa-legend--large') }}
|
||||
<div class="grid-col-9">
|
||||
{{ page_footer('Continue') }}
|
||||
</div>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
<div class="grid-row">
|
||||
{% call form_wrapper() %}
|
||||
{{ radios(form.sender) }}
|
||||
{{ radios(form.sender, legend_style='usa-legend--large') }}
|
||||
<div class="grid-col-9">
|
||||
{{ page_footer('Continue') }}
|
||||
</div>
|
||||
|
||||
@@ -4,7 +4,10 @@ from app.enums import ServicePermission
|
||||
|
||||
permission_mappings = {
|
||||
# TODO: consider turning off email-sending permissions during SMS pilot
|
||||
ServicePermission.SEND_MESSAGES: [ServicePermission.SEND_TEXTS, ServicePermission.SEND_EMAILS],
|
||||
ServicePermission.SEND_MESSAGES: [
|
||||
ServicePermission.SEND_TEXTS,
|
||||
ServicePermission.SEND_EMAILS,
|
||||
],
|
||||
ServicePermission.MANAGE_TEMPLATES: [ServicePermission.MANAGE_TEMPLATES],
|
||||
ServicePermission.MANAGE_SERVICE: [
|
||||
ServicePermission.MANAGE_USERS,
|
||||
|
||||
Reference in New Issue
Block a user