Update delete confirmations

This commit is contained in:
Ronald Barendse
2021-07-07 10:48:09 +02:00
parent 48ba4f3875
commit 1fea66990d
2 changed files with 25 additions and 66 deletions

View File

@@ -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);
});
});
};

View File

@@ -1754,12 +1754,8 @@ To manage your website, simply open the Umbraco backoffice and start adding cont
<key alias="propertyHasChanges">You have made changes to this property. Are you sure you want to discard them?</key>
<key alias="displaySettingsHeadline">Appearance</key>
<key alias="displaySettingsLabelOnTop">Label above (full-width)</key>
<key alias="removeTabPromptTitle">Remove the tab "%0%?"</key>
<key alias="removeTabPromptContent">Are you sure you want to remove "%0%" and all groups and properties underneath?</key>
<key alias="removeGroupPromptTitle">Remove the group "%0%?"</key>
<key alias="removeGroupPromptContent">Are you sure you want to remove "%0%" and all properties underneath?</key>
<key alias="removePropertyPromptTitle">Remove the property "%0%"?</key>
<key alias="removePropertyPromptContent">Are you sure you want to remove "%0%"?</key>
<key alias="confirmDeleteTabNotice">This will also delete all items below this tab.</key>
<key alias="confirmDeleteGroupNotice">This will also delete all items below this group.</key>
</area>
<area alias="languages">
<key alias="addLanguage">Add language</key>