From 994698d76c96207353ad75901a7eafedef547401 Mon Sep 17 00:00:00 2001 From: Sage Abdullah Date: Thu, 22 Jun 2023 10:51:02 +0100 Subject: [PATCH] Do not use FieldRowPanel for scheduled publishing fields To prevent inconsistent layout if only one of the fields has an error --- client/scss/components/forms/_publishing.scss | 5 ---- wagtail/admin/panels/publishing_panel.py | 28 ++++++++----------- 2 files changed, 12 insertions(+), 21 deletions(-) diff --git a/client/scss/components/forms/_publishing.scss b/client/scss/components/forms/_publishing.scss index 2cf3ac454a..52948dfeb4 100644 --- a/client/scss/components/forms/_publishing.scss +++ b/client/scss/components/forms/_publishing.scss @@ -1,10 +1,5 @@ // Styles for the fields in the scheduled publishing dialog .w-dialog.publishing { - .w-panel__wrapper { - margin-top: theme('spacing.2'); - margin-bottom: theme('spacing.2'); - } - .w-field--date_time_field input { width: 100%; } diff --git a/wagtail/admin/panels/publishing_panel.py b/wagtail/admin/panels/publishing_panel.py index 3e291d377c..4a94d4de84 100644 --- a/wagtail/admin/panels/publishing_panel.py +++ b/wagtail/admin/panels/publishing_panel.py @@ -5,7 +5,7 @@ from wagtail.admin.widgets.datetime import AdminDateTimeInput from wagtail.models import Page from .field_panel import FieldPanel -from .group import FieldRowPanel, MultiFieldPanel +from .group import MultiFieldPanel # This allows users to include the publishing panel in their own per-model override @@ -16,21 +16,17 @@ class PublishingPanel(MultiFieldPanel): js_overlay_parent_selector = "#schedule-publishing-dialog" updated_kwargs = { "children": [ - FieldRowPanel( - [ - FieldPanel( - "go_live_at", - widget=AdminDateTimeInput( - js_overlay_parent_selector=js_overlay_parent_selector, - ), - ), - FieldPanel( - "expire_at", - widget=AdminDateTimeInput( - js_overlay_parent_selector=js_overlay_parent_selector, - ), - ), - ], + FieldPanel( + "go_live_at", + widget=AdminDateTimeInput( + js_overlay_parent_selector=js_overlay_parent_selector, + ), + ), + FieldPanel( + "expire_at", + widget=AdminDateTimeInput( + js_overlay_parent_selector=js_overlay_parent_selector, + ), ), ], "classname": "publishing",