A platform for community discussion. Free, open, simple.
FIX: Move HighlightedCode to core namespace (#38141)
Samdada61dc89c6
diff --git a/frontend/discourse/admin/templates/admin-embedding/index.gjs b/frontend/discourse/admin/templates/admin-embedding/index.gjsindex 29489fa2a30..0c9cca19c7e 100644--- a/frontend/discourse/admin/templates/admin-embedding/index.gjs+++ b/frontend/discourse/admin/templates/admin-embedding/index.gjs@@ -2,7 +2,7 @@ import { htmlSafe } from "@ember/template";import AdminConfigAreaCard from "discourse/admin/components/admin-config-area-card";import AdminConfigAreaEmptyList from "discourse/admin/components/admin-config-area-empty-list";import EmbeddableHost from "discourse/admin/components/embeddable-host";-import HighlightedCode from "discourse/admin/components/highlighted-code";+import HighlightedCode from "discourse/components/highlighted-code";import PluginOutlet from "discourse/components/plugin-outlet";import lazyHash from "discourse/helpers/lazy-hash";import { i18n } from "discourse-i18n";diff --git a/frontend/discourse/admin/components/highlighted-code.gjs b/frontend/discourse/app/components/highlighted-code.gjssimilarity index 100%rename from frontend/discourse/admin/components/highlighted-code.gjsrename to frontend/discourse/app/components/highlighted-code.gjsdiff --git a/frontend/discourse/app/components/modal/customize-form-template-view.gjs b/frontend/discourse/app/components/modal/customize-form-template-view.gjsindex 26795a3f603..5a808f0237f 100644--- a/frontend/discourse/app/components/modal/customize-form-template-view.gjs+++ b/frontend/discourse/app/components/modal/customize-form-template-view.gjs@@ -3,12 +3,12 @@ import { tracked } from "@glimmer/tracking";import { on } from "@ember/modifier";import { action } from "@ember/object";import { service } from "@ember/service";-import HighlightedCode from "discourse/admin/components/highlighted-code";import DButton from "discourse/components/d-button";import DModal from "discourse/components/d-modal";import DModalCancel from "discourse/components/d-modal-cancel";import DToggleSwitch from "discourse/components/d-toggle-switch";import Wrapper from "discourse/components/form-template-field/wrapper";+import HighlightedCode from "discourse/components/highlighted-code";import { ajax } from "discourse/lib/ajax";import { popupAjaxError } from "discourse/lib/ajax-error";import { i18n } from "discourse-i18n";diff --git a/frontend/discourse/tests/integration/components/highlighted-code-test.gjs b/frontend/discourse/tests/integration/components/highlighted-code-test.gjsindex d20a719c224..55dbbf33f54 100644--- a/frontend/discourse/tests/integration/components/highlighted-code-test.gjs+++ b/frontend/discourse/tests/integration/components/highlighted-code-test.gjs@@ -1,7 +1,7 @@import { tracked } from "@glimmer/tracking";import { render, settled } from "@ember/test-helpers";import { module, test } from "qunit";-import HighlightedCode from "discourse/admin/components/highlighted-code";+import HighlightedCode from "discourse/components/highlighted-code";import { setupRenderingTest } from "discourse/tests/helpers/component-test";module("Integration | Component | highlighted-code", function (hooks) {diff --git a/plugins/styleguide/assets/javascripts/discourse/components/sections/atoms/01-font-scale.gjs b/plugins/styleguide/assets/javascripts/discourse/components/sections/atoms/01-font-scale.gjsindex 0b80d9748c6..f35858811b5 100644--- a/plugins/styleguide/assets/javascripts/discourse/components/sections/atoms/01-font-scale.gjs+++ b/plugins/styleguide/assets/javascripts/discourse/components/sections/atoms/01-font-scale.gjs@@ -1,4 +1,4 @@-import HighlightedCode from "discourse/admin/components/highlighted-code";+import HighlightedCode from "discourse/components/highlighted-code";import { i18n } from "discourse-i18n";import StyleguideExample from "discourse/plugins/styleguide/discourse/components/styleguide-example";diff --git a/plugins/styleguide/assets/javascripts/discourse/components/styleguide-example.gjs b/plugins/styleguide/assets/javascripts/discourse/components/styleguide-example.gjsindex f6690ca74c9..4db72e2725b 100644--- a/plugins/styleguide/assets/javascripts/discourse/components/styleguide-example.gjs+++ b/plugins/styleguide/assets/javascripts/discourse/components/styleguide-example.gjs@@ -1,8 +1,8 @@import Component from "@glimmer/component";import { tracked } from "@glimmer/tracking";import { fn } from "@ember/helper";-import HighlightedCode from "discourse/admin/components/highlighted-code";import DButton from "discourse/components/d-button";+import HighlightedCode from "discourse/components/highlighted-code";import { not } from "discourse/truth-helpers";export default class StyleguideExample extends Component {diff --git a/plugins/styleguide/spec/system/smoke_test_spec.rb b/plugins/styleguide/spec/system/smoke_test_spec.rbindex 38b3a8093d4..fd00d46fbd6 100644--- a/plugins/styleguide/spec/system/smoke_test_spec.rb+++ b/plugins/styleguide/spec/system/smoke_test_spec.rb@@ -124,6 +124,19 @@ RSpec.describe "Styleguide Smoke Test", type: :system doendend+ context "when the styleguide is enabled for everyone" do+ before do+ Capybara.reset_sessions!+ SiteSetting.styleguide_allowed_groups = Group::AUTO_GROUPS[:everyone]+ end++ it "renders a page using HighlightedCode for anonymous users" do+ visit "/styleguide/atoms/font-scale"+ expect(page).to have_css(".styleguide-contents h1.section-title", text: "Font System")+ expect(page).to have_css("code.hljs")+ end+ end+context "when the styleguide is only enabled for staff" dobefore { SiteSetting.styleguide_allowed_groups = Group::AUTO_GROUPS[:staff] }