mirror of
https://github.com/discourse/discourse.git
synced 2024-12-03 01:43:39 +08:00
94b09f3331
Why this change? The `/admin/customize/themes/:id/schema/name` route is a work in progress but we want to be able to start navigating to it from the `/admin/customize/themes/:id` route. What does this change do? 1. Move `adminCustomizeThemes.schema` to a child route of `adminCustomizeThemes.show`. This is because we need the model from the parent route and if it isn't a child route we end up having to load the theme model again from the server. 1. Add the `objects_schema` attribute to `ThemeSettingsSerializer` 1. Refactor `SiteSettingComponent` to be able to render a button so that we don't have to hardcode the button rendering into the `SiteSettings::String` component
48 lines
1.1 KiB
Ruby
48 lines
1.1 KiB
Ruby
# frozen_string_literal: true
|
|
|
|
module PageObjects
|
|
module Pages
|
|
class AdminCustomizeThemes < PageObjects::Pages::Base
|
|
def has_inactive_themes?
|
|
has_css?(".inactive-indicator")
|
|
end
|
|
|
|
def has_no_inactive_themes?
|
|
has_no_css?(".inactive-indicator")
|
|
end
|
|
|
|
def has_select_inactive_mode_button?
|
|
has_css?(".select-inactive-mode")
|
|
end
|
|
|
|
def click_select_inactive_mode
|
|
find(".select-inactive-mode").click
|
|
end
|
|
|
|
def cancel_select_inactive_mode
|
|
find(".cancel-select-inactive-mode").click
|
|
end
|
|
|
|
def has_inactive_themes_selected?(count:)
|
|
has_css?(".inactive-theme input:checked", count: count)
|
|
end
|
|
|
|
def toggle_all_inactive
|
|
find(".toggle-all-inactive").click
|
|
end
|
|
|
|
def has_disabled_delete_theme_button?
|
|
find_button("Delete", disabled: true)
|
|
end
|
|
|
|
def click_delete_themes_button
|
|
find(".btn-delete").click
|
|
end
|
|
|
|
def click_edit_objects_theme_setting_button(setting_name)
|
|
find(".theme-setting[data-setting=\"#{setting_name}\"] .setting-value-edit-button").click
|
|
end
|
|
end
|
|
end
|
|
end
|