DEV: Introduce <DPageHeader /> and <DPageSubheader /> components (#30146)

This converts the `<AdminPageHeader />` component and the
`<AdminPageSubheader />` components into new components
that can be used outside of admin, and updates the CSS classes.
Also introduces a `<DPageActionButton />` component and child
components for the header action buttons.

I have to keep the old admin-only components around for
now until plugins are updated, then we can remove it,
and remove the re-exports that are done within
admin-page-action-button.gjs
This commit is contained in:
Martin Brennan
2024-12-18 08:13:39 +10:00
committed by GitHub
parent ef754cdd9a
commit a879bcdc35
41 changed files with 789 additions and 489 deletions

View File

@ -8,7 +8,7 @@ describe "Admin Flags Page", type: :system do
let(:admin_flags_page) { PageObjects::Pages::AdminFlags.new }
let(:admin_flag_form_page) { PageObjects::Pages::AdminFlagForm.new }
let(:flag_modal) { PageObjects::Modals::Flag.new }
let(:admin_header) { PageObjects::Components::AdminHeader.new }
let(:d_page_header) { PageObjects::Components::DPageHeader.new }
before do
sign_in(admin)
@ -27,7 +27,7 @@ describe "Admin Flags Page", type: :system do
)
admin_flags_page.visit
expect(admin_header).to be_visible
expect(d_page_header).to be_visible
admin_flags_page.toggle("spam")
topic_page.visit_topic(post.topic).open_flag_topic_modal
@ -81,8 +81,7 @@ describe "Admin Flags Page", type: :system do
expect(admin_flags_page).to have_add_flag_button_enabled
admin_flags_page.click_add_flag
expect(admin_header).to be_hidden
expect(d_page_header).to be_hidden
admin_flag_form_page
.fill_in_name("Vulgar")
@ -115,7 +114,7 @@ describe "Admin Flags Page", type: :system do
# update
admin_flags_page.visit.click_edit_flag("custom_vulgar")
expect(admin_header).to be_hidden
expect(d_page_header).to be_hidden
admin_flag_form_page.fill_in_name("Tasteless").click_save
expect(admin_flags_page).to have_flags(
@ -158,7 +157,7 @@ describe "Admin Flags Page", type: :system do
it "has settings tab" do
admin_flags_page.visit
expect(admin_header).to have_tabs(
expect(d_page_header).to have_tabs(
[I18n.t("admin_js.settings"), I18n.t("admin_js.admin.config_areas.flags.flags_tab")],
)