mirror of
https://github.com/discourse/discourse.git
synced 2025-02-08 12:24:55 +00:00
9f78ff5572
Allow admins to edit Community section. This includes drag and drop reorder, change names, delete and reset to default. Visual improvements introduced in edit community section modal are available in edit custom section form as well. For example: - drag and drop links to change their position; - smaller icon picker.
62 lines
1.3 KiB
Ruby
62 lines
1.3 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)
|
|
fill_in "link-name", with: name, match: :first
|
|
fill_in "link-url", with: url, match: :first
|
|
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
|
|
end
|
|
|
|
def save
|
|
find("#save-section").click
|
|
end
|
|
|
|
def visible?
|
|
page.has_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 everything_link
|
|
find(".draggable[data-link-name='Everything']")
|
|
end
|
|
|
|
def review_link
|
|
find(".draggable[data-link-name='Review']")
|
|
end
|
|
end
|
|
end
|
|
end
|