UX: the ability to hide the admin header (#30175)

Some pages like new/edit item should not display admin header. New attribute called `@shouldDisplay` was added.

As a proof of concept, the flags page was updated.
This commit is contained in:
Krzysztof Kotlarek
2024-12-10 11:59:47 +11:00
committed by GitHub
parent d69edab611
commit 51a5fa036a
8 changed files with 183 additions and 133 deletions

View File

@ -27,7 +27,7 @@ describe "Admin Flags Page", type: :system do
)
admin_flags_page.visit
expect(page).to have_css(".admin-page-header")
expect(admin_header).to be_visible
admin_flags_page.toggle("spam")
topic_page.visit_topic(post.topic).open_flag_topic_modal
@ -81,7 +81,9 @@ describe "Admin Flags Page", type: :system do
expect(admin_flags_page).to have_add_flag_button_enabled
admin_flags_page.click_add_flag
expect(page).not_to have_css(".admin-page-header")
expect(admin_header).to be_hidden
admin_flag_form_page
.fill_in_name("Vulgar")
.fill_in_description("New flag description")
@ -113,7 +115,7 @@ describe "Admin Flags Page", type: :system do
# update
admin_flags_page.visit.click_edit_flag("custom_vulgar")
expect(page).not_to have_css(".admin-page-header")
expect(admin_header).to be_hidden
admin_flag_form_page.fill_in_name("Tasteless").click_save
expect(admin_flags_page).to have_flags(