mirror of
https://github.com/discourse/discourse.git
synced 2025-05-25 00:32:52 +08:00
DEV: Refactor the Automation Plugin UI to match admin UI guidelines (#31060)
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.
This commit is contained in:
@ -4,7 +4,7 @@ module PageObjects
|
||||
module Pages
|
||||
class Automation < PageObjects::Pages::Base
|
||||
def visit(automation)
|
||||
super("/admin/plugins/discourse-automation/#{automation.id}")
|
||||
super("/admin/plugins/automation/automation/#{automation.id}")
|
||||
self
|
||||
end
|
||||
|
||||
@ -34,7 +34,7 @@ module PageObjects
|
||||
end
|
||||
|
||||
def form
|
||||
@form ||= find(".discourse-automation-form.edit")
|
||||
@form ||= find(".discourse-automation-edit")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -4,7 +4,7 @@ module PageObjects
|
||||
module Pages
|
||||
class NewAutomation < PageObjects::Pages::Base
|
||||
def visit
|
||||
super("/admin/plugins/discourse-automation/new")
|
||||
super("/admin/plugins/automation/automation/new")
|
||||
self
|
||||
end
|
||||
|
||||
|
@ -21,7 +21,10 @@ describe "DiscourseAutomation | smoke test", type: :system do
|
||||
after { DiscourseAutomation::Scriptable.remove("test") }
|
||||
|
||||
it "populate correctly" do
|
||||
visit("/admin/plugins/discourse-automation")
|
||||
visit("/admin/plugins/automation")
|
||||
|
||||
find(".admin-config-area-empty-list__cta-button").click
|
||||
|
||||
find(".admin-section-landing__header-filter").set("test")
|
||||
find(".admin-section-landing-item__content", match: :first).click
|
||||
fill_in("automation-name", with: "aaaaa")
|
||||
@ -34,7 +37,9 @@ describe "DiscourseAutomation | smoke test", type: :system do
|
||||
end
|
||||
|
||||
it "works" do
|
||||
visit("/admin/plugins/discourse-automation")
|
||||
visit("/admin/plugins/automation")
|
||||
|
||||
find(".admin-config-area-empty-list__cta-button").click
|
||||
|
||||
find(".admin-section-landing__header-filter").set("user group membership through badge")
|
||||
find(".admin-section-landing-item__content", match: :first).click
|
||||
@ -51,6 +56,6 @@ describe "DiscourseAutomation | smoke test", type: :system do
|
||||
find(".automation-enabled input").click
|
||||
find(".update-automation").click
|
||||
|
||||
expect(page).to have_css('[role="button"]', text: "aaaaa")
|
||||
expect(page).to have_css(".automations__name", text: "aaaaa")
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user