From 3761a7a436fc298809463d2147ff5acb40d02f17 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Wed, 12 Oct 2016 09:23:59 +0100 Subject: [PATCH] If possible, show sent not uploaded time for jobs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If you’re looking back at a job that was scheduled and has now been sent it’s more useful and consistent to know what time it went out. The time it was uploaded at is a bit arbitrary once it’s sent. The only time the uploaded time is relevant is when the job is still waiting to be sent. Slightly fiddlier than it sounds because we never want to show ‘uploaded by’ for a job that hasn’t been scheduled because it almost immediately changes to ‘sent by’. This flickering of the UI is undesirable. --- app/templates/partials/jobs/status.html | 10 +++++++++- tests/app/main/views/test_jobs.py | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/templates/partials/jobs/status.html b/app/templates/partials/jobs/status.html index 694bb117c..c66bc6427 100644 --- a/app/templates/partials/jobs/status.html +++ b/app/templates/partials/jobs/status.html @@ -1,5 +1,13 @@

- Uploaded by {{ job.created_by.name }} on {{ job.created_at|format_datetime_short }} + {% if job.scheduled_for %} + {% if job.processing_started %} + Sent by {{ job.created_by.name }} on {{ job.processing_started|format_datetime_short }} + {% else %} + Uploaded by {{ job.created_by.name }} on {{ job.created_at|format_datetime_short }} + {% endif %} + {% else %} + Sent by {{ job.created_by.name }} on {{ job.created_at|format_datetime_short }} + {% endif %}

diff --git a/tests/app/main/views/test_jobs.py b/tests/app/main/views/test_jobs.py index 98184fa31..0e66c584c 100644 --- a/tests/app/main/views/test_jobs.py +++ b/tests/app/main/views/test_jobs.py @@ -267,7 +267,7 @@ def test_should_show_updates_for_one_job_as_json( assert 'Status' in content['notifications'] assert 'Delivered' in content['notifications'] assert '12:01am' in content['notifications'] - assert 'Uploaded by Test User on 1 January at midnight' in content['status'] + assert 'Sent by Test User on 1 January at midnight' in content['status'] @pytest.mark.parametrize(