removes legacy disable user menu item and uses the new/normal way of dealing with menu items.
This commit is contained in:
@@ -190,20 +190,6 @@ Umbraco.Sys.registerNamespace("Umbraco.Application");
|
||||
var actions = {
|
||||
openDashboard : function(section){
|
||||
navService.changeSection(section);
|
||||
},
|
||||
actionDisable: function () {
|
||||
localizationService.localize("defaultdialogs_confirmdisable").then(function (txtConfirmDisable) {
|
||||
var currentMenuNode = UmbClientMgr.mainTree().getActionNode();
|
||||
if (currentMenuNode) {
|
||||
if (confirm(txtConfirmDisable + ' "' + UmbClientMgr.mainTree().getActionNode().nodeName + '"?\n\n')) {
|
||||
angularHelper.safeApply($rootScope, function () {
|
||||
userResource.disableUser(currentMenuNode.nodeId).then(function () {
|
||||
UmbClientMgr.mainTree().syncTree("-1," + currentMenuNode.nodeId, true);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -8,10 +8,21 @@
|
||||
* @description
|
||||
* Defines the methods that are called when menu items declare only an action to execute
|
||||
*/
|
||||
function umbracoMenuActions($q, treeService, $location, navigationService, appState) {
|
||||
function umbracoMenuActions($q, treeService, $location, navigationService, appState, localizationService, userResource) {
|
||||
|
||||
return {
|
||||
|
||||
"DisableUser": function(args) {
|
||||
localizationService.localize("defaultdialogs_confirmdisable").then(function (txtConfirmDisable) {
|
||||
var currentMenuNode = UmbClientMgr.mainTree().getActionNode();
|
||||
if (confirm(txtConfirmDisable + ' "' + args.entity.name + '"?\n\n')) {
|
||||
userResource.disableUser(args.entity.id).then(function () {
|
||||
navigationService.syncTree({ tree: args.treeAlias, path: [args.entity.parentId, args.entity.id], forceReload: true });
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* @ngdoc method
|
||||
* @name umbraco.services.umbracoMenuActions#RefreshNode
|
||||
|
||||
Reference in New Issue
Block a user