Implement DELETE for jobsets and use it in the web interface
[?]
Oct 3, 2013, 3:54 PM
4NTIBJ74F2QUMISJPB4DGM7VPYFVZDS6ZDITVIAQCSWO6C3UIQ6QCDependencies
- [2]
DAPOSS44Use the REST API in the web interface for editing projects - [3]
JIJDYWPYRemove the Build menu from the top bar - [4]
M6UBWKN2Fix project/jobset deletion - [5]
JY7BXXOPSplit viewing and editing a project - [6]
3PNG7NIBRemove trailing whitespace - [7]
TFK74CQRPut job status on a separate tab - [8]
VJFLX7B6Fix rendering of jobset inputs - [9]
UMFB2767Hydra/64: Leaving number of builds empty gives DBIx error - [10]
D7PL2VWUMove more actions from the top bar - [11]
ODNCGFQ5* Improved the navigation bar: don't include all projects (since that - [12]
MJ4RWQ3TAdd links to the project/jobset edit pages in the logical place - [13]
OX6NYJDVSplit viewing and editing a jobset - [14]
ZRRPBEI4Make jobset deletion consistent with project deletion - [15]
BV7V5RGNAllow only project owners to delete projects / jobsets - [16]
LZVO64YGMerge in the first bits of the API work - [17]
225GEK4NAfter editing a project/jobset, redirect back to the config tab - [18]
OIBSCXGIUse a popover to show how to use the build reproduction script - [*]
3HZY24CX* Make jobsets viewable under - [*]
IK53RV4V - [*]
7YBYT2LQ
Change contents
- edit in src/lib/Hydra/Controller/Jobset.pm at line 3
use utf8; - edit in src/lib/Hydra/Controller/Jobset.pm at line 139
sub jobset_DELETE {my ($self, $c) = @_; - edit in src/lib/Hydra/Controller/Jobset.pm at line 142
requireProjectOwner($c, $c->stash->{project});txn_do($c->model('DB')->schema, sub {$c->stash->{jobset}->jobsetevals->delete_all;$c->stash->{jobset}->builds->delete_all;$c->stash->{jobset}->delete;});my $uri = $c->uri_for($c->controller('Project')->action_for("project"), [$c->stash->{project}->name]);$self->status_ok($c, entity => { redirect => "$uri" });} - edit in src/lib/Hydra/Controller/Jobset.pm at line 225[3.51]→[3.0:62](∅→∅),[3.861]→[3.0:62](∅→∅),[3.62]→[3.0:210](∅→∅),[3.210]→[3.10994:11121](∅→∅),[3.11121]→[3.223:229](∅→∅),[3.223]→[3.223:229](∅→∅)
if (($c->request->params->{submit} // "") eq "delete") {txn_do($c->model('DB')->schema, sub {$c->stash->{jobset}->jobsetevals->delete_all;$c->stash->{jobset}->builds->delete_all;$c->stash->{jobset}->delete;});return $c->res->redirect($c->uri_for($c->controller('Project')->action_for("project"), [$c->stash->{project}->name]));} - replacement in src/root/common.tt at line 455
<a href="[% uri %]" [% IF modal %]data-toggle="modal"[% END %]>[% title %]</a><a href="[% uri %]" [% IF modal %]data-toggle="modal"[% END %]>[% IF icon %]<i class="[% icon %] icon-black"></i> [%+ END %][% title %]</a> - edit in src/root/edit-jobset.tt at line 136
[% IF !create %]<button id="delete-jobset" type="submit" class="btn btn-danger" name="submit" value="delete"><i class="icon-trash icon-white"></i>Delete this jobset</button><script type="text/javascript">$("#delete-jobset").click(function() {return confirm("Are you sure you want to delete this jobset?");});</script>[% END %] - replacement in src/root/jobset.tt at line 52
[% INCLUDE menuItem uri = c.uri_for('/jobset' project.name jobset.name 'edit') title="Edit configuration" %][% INCLUDE menuItem uri = c.uri_for('/jobset' project.name jobset.name 'clone') title="Clone this jobset" %][% INCLUDE menuItem uri = "javascript:confirmEvaluateJobset()" title="Evaluate this jobset" %][% INCLUDE menuItem title="Edit configuration" icon="icon-edit" uri=c.uri_for(c.controller('Jobset').action_for('edit'), [project.name, jobset.name]) %][% INCLUDE menuItem title="Delete this jobset" icon="icon-trash" uri="javascript:deleteJobset()" %][% INCLUDE menuItem title="Clone this jobset" uri=c.uri_for('/jobset' project.name jobset.name 'clone') %][% INCLUDE menuItem title="Evaluate this jobset" uri="javascript:confirmEvaluateJobset()" %] - edit in src/root/jobset.tt at line 117
<a class="btn pull-right" href="[% c.uri_for('/jobset' project.name jobset.name "edit") %]"><i class="icon-edit"></i> Edit</a> - replacement in src/root/jobset.tt at line 169
$.post("[% HTML.escape(c.uri_for('/api/push', { jobsets = project.name _ ':' _ jobset.name, force = "1" })) %]").done(function(data) {if (data.error)bootbox.alert("Unable to schedule the jobset for evaluation: " + data.error);elsebootbox.alert("The jobset has been scheduled for evaluation.");}).fail(function() { bootbox.alert("Server request failed!"); });requestJSON({url: "[% HTML.escape(c.uri_for('/api/push', { jobsets = project.name _ ':' _ jobset.name, force = "1" })) %]",success: function(data) {bootbox.alert("The jobset has been scheduled for evaluation.");}}); - replacement in src/root/jobset.tt at line 176
return;};function deleteJobset() {bootbox.confirm('Are you sure you want to delete this jobset?',function(c) {if (!c) return;redirectJSON({url: "[% c.uri_for(c.controller('Jobset').action_for('jobset'), [project.name, jobset.name]) %]",type: 'DELETE'});}); - replacement in src/root/project.tt at line 12
<li><a href="[% c.uri_for('/project' project.name 'edit') %]"><i class="icon-edit icon-black"></i> Edit configuration</a></li><li><a href="javascript:deleteProject()"><i class="icon-trash icon-black"></i> Delete this project</a></li>[% INCLUDE menuItem uri = c.uri_for(c.controller('Project').action_for('create_jobset'), [project.name]) title = "Create jobset" %][% INCLUDE menuItem uri = c.uri_for('/project' project.name 'create-release') title = "Create release" %][% INCLUDE menuItem title="Edit configuration" icon="icon-edit" uri=c.uri_for(c.controller('Project').action_for('edit'), [project.name]) %][% INCLUDE menuItem title="Delete this project" icon="icon-trash" uri="javascript:deleteProject()" %][% INCLUDE menuItem title="Create jobset" icon="icon-plus" uri=c.uri_for(c.controller('Project').action_for('create_jobset'), [project.name]) %][% INCLUDE menuItem title="Create release" icon="icon-plus" uri=c.uri_for(c.controller('Project').action_for('create_release'), [project.name]) %]