From 27d5fdad8d03d379ab604a795d6f40b8d6c626f5 Mon Sep 17 00:00:00 2001 From: Kris Date: Wed, 22 Oct 2025 12:49:54 -0400 Subject: [PATCH] FIX: Update optionalRequire paths after admin directory move (#35551) Looks like the admin directory move (#35322) caused a couple issues with optionalRequire paths, this updates the paths to get the tag admin dropdown and review queue IP lookup working again. --- .../app/components/reviewable-item.gjs | 2 +- .../discourse/app/controllers/tags/index.js | 2 +- spec/system/tags_index_spec.rb | 25 +++++++++++++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 spec/system/tags_index_spec.rb 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