From e1d9fd479f83191af24a10964a0e9915de6141f5 Mon Sep 17 00:00:00 2001 From: Krzysztof Kotlarek Date: Tue, 23 Apr 2024 10:04:15 +1000 Subject: [PATCH] FEATURE: after wizard admin is redirected to the guide page (#26696) After the wizard is completed, the admin should be redirected to the admin guide topic. Also tooltip from "Getting started" button was removed. --- .../app/components/bootstrap-mode-notice.hbs | 40 +++---------------- .../app/components/bootstrap-mode-notice.js | 17 -------- .../discourse/app/templates/wizard/step.gjs | 17 +++++++- app/models/user.rb | 1 - config/locales/client.en.yml | 5 --- ...ve_admin_guide_tooltip_from_seen_popups.rb | 16 ++++++++ docs/ADMIN-QUICK-START-GUIDE.md | 2 +- .../api/schemas/json/site_response.json | 6 +-- spec/system/page_objects/pages/wizard.rb | 11 +++++ spec/system/user_tips_spec.rb | 9 ----- spec/system/wizard_spec.rb | 28 +++++++++++++ 11 files changed, 77 insertions(+), 75 deletions(-) create mode 100644 db/migrate/20240422015830_remove_admin_guide_tooltip_from_seen_popups.rb create mode 100644 spec/system/page_objects/pages/wizard.rb create mode 100644 spec/system/wizard_spec.rb diff --git a/app/assets/javascripts/discourse/app/components/bootstrap-mode-notice.hbs b/app/assets/javascripts/discourse/app/components/bootstrap-mode-notice.hbs index 3bc42ff2480..7c1e030e756 100644 --- a/app/assets/javascripts/discourse/app/components/bootstrap-mode-notice.hbs +++ b/app/assets/javascripts/discourse/app/components/bootstrap-mode-notice.hbs @@ -1,35 +1,5 @@ - - <:button> - - {{#if this.showUserTip}} - - {{/if}} - - - - <:tooltip> - {{#unless this.showUserTip}} - -
-
- {{i18n "user_tips.admin_guide.title"}} -
-
- {{i18n "user_tips.admin_guide.content_no_url"}} -
-
-
- {{/unless}} - -
\ No newline at end of file + \ No newline at end of file diff --git a/app/assets/javascripts/discourse/app/components/bootstrap-mode-notice.js b/app/assets/javascripts/discourse/app/components/bootstrap-mode-notice.js index 6374ec0afe8..1edf07efc90 100644 --- a/app/assets/javascripts/discourse/app/components/bootstrap-mode-notice.js +++ b/app/assets/javascripts/discourse/app/components/bootstrap-mode-notice.js @@ -1,32 +1,15 @@ import Component from "@glimmer/component"; -import { tracked } from "@glimmer/tracking"; import { action } from "@ember/object"; import { service } from "@ember/service"; import DiscourseURL from "discourse/lib/url"; -import getURL from "discourse-common/lib/get-url"; -import I18n from "discourse-i18n"; export default class BootstrapModeNotice extends Component { @service siteSettings; - @service userTips; - - @tracked showUserTip = this.userTips.canSeeUserTip("admin_guide"); @action routeToAdminGuide() { - this.showUserTip = false; DiscourseURL.routeTo( `/t/-/${this.siteSettings.admin_quick_start_topic_id}` ); } - - get adminGuideUrl() { - return getURL(`/t/-/${this.siteSettings.admin_quick_start_topic_id}`); - } - - get userTipContent() { - return I18n.t("user_tips.admin_guide.content", { - admin_guide_url: this.adminGuideUrl, - }); - } } diff --git a/app/assets/javascripts/discourse/app/templates/wizard/step.gjs b/app/assets/javascripts/discourse/app/templates/wizard/step.gjs index 1d1eb2e3595..acdfd268f59 100644 --- a/app/assets/javascripts/discourse/app/templates/wizard/step.gjs +++ b/app/assets/javascripts/discourse/app/templates/wizard/step.gjs @@ -2,6 +2,8 @@ import Component from "@glimmer/component"; import { action } from "@ember/object"; import { service } from "@ember/service"; import RouteTemplate from "ember-route-template"; +import DiscourseURL from "discourse/lib/url"; +import { defaultHomepage } from "discourse/lib/utilities"; import WizardCanvas from "discourse/static/wizard/components/wizard-canvas"; import WizardStep from "discourse/static/wizard/components/wizard-step"; import getUrl from "discourse-common/lib/get-url"; @@ -9,6 +11,7 @@ import getUrl from "discourse-common/lib/get-url"; export default RouteTemplate( class extends Component { @service router; + @service siteSettings;