Skip to content

Commit

Permalink
will not allow to delete running execution, if there is an action in …
Browse files Browse the repository at this point in the history
…collection that's no longer there it will handle it
  • Loading branch information
dmolchanenko committed Sep 8, 2013
1 parent f9a2fc6 commit db18dac
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions public/controller/Executions.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,10 @@ Ext.define("Redwood.controller.Executions", {
onExecutionDelete: function(record){
var foundTab = this.tabPanel.down("#"+record.get("_id"));
if(record) {
if (record.get("status") == "Running"){
Ext.Msg.alert('Error', "Unable to delete running execution.");
return;
}
Ext.Msg.show({
title:'Delete Confirmation',
msg: "Are you sure you want to delete '"+ record.get("name") + "' execution?" ,
Expand Down
8 changes: 4 additions & 4 deletions public/view/ActionCollection.js
Original file line number Diff line number Diff line change
Expand Up @@ -970,14 +970,14 @@ Ext.define('Redwood.view.ActionCollection', {
collection.forEach(function(action,index){
var foundAction = actionStore.query("_id",action.actionid).getAt(0);

/*

//this means that there is no action like that any more
//reorder the rest of the actions and ignore this one
if (foundAction == null){
orderAdjustment = orderAdjustment - 1;
return;
}
*/

var newAction = {};
newAction.actionname = foundAction.get("name");
newAction.actionid = foundAction.get("_id");
Expand All @@ -987,9 +987,9 @@ Ext.define('Redwood.view.ActionCollection', {
newAction.executionflow = action.executionflow;
newAction.returnvalue = action.returnvalue;
newAction.children = [];
newAction.order = index+1;
newAction.order = index+1+orderAdjustment;
//newAction.order = (parseInt(action.order,10) + orderAdjustment).toString(10);
newAction.rowOrder = index + index;
newAction.rowOrder = (index+orderAdjustment) * 2;
//newAction.rowOrder = parseInt(newAction.order,10) + (parseInt(newAction.order,10) - 1);

foundAction.get("params").forEach(function(searchParam){
Expand Down

0 comments on commit db18dac

Please sign in to comment.