mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-27 06:56:35 +08:00
This change updates the Automation plugin to make use of the `use_new_show_route` plugin flag, as well as generally updating the UI to match current admin UI guidelines. Notable changes include: - Moving template/router/controller files to make use of the `admin.adminPlugins.show` route. - Changing the URIs from `/admin/plugins/discourse-automation` to `/admin/plugins/automation`, to match the `PLUGIN_NAME`. - Adding UI wrappers around the New/Edit forms, and polishing the list of defined automations.
41 lines
919 B
Ruby
Vendored
41 lines
919 B
Ruby
Vendored
# frozen_string_literal: true
|
|
|
|
module PageObjects
|
|
module Pages
|
|
class Automation < PageObjects::Pages::Base
|
|
def visit(automation)
|
|
super("/admin/plugins/automation/automation/#{automation.id}")
|
|
self
|
|
end
|
|
|
|
def set_name(name)
|
|
form.find('input[name="automation-name"]').set("aaaaa")
|
|
self
|
|
end
|
|
|
|
def has_error?(message)
|
|
form.has_content?(message)
|
|
end
|
|
|
|
def has_name?(name)
|
|
form.find_field("automation-name", with: name)
|
|
end
|
|
|
|
def set_triggerables(triggerable)
|
|
select_kit = PageObjects::Components::SelectKit.new(".triggerables")
|
|
select_kit.expand
|
|
select_kit.select_row_by_value(triggerable)
|
|
self
|
|
end
|
|
|
|
def update
|
|
form.find(".update-automation").click
|
|
self
|
|
end
|
|
|
|
def form
|
|
@form ||= find(".discourse-automation-edit")
|
|
end
|
|
end
|
|
end
|
|
end
|