DEV: Remove OpenComposer mixin and refactor related logic (#23015)

The OpenComposer mixin comes from a time before we had a composer service. As well as being a general cleanup/refactor, this commit aims to removes interlinking between composer APIs and the discovery-related controllers which are being removed as part of #22622.

In summary, this commit:
- Removes OpenComposer mixin
- Adds and updates composer service APIs to support everything that `openComposer` did
- Updates consumers to call the composer service directly, instead of relying on the mixin (either directly, or via a route-action which bubbled up to some parent)
- Deprecates composer-related methods on `DiscourseRoute` and on the application route
This commit is contained in:
David Taylor
2023-08-11 09:53:44 +01:00
committed by GitHub
parent 31626ce85d
commit 6de4b3ac3f
28 changed files with 253 additions and 293 deletions

View File

@ -41,13 +41,9 @@ describe "Default to Subcategory when parent Category doesn't allow posting", ty
end
end
describe "Category does not have subcategory" do
it "should have the 'New Topic' button enabled and default Subcategory set to latest default subcategory" do
it "should have the 'New Topic' button disabled" do
category_page.visit(category_with_no_subcategory)
expect(category_page).to have_button("New Topic", disabled: false)
category_page.new_topic_button.click
select_kit =
PageObjects::Components::SelectKit.new("#reply-control.open .category-chooser")
expect(select_kit).to have_selected_value(default_latest_category.id)
expect(category_page).to have_button("New Topic", disabled: true)
end
end
end
@ -70,13 +66,9 @@ describe "Default to Subcategory when parent Category doesn't allow posting", ty
end
describe "Can't post on parent category" do
describe "Category does not have subcategory" do
it "should have the 'New Topic' button enabled and default Subcategory not set" do
it "should have the 'New Topic' button disabled" do
category_page.visit(category_with_no_subcategory)
expect(category_page).to have_button("New Topic", disabled: false)
category_page.new_topic_button.click
select_kit =
PageObjects::Components::SelectKit.new("#reply-control.open .category-chooser")
expect(select_kit).to have_selected_name("category…")
expect(category_page).to have_button("New Topic", disabled: true)
end
end
end