Files
notifications-admin/app/navigation.py
T

1386 lines
42 KiB
Python
Raw Normal View History

2018-04-24 12:48:05 +01:00
from itertools import chain
from flask import request
2018-04-25 10:24:32 +01:00
class Navigation:
2018-04-24 12:48:05 +01:00
2018-04-25 10:24:32 +01:00
mapping = {}
exclude = {}
2019-12-11 20:33:57 +00:00
selected_class = "selected"
2018-04-24 12:48:05 +01:00
2018-04-25 10:24:32 +01:00
def __init__(self):
self.mapping = {
navigation: {
# if not specified, assume endpoints are all in the `main` blueprint.
self._get_endpoint_with_blueprint(endpoint) for endpoint in endpoints
2018-04-25 10:24:32 +01:00
} for navigation, endpoints in self.mapping.items()
}
2018-04-24 12:48:05 +01:00
2018-04-25 10:24:32 +01:00
@property
def endpoints_with_navigation(self):
return tuple(chain.from_iterable((
endpoints
for navigation_item, endpoints in self.mapping.items()
)))
@property
def endpoints_without_navigation(self):
return tuple(
self._get_endpoint_with_blueprint(endpoint) for endpoint in self.exclude
2020-07-01 13:27:12 +01:00
) + ('static', 'status.show_status', 'metrics')
2018-04-25 10:24:32 +01:00
def is_selected(self, navigation_item):
if request.endpoint in self.mapping[navigation_item]:
2019-12-11 20:33:57 +00:00
return " " + self.selected_class
2018-04-25 10:24:32 +01:00
return ''
2018-04-24 12:48:05 +01:00
@staticmethod
def _get_endpoint_with_blueprint(endpoint):
return endpoint if '.' in endpoint else 'main.{}'.format(endpoint)
2018-04-24 12:48:05 +01:00
class HeaderNavigation(Navigation):
mapping = {
'support': {
'bat_phone',
'feedback',
'support',
'support_public',
'thanks',
'triage',
},
'features': {
'features',
2019-04-11 11:47:09 +01:00
'features_email',
'features_letters',
'features_sms',
'message_status',
'roadmap',
'security',
'terms',
'trial_mode_new',
'using_notify',
},
'pricing': {
'pricing',
2019-06-04 10:43:15 +01:00
'how_to_pay',
},
'documentation': {
'documentation',
'integration_testing',
},
'user-profile': {
'user_profile',
'user_profile_email',
'user_profile_email_authenticate',
'user_profile_email_confirm',
'user_profile_mobile_number',
'user_profile_mobile_number_authenticate',
'user_profile_mobile_number_confirm',
'user_profile_name',
'user_profile_password',
'user_profile_disable_platform_admin_view',
},
'platform-admin': {
2019-05-22 11:38:47 +01:00
'archive_user',
2019-02-15 10:27:38 +00:00
'clear_cache',
'create_email_branding',
2019-01-31 16:56:35 +00:00
'create_letter_branding',
'edit_sms_provider_ratio',
'email_branding',
2019-08-13 16:25:26 +01:00
'find_services_by_name',
'find_users_by_email',
'letter_branding',
'live_services',
2019-04-24 16:23:12 +01:00
'live_services_csv',
'notifications_sent_by_service',
'performance_platform_xlsx',
'usage_for_all_services',
2020-04-23 11:08:43 +01:00
'organisations',
'platform_admin',
'platform_admin_list_complaints',
'platform_admin_reports',
'platform_admin_returned_letters',
'platform_admin_splash_page',
'suspend_service',
'trial_services',
'update_email_branding',
2019-02-11 15:31:12 +00:00
'update_letter_branding',
'user_information',
'view_provider',
'view_providers',
},
'sign-in': {
'revalidate_email_sent',
'sign_in',
'two_factor',
'two_factor_email',
'two_factor_email_sent',
'two_factor_email_interstitial',
'verify',
'verify_email',
},
}
exclude = {
'accept_invite',
'accept_org_invite',
2020-09-23 09:53:12 +01:00
'accessibility_statement',
'action_blocked',
'add_data_retention',
2019-07-02 09:49:00 +01:00
'add_organisation',
'add_organisation_from_gp_service',
'add_organisation_from_nhs_local_service',
'add_service',
'add_service_template',
'api_callbacks',
'api_documentation',
'api_integration',
'api_keys',
'archive_service',
2020-09-29 14:48:56 +01:00
'begin_tour',
'branding_request',
'callbacks',
'cancel_invited_org_user',
'cancel_invited_user',
'cancel_job',
2018-12-05 10:58:27 +00:00
'cancel_letter',
'cancel_letter_job',
'check_and_resend_text_code',
'check_and_resend_verification_code',
'check_messages',
'no_cookie.check_messages_preview',
'check_notification',
'no_cookie.check_notification_preview',
'check_tour_notification',
'choose_account',
2020-03-13 17:51:22 +00:00
'choose_from_contact_list',
'choose_service',
'choose_template',
'choose_template_to_copy',
'confirm_edit_organisation_name',
2019-02-20 11:50:34 +00:00
'confirm_edit_user_email',
'confirm_edit_user_mobile_number',
'confirm_redact_template',
'conversation',
'conversation_reply',
'conversation_reply_with_template',
'conversation_updates',
'cookies',
'copy_template',
'create_api_key',
'data_retention',
'delete_service_template',
'delete_template_folder',
'delivery_and_failure',
'delivery_status_callback',
'design_content',
2020-03-15 19:13:07 +00:00
'download_contact_list',
'download_notifications_csv',
'edit_data_retention',
'edit_organisation_agreement',
'edit_organisation_crown_status',
'edit_organisation_domains',
'edit_organisation_email_branding',
'edit_organisation_letter_branding',
2019-05-13 14:50:40 +01:00
'edit_organisation_go_live_notes',
'edit_organisation_name',
'edit_organisation_type',
'edit_provider',
'edit_service_template',
2019-01-29 15:43:59 +00:00
'edit_template_postage',
'edit_user_org_permissions',
2019-02-20 11:50:34 +00:00
'edit_user_email',
'edit_user_mobile_number',
'edit_user_permissions',
'email_not_received',
'email_template',
'error',
2019-02-15 11:03:19 +00:00
'estimate_usage',
'forgot_password',
'get_example_csv',
'get_notifications_as_json',
2019-10-17 16:15:28 +01:00
'get_started',
2020-01-24 15:57:29 +00:00
'get_started_old',
'go_to_dashboard_after_tour',
2020-01-24 15:57:29 +00:00
'guidance_index',
'branding_and_customisation',
'create_and_send_messages',
'edit_and_format_messages',
'send_files_by_email',
'upload_a_letter',
2020-09-22 15:09:46 +01:00
'letter_specification',
2019-10-18 09:18:51 +01:00
'history',
'inbound_sms_admin',
'inbox',
'inbox_download',
'inbox_updates',
'index',
'information_risk_management',
'information_security',
'invite_org_user',
'invite_user',
'no_cookie.letter_branding_preview_image',
2020-01-15 10:56:14 +00:00
'letter_spec',
'letter_template',
'link_service_to_organisation',
'manage_org_users',
'manage_template_folder',
'manage_users',
'monthly',
'new_password',
'old_integration_testing',
'old_roadmap',
'old_service_dashboard',
'old_terms',
'old_using_notify',
'organisation_dashboard',
'organisation_trial_mode_services',
'organisation_settings',
'organisation_preview_email_branding',
'organisation_preview_letter_branding',
'privacy',
'public_agreement',
'public_download_agreement',
'received_text_messages_callback',
'redact_template',
'register',
'register_from_invite',
'register_from_org_invite',
'registration_continue',
'remove_user_from_organisation',
'remove_user_from_service',
'request_to_go_live',
'resend_email_link',
'resend_email_verification',
'resume_service',
2019-12-18 11:53:46 +00:00
'returned_letter_summary',
2019-12-31 13:27:27 +00:00
'returned_letters',
2019-12-18 11:53:46 +00:00
'returned_letters_report',
'revoke_api_key',
'send_messages',
'send_notification',
'send_one_off',
2020-03-10 15:12:19 +00:00
'send_one_off_letter_address',
'send_one_off_step',
'send_one_off_to_myself',
'no_cookie.send_test_preview',
'send_from_contact_list',
2019-09-09 12:22:52 +01:00
'send_uploaded_letter',
'service_add_email_reply_to',
'service_add_letter_contact',
'service_add_sms_sender',
'service_agreement',
'service_accept_agreement',
'service_confirm_agreement',
'service_confirm_delete_email_reply_to',
2019-07-04 16:11:19 +01:00
'service_confirm_delete_letter_contact',
'service_confirm_delete_sms_sender',
'service_dashboard',
'service_dashboard_updates',
'service_delete_email_reply_to',
2019-07-04 16:11:19 +01:00
'service_delete_letter_contact',
'service_delete_sms_sender',
'service_download_agreement',
'service_edit_email_reply_to',
'service_edit_letter_contact',
'service_edit_sms_sender',
'service_email_reply_to',
'service_letter_contact_details',
'service_make_blank_default_letter_contact',
'service_name_change',
'service_name_change_confirm',
2018-08-03 17:39:58 +01:00
'service_preview_email_branding',
'service_preview_letter_branding',
'service_set_auth_type',
'service_set_channel',
'send_files_by_email_contact_details',
'service_set_email_branding',
'service_set_inbound_number',
'service_set_inbound_sms',
'service_set_international_letters',
'service_set_international_sms',
'service_set_letter_branding',
'service_set_letters',
'service_set_reply_to_email',
'service_set_sms_prefix',
'service_settings',
'service_sms_senders',
'service_switch_count_as_live',
'service_switch_live',
'service_set_permission',
'service_set_broadcast_permission',
'service_verify_reply_to_address',
'service_verify_reply_to_address_updates',
'services_or_dashboard',
'set_free_sms_allowance',
'set_message_limit',
2020-10-21 14:30:35 +01:00
'set_rate_limit',
'set_sender',
'set_template_sender',
'show_accounts_or_dashboard',
'sign_out',
'start_job',
'submit_request_to_go_live',
'template_history',
'template_usage',
2020-09-29 14:48:56 +01:00
'tour_step',
'trial_mode',
'upload_contact_list',
'check_contact_list',
'save_contact_list',
'contact_list',
2020-03-18 13:37:39 +00:00
'delete_contact_list',
'upload_letter',
'uploaded_letter_preview',
2020-05-11 10:52:43 +01:00
'uploaded_letters',
2019-08-09 08:44:11 +01:00
'uploads',
'usage',
'view_job',
'view_job_csv',
'view_job_updates',
'view_jobs',
'view_letter_notification_as_preview',
'no_cookie.view_letter_template_preview',
2019-09-09 10:59:32 +01:00
'view_letter_upload_as_preview',
'view_notification',
'view_notification_updates',
'view_notifications',
'view_notifications_csv',
'view_template',
'view_template_version',
'no_cookie.view_template_version_preview',
'view_template_versions',
'guest_list',
2020-06-12 09:07:29 +01:00
'old_guest_list',
2020-05-20 15:54:15 +01:00
'who_can_use_notify',
2020-05-21 11:17:44 +01:00
'who_its_for',
'broadcast_tour',
2020-07-08 11:34:16 +01:00
'broadcast_dashboard',
2020-10-13 11:40:20 +01:00
'broadcast_dashboard_previous',
'broadcast_dashboard_updates',
'broadcast',
'preview_broadcast_areas',
'choose_broadcast_library',
'choose_broadcast_area',
'choose_broadcast_sub_area',
'remove_broadcast_area',
'preview_broadcast_message',
'view_current_broadcast',
'view_previous_broadcast',
2020-07-17 08:07:44 +01:00
'approve_broadcast_message',
2020-07-17 08:07:44 +01:00
'reject_broadcast_message',
2020-07-10 09:16:36 +01:00
'cancel_broadcast_message',
}
2019-10-09 16:00:45 +01:00
# header HTML now comes from GOVUK Frontend so requires a boolean, not an attribute
def is_selected(self, navigation_item):
2019-10-30 10:17:32 +00:00
return request.endpoint in self.mapping[navigation_item]
2019-10-09 16:00:45 +01:00
2018-04-25 10:24:32 +01:00
class MainNavigation(Navigation):
mapping = {
'dashboard': {
'broadcast_tour',
2018-04-25 10:24:32 +01:00
'conversation',
'inbox',
'monthly',
'returned_letter_summary',
'returned_letters',
2018-04-25 10:24:32 +01:00
'service_dashboard',
'template_usage',
'view_notification',
'view_notifications',
},
'current-broadcasts': {
'broadcast_dashboard',
'broadcast_dashboard_updates',
'view_current_broadcast',
},
'previous-broadcasts': {
2020-10-13 11:40:20 +01:00
'broadcast_dashboard_previous',
'view_previous_broadcast',
2020-10-13 11:40:20 +01:00
},
2018-04-25 10:24:32 +01:00
'templates': {
'action_blocked',
'add_service_template',
'check_messages',
'check_notification',
2020-03-13 17:51:22 +00:00
'choose_from_contact_list',
2018-04-25 10:24:32 +01:00
'choose_template',
'choose_template_to_copy',
2018-04-25 10:24:32 +01:00
'confirm_redact_template',
'conversation_reply',
'copy_template',
2018-04-25 10:24:32 +01:00
'delete_service_template',
'edit_service_template',
2019-01-29 15:43:59 +00:00
'edit_template_postage',
'manage_template_folder',
2018-04-25 10:24:32 +01:00
'send_messages',
'send_one_off',
2020-03-10 15:12:19 +00:00
'send_one_off_letter_address',
2018-04-25 10:24:32 +01:00
'send_one_off_step',
'send_one_off_to_myself',
'no_cookie.send_test_preview',
2018-04-25 10:24:32 +01:00
'set_sender',
'set_template_sender',
'view_template',
'view_template_version',
'view_template_versions',
'broadcast',
'preview_broadcast_areas',
'choose_broadcast_library',
'choose_broadcast_area',
'choose_broadcast_sub_area',
'remove_broadcast_area',
'preview_broadcast_message',
2020-07-17 08:07:44 +01:00
'approve_broadcast_message',
2020-07-17 08:07:44 +01:00
'reject_broadcast_message',
2020-07-10 09:16:36 +01:00
'cancel_broadcast_message',
2018-04-25 10:24:32 +01:00
},
2019-08-09 08:44:11 +01:00
'uploads': {
'upload_contact_list',
'check_contact_list',
'save_contact_list',
'contact_list',
2020-03-18 13:37:39 +00:00
'delete_contact_list',
'upload_letter',
'uploaded_letter_preview',
2020-05-11 10:52:43 +01:00
'uploaded_letters',
2019-08-09 08:44:11 +01:00
'uploads',
2020-03-03 14:27:13 +00:00
'view_job',
'view_jobs',
2019-08-09 08:44:11 +01:00
},
2018-04-25 10:24:32 +01:00
'team-members': {
2019-02-20 11:50:34 +00:00
'confirm_edit_user_email',
'confirm_edit_user_mobile_number',
2019-02-20 11:50:34 +00:00
'edit_user_email',
'edit_user_mobile_number',
2018-04-25 10:24:32 +01:00
'edit_user_permissions',
'invite_user',
'manage_users',
'remove_user_from_service',
},
'usage': {
'usage',
},
'settings': {
'add_organisation_from_gp_service',
'add_organisation_from_nhs_local_service',
'branding_request',
2019-02-15 11:03:19 +00:00
'estimate_usage',
2018-04-25 10:24:32 +01:00
'link_service_to_organisation',
'request_to_go_live',
'service_add_email_reply_to',
'service_add_letter_contact',
'service_add_sms_sender',
'service_agreement',
'service_accept_agreement',
'service_confirm_agreement',
'service_confirm_delete_email_reply_to',
2019-07-04 16:11:19 +01:00
'service_confirm_delete_letter_contact',
'service_confirm_delete_sms_sender',
2018-04-25 10:24:32 +01:00
'service_edit_email_reply_to',
'service_edit_letter_contact',
'service_edit_sms_sender',
'service_email_reply_to',
'service_letter_contact_details',
'service_make_blank_default_letter_contact',
2018-04-25 10:24:32 +01:00
'service_name_change',
'service_name_change_confirm',
2018-08-03 17:39:58 +01:00
'service_preview_email_branding',
'service_preview_letter_branding',
2018-04-25 10:24:32 +01:00
'service_set_auth_type',
'service_set_channel',
'send_files_by_email_contact_details',
2018-04-25 10:24:32 +01:00
'service_set_email_branding',
'service_set_inbound_number',
'service_set_inbound_sms',
'service_set_international_letters',
2018-04-25 10:24:32 +01:00
'service_set_international_sms',
'service_set_letters',
'service_set_reply_to_email',
'service_set_sms_prefix',
'service_verify_reply_to_address',
'service_verify_reply_to_address_updates',
2018-04-25 10:24:32 +01:00
'service_settings',
'service_sms_senders',
'set_free_sms_allowance',
'set_message_limit',
2020-10-21 14:30:35 +01:00
'set_rate_limit',
2019-02-05 16:33:36 +00:00
'service_set_letter_branding',
2018-04-25 10:24:32 +01:00
'submit_request_to_go_live',
},
'api-integration': {
'api_callbacks',
'api_documentation',
'api_integration',
'api_keys',
'create_api_key',
'delivery_status_callback',
'received_text_messages_callback',
'revoke_api_key',
'guest_list',
2020-06-12 09:07:29 +01:00
'old_guest_list',
2018-04-25 10:24:32 +01:00
},
}
exclude = {
'accept_invite',
'accept_org_invite',
2020-09-23 09:53:12 +01:00
'accessibility_statement',
'add_data_retention',
2018-04-25 10:24:32 +01:00
'add_organisation',
'add_service',
'archive_service',
2019-05-22 11:38:47 +01:00
'archive_user',
2018-04-25 10:24:32 +01:00
'bat_phone',
2020-09-29 14:48:56 +01:00
'begin_tour',
2018-04-25 10:24:32 +01:00
'callbacks',
'cancel_invited_org_user',
'cancel_invited_user',
'cancel_job',
2018-12-05 10:58:27 +00:00
'cancel_letter',
'cancel_letter_job',
2018-04-25 10:24:32 +01:00
'check_and_resend_text_code',
'check_and_resend_verification_code',
'no_cookie.check_messages_preview',
'no_cookie.check_notification_preview',
'check_tour_notification',
2018-04-25 10:24:32 +01:00
'choose_account',
'choose_service',
2019-02-15 10:27:38 +00:00
'clear_cache',
2018-04-25 10:24:32 +01:00
'confirm_edit_organisation_name',
'conversation_reply_with_template',
'conversation_updates',
'cookies',
'create_email_branding',
2019-01-31 16:56:35 +00:00
'create_letter_branding',
'data_retention',
'delete_template_folder',
2018-04-25 10:24:32 +01:00
'delivery_and_failure',
'design_content',
'documentation',
2020-03-15 19:13:07 +00:00
'download_contact_list',
2018-04-25 10:24:32 +01:00
'download_notifications_csv',
'edit_data_retention',
'edit_organisation_agreement',
'edit_organisation_crown_status',
'edit_organisation_email_branding',
'edit_organisation_domains',
2019-05-13 14:50:40 +01:00
'edit_organisation_go_live_notes',
'edit_organisation_letter_branding',
2018-04-25 10:24:32 +01:00
'edit_organisation_name',
'edit_organisation_type',
2018-04-25 10:24:32 +01:00
'edit_provider',
'edit_sms_provider_ratio',
2018-04-25 10:24:32 +01:00
'edit_user_org_permissions',
'email_branding',
'email_not_received',
'email_template',
'error',
'features',
2019-04-11 11:47:09 +01:00
'features_email',
'features_letters',
'features_sms',
2018-04-25 10:24:32 +01:00
'feedback',
2019-08-13 16:25:26 +01:00
'find_services_by_name',
'find_users_by_email',
2018-04-25 10:24:32 +01:00
'forgot_password',
'get_example_csv',
'get_notifications_as_json',
2019-10-17 16:15:28 +01:00
'get_started',
2020-01-24 15:57:29 +00:00
'get_started_old',
2018-04-25 10:24:32 +01:00
'go_to_dashboard_after_tour',
2020-01-24 15:57:29 +00:00
'guidance_index',
'branding_and_customisation',
'create_and_send_messages',
'edit_and_format_messages',
'send_files_by_email',
'upload_a_letter',
2020-09-22 15:09:46 +01:00
'letter_specification',
2019-10-18 09:18:51 +01:00
'history',
2019-06-04 10:43:15 +01:00
'how_to_pay',
2018-04-25 10:24:32 +01:00
'inbound_sms_admin',
'inbox_download',
'inbox_updates',
'index',
'information_risk_management',
'information_security',
'integration_testing',
'invite_org_user',
'letter_branding',
'no_cookie.letter_branding_preview_image',
2018-04-25 10:24:32 +01:00
'live_services',
2019-04-24 16:23:12 +01:00
'live_services_csv',
2020-01-15 10:56:14 +00:00
'letter_spec',
'letter_template',
2019-04-11 11:47:09 +01:00
'message_status',
2018-04-25 10:24:32 +01:00
'manage_org_users',
'new_password',
'notifications_sent_by_service',
2018-04-25 10:24:32 +01:00
'old_integration_testing',
'old_roadmap',
'old_service_dashboard',
'old_terms',
'old_using_notify',
'organisation_dashboard',
'organisation_trial_mode_services',
'organisation_preview_email_branding',
'organisation_preview_letter_branding',
2018-04-25 10:24:32 +01:00
'organisation_settings',
'organisations',
'performance_platform_xlsx',
2018-04-25 10:24:32 +01:00
'platform_admin',
'platform_admin_list_complaints',
'platform_admin_reports',
'platform_admin_returned_letters',
'platform_admin_splash_page',
2018-04-25 10:24:32 +01:00
'pricing',
'privacy',
'public_agreement',
'public_download_agreement',
2018-04-25 10:24:32 +01:00
'redact_template',
'register',
'register_from_invite',
'register_from_org_invite',
'registration_continue',
'remove_user_from_organisation',
'resend_email_link',
'resend_email_verification',
'resume_service',
2019-12-18 11:53:46 +00:00
'returned_letters_report',
'revalidate_email_sent',
2018-04-25 10:24:32 +01:00
'roadmap',
'security',
'send_notification',
'send_from_contact_list',
2019-09-09 12:22:52 +01:00
'send_uploaded_letter',
2018-04-25 10:24:32 +01:00
'service_dashboard_updates',
'service_delete_email_reply_to',
2019-07-04 16:11:19 +01:00
'service_delete_letter_contact',
'service_delete_sms_sender',
'service_download_agreement',
'service_switch_count_as_live',
2018-04-25 10:24:32 +01:00
'service_switch_live',
'service_set_permission',
'service_set_broadcast_permission',
2018-04-25 10:24:32 +01:00
'services_or_dashboard',
'show_accounts_or_dashboard',
'sign_in',
'sign_out',
'start_job',
'support',
'support_public',
2018-04-25 10:24:32 +01:00
'suspend_service',
'template_history',
'terms',
'thanks',
2020-09-29 14:48:56 +01:00
'tour_step',
2018-04-25 10:24:32 +01:00
'triage',
'trial_mode',
2019-04-11 11:47:09 +01:00
'trial_mode_new',
2018-04-25 10:24:32 +01:00
'trial_services',
'two_factor',
'two_factor_email',
'two_factor_email_sent',
'two_factor_email_interstitial',
2018-04-25 10:24:32 +01:00
'update_email_branding',
2019-02-11 15:31:12 +00:00
'update_letter_branding',
'usage_for_all_services',
'user_information',
2018-04-25 10:24:32 +01:00
'user_profile',
'user_profile_email',
'user_profile_email_authenticate',
'user_profile_email_confirm',
'user_profile_mobile_number',
'user_profile_mobile_number_authenticate',
'user_profile_mobile_number_confirm',
'user_profile_name',
'user_profile_password',
'user_profile_disable_platform_admin_view',
2018-04-25 10:24:32 +01:00
'using_notify',
'verify',
'verify_email',
'view_job_csv',
'view_job_updates',
'view_letter_notification_as_preview',
'no_cookie.view_letter_template_preview',
2019-09-09 10:59:32 +01:00
'view_letter_upload_as_preview',
2018-04-25 10:24:32 +01:00
'view_notification_updates',
'view_notifications_csv',
'view_provider',
'view_providers',
'no_cookie.view_template_version_preview',
2020-05-20 15:54:15 +01:00
'who_can_use_notify',
2020-05-21 11:17:44 +01:00
'who_its_for',
2018-04-25 10:24:32 +01:00
}
2018-06-12 16:17:20 +01:00
class CaseworkNavigation(Navigation):
mapping = {
2020-07-08 11:34:16 +01:00
'dashboard': {
'broadcast_tour',
2020-07-08 11:34:16 +01:00
'broadcast_dashboard',
2020-10-13 11:40:20 +01:00
'broadcast_dashboard_previous',
'broadcast_dashboard_updates',
2020-07-08 11:34:16 +01:00
},
2018-06-12 16:17:20 +01:00
'send-one-off': {
2020-03-13 17:51:22 +00:00
'choose_from_contact_list',
2018-06-12 16:17:20 +01:00
'choose_template',
'send_one_off',
2020-03-10 15:12:19 +00:00
'send_one_off_letter_address',
2018-06-12 16:17:20 +01:00
'send_one_off_step',
'send_one_off_to_myself',
2018-06-13 14:16:10 +01:00
},
'sent-messages': {
'view_notifications',
2018-06-12 16:17:20 +01:00
'view_notification',
},
2019-10-09 10:58:15 +01:00
'uploads': {
2018-07-30 17:40:32 +01:00
'view_jobs',
'view_job',
'upload_contact_list',
'check_contact_list',
'save_contact_list',
'contact_list',
2020-03-18 13:37:39 +00:00
'delete_contact_list',
2019-10-09 10:58:15 +01:00
'upload_letter',
'uploaded_letter_preview',
2020-05-11 10:52:43 +01:00
'uploaded_letters',
2019-10-09 10:58:15 +01:00
'uploads',
2018-07-30 17:40:32 +01:00
},
2018-06-12 16:17:20 +01:00
}
exclude = {
'accept_invite',
'accept_org_invite',
2020-09-23 09:53:12 +01:00
'accessibility_statement',
2018-06-12 16:17:20 +01:00
'action_blocked',
'add_data_retention',
2018-06-12 16:17:20 +01:00
'add_organisation',
'add_organisation_from_gp_service',
'add_organisation_from_nhs_local_service',
2018-06-12 16:17:20 +01:00
'add_service',
'add_service_template',
'api_callbacks',
'api_documentation',
'api_integration',
'api_keys',
'archive_service',
2019-05-22 11:38:47 +01:00
'archive_user',
2018-06-12 16:17:20 +01:00
'bat_phone',
2020-09-29 14:48:56 +01:00
'begin_tour',
2018-06-12 16:17:20 +01:00
'branding_request',
'callbacks',
'cancel_invited_org_user',
'cancel_invited_user',
'cancel_job',
2018-12-05 10:58:27 +00:00
'cancel_letter',
'cancel_letter_job',
2018-06-12 16:17:20 +01:00
'check_and_resend_text_code',
'check_and_resend_verification_code',
'check_messages',
'no_cookie.check_messages_preview',
2018-06-12 16:17:20 +01:00
'check_notification',
'no_cookie.check_notification_preview',
'check_tour_notification',
2018-06-12 16:17:20 +01:00
'choose_account',
'choose_service',
'choose_template_to_copy',
2019-02-15 10:27:38 +00:00
'clear_cache',
'edit_organisation_agreement',
'edit_organisation_crown_status',
'edit_organisation_domains',
'edit_organisation_email_branding',
2019-05-13 14:50:40 +01:00
'edit_organisation_go_live_notes',
'edit_organisation_letter_branding',
2018-06-12 16:17:20 +01:00
'confirm_edit_organisation_name',
2019-02-20 11:50:34 +00:00
'confirm_edit_user_email',
'confirm_edit_user_mobile_number',
2018-06-12 16:17:20 +01:00
'confirm_redact_template',
'conversation',
'conversation_reply',
'conversation_reply_with_template',
'conversation_updates',
'cookies',
'copy_template',
2018-06-12 16:17:20 +01:00
'create_api_key',
'create_email_branding',
2019-01-31 16:56:35 +00:00
'create_letter_branding',
'data_retention',
2018-06-12 16:17:20 +01:00
'delete_service_template',
'delete_template_folder',
2018-06-12 16:17:20 +01:00
'delivery_and_failure',
'delivery_status_callback',
'design_content',
'documentation',
2020-03-15 19:13:07 +00:00
'download_contact_list',
2018-06-12 16:17:20 +01:00
'download_notifications_csv',
'edit_data_retention',
'edit_organisation_agreement',
'edit_organisation_crown_status',
'edit_organisation_domains',
2018-06-12 16:17:20 +01:00
'edit_organisation_name',
'edit_organisation_type',
2018-06-12 16:17:20 +01:00
'edit_provider',
'edit_sms_provider_ratio',
2018-06-12 16:17:20 +01:00
'edit_service_template',
2019-01-29 15:43:59 +00:00
'edit_template_postage',
2019-02-20 11:50:34 +00:00
'edit_user_email',
'edit_user_mobile_number',
2018-06-12 16:17:20 +01:00
'edit_user_org_permissions',
'edit_user_permissions',
'email_branding',
'email_not_received',
'email_template',
'error',
2019-02-15 11:03:19 +00:00
'estimate_usage',
2018-06-12 16:17:20 +01:00
'features',
2019-04-11 11:47:09 +01:00
'features_email',
'features_letters',
'features_sms',
2018-06-12 16:17:20 +01:00
'feedback',
2019-08-13 16:25:26 +01:00
'find_services_by_name',
'find_users_by_email',
2018-06-12 16:17:20 +01:00
'forgot_password',
'get_example_csv',
'get_notifications_as_json',
2019-10-17 16:15:28 +01:00
'get_started',
2020-01-24 15:57:29 +00:00
'get_started_old',
2018-06-12 16:17:20 +01:00
'go_to_dashboard_after_tour',
2020-01-24 15:57:29 +00:00
'guidance_index',
'branding_and_customisation',
'create_and_send_messages',
'edit_and_format_messages',
'send_files_by_email',
'upload_a_letter',
2020-09-22 15:09:46 +01:00
'letter_specification',
2019-10-18 09:18:51 +01:00
'history',
2019-06-04 10:43:15 +01:00
'how_to_pay',
2018-06-12 16:17:20 +01:00
'inbound_sms_admin',
'inbox_download',
'inbox_updates',
'inbox',
2018-06-12 16:17:20 +01:00
'index',
'information_risk_management',
'information_security',
'integration_testing',
'invite_org_user',
'invite_user',
'no_cookie.letter_branding_preview_image',
'letter_branding',
2020-01-15 10:56:14 +00:00
'letter_spec',
'letter_template',
2018-06-12 16:17:20 +01:00
'link_service_to_organisation',
'live_services',
2019-04-24 16:23:12 +01:00
'live_services_csv',
2018-06-12 16:17:20 +01:00
'manage_org_users',
'manage_template_folder',
2018-06-12 16:17:20 +01:00
'manage_users',
2019-04-11 11:47:09 +01:00
'message_status',
2018-06-12 16:17:20 +01:00
'monthly',
'new_password',
'notifications_sent_by_service',
2018-06-12 16:17:20 +01:00
'old_integration_testing',
'old_roadmap',
'old_service_dashboard',
'old_terms',
'old_using_notify',
'organisation_dashboard',
'organisation_trial_mode_services',
'organisation_preview_email_branding',
'organisation_preview_letter_branding',
2018-06-12 16:17:20 +01:00
'organisation_settings',
'organisations',
'performance_platform_xlsx',
2018-06-12 16:17:20 +01:00
'platform_admin_list_complaints',
'platform_admin_reports',
'platform_admin_returned_letters',
'platform_admin',
'platform_admin_splash_page',
2018-06-12 16:17:20 +01:00
'pricing',
'privacy',
'public_agreement',
'public_download_agreement',
'received_text_messages_callback',
'redact_template',
'register_from_invite',
'register_from_org_invite',
'register',
2018-06-12 16:17:20 +01:00
'registration_continue',
'remove_user_from_organisation',
'remove_user_from_service',
'request_to_go_live',
'resend_email_link',
'resend_email_verification',
'resume_service',
2019-12-18 11:53:46 +00:00
'returned_letter_summary',
2019-12-31 13:27:27 +00:00
'returned_letters',
2019-12-18 11:53:46 +00:00
'returned_letters_report',
'revalidate_email_sent',
2018-06-12 16:17:20 +01:00
'revoke_api_key',
'roadmap',
'security',
'send_messages',
'send_notification',
'no_cookie.send_test_preview',
'send_from_contact_list',
2019-09-09 12:22:52 +01:00
'send_uploaded_letter',
2018-06-12 16:17:20 +01:00
'service_add_email_reply_to',
'service_add_letter_contact',
'service_add_sms_sender',
'service_agreement',
'service_accept_agreement',
'service_confirm_agreement',
2018-06-12 16:17:20 +01:00
'service_confirm_delete_email_reply_to',
2019-07-04 16:11:19 +01:00
'service_confirm_delete_letter_contact',
2018-06-12 16:17:20 +01:00
'service_confirm_delete_sms_sender',
'service_dashboard',
'service_dashboard_updates',
'service_delete_email_reply_to',
2019-07-04 16:11:19 +01:00
'service_delete_letter_contact',
2018-06-12 16:17:20 +01:00
'service_delete_sms_sender',
'service_download_agreement',
2018-06-12 16:17:20 +01:00
'service_edit_email_reply_to',
'service_edit_letter_contact',
'service_edit_sms_sender',
'service_email_reply_to',
'service_letter_contact_details',
'service_make_blank_default_letter_contact',
2018-06-12 16:17:20 +01:00
'service_name_change',
'service_name_change_confirm',
2018-08-03 17:39:58 +01:00
'service_preview_email_branding',
'service_preview_letter_branding',
2018-06-12 16:17:20 +01:00
'service_set_auth_type',
'service_set_channel',
'send_files_by_email_contact_details',
2018-06-12 16:17:20 +01:00
'service_set_email_branding',
'service_set_inbound_number',
'service_set_inbound_sms',
'service_set_international_letters',
2018-06-12 16:17:20 +01:00
'service_set_international_sms',
'service_set_letters',
'service_set_reply_to_email',
'service_set_sms_prefix',
'service_settings',
'service_sms_senders',
'service_switch_count_as_live',
2018-06-12 16:17:20 +01:00
'service_switch_live',
'service_set_permission',
'service_set_broadcast_permission',
'service_verify_reply_to_address',
'service_verify_reply_to_address_updates',
2018-06-12 16:17:20 +01:00
'services_or_dashboard',
'set_free_sms_allowance',
'set_message_limit',
2020-10-21 14:30:35 +01:00
'set_rate_limit',
2019-02-05 16:33:36 +00:00
'service_set_letter_branding',
2018-06-12 16:17:20 +01:00
'set_sender',
'set_template_sender',
'show_accounts_or_dashboard',
'sign_in',
'sign_out',
'start_job',
'submit_request_to_go_live',
'support',
'support_public',
2018-06-12 16:17:20 +01:00
'suspend_service',
'template_history',
'template_usage',
'terms',
'thanks',
2020-09-29 14:48:56 +01:00
'tour_step',
2018-06-12 16:17:20 +01:00
'triage',
'trial_mode',
2019-04-11 11:47:09 +01:00
'trial_mode_new',
2018-06-12 16:17:20 +01:00
'trial_services',
'two_factor',
'two_factor_email',
'two_factor_email_sent',
'two_factor_email_interstitial',
2018-06-12 16:17:20 +01:00
'update_email_branding',
2019-02-11 15:31:12 +00:00
'update_letter_branding',
2018-06-12 16:17:20 +01:00
'usage',
'usage_for_all_services',
'user_information',
2018-06-12 16:17:20 +01:00
'user_profile',
'user_profile_email',
'user_profile_email_authenticate',
'user_profile_email_confirm',
'user_profile_mobile_number',
'user_profile_mobile_number_authenticate',
'user_profile_mobile_number_confirm',
'user_profile_name',
'user_profile_password',
'user_profile_disable_platform_admin_view',
2018-06-12 16:17:20 +01:00
'using_notify',
'verify',
'verify_email',
'view_job_csv',
'view_job_updates',
'view_letter_notification_as_preview',
'no_cookie.view_letter_template_preview',
2019-09-09 10:59:32 +01:00
'view_letter_upload_as_preview',
2018-06-12 16:17:20 +01:00
'view_notification_updates',
'view_notifications_csv',
'view_provider',
'view_providers',
'view_template',
'view_template_version',
'no_cookie.view_template_version_preview',
2018-06-12 16:17:20 +01:00
'view_template_versions',
'guest_list',
2020-06-12 09:07:29 +01:00
'old_guest_list',
2020-05-20 15:54:15 +01:00
'who_can_use_notify',
2020-05-21 11:17:44 +01:00
'who_its_for',
'broadcast',
'preview_broadcast_areas',
'choose_broadcast_library',
'choose_broadcast_area',
'choose_broadcast_sub_area',
'remove_broadcast_area',
'preview_broadcast_message',
'view_current_broadcast',
'view_previous_broadcast',
2020-07-17 08:07:44 +01:00
'approve_broadcast_message',
2020-07-17 08:07:44 +01:00
'reject_broadcast_message',
2020-07-10 09:16:36 +01:00
'cancel_broadcast_message',
2018-06-12 16:17:20 +01:00
}
class OrgNavigation(Navigation):
mapping = {
'dashboard': {
'organisation_dashboard',
},
'settings': {
'confirm_edit_organisation_name',
'edit_organisation_agreement',
'edit_organisation_crown_status',
'edit_organisation_domains',
'edit_organisation_email_branding',
'edit_organisation_letter_branding',
'edit_organisation_domains',
2019-05-13 14:50:40 +01:00
'edit_organisation_go_live_notes',
'edit_organisation_name',
'edit_organisation_type',
'organisation_preview_email_branding',
'organisation_preview_letter_branding',
'organisation_settings',
},
'team-members': {
'edit_user_org_permissions',
'invite_org_user',
'manage_org_users',
'remove_user_from_organisation',
},
'trial-services': {
'organisation_trial_mode_services',
}
}
exclude = {
'accept_invite',
'accept_org_invite',
2020-09-23 09:53:12 +01:00
'accessibility_statement',
'action_blocked',
'add_data_retention',
'add_organisation',
'add_organisation_from_gp_service',
'add_organisation_from_nhs_local_service',
'add_service',
'add_service_template',
'api_callbacks',
'api_documentation',
'api_integration',
'api_keys',
'archive_service',
2019-05-22 11:38:47 +01:00
'archive_user',
'bat_phone',
2020-09-29 14:48:56 +01:00
'begin_tour',
'branding_request',
'callbacks',
'cancel_invited_org_user',
'cancel_invited_user',
'cancel_job',
2018-12-05 10:58:27 +00:00
'cancel_letter',
'cancel_letter_job',
'check_and_resend_text_code',
'check_and_resend_verification_code',
'check_messages',
'no_cookie.check_messages_preview',
'check_notification',
'no_cookie.check_notification_preview',
'check_tour_notification',
'choose_account',
2020-03-13 17:51:22 +00:00
'choose_from_contact_list',
'choose_service',
'choose_template',
'choose_template_to_copy',
2019-02-15 10:27:38 +00:00
'clear_cache',
2019-02-20 11:50:34 +00:00
'confirm_edit_user_email',
'confirm_edit_user_mobile_number',
'confirm_redact_template',
'conversation',
'conversation_reply',
'conversation_reply_with_template',
'conversation_updates',
'cookies',
'copy_template',
'create_api_key',
'create_email_branding',
2019-01-31 16:56:35 +00:00
'create_letter_branding',
'data_retention',
'delete_service_template',
'delete_template_folder',
'delivery_and_failure',
'delivery_status_callback',
'design_content',
'documentation',
2020-03-15 19:13:07 +00:00
'download_contact_list',
'download_notifications_csv',
'edit_data_retention',
'edit_provider',
'edit_service_template',
'edit_sms_provider_ratio',
2019-01-29 15:43:59 +00:00
'edit_template_postage',
2019-02-20 11:50:34 +00:00
'edit_user_email',
'edit_user_mobile_number',
'edit_user_permissions',
'email_branding',
'email_not_received',
'email_template',
'error',
2019-02-15 11:03:19 +00:00
'estimate_usage',
'features',
2019-04-11 11:47:09 +01:00
'features_email',
'features_letters',
'features_sms',
'feedback',
2019-08-13 16:25:26 +01:00
'find_services_by_name',
'find_users_by_email',
'forgot_password',
'get_example_csv',
'get_notifications_as_json',
2019-10-17 16:15:28 +01:00
'get_started',
2020-01-24 15:57:29 +00:00
'get_started_old',
'go_to_dashboard_after_tour',
2020-01-24 15:57:29 +00:00
'guidance_index',
'branding_and_customisation',
'create_and_send_messages',
'edit_and_format_messages',
'send_files_by_email',
'upload_a_letter',
2020-09-22 15:09:46 +01:00
'letter_specification',
2019-10-18 09:18:51 +01:00
'history',
2019-06-04 10:43:15 +01:00
'how_to_pay',
'inbound_sms_admin',
'inbox',
'inbox_download',
'inbox_updates',
'index',
'information_risk_management',
'information_security',
'integration_testing',
'invite_user',
'letter_branding',
'no_cookie.letter_branding_preview_image',
2020-01-15 10:56:14 +00:00
'letter_spec',
'letter_template',
'link_service_to_organisation',
'live_services',
2019-04-24 16:23:12 +01:00
'live_services_csv',
'manage_template_folder',
'manage_users',
2019-04-11 11:47:09 +01:00
'message_status',
'monthly',
'new_password',
'notifications_sent_by_service',
'old_integration_testing',
'old_roadmap',
'old_service_dashboard',
'old_terms',
'old_using_notify',
'organisations',
'performance_platform_xlsx',
'platform_admin',
'platform_admin_list_complaints',
'platform_admin_reports',
'platform_admin_returned_letters',
'platform_admin_splash_page',
'pricing',
'privacy',
'public_agreement',
'public_download_agreement',
'received_text_messages_callback',
'redact_template',
'register',
'register_from_invite',
'register_from_org_invite',
'registration_continue',
'remove_user_from_service',
'request_to_go_live',
'resend_email_link',
'resend_email_verification',
'resume_service',
2019-12-18 11:53:46 +00:00
'returned_letter_summary',
2019-12-31 13:27:27 +00:00
'returned_letters',
2019-12-18 11:53:46 +00:00
'returned_letters_report',
'revalidate_email_sent',
'revoke_api_key',
'roadmap',
'security',
'send_messages',
'send_notification',
'send_one_off',
2020-03-10 15:12:19 +00:00
'send_one_off_letter_address',
'send_one_off_step',
'send_one_off_to_myself',
'no_cookie.send_test_preview',
'send_from_contact_list',
2019-09-09 12:22:52 +01:00
'send_uploaded_letter',
'service_add_email_reply_to',
'service_add_letter_contact',
'service_add_sms_sender',
'service_agreement',
'service_accept_agreement',
'service_confirm_agreement',
'service_confirm_delete_email_reply_to',
2019-07-04 16:11:19 +01:00
'service_confirm_delete_letter_contact',
'service_confirm_delete_sms_sender',
'service_dashboard',
'service_dashboard_updates',
'service_delete_email_reply_to',
2019-07-04 16:11:19 +01:00
'service_delete_letter_contact',
'service_delete_sms_sender',
'service_download_agreement',
'service_edit_email_reply_to',
'service_edit_letter_contact',
'service_edit_sms_sender',
'service_email_reply_to',
'service_letter_contact_details',
'service_make_blank_default_letter_contact',
'service_name_change',
'service_name_change_confirm',
2018-08-03 17:39:58 +01:00
'service_preview_email_branding',
'service_preview_letter_branding',
'service_set_auth_type',
'service_set_channel',
'send_files_by_email_contact_details',
'service_set_email_branding',
'service_set_inbound_number',
'service_set_inbound_sms',
'service_set_international_letters',
'service_set_international_sms',
'service_set_letters',
'service_set_reply_to_email',
'service_set_sms_prefix',
'service_settings',
'service_sms_senders',
'service_switch_count_as_live',
'service_switch_live',
'service_set_permission',
'service_set_broadcast_permission',
'service_verify_reply_to_address',
'service_verify_reply_to_address_updates',
'services_or_dashboard',
'set_free_sms_allowance',
'set_message_limit',
2020-10-21 14:30:35 +01:00
'set_rate_limit',
2019-02-05 16:33:36 +00:00
'service_set_letter_branding',
'set_sender',
'set_template_sender',
'show_accounts_or_dashboard',
'sign_in',
'sign_out',
'start_job',
'submit_request_to_go_live',
'support',
'support_public',
'suspend_service',
'template_history',
'template_usage',
'terms',
'thanks',
2020-09-29 14:48:56 +01:00
'tour_step',
'triage',
'trial_mode',
2019-04-11 11:47:09 +01:00
'trial_mode_new',
'trial_services',
'two_factor',
'two_factor_email',
'two_factor_email_sent',
'two_factor_email_interstitial',
'update_email_branding',
2019-02-11 15:31:12 +00:00
'update_letter_branding',
'upload_contact_list',
'check_contact_list',
'save_contact_list',
'contact_list',
2020-03-18 13:37:39 +00:00
'delete_contact_list',
'upload_letter',
'uploaded_letter_preview',
2020-05-11 10:52:43 +01:00
'uploaded_letters',
2019-08-09 08:44:11 +01:00
'uploads',
'usage',
'usage_for_all_services',
'user_information',
'user_profile',
'user_profile_email',
'user_profile_email_authenticate',
'user_profile_email_confirm',
'user_profile_mobile_number',
'user_profile_mobile_number_authenticate',
'user_profile_mobile_number_confirm',
'user_profile_name',
'user_profile_password',
'user_profile_disable_platform_admin_view',
'using_notify',
'verify',
'verify_email',
'view_job',
'view_job_csv',
'view_job_updates',
'view_jobs',
'view_letter_notification_as_preview',
'no_cookie.view_letter_template_preview',
2019-09-09 10:59:32 +01:00
'view_letter_upload_as_preview',
'view_notification',
'view_notification_updates',
'view_notifications',
'view_notifications_csv',
'view_provider',
'view_providers',
'view_template',
'view_template_version',
'no_cookie.view_template_version_preview',
'view_template_versions',
'guest_list',
2020-06-12 09:07:29 +01:00
'old_guest_list',
2020-05-20 15:54:15 +01:00
'who_can_use_notify',
2020-05-21 11:17:44 +01:00
'who_its_for',
'broadcast_tour',
2020-07-08 11:34:16 +01:00
'broadcast_dashboard',
2020-10-13 11:40:20 +01:00
'broadcast_dashboard_previous',
'broadcast_dashboard_updates',
'broadcast',
'preview_broadcast_areas',
'choose_broadcast_library',
'choose_broadcast_area',
'choose_broadcast_sub_area',
'remove_broadcast_area',
'preview_broadcast_message',
'view_current_broadcast',
'view_previous_broadcast',
2020-07-17 08:07:44 +01:00
'approve_broadcast_message',
2020-07-17 08:07:44 +01:00
'reject_broadcast_message',
2020-07-10 09:16:36 +01:00
'cancel_broadcast_message',
}