Skip to content

A platform for community discussion. Free, open, simple.

FIX: Update optionalRequire paths after admin directory move (#35551)

Kris27d5fdad8d03
diff --git a/frontend/discourse/app/components/reviewable-item.gjs b/frontend/discourse/app/components/reviewable-item.gjs
index a4a13ee9b92..bf0413f5f81 100644
--- a/frontend/discourse/app/components/reviewable-item.gjs
+++ b/frontend/discourse/app/components/reviewable-item.gjs
@@ -252,7 +252,7 @@ export default class ReviewableItem extends Component {
}
get IpLookupComponent() {
- return optionalRequire("admin/components/ip-lookup");
+ return optionalRequire("discourse/admin/components/ip-lookup");
}
@bind
diff --git a/frontend/discourse/app/controllers/tags/index.js b/frontend/discourse/app/controllers/tags/index.js
index 33c7e4f04c9..635080ed985 100644
--- a/frontend/discourse/app/controllers/tags/index.js
+++ b/frontend/discourse/app/controllers/tags/index.js
@@ -26,7 +26,7 @@ export default class TagsIndexController extends Controller {
}
get TagsAdminDropdownComponent() {
- return optionalRequire("admin/components/tags-admin-dropdown");
+ return optionalRequire("discourse/admin/components/tags-admin-dropdown");
}
@discourseComputed("groupedByCategory", "groupedByTagGroup")
diff --git a/spec/system/tags_index_spec.rb b/spec/system/tags_index_spec.rb
new file mode 100644
index 00000000000..b7f98258926
--- /dev/null
+++ b/spec/system/tags_index_spec.rb
@@ -0,0 +1,25 @@
+# frozen_string_literal: true
+
+describe "Tags index page", type: :system do
+ fab!(:admin)
+ fab!(:user)
+
+ context "when visiting as a staff user" do
+ it "shows the admin dropdown" do
+ sign_in(admin)
+ visit("/tags")
+
+ expect(page).to have_css(".tags-admin-dropdown")
+ end
+ end
+
+ context "when visiting as a regular user" do
+ it "does not show the admin dropdown" do
+ sign_in(user)
+ visit("/tags")
+
+ expect(page).to have_css(".tags-index")
+ expect(page).to have_no_css(".tags-admin-dropdown")
+ end
+ end
+end