mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-24 08:16:51 -04: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,
|
generate_previous_dict,
|
||||||
user_has_permissions,
|
user_has_permissions,
|
||||||
generate_notifications_csv,
|
generate_notifications_csv,
|
||||||
get_help_argument,
|
|
||||||
get_template,
|
get_template,
|
||||||
get_time_left,
|
get_time_left,
|
||||||
REQUESTED_STATUSES,
|
REQUESTED_STATUSES,
|
||||||
@@ -121,10 +120,8 @@ def view_job(service_id, job_id):
|
|||||||
service_id=service_id,
|
service_id=service_id,
|
||||||
job_id=job['id'],
|
job_id=job['id'],
|
||||||
status=request.args.get('status', ''),
|
status=request.args.get('status', ''),
|
||||||
help=get_help_argument()
|
|
||||||
),
|
),
|
||||||
partials=get_job_partials(job),
|
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 (
|
sending = 0 if job['job_status'] == 'scheduled' else (
|
||||||
job.get('notification_count', 0) -
|
job.get('notification_count', 0) -
|
||||||
job.get('notifications_delivered', 0) -
|
job.get('notifications_delivered', 0) -
|
||||||
@@ -322,7 +319,6 @@ def _get_job_counts(job, help_argument):
|
|||||||
service_id=job['service'],
|
service_id=job['service'],
|
||||||
job_id=job['id'],
|
job_id=job['id'],
|
||||||
status=query_param,
|
status=query_param,
|
||||||
help=help_argument
|
|
||||||
),
|
),
|
||||||
count
|
count
|
||||||
) for label, query_param, count in [
|
) for label, query_param, count in [
|
||||||
@@ -360,7 +356,7 @@ def get_job_partials(job):
|
|||||||
return {
|
return {
|
||||||
'counts': render_template(
|
'counts': render_template(
|
||||||
'partials/count.html',
|
'partials/count.html',
|
||||||
counts=_get_job_counts(job, request.args.get('help', 0)),
|
counts=_get_job_counts(job),
|
||||||
status=filter_args['status']
|
status=filter_args['status']
|
||||||
),
|
),
|
||||||
'notifications': render_template(
|
'notifications': render_template(
|
||||||
@@ -376,7 +372,6 @@ def get_job_partials(job):
|
|||||||
job_id=job['id'],
|
job_id=job['id'],
|
||||||
status=request.args.get('status')
|
status=request.args.get('status')
|
||||||
),
|
),
|
||||||
help=get_help_argument(),
|
|
||||||
time_left=get_time_left(job['created_at']),
|
time_left=get_time_left(job['created_at']),
|
||||||
job=job,
|
job=job,
|
||||||
template=template,
|
template=template,
|
||||||
|
|||||||
@@ -24,18 +24,16 @@
|
|||||||
<div class="dashboard-table bottom-gutter-3-2">
|
<div class="dashboard-table bottom-gutter-3-2">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if not help %}
|
{% if percentage_complete < 100 %}
|
||||||
{% if percentage_complete < 100 %}
|
<p class="bottom-gutter hint">
|
||||||
<p class="bottom-gutter hint">
|
Report is {{ "{:.0f}%".format(percentage_complete) }} complete…
|
||||||
Report is {{ "{:.0f}%".format(percentage_complete) }} complete…
|
</p>
|
||||||
</p>
|
{% elif notifications %}
|
||||||
{% elif notifications %}
|
<p class="bottom-gutter">
|
||||||
<p class="bottom-gutter">
|
<a href="{{ download_link }}" download="download" class="heading-small">Download this report</a>
|
||||||
<a href="{{ download_link }}" download="download" class="heading-small">Download this report</a>
|
 
|
||||||
 
|
<span id="time-left">{{ time_left }}</span>
|
||||||
<span id="time-left">{{ time_left }}</span>
|
</p>
|
||||||
</p>
|
|
||||||
{% endif %}
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% call(item, row_number) list_table(
|
{% call(item, row_number) list_table(
|
||||||
|
|||||||
@@ -224,38 +224,6 @@ def test_should_not_show_cancelled_job(
|
|||||||
assert response.status_code == 404
|
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")
|
@freeze_time("2016-01-01 00:00:00.000001")
|
||||||
def test_should_show_updates_for_one_job_as_json(
|
def test_should_show_updates_for_one_job_as_json(
|
||||||
logged_in_client,
|
logged_in_client,
|
||||||
|
|||||||
Reference in New Issue
Block a user