diff --git a/plugins/discourse-narrative-bot/assets/javascripts/initializers/new-user-narrative.js b/plugins/discourse-narrative-bot/assets/javascripts/initializers/new-user-narrative.js deleted file mode 100644 index 2cf2361121b..00000000000 --- a/plugins/discourse-narrative-bot/assets/javascripts/initializers/new-user-narrative.js +++ /dev/null @@ -1,63 +0,0 @@ -import { withPluginApi } from "discourse/lib/plugin-api"; -import { bind } from "discourse-common/utils/decorators"; - -export default { - name: "new-user-narrative", - - initialize(container) { - const siteSettings = container.lookup("service:site-settings"); - - if (!siteSettings.discourse_narrative_bot_enabled) { - return; - } - - this.messageBus = container.lookup("service:message-bus"); - this.appEvents = container.lookup("service:app-events"); - - withPluginApi("0.8.7", (api) => { - this.currentUser = api.getCurrentUser(); - - if (!this.currentUser) { - return; - } - - api.dispatchWidgetAppEvent( - "site-header", - "header", - "header:search-context-trigger" - ); - - api.attachWidgetAction( - "header", - "headerSearchContextTrigger", - function () { - if (this.site.mobileView) { - this.state.skipSearchContext = false; - } else { - this.state.contextEnabled = true; - this.state.searchContextType = "topic"; - } - } - ); - - this.messageBus.subscribe( - `/new_user_narrative/tutorial_search/${this.currentUser.id}`, - this.onMessage - ); - }); - }, - - teardown() { - if (this.currentUser) { - this.messageBus?.unsubscribe( - `/new_user_narrative/tutorial_search/${this.currentUser.id}`, - this.onMessage - ); - } - }, - - @bind - onMessage() { - this.appEvents.trigger("header:search-context-trigger"); - }, -}; diff --git a/plugins/discourse-narrative-bot/config/locales/server.en.yml b/plugins/discourse-narrative-bot/config/locales/server.en.yml index 2bab753ac5a..b3135aa175d 100644 --- a/plugins/discourse-narrative-bot/config/locales/server.en.yml +++ b/plugins/discourse-narrative-bot/config/locales/server.en.yml @@ -314,7 +314,7 @@ en: search: instructions: |- - _psst_ … I’ve hidden a surprise in this topic. If you’re up for the challenge, **select the search icon** at the top right ↗ to search for it. + _psst_ … I’ve hidden a surprise in this topic. If you’re up for the challenge, **select the search icon** at the top right ↗, choose 'in this topic', then search for it. Try searching for the term "capy​bara" in this topic hidden_message: |- diff --git a/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/new_user_narrative.rb b/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/new_user_narrative.rb index d31bd7f2646..b601124f84f 100644 --- a/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/new_user_narrative.rb +++ b/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/new_user_narrative.rb @@ -173,12 +173,6 @@ module DiscourseNarrativeBot topic = @post.topic post = topic.first_post - MessageBus.publish( - "/new_user_narrative/tutorial_search/#{@user.id}", - {}, - user_ids: [@user.id], - ) - raw = <<~MD #{post.raw}