mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Add deprecation for Discourse.NavItem in case themes are using it
This commit is contained in:
parent
f03edb36be
commit
bd92fdeb4d
@ -3,6 +3,7 @@ import { toTitleCase } from "discourse/lib/formatter";
|
|||||||
import { emojiUnescape } from "discourse/lib/text";
|
import { emojiUnescape } from "discourse/lib/text";
|
||||||
import Category from "discourse/models/category";
|
import Category from "discourse/models/category";
|
||||||
import EmberObject from "@ember/object";
|
import EmberObject from "@ember/object";
|
||||||
|
import deprecated from "discourse-common/lib/deprecated";
|
||||||
|
|
||||||
const NavItem = EmberObject.extend({
|
const NavItem = EmberObject.extend({
|
||||||
@discourseComputed("categoryName", "name")
|
@discourseComputed("categoryName", "name")
|
||||||
@ -255,3 +256,13 @@ export function addNavItem(item) {
|
|||||||
NavItem.extraNavItems.push(navItem);
|
NavItem.extraNavItems.push(navItem);
|
||||||
return navItem;
|
return navItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Object.defineProperty(Discourse, "NavItem", {
|
||||||
|
get() {
|
||||||
|
deprecated("Import the NavItem object instead of using Discourse.NavItem", {
|
||||||
|
since: "2.4.0",
|
||||||
|
dropFrom: "2.5.0"
|
||||||
|
});
|
||||||
|
return NavItem;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user