discourse/spec/system/page_objects/modals/sidebar_section_form.rb
Alan Guo Xiang Tan ab053ac669
UX: Remove section heading for community section (#22405)
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.
2023-07-11 09:40:37 +08:00

73 lines
1.6 KiB
Ruby

# frozen_string_literal: true
module PageObjects
module Modals
class SidebarSectionForm < PageObjects::Modals::Base
def fill_name(name)
fill_in "section-name", with: name
end
def fill_link(name, url, icon = "link")
fill_in "link-name", with: name, match: :first
fill_in "link-url", with: url, match: :first
find(".sidebar-section-form-link .select-kit summary", match: :first).click
fill_in "filter-input-search", with: icon, match: :first
find(".select-kit-row.is-highlighted", match: :first).click
end
def mark_as_public
find(".modal .mark-public").click
end
def remove_last_link
all(".delete-link").last.click
end
def delete
find("#delete-section").click
end
def confirm_delete
find(".dialog-container .btn-primary").click
end
def reset
find(".reset-link").click
find(".dialog-footer .btn-primary").click
closed?
self
end
def save
find("#save-section").click
closed?
self
end
def visible?
page.has_css?(".sidebar-section-form-modal")
end
def closed?
page.has_no_css?(".sidebar-section-form-modal")
end
def has_disabled_save?
find_button("Save", disabled: true)
end
def has_enabled_save?
find_button("Save", disabled: false)
end
def topics_link
find(".draggable[data-link-name='Topics']")
end
def review_link
find(".draggable[data-link-name='Review']")
end
end
end
end