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

@ -6,11 +6,11 @@ describe "Admin User Fields", type: :system do
before { sign_in(current_user) }
let(:user_fields_page) { PageObjects::Pages::AdminUserFields.new }
let(:admin_header) { PageObjects::Components::AdminHeader.new }
let(:page_header) { PageObjects::Components::DPageHeader.new }
it "correctly saves user fields" do
user_fields_page.visit
expect(admin_header).to be_visible
expect(page_header).to be_visible
user_fields_page.add_field(name: "Occupation", description: "What you do for work")
expect(user_fields_page).to have_user_field("Occupation")
@ -32,7 +32,7 @@ describe "Admin User Fields", type: :system do
user_fields_page.visit
user_fields_page.click_add_field
expect(admin_header).to be_hidden
expect(page_header).to be_hidden
form = page.find(".user-field")
editable_label = I18n.t("admin_js.admin.user_fields.editable.title")
@ -73,7 +73,7 @@ describe "Admin User Fields", type: :system do
form.find(".user-field-name").fill_in(with: "Favourite Transformer")
expect(admin_header).to be_hidden
expect(page_header).to be_hidden
form.find(".btn-primary").click