Skip to content

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

DEV: Unsilence d-section deprecation (#29851)

David Taylordaa34b9e11cb
diff --git a/app/assets/javascripts/discourse-common/addon/deprecation-workflow.js b/app/assets/javascripts/discourse-common/addon/deprecation-workflow.js
index dc7384dcfe3..4e35373ee66 100644
--- a/app/assets/javascripts/discourse-common/addon/deprecation-workflow.js
+++ b/app/assets/javascripts/discourse-common/addon/deprecation-workflow.js
@@ -4,7 +4,6 @@ const DEPRECATION_WORKFLOW = [
matchId: "ember-this-fallback.this-property-fallback",
},
{ handler: "silence", matchId: "discourse.select-kit" },
- { handler: "silence", matchId: "discourse.d-section" },
{
handler: "silence",
matchId: "discourse.decorate-widget.hamburger-widget-links",
diff --git a/app/assets/javascripts/discourse/app/templates/preferences/tracking.hbs b/app/assets/javascripts/discourse/app/templates/preferences/tracking.hbs
index 943ddddc306..49700bff811 100644
--- a/app/assets/javascripts/discourse/app/templates/preferences/tracking.hbs
+++ b/app/assets/javascripts/discourse/app/templates/preferences/tracking.hbs
@@ -1,4 +1,4 @@
-<DSection @pageClass="user-preferences-tracking" />
+{{body-class "user-preferences-tracking-page"}}
<div class="user-preferences__tracking-topics-wrapper">
<label class="control-label">{{i18n "user.topics_settings"}}</label>
diff --git a/app/assets/javascripts/discourse/tests/integration/components/d-section-test.gjs b/app/assets/javascripts/discourse/tests/integration/components/d-section-test.gjs
index 12b46da2bc3..b29b90a0f7b 100644
--- a/app/assets/javascripts/discourse/tests/integration/components/d-section-test.gjs
+++ b/app/assets/javascripts/discourse/tests/integration/components/d-section-test.gjs
@@ -2,16 +2,19 @@ import { render } from "@ember/test-helpers";
import { module, test } from "qunit";
import DSection from "discourse/components/d-section";
import { setupRenderingTest } from "discourse/tests/helpers/component-test";
+import { withSilencedDeprecationsAsync } from "discourse-common/lib/deprecated";
module("Integration | Component | d-section", function (hooks) {
setupRenderingTest(hooks);
test("can set classes on the body element", async function (assert) {
- await render(<template>
- <DSection @pageClass="test" @bodyClass="foo bar" class="special">
- testing!
- </DSection>
- </template>);
+ await withSilencedDeprecationsAsync("discourse.d-section", async () => {
+ await render(<template>
+ <DSection @pageClass="test" @bodyClass="foo bar" class="special">
+ testing!
+ </DSection>
+ </template>);
+ });
assert.dom(".special").hasText("testing!");
assert.strictEqual(document.body.className, "test-page foo bar");