delete account, delete network offeirng, delete guest network - use 'remove' instead of 'destroy' since their definitions have been switched. [reviewed-by: Brian]

This commit is contained in:
Jessica Wang 2012-03-01 16:58:57 -08:00
parent 2608e30d39
commit 0441508e19
3 changed files with 8 additions and 12 deletions

View File

@ -436,7 +436,7 @@
}
},
destroy: {
remove: {
label: 'label.action.delete.account',
messages: {
confirm: function(args) {
@ -1006,7 +1006,7 @@
else if(jsonObj.state == "disabled" || jsonObj.state == "locked") {
allowedActions.push("enable");
}
allowedActions.push("destroy");
allowedActions.push("remove");
}
}
allowedActions.push("updateResourceCount");

View File

@ -1489,7 +1489,7 @@
}
},
destroy: {
remove: {
label: 'Remove network offering',
action: function(args) {
$.ajax({
@ -1662,7 +1662,7 @@
allowedActions.push("enable");
if(jsonObj.isdefault == false)
allowedActions.push("destroy");
allowedActions.push("remove");
return allowedActions;
};

View File

@ -495,7 +495,7 @@
}
},
destroy: {
remove: {
label: 'label.action.delete.network',
messages: {
confirm: function(args) {
@ -514,10 +514,7 @@
var jid = json.deletenetworkresponse.jobid;
args.response.success(
{_custom:
{jobId: jid,
getUpdatedItem: function(json) {
return { state: 'Destroyed' }; //nothing in this network needs to be updated, in fact, this whole template has being deleted
}
{jobId: jid
}
}
);
@ -2912,9 +2909,8 @@
var jsonObj = args.context.item;
var allowedActions = [];
if (jsonObj.state == 'Destroyed')
return [];
allowedActions.push('remove');
if (jsonObj.type == 'Shared' ||
!$.grep(jsonObj.service, function(service) {
return service.name == 'SourceNat';