mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-24 04:10:57 -05:00
Remove tour-related stuff from the job page
The tour does the send one-off thing now, rather than creating a job.
This commit is contained in:
@@ -34,7 +34,6 @@ from app.utils import (
|
||||
generate_previous_dict,
|
||||
user_has_permissions,
|
||||
generate_notifications_csv,
|
||||
get_help_argument,
|
||||
get_template,
|
||||
get_time_left,
|
||||
REQUESTED_STATUSES,
|
||||
@@ -121,10 +120,8 @@ def view_job(service_id, job_id):
|
||||
service_id=service_id,
|
||||
job_id=job['id'],
|
||||
status=request.args.get('status', ''),
|
||||
help=get_help_argument()
|
||||
),
|
||||
partials=get_job_partials(job),
|
||||
help=get_help_argument()
|
||||
)
|
||||
|
||||
|
||||
@@ -307,7 +304,7 @@ def get_status_filters(service, message_type, statistics):
|
||||
]
|
||||
|
||||
|
||||
def _get_job_counts(job, help_argument):
|
||||
def _get_job_counts(job):
|
||||
sending = 0 if job['job_status'] == 'scheduled' else (
|
||||
job.get('notification_count', 0) -
|
||||
job.get('notifications_delivered', 0) -
|
||||
@@ -322,7 +319,6 @@ def _get_job_counts(job, help_argument):
|
||||
service_id=job['service'],
|
||||
job_id=job['id'],
|
||||
status=query_param,
|
||||
help=help_argument
|
||||
),
|
||||
count
|
||||
) for label, query_param, count in [
|
||||
@@ -360,7 +356,7 @@ def get_job_partials(job):
|
||||
return {
|
||||
'counts': render_template(
|
||||
'partials/count.html',
|
||||
counts=_get_job_counts(job, request.args.get('help', 0)),
|
||||
counts=_get_job_counts(job),
|
||||
status=filter_args['status']
|
||||
),
|
||||
'notifications': render_template(
|
||||
@@ -376,7 +372,6 @@ def get_job_partials(job):
|
||||
job_id=job['id'],
|
||||
status=request.args.get('status')
|
||||
),
|
||||
help=get_help_argument(),
|
||||
time_left=get_time_left(job['created_at']),
|
||||
job=job,
|
||||
template=template,
|
||||
|
||||
@@ -24,18 +24,16 @@
|
||||
<div class="dashboard-table bottom-gutter-3-2">
|
||||
{% endif %}
|
||||
|
||||
{% if not help %}
|
||||
{% if percentage_complete < 100 %}
|
||||
<p class="bottom-gutter hint">
|
||||
Report is {{ "{:.0f}%".format(percentage_complete) }} complete…
|
||||
</p>
|
||||
{% elif notifications %}
|
||||
<p class="bottom-gutter">
|
||||
<a href="{{ download_link }}" download="download" class="heading-small">Download this report</a>
|
||||
 
|
||||
<span id="time-left">{{ time_left }}</span>
|
||||
</p>
|
||||
{% endif %}
|
||||
{% if percentage_complete < 100 %}
|
||||
<p class="bottom-gutter hint">
|
||||
Report is {{ "{:.0f}%".format(percentage_complete) }} complete…
|
||||
</p>
|
||||
{% elif notifications %}
|
||||
<p class="bottom-gutter">
|
||||
<a href="{{ download_link }}" download="download" class="heading-small">Download this report</a>
|
||||
 
|
||||
<span id="time-left">{{ time_left }}</span>
|
||||
</p>
|
||||
{% endif %}
|
||||
|
||||
{% call(item, row_number) list_table(
|
||||
|
||||
@@ -224,38 +224,6 @@ def test_should_not_show_cancelled_job(
|
||||
assert response.status_code == 404
|
||||
|
||||
|
||||
def test_should_show_not_show_csv_download_in_tour(
|
||||
logged_in_client,
|
||||
service_one,
|
||||
active_user_with_permissions,
|
||||
mock_get_service_template,
|
||||
mock_get_job,
|
||||
mocker,
|
||||
mock_get_notifications,
|
||||
fake_uuid,
|
||||
):
|
||||
response = logged_in_client.get(url_for(
|
||||
'main.view_job',
|
||||
service_id=service_one['id'],
|
||||
job_id=fake_uuid,
|
||||
help=3
|
||||
))
|
||||
|
||||
assert response.status_code == 200
|
||||
assert url_for(
|
||||
'main.view_job_updates',
|
||||
service_id=service_one['id'],
|
||||
job_id=fake_uuid,
|
||||
status='',
|
||||
help=3
|
||||
).replace('&', '&') in response.get_data(as_text=True)
|
||||
assert url_for(
|
||||
'main.view_job_csv',
|
||||
service_id=service_one['id'],
|
||||
job_id=fake_uuid
|
||||
) not in response.get_data(as_text=True)
|
||||
|
||||
|
||||
@freeze_time("2016-01-01 00:00:00.000001")
|
||||
def test_should_show_updates_for_one_job_as_json(
|
||||
logged_in_client,
|
||||
|
||||
Reference in New Issue
Block a user