mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-19 14:09:20 -04:00
Remove letter jobs page
When we first built letters you could only send them via a CSV upload, initially we needed a way to send those files to dvla per job. We since stopped using this page. So let's delete it!
This commit is contained in:
@@ -28,7 +28,6 @@ from app.main.views import ( # noqa
|
||||
providers,
|
||||
find_users,
|
||||
platform_admin,
|
||||
letter_jobs,
|
||||
email_branding,
|
||||
conversation,
|
||||
organisations,
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
from flask import redirect, render_template, request, session, url_for
|
||||
from flask_login import login_required
|
||||
|
||||
from app import letter_jobs_client
|
||||
from app.main import main
|
||||
from app.utils import user_is_platform_admin
|
||||
|
||||
|
||||
@main.route("/letter-jobs", methods=['GET', 'POST'])
|
||||
@login_required
|
||||
@user_is_platform_admin
|
||||
def letter_jobs():
|
||||
letter_jobs_list = letter_jobs_client.get_letter_jobs()
|
||||
|
||||
if request.method == 'POST':
|
||||
if len(request.form.getlist('job_id')) > 0:
|
||||
job_ids = request.form.getlist('job_id')
|
||||
session['job_ids'] = job_ids
|
||||
|
||||
response = letter_jobs_client.send_letter_jobs(job_ids)
|
||||
msg = response['response']
|
||||
else:
|
||||
msg = 'No jobs selected'
|
||||
|
||||
session['msg'] = msg
|
||||
|
||||
return redirect(url_for('main.letter_jobs'))
|
||||
|
||||
msg = session.pop('msg', None)
|
||||
job_ids = session.pop('job_ids', None)
|
||||
if job_ids:
|
||||
for job_id in job_ids:
|
||||
job = [j for j in letter_jobs_list if job_id == j['id']][0]
|
||||
job['sending'] = 'sending'
|
||||
|
||||
return render_template('views/letter-jobs.html', letter_jobs_list=letter_jobs_list, message=msg)
|
||||
@@ -170,7 +170,6 @@ class HeaderNavigation(Navigation):
|
||||
'information_security',
|
||||
'invite_org_user',
|
||||
'invite_user',
|
||||
'letter_jobs',
|
||||
'link_service_to_organisation',
|
||||
'manage_org_users',
|
||||
'manage_template_folder',
|
||||
@@ -439,7 +438,6 @@ class MainNavigation(Navigation):
|
||||
'information_security',
|
||||
'integration_testing',
|
||||
'invite_org_user',
|
||||
'letter_jobs',
|
||||
'live_services',
|
||||
'manage_org_users',
|
||||
'new_password',
|
||||
@@ -626,7 +624,6 @@ class CaseworkNavigation(Navigation):
|
||||
'integration_testing',
|
||||
'invite_org_user',
|
||||
'invite_user',
|
||||
'letter_jobs',
|
||||
'link_service_to_organisation',
|
||||
'live_services',
|
||||
'manage_org_users',
|
||||
@@ -861,7 +858,6 @@ class OrgNavigation(Navigation):
|
||||
'information_security',
|
||||
'integration_testing',
|
||||
'invite_user',
|
||||
'letter_jobs',
|
||||
'link_service_to_organisation',
|
||||
'live_services',
|
||||
'manage_template_folder',
|
||||
|
||||
@@ -6,15 +6,6 @@ class LetterJobsClient(NotifyAdminAPIClient):
|
||||
def __init__(self):
|
||||
super().__init__("a" * 73, "b")
|
||||
|
||||
def get_letter_jobs(self):
|
||||
return self.get(url='/letter-jobs')['data']
|
||||
|
||||
def send_letter_jobs(self, job_ids):
|
||||
return self.post(
|
||||
url='/send-letter-jobs',
|
||||
data={"job_ids": job_ids}
|
||||
)['data']
|
||||
|
||||
def submit_returned_letters(self, references):
|
||||
return self.post(
|
||||
url='/letters/returned',
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
{% extends "views/platform-admin/_base_template.html" %}
|
||||
{% from "components/page-footer.html" import page_footer %}
|
||||
{% from "components/form.html" import form_wrapper %}
|
||||
|
||||
{% block per_page_title %}
|
||||
Letter jobs
|
||||
{% endblock %}
|
||||
|
||||
{% block platform_admin_content %}
|
||||
|
||||
<h1 class="heading-large">Letter jobs</h1>
|
||||
|
||||
{% call form_wrapper() %}
|
||||
<p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Service name</th>
|
||||
<th>Job ID</th>
|
||||
<th>Count</th>
|
||||
<th>Status</th>
|
||||
<th colspan="3">Created at</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for job in letter_jobs_list %}
|
||||
<tr>
|
||||
<td>{{ job.service_name.name }}</td>
|
||||
<td>{{ job.id }}</td>
|
||||
<td>{{ job.notification_count }}</td>
|
||||
<td>{{ job.job_status }}</td>
|
||||
<td>{{ job.created_at|format_datetime_short }}</td>
|
||||
<td><input name="job_id" value='{{ job.id }}' type="checkbox"{% if not (job.job_status == 'ready to send' or job.job_status == 'sent to dvla') %} disabled{% endif %}></td>
|
||||
<td>{{ job.sending }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</p>
|
||||
{{ page_footer('Send') }}
|
||||
|
||||
{% if message %}
|
||||
<p id='message'>
|
||||
{{ message }}
|
||||
{% if message != 'No jobs selected' %}
|
||||
<div>Refresh page to see status updates</div>
|
||||
{% endif %}
|
||||
</p>
|
||||
{% endif %}
|
||||
{% endcall %}
|
||||
|
||||
{% endblock %}
|
||||
@@ -18,7 +18,6 @@
|
||||
('Organisations', url_for('main.organisations')),
|
||||
('Providers', url_for('main.view_providers')),
|
||||
('Email branding', url_for('main.email_branding')),
|
||||
('Letter jobs', url_for('main.letter_jobs')),
|
||||
('Inbound SMS numbers', url_for('main.inbound_sms_admin')),
|
||||
('Find users by email', url_for('main.find_users_by_email')),
|
||||
('Email Complaints', url_for('main.platform_admin_list_complaints')),
|
||||
|
||||
Reference in New Issue
Block a user