diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/umbgroupsbuilder.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/umbgroupsbuilder.directive.js index b14c6d3bf5..67d619d966 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/umbgroupsbuilder.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/umbgroupsbuilder.directive.js @@ -425,39 +425,28 @@ }; scope.removeTab = function (tab, indexInTabs) { - $q.all([ - localizationService.localize('contentTypeEditor_removeTabPromptTitle', [tab.name]), - localizationService.localize('contentTypeEditor_removeTabPromptContent', [tab.name]) - ]).then((localizations) => { - - const confirm = { - title: localizations[0], - view: "default", - content: localizations[1], - submitButtonLabelKey: "general_remove", - submitButtonStyle: "danger", - closeButtonLabelKey: "general_cancel", + localizationService.localizeMany(['general_delete', 'defaultdialogs_confirmdelete', 'contentTypeEditor_confirmDeleteTabNotice']).then(function (data) { + overlayService.confirmDelete({ + title: data[0] + ' tab', + content: data[1] + ' "' + tab.name + '"?', + confirmMessage: data[2], + submitButtonLabelKey: 'contentTypeEditor_yesDelete', submit: function () { scope.model.groups.splice(tab.indexInGroups, 1); - + // remove all child groups scope.model.groups = scope.model.groups.filter(group => group.parentKey !== tab.key); - + // we need a timeout because the filter hasn't updated the tabs collection $timeout(() => { scope.openTabKey = indexInTabs > 0 ? scope.tabs[indexInTabs - 1].key : scope.tabs[0].key; }); - + scope.$broadcast('umbOverflowChecker.checkOverflow'); - overlayService.close(); - }, - close: function () { overlayService.close(); } - }; - - overlayService.open(confirm); + }); }); }; @@ -581,31 +570,19 @@ }; scope.removeGroup = function (selectedGroup) { - $q.all([ - localizationService.localize('contentTypeEditor_removeGroupPromptTitle', [selectedGroup.name]), - localizationService.localize('contentTypeEditor_removeGroupPromptContent', [selectedGroup.name]) - ]).then((localizations) => { - - const confirm = { - title: localizations[0], - view: "default", - content: localizations[1], - submitButtonLabelKey: "general_remove", - submitButtonStyle: "danger", - closeButtonLabelKey: "general_cancel", + localizationService.localizeMany(['general_delete', 'defaultdialogs_confirmdelete', 'contentTypeEditor_confirmDeleteGroupNotice']).then(function (data) { + overlayService.confirmDelete({ + title: data[0] + ' group', + content: data[1] + ' "' + selectedGroup.name + '"?', + confirmMessage: data[2], + submitButtonLabelKey: 'contentTypeEditor_yesDelete', submit: function () { - const index = scope.model.groups.findIndex(group => group.key === selectedGroup.key); scope.model.groups.splice(index, 1); - overlayService.close(); - }, - close: function () { overlayService.close(); } - }; - - overlayService.open(confirm); + }); }); }; @@ -768,33 +745,19 @@ }; scope.deleteProperty = function (properties, { id, label }) { - - $q.all([ - localizationService.localize('contentTypeEditor_removePropertyPromptTitle', [label]), - localizationService.localize('contentTypeEditor_removePropertyPromptContent', [label]) - ]).then((localizations) => { - - const confirm = { - title: localizations[0], - view: "default", - content: localizations[1], - submitButtonLabelKey: "general_remove", - submitButtonStyle: "danger", - closeButtonLabelKey: "general_cancel", + localizationService.localizeMany(['general_delete', 'defaultdialogs_confirmdelete']).then(function (data) { + overlayService.confirmDelete({ + title: data[0] + ' property', + content: data[1] + ' "' + label + '"?', + submitButtonLabelKey: 'contentTypeEditor_yesDelete', submit: function () { - const index = properties.findIndex(property => property.id === id); properties.splice(index, 1); notifyChanged(); - overlayService.close(); - }, - close: function () { overlayService.close(); } - }; - - overlayService.open(confirm); + }); }); }; diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml index 6d6ba0cec3..8039ef01a9 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml @@ -1754,12 +1754,8 @@ To manage your website, simply open the Umbraco backoffice and start adding cont You have made changes to this property. Are you sure you want to discard them? Appearance Label above (full-width) - Remove the tab "%0%?" - Are you sure you want to remove "%0%" and all groups and properties underneath? - Remove the group "%0%?" - Are you sure you want to remove "%0%" and all properties underneath? - Remove the property "%0%"? - Are you sure you want to remove "%0%"? + This will also delete all items below this tab. + This will also delete all items below this group. Add language