From a8b5d69be046fd89a7a705f812d0dbca2d683e2d Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Wed, 19 Jun 2019 11:57:07 +0200 Subject: [PATCH] Fix confirmation for permissions dialog --- .../content/content.rights.controller.js | 33 ++++++++++++++----- .../src/views/content/rights.html | 18 ---------- 2 files changed, 24 insertions(+), 27 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/content/content.rights.controller.js b/src/Umbraco.Web.UI.Client/src/views/content/content.rights.controller.js index a8f87ce2c9..60a8694eca 100644 --- a/src/Umbraco.Web.UI.Client/src/views/content/content.rights.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/content/content.rights.controller.js @@ -1,7 +1,7 @@ (function () { "use strict"; - function ContentRightsController($scope, $timeout, contentResource, localizationService, angularHelper, navigationService) { + function ContentRightsController($scope, $timeout, contentResource, localizationService, angularHelper, navigationService, overlayService) { var vm = this; var currentForm; @@ -11,7 +11,6 @@ vm.removedUserGroups = []; vm.viewState = "manageGroups"; vm.labels = {}; - vm.showNotification = false; vm.setViewSate = setViewSate; vm.editPermissions = editPermissions; @@ -20,7 +19,6 @@ vm.removePermissions = removePermissions; vm.cancelManagePermissions = cancelManagePermissions; vm.closeDialog = closeDialog; - vm.stay = stay; vm.discardChanges = discardChanges; function onInit() { @@ -164,14 +162,31 @@ }); } - function stay() { - vm.showNotification = false; - } - function closeDialog() { // check if form has been changed. If it has show discard changes notification if (currentForm && currentForm.$dirty) { - vm.showNotification = true; + localizationService.localizeMany(["prompt_unsavedChanges", "prompt_unsavedChangesWarning", "prompt_discardChanges", "prompt_stay"]).then( + function(values) { + var overlay = { + "view": "default", + "title": values[0], + "content": values[1], + "disableBackdropClick": true, + "disableEscKey": true, + "submitButtonLabel": values[2], + "closeButtonLabel": values[3], + submit: function () { + overlayService.close(); + navigationService.hideDialog(); + }, + close: function () { + overlayService.close(); + } + }; + + overlayService.open(overlay); + } + ); } else { navigationService.hideDialog(); } @@ -187,4 +202,4 @@ angular.module("umbraco").controller("Umbraco.Editors.Content.RightsController", ContentRightsController); -})(); \ No newline at end of file +})(); diff --git a/src/Umbraco.Web.UI.Client/src/views/content/rights.html b/src/Umbraco.Web.UI.Client/src/views/content/rights.html index 292db6f105..f430aad342 100644 --- a/src/Umbraco.Web.UI.Client/src/views/content/rights.html +++ b/src/Umbraco.Web.UI.Client/src/views/content/rights.html @@ -62,24 +62,6 @@ -
-
-

-

- - - - -
-
-