mirror of
https://github.com/discourse/discourse.git
synced 2025-04-03 05:39:41 +08:00
UX: consistent flags page (#29798)
Add/Edit form should not have an admin header
This commit is contained in:
parent
55a074e4c3
commit
04bac33ed9
@ -1 +1,38 @@
|
|||||||
<AdminConfigAreas::Flags />
|
<AdminPageHeader
|
||||||
|
@titleLabel="admin.config_areas.flags.header"
|
||||||
|
@descriptionLabel="admin.config_areas.flags.subheader"
|
||||||
|
@learnMoreUrl="https://meta.discourse.org/t/moderation-flags/325589"
|
||||||
|
@hideTabs={{this.hideTabs}}
|
||||||
|
>
|
||||||
|
<:breadcrumbs>
|
||||||
|
<DBreadcrumbsItem
|
||||||
|
@path="/admin/config/flags"
|
||||||
|
@label={{i18n "admin.config_areas.flags.header"}}
|
||||||
|
/>
|
||||||
|
</:breadcrumbs>
|
||||||
|
<:actions as |actions|>
|
||||||
|
<actions.Primary
|
||||||
|
@route="adminConfig.flags.new"
|
||||||
|
@title="admin.config_areas.flags.add"
|
||||||
|
@label="admin.config_areas.flags.add"
|
||||||
|
@disabled={{this.addFlagButtonDisabled}}
|
||||||
|
class="admin-flags__header-add-flag"
|
||||||
|
/>
|
||||||
|
</:actions>
|
||||||
|
<:tabs>
|
||||||
|
<NavItem
|
||||||
|
@route="adminConfig.flags.settings"
|
||||||
|
@label="settings"
|
||||||
|
class="admin-flags-tabs__settings"
|
||||||
|
/>
|
||||||
|
<NavItem
|
||||||
|
@route="adminConfig.flags.index"
|
||||||
|
@label="admin.config_areas.flags.flags_tab"
|
||||||
|
class="admin-flags-tabs__flags"
|
||||||
|
/>
|
||||||
|
</:tabs>
|
||||||
|
</AdminPageHeader>
|
||||||
|
|
||||||
|
<div class="admin-container admin-config-page__main-area">
|
||||||
|
<AdminConfigAreas::Flags />
|
||||||
|
</div>
|
@ -1,38 +0,0 @@
|
|||||||
<AdminPageHeader
|
|
||||||
@titleLabel="admin.config_areas.flags.header"
|
|
||||||
@descriptionLabel="admin.config_areas.flags.subheader"
|
|
||||||
@learnMoreUrl="https://meta.discourse.org/t/moderation-flags/325589"
|
|
||||||
@hideTabs={{this.hideTabs}}
|
|
||||||
>
|
|
||||||
<:breadcrumbs>
|
|
||||||
<DBreadcrumbsItem
|
|
||||||
@path="/admin/config/flags"
|
|
||||||
@label={{i18n "admin.config_areas.flags.header"}}
|
|
||||||
/>
|
|
||||||
</:breadcrumbs>
|
|
||||||
<:actions as |actions|>
|
|
||||||
<actions.Primary
|
|
||||||
@route="adminConfig.flags.new"
|
|
||||||
@title="admin.config_areas.flags.add"
|
|
||||||
@label="admin.config_areas.flags.add"
|
|
||||||
@disabled={{this.addFlagButtonDisabled}}
|
|
||||||
class="admin-flags__header-add-flag"
|
|
||||||
/>
|
|
||||||
</:actions>
|
|
||||||
<:tabs>
|
|
||||||
<NavItem
|
|
||||||
@route="adminConfig.flags.settings"
|
|
||||||
@label="settings"
|
|
||||||
class="admin-flags-tabs__settings"
|
|
||||||
/>
|
|
||||||
<NavItem
|
|
||||||
@route="adminConfig.flags.index"
|
|
||||||
@label="admin.config_areas.flags.flags_tab"
|
|
||||||
class="admin-flags-tabs__flags"
|
|
||||||
/>
|
|
||||||
</:tabs>
|
|
||||||
</AdminPageHeader>
|
|
||||||
|
|
||||||
<div class="admin-container admin-config-page__main-area">
|
|
||||||
{{outlet}}
|
|
||||||
</div>
|
|
@ -26,7 +26,10 @@ describe "Admin Flags Page", type: :system do
|
|||||||
"Something Else",
|
"Something Else",
|
||||||
)
|
)
|
||||||
|
|
||||||
admin_flags_page.visit.toggle("spam")
|
admin_flags_page.visit
|
||||||
|
expect(page).to have_css(".admin-page-header")
|
||||||
|
|
||||||
|
admin_flags_page.toggle("spam")
|
||||||
topic_page.visit_topic(post.topic).open_flag_topic_modal
|
topic_page.visit_topic(post.topic).open_flag_topic_modal
|
||||||
|
|
||||||
expect(flag_modal).to have_choices("It's Inappropriate", "It's Illegal", "Something Else")
|
expect(flag_modal).to have_choices("It's Inappropriate", "It's Illegal", "Something Else")
|
||||||
@ -78,6 +81,7 @@ describe "Admin Flags Page", type: :system do
|
|||||||
expect(admin_flags_page).to have_add_flag_button_enabled
|
expect(admin_flags_page).to have_add_flag_button_enabled
|
||||||
|
|
||||||
admin_flags_page.click_add_flag
|
admin_flags_page.click_add_flag
|
||||||
|
expect(page).not_to have_css(".admin-page-header")
|
||||||
admin_flag_form_page
|
admin_flag_form_page
|
||||||
.fill_in_name("Vulgar")
|
.fill_in_name("Vulgar")
|
||||||
.fill_in_description("New flag description")
|
.fill_in_description("New flag description")
|
||||||
@ -109,6 +113,7 @@ describe "Admin Flags Page", type: :system do
|
|||||||
|
|
||||||
# update
|
# update
|
||||||
admin_flags_page.visit.click_edit_flag("custom_vulgar")
|
admin_flags_page.visit.click_edit_flag("custom_vulgar")
|
||||||
|
expect(page).not_to have_css(".admin-page-header")
|
||||||
admin_flag_form_page.fill_in_name("Tasteless").click_save
|
admin_flag_form_page.fill_in_name("Tasteless").click_save
|
||||||
|
|
||||||
expect(admin_flags_page).to have_flags(
|
expect(admin_flags_page).to have_flags(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user