Issue #222 - "Reset failed jobs" button #235
Conversation
in jobs.js. Add action bar above and below run table.
| resetJob($(this).parent('td')); | ||
| }); | ||
|
|
||
| $( document ).on ( 'click' , '.swarm-job-reset-failed', function () { |
Krinkle
Oct 16, 2012
Member
- (unexpected space in between function name and invocation parentheses)
- (unexpected space before comma)
- (unexpected space in between function name and invocation parentheses)
- (unexpected space before comma)
…l test to be deleted.
|
Cleaned up the code formatting. |
| if ( $request->getSessionData( "auth" ) === "yes" && $data["jobInfo"]["ownerName"] == $request->getSessionData( "username" ) ) { | ||
| $html .= '<script>SWARM.jobInfo = ' . json_encode( $data["jobInfo"] ) . ';</script>'; | ||
| $action_bar = '<div class="form-actions swarm-item-actions">' | ||
| . ' <button class="swarm-job-reset-failed btn btn-info">Reset Failed jobs</button>' |
Krinkle
Nov 1, 2012
Member
Use sentence case ("Reset failed jobs") like the others.
Use sentence case ("Reset failed jobs") like the others.
| @@ -115,6 +121,10 @@ public static function getUaRunsHtmlRows( $runs, $userAgents ) { | |||
| "Open run results for {$userAgents[$uaID]['displaytitle']}" | |||
| ) . '"></i>' | |||
| . '</a>'; | |||
| $html .= | |||
| html_tag_open( 'i', array('class' => 'hover-only swarm-job-reset-single icon-trash pull-right', 'title' => htmlspecialchars( | |||
| "Delete results for {$userAgents[$uaID]['displaytitle']}" | |||
Krinkle
Nov 1, 2012
Member
We don't delete the results, we reset the run in this job. The results have permalinks and will stay available by direct link.
We don't delete the results, we reset the run in this job. The results have permalinks and will stay available by direct link.
| @@ -61,38 +61,49 @@ jQuery(function ( $ ) { | |||
| $wipejobErr.hide().text( data.error && data.error.info || 'Action failed.' ).slideDown(); | |||
| } | |||
|
|
|||
| function resetJob( $el ) { | |||
Krinkle
Nov 1, 2012
Member
This resets the run, not the entire job.
This resets the run, not the entire job.
| } | ||
| } | ||
| }); | ||
| $( document ).on( 'click', '.swarm-job-reset-single', function () { |
Krinkle
Nov 1, 2012
Member
job>run.
job>run.
| @@ -115,6 +121,10 @@ public static function getUaRunsHtmlRows( $runs, $userAgents ) { | |||
| "Open run results for {$userAgents[$uaID]['displaytitle']}" | |||
| ) . '"></i>' | |||
| . '</a>'; | |||
| $html .= | |||
| html_tag_open( 'i', array('class' => 'hover-only swarm-job-reset-single icon-trash pull-right', 'title' => htmlspecialchars( | |||
Krinkle
Nov 1, 2012
Member
This double escapes it. html_tag_open takes care of escaping.
This double escapes it. html_tag_open takes care of escaping.
Krinkle
Nov 2, 2012
Member
This button should only be displayed if the user is authorised for the current project (just like we do with the buttons).
This button should only be displayed if the user is authorised for the current project (just like we do with the buttons).
| @@ -117,6 +117,14 @@ table.swarm-results tbody td.swarm-status { | |||
| font-weight: bold; | |||
| } | |||
|
|
|||
| table.swarm-results tbody td.swarm-status .hover-only { | |||
| visibility: hidden; | |||
Krinkle
Nov 1, 2012
Member
Visibility works fine, but looks a little odd because the text isn't centered anymore and the icons are hidden too.
It also doesn't work well for discoverability (better than double click, which nobody would guess, but hovering to discover isn't ideal either). Lets try opacity.
Visibility works fine, but looks a little odd because the text isn't centered anymore and the icons are hidden too.
It also doesn't work well for discoverability (better than double click, which nobody would guess, but hovering to discover isn't ideal either). Lets try opacity.
| resetJob( $( this ).parent( 'td' ) ); | ||
| }); | ||
|
|
||
| $( document ).on( 'click', '.swarm-job-reset-failed', function () { |
Krinkle
Nov 1, 2012
Member
This one should have a confirmation as well.
This one should have a confirmation as well.
Abstract out reset job function in jobs.js. Add action bar above and below run table. Add an icon to each cell to allow for an individual runs to be reset (replacing the old dblclick logic).
Abstract out reset job function in jobs.js. Add action bar above and below run table.