-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to clone previous jobs #334
Conversation
2046ad9
to
62629d4
Compare
Added tests for cloning the four creating pages. @lukeyeager can you have a look? |
Sure, I'll take a look. But you've got 5 test failures that need resolving before a merge. |
@@ -115,6 +115,10 @@ def create_dataset(cls, **kwargs): | |||
if request_json: | |||
url += '.json' | |||
|
|||
clone = data.pop('clone', None) | |||
if clone is not None: | |||
url += '?clone=' + clone |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought we said this was going to work for POST data as well as query string arguments? Why is this necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you asking did I put it into data?
7845805
to
a55a0ec
Compare
8242f2f
to
5f681be
Compare
This looks good to me. Let's squash into a single commit and merge. |
Add ability to clone previous jobs
A 'Clone Job' button has been added to the Job pages.
The approach I took was to save the form settings when a job starts for each Field (except SubmitField and FileField in a dict() on the job called form_data.
When a job is cloned, the form is created and populated with the saved form_data from the source job. If a field in the form can not be populated with saved form_data, a warning is presented at the head of the document.
I put the 'Clone Job' button to the left of the 'Abort Job' button.
I'd don't love this. When the Job completes, the 'Abort Job' disappears and the Clone moves to where the Abort Job had been, and could fire a Clone when the user means to Abort. Also, if the source job does not have form_data, the 'Clone Job' button is disabled rather then hidden. I'm not sure I feel is better.
I need to make a test for the suite, but prefer to get this out as is for comment.
I changed the print_errors macro to also print warnings and added a hl_errors macro to add has-error and has-warning classes.