Hid tour throbbers when opening launch wizard

refs https://github.com/TryGhost/Team/issues/460

- add `showTour` property to `ui` service
- updated `<GhTourItem>` to not render anything if `ui.showTour` is `false`
- updated launch wizard template to hide tour when open and re-enable when closed
This commit is contained in:
Kevin Ansfield 2021-02-09 11:43:44 +00:00
parent fc317cd75d
commit b4e750466d
4 changed files with 13 additions and 3 deletions

View File

@ -70,6 +70,7 @@ const GhTourItemComponent = Component.extend({
mediaQueries: service(),
tour: service(),
ui: service(),
tagName: '',
@ -88,11 +89,12 @@ const GhTourItemComponent = Component.extend({
_popoverOffset: null,
isMobile: reads('mediaQueries.isMobile'),
isVisible: computed('isMobile', '_throbber', function () {
isVisible: computed('isMobile', '_throbber', 'ui.showTour', function () {
let showTour = this.ui.showTour;
let isMobile = this.isMobile;
let hasThrobber = !isBlank(this._throbber);
return !isMobile && hasThrobber;
return showTour && !isMobile && hasThrobber;
}),
init() {

View File

@ -7,6 +7,7 @@ export default class LaunchController extends Controller {
@service config;
@service router;
@service settings;
@service ui;
queryParams = ['step'];
@ -99,9 +100,15 @@ export default class LaunchController extends Controller {
this.router.transitionTo('dashboard');
}
@action
setup() {
this.ui.set('showTour', false);
}
@action
reset() {
this.step = 'customise-design';
this.skippedSteps = [];
this.ui.set('showTour', true);
}
}

View File

@ -42,6 +42,7 @@ export default Service.extend({
isFullScreen: false,
showMobileMenu: false,
showSettingsMenu: false,
showTour: true,
mainClass: '',
hasSideNav: not('isSideNavHidden'),

View File

@ -1,4 +1,4 @@
<div class="fullscreen-wizard-container" {{will-destroy this.reset}}>
<div class="fullscreen-wizard-container" {{did-insert this.setup}} {{will-destroy this.reset}}>
<div class="pt7 pb5 pl12 pr12 flex justify-between items-center bb b--whitegrey">
<div class="flex flex-column">
<div class="ttu gh-launch-wizard-step-indicator">{{this.currentStep.position}}</div>