FIX: display customised community section button when no secondary links (#22948)
Edit community section button is hidden in secondary/more section. However, when there are no secondary links, then more section is not shown. In that case, we should still display an edit button for admins, so they can edit the section.
This commit is contained in:
parent
135e88cb12
commit
fbabea5c76
|
@ -82,5 +82,11 @@
|
|||
@moreButtonIcon={{this.section.moreSectionButtonIcon}}
|
||||
/>
|
||||
{{/if}}
|
||||
{{else if this.section.moreSectionButtonAction}}
|
||||
<Sidebar::SectionLinkButton
|
||||
@action={{this.section.moreSectionButtonAction}}
|
||||
@icon={{this.section.moreSectionButtonIcon}}
|
||||
@text={{this.section.moreSectionButtonText}}
|
||||
/>
|
||||
{{/if}}
|
||||
</Sidebar::Section>
|
|
@ -53,6 +53,23 @@ RSpec.describe "Editing Sidebar Community Section", type: :system do
|
|||
)
|
||||
end
|
||||
|
||||
it "allows admin to edit community section when no secondary section links" do
|
||||
SidebarSection
|
||||
.where(title: "Community")
|
||||
.first
|
||||
.sidebar_section_links
|
||||
.where.not(position: 0)
|
||||
.destroy_all
|
||||
|
||||
sign_in(admin)
|
||||
|
||||
visit("/latest")
|
||||
|
||||
modal = sidebar.click_customize_community_section_button
|
||||
|
||||
expect(modal).to be_visible
|
||||
end
|
||||
|
||||
it "should allow admins to open modal to edit the section when `navigation_menu` site setting is `header dropdown`" do
|
||||
SiteSetting.navigation_menu = "header dropdown"
|
||||
|
||||
|
|
Loading…
Reference in New Issue