Remove DeleteMenuItem in PageActionMenu

Functionality has been replaced by the page header buttons
pull/8916/head^2
Sage Abdullah 2022-08-03 14:12:48 +07:00 zatwierdzone przez Karl Hobley
rodzic 0cdb9d8915
commit 9df6df5571
1 zmienionych plików z 0 dodań i 16 usunięć

Wyświetl plik

@ -209,21 +209,6 @@ class UnpublishMenuItem(ActionMenuItem):
return reverse("wagtailadmin_pages:unpublish", args=(context["page"].id,))
class DeleteMenuItem(ActionMenuItem):
name = "action-delete"
label = _("Delete")
icon_name = "bin"
classname = "action-secondary"
def is_shown(self, context):
if context["view"] == "edit":
perms_tester = self.get_user_page_permissions_tester(context)
return not perms_tester.page_locked() and perms_tester.can_delete()
def get_url(self, context):
return reverse("wagtailadmin_pages:delete", args=(context["page"].id,))
class SaveDraftMenuItem(ActionMenuItem):
name = "action-save-draft"
label = _("Save Draft")
@ -265,7 +250,6 @@ def _get_base_page_action_menu_items():
if BASE_PAGE_ACTION_MENU_ITEMS is None:
BASE_PAGE_ACTION_MENU_ITEMS = [
SaveDraftMenuItem(order=0),
DeleteMenuItem(order=10),
UnpublishMenuItem(order=20),
PublishMenuItem(order=30),
CancelWorkflowMenuItem(order=40),