mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
bug 12266
- Show 'delete' instead of 'create' in dialog - Select domain's parent upon deletion, for UI consistency
This commit is contained in:
parent
fdb21b5521
commit
e7c4bc48fd
@ -28,6 +28,7 @@
|
|||||||
|
|
||||||
createForm: {
|
createForm: {
|
||||||
title: 'Delete domain',
|
title: 'Delete domain',
|
||||||
|
createLabel: 'Delete',
|
||||||
preFilter: function(args) {
|
preFilter: function(args) {
|
||||||
if(isAdmin()) {
|
if(isAdmin()) {
|
||||||
args.$form.find('.form-item[rel=isForced]').css('display', 'inline-block');
|
args.$form.find('.form-item[rel=isForced]').css('display', 'inline-block');
|
||||||
@ -58,6 +59,12 @@
|
|||||||
{jobId: jid}
|
{jobId: jid}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Quick fix for proper UI reaction to delete domain
|
||||||
|
var $item = $('.name.selected').closest('li');
|
||||||
|
var $itemParent = $item.closest('li');
|
||||||
|
$itemParent.parent().parent().find('.name:first').click();
|
||||||
|
$item.remove();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -332,12 +339,12 @@
|
|||||||
var allowedActions = [];
|
var allowedActions = [];
|
||||||
if(isAdmin()) {
|
if(isAdmin()) {
|
||||||
allowedActions.push("create");
|
allowedActions.push("create");
|
||||||
if(jsonObj.id != 1) { //"ROOT" domain is not allowed to edit or delete
|
if(jsonObj.id != 1) { //"ROOT" domain is not allowed to edit or delete
|
||||||
allowedActions.push("edit"); //merge updateResourceCount into edit
|
allowedActions.push("edit"); //merge updateResourceCount into edit
|
||||||
allowedActions.push("delete");
|
allowedActions.push("delete");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//allowedActions.push("updateResourceCount");
|
//allowedActions.push("updateResourceCount");
|
||||||
return allowedActions;
|
return allowedActions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -21,6 +21,7 @@
|
|||||||
var $formContainer = $('<div>').addClass('form-container');
|
var $formContainer = $('<div>').addClass('form-container');
|
||||||
var $message = $('<span>').addClass('message').appendTo($formContainer).html(args.form.desc);
|
var $message = $('<span>').addClass('message').appendTo($formContainer).html(args.form.desc);
|
||||||
var $form = $('<form>').appendTo($formContainer);
|
var $form = $('<form>').appendTo($formContainer);
|
||||||
|
var createLabel = args.form.createLabel;
|
||||||
|
|
||||||
// Render fields and events
|
// Render fields and events
|
||||||
$.each(args.form.fields, function(key, field) {
|
$.each(args.form.fields, function(key, field) {
|
||||||
@ -297,7 +298,7 @@
|
|||||||
},
|
},
|
||||||
buttons: [
|
buttons: [
|
||||||
{
|
{
|
||||||
text: 'Create',
|
text: createLabel ? createLabel : 'Create',
|
||||||
'class': 'ok',
|
'class': 'ok',
|
||||||
click: function() {
|
click: function() {
|
||||||
if (!complete($formContainer)) { return false; }
|
if (!complete($formContainer)) { return false; }
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user