mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-09 10:54:11 -04:00
Move service history into it own file
We’re going to do some work on this page, let’s put it in a sensible place first before we add a bunch more code to the wrong place.
This commit is contained in:
@@ -15,6 +15,7 @@ from app.main.views import ( # noqa isort:skip
|
||||
find_services,
|
||||
find_users,
|
||||
forgot_password,
|
||||
history,
|
||||
inbound_number,
|
||||
index,
|
||||
invites,
|
||||
|
||||
@@ -38,19 +38,6 @@ from app.utils import (
|
||||
)
|
||||
|
||||
|
||||
# This is a placeholder view method to be replaced
|
||||
# when product team makes decision about how/what/when
|
||||
# to view history
|
||||
@main.route("/services/<service_id>/history")
|
||||
@user_has_permissions()
|
||||
def temp_service_history(service_id):
|
||||
data = service_api_client.get_service_history(service_id)['data']
|
||||
return render_template('views/temp-history.html',
|
||||
services=data['service_history'],
|
||||
api_keys=data['api_key_history'],
|
||||
events=data['events'])
|
||||
|
||||
|
||||
@main.route("/services/<service_id>/dashboard")
|
||||
@user_has_permissions('view_activity', 'send_messages')
|
||||
def old_service_dashboard(service_id):
|
||||
|
||||
19
app/main/views/history.py
Normal file
19
app/main/views/history.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from flask import render_template
|
||||
|
||||
from app import service_api_client
|
||||
from app.main import main
|
||||
from app.utils import user_has_permissions
|
||||
|
||||
|
||||
@main.route("/services/<service_id>/history")
|
||||
@user_has_permissions('manage_service')
|
||||
def history(service_id):
|
||||
|
||||
data = service_api_client.get_service_history(service_id)['data']
|
||||
|
||||
return render_template(
|
||||
'views/temp-history.html',
|
||||
services=data['service_history'],
|
||||
api_keys=data['api_key_history'],
|
||||
events=data['events']
|
||||
)
|
||||
@@ -191,6 +191,7 @@ class HeaderNavigation(Navigation):
|
||||
'get_example_csv',
|
||||
'get_notifications_as_json',
|
||||
'go_to_dashboard_after_tour',
|
||||
'history',
|
||||
'inbound_sms_admin',
|
||||
'inbox',
|
||||
'inbox_download',
|
||||
@@ -301,7 +302,6 @@ class HeaderNavigation(Navigation):
|
||||
'start_tour',
|
||||
'styleguide',
|
||||
'submit_request_to_go_live',
|
||||
'temp_service_history',
|
||||
'template_history',
|
||||
'template_usage',
|
||||
'trial_mode',
|
||||
@@ -505,6 +505,7 @@ class MainNavigation(Navigation):
|
||||
'get_example_csv',
|
||||
'get_notifications_as_json',
|
||||
'go_to_dashboard_after_tour',
|
||||
'history',
|
||||
'how_to_pay',
|
||||
'inbound_sms_admin',
|
||||
'inbox_download',
|
||||
@@ -577,7 +578,6 @@ class MainNavigation(Navigation):
|
||||
'styleguide',
|
||||
'support',
|
||||
'suspend_service',
|
||||
'temp_service_history',
|
||||
'template_history',
|
||||
'terms',
|
||||
'thanks',
|
||||
@@ -729,6 +729,7 @@ class CaseworkNavigation(Navigation):
|
||||
'get_example_csv',
|
||||
'get_notifications_as_json',
|
||||
'go_to_dashboard_after_tour',
|
||||
'history',
|
||||
'how_to_pay',
|
||||
'inbound_sms_admin',
|
||||
'inbox_download',
|
||||
@@ -854,7 +855,6 @@ class CaseworkNavigation(Navigation):
|
||||
'submit_request_to_go_live',
|
||||
'support',
|
||||
'suspend_service',
|
||||
'temp_service_history',
|
||||
'template_history',
|
||||
'template_usage',
|
||||
'terms',
|
||||
@@ -1016,6 +1016,7 @@ class OrgNavigation(Navigation):
|
||||
'get_example_csv',
|
||||
'get_notifications_as_json',
|
||||
'go_to_dashboard_after_tour',
|
||||
'history',
|
||||
'how_to_pay',
|
||||
'inbound_sms_admin',
|
||||
'inbox',
|
||||
@@ -1137,7 +1138,6 @@ class OrgNavigation(Navigation):
|
||||
'submit_request_to_go_live',
|
||||
'support',
|
||||
'suspend_service',
|
||||
'temp_service_history',
|
||||
'template_history',
|
||||
'template_usage',
|
||||
'terms',
|
||||
|
||||
Reference in New Issue
Block a user