Add a component for picking the time to send a job

Users need to pick a time in the next 24hrs, or send a file immediately.

Rationale for this is a bit lost in time-before-holiday, but generally:

‘Now’ and ‘later’ as the inital choices makes it really clear what
this feature is about conceptually.

The choice of times is absolute, eg ‘1pm’ not ‘in 3 hours’
This commit is contained in:
Chris Hill-Scott
2016-08-07 09:17:49 +01:00
parent ee447ba6a4
commit 225a61ddd3
17 changed files with 288 additions and 12 deletions

View File

@@ -58,13 +58,15 @@ class JobApiClient(BaseAPIClient):
return jobs
def create_job(self, job_id, service_id, template_id, original_file_name, notification_count):
def create_job(self, job_id, service_id, template_id, original_file_name, notification_count, scheduled_for=None):
data = {
"id": job_id,
"template": template_id,
"original_file_name": original_file_name,
"notification_count": notification_count
}
if scheduled_for:
data.update({'scheduled_for': scheduled_for})
data = _attach_current_user(data)
job = self.post(url='/service/{}/job'.format(service_id), data=data)