mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 09:17:30 +08:00
ab053ac669
Why is this change being made? We've decided that the previous "community" section should look more like a primary section that holds the most important navigation links for the site and the word "community" doesn't quite fit that description. Therefore, we've made the decision to drop the section heading for the community section. As part of removing the section heading, the following changes are made as well: 1. Button to customize the section has been moved to the "footer" of the "More..." section when `navigation_menu` site setting is set to `sidebar`. When `navigation_menu` is set to `header dropdown`, a button to customize the section is shown inline. 2. The section will no longer be collapsable. 3. The title of the section is no longer customisable as it is no longer displayed. As a technical note, we have not dropped any previous customisations of the section's title previously in case we have to bring back the header in the future. 4. The new topic button that was previously present in the header has been removed alongside the header. Admins can add a custom section link to the `/new-topic` route if there would like to make it easier for users to create a new topic in the sidebar.
51 lines
1.3 KiB
Ruby
51 lines
1.3 KiB
Ruby
# frozen_string_literal: true
|
|
|
|
module PageObjects
|
|
module Components
|
|
class SidebarHeaderDropdown < PageObjects::Components::Base
|
|
def click
|
|
page.find(".hamburger-dropdown").click
|
|
wait_for_animation(find(".menu-panel"), timeout: 5)
|
|
self
|
|
end
|
|
|
|
SIDEBAR_HAMBURGER_DROPDOWN = ".sidebar-hamburger-dropdown"
|
|
|
|
def visible?
|
|
page.has_css?(SIDEBAR_HAMBURGER_DROPDOWN)
|
|
end
|
|
|
|
def hidden?
|
|
page.has_no_css?(SIDEBAR_HAMBURGER_DROPDOWN)
|
|
end
|
|
|
|
def has_no_keyboard_shortcuts_button?
|
|
page.has_no_css?(".sidebar-footer-actions-keyboard-shortcuts")
|
|
end
|
|
|
|
def click_categories_header_button
|
|
page.click_button(
|
|
I18n.t("js.sidebar.sections.categories.header_action_title"),
|
|
class: "sidebar-section-header-button",
|
|
)
|
|
end
|
|
|
|
def click_topics_link
|
|
find(".sidebar-section-link[data-link-name='everything']").click
|
|
end
|
|
|
|
def click_toggle_to_desktop_view_button
|
|
page.click_button(
|
|
I18n.t("js.desktop_view"),
|
|
class: "sidebar-footer-actions-toggle-mobile-view",
|
|
)
|
|
end
|
|
|
|
def click_outside
|
|
width = page.evaluate_script("document.body.clientWidth")
|
|
page.find("body").click(x: width - 1, y: 1)
|
|
end
|
|
end
|
|
end
|
|
end
|