From bd92fdeb4d5e0d366d8a40dded5109d7aa74b282 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Fri, 8 Nov 2019 14:14:51 -0500 Subject: [PATCH] FIX: Add deprecation for Discourse.NavItem in case themes are using it --- .../javascripts/discourse/models/nav-item.js.es6 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/assets/javascripts/discourse/models/nav-item.js.es6 b/app/assets/javascripts/discourse/models/nav-item.js.es6 index 4502757aee3..c0cec002ae0 100644 --- a/app/assets/javascripts/discourse/models/nav-item.js.es6 +++ b/app/assets/javascripts/discourse/models/nav-item.js.es6 @@ -3,6 +3,7 @@ import { toTitleCase } from "discourse/lib/formatter"; import { emojiUnescape } from "discourse/lib/text"; import Category from "discourse/models/category"; import EmberObject from "@ember/object"; +import deprecated from "discourse-common/lib/deprecated"; const NavItem = EmberObject.extend({ @discourseComputed("categoryName", "name") @@ -255,3 +256,13 @@ export function addNavItem(item) { NavItem.extraNavItems.push(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; + } +});