diff --git a/README.md b/README.md index d9b84da..bb184df 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,12 @@ +# DEPRECATED + +Search Banner theme component is deprecated in favor of Discourse's core Welcome banner. + +More details about deprecating Search Banner: https://meta.discourse.org/t/deprecating-the-search-banner-theme-component/379322. + +More about Welcome Banner: https://meta.discourse.org/t/creating-a-banner-to-display-at-the-top-of-your-site/153718#p-762961-welcome-banner-1. +--- + This is a component that puts a search bar along with optional headline and subhead text in a banner above the main topic list navigation of a Discourse community. By default this banner appears on all top-level topic pages (latest/new/unread/top/categories... anything in the `top menu` site setting) but it can also be set to only display on a community's homepage. diff --git a/javascripts/discourse/components/search-banner.gjs b/javascripts/discourse/components/search-banner.gjs index d054010..aec862f 100644 --- a/javascripts/discourse/components/search-banner.gjs +++ b/javascripts/discourse/components/search-banner.gjs @@ -7,6 +7,7 @@ import { service } from "@ember/service"; import { htmlSafe } from "@ember/template"; import PluginOutlet from "discourse/components/plugin-outlet"; import SearchMenu from "discourse/components/search-menu"; +import deprecated from "discourse/lib/deprecated"; import { defaultHomepage } from "discourse/lib/utilities"; import { i18n } from "discourse-i18n"; import SearchIcon from "./search-icon"; @@ -16,6 +17,13 @@ export default class SearchBanner extends Component { @service siteSettings; @service currentUser; + constructor() { + super(...arguments); + deprecated("Search Banner is deprecated in favor of core Welcome banner.", { + id: "search-banner.deprecated", + }); + } + @action willDestroy() { super.willDestroy(...arguments); diff --git a/locales/en.yml b/locales/en.yml index 9e9e5bb..ddf0ec9 100644 --- a/locales/en.yml +++ b/locales/en.yml @@ -5,3 +5,4 @@ en: search_button_text: "" theme_metadata: description: "Advanced Search Banner puts a search bar along with optional headline and subhead text in a banner above the main topic list navigation" + deprecation_warning: "The Search Banner theme component is deprecated in favor of the core Welcome banner. Please migrate to the Welcome banner"