0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-04-01 02:41:39 -05:00

Replaced setup/done screen with onboarding checklist (#19952)

part of https://linear.app/tryghost/issue/IPC-81/remove-setupdone-screen-from-signup-flow

- when the `onboardingChecklist` flag is enabled the `setup/done` screen shown after install or signup will initiate the onboarding checklist and redirect straight to the dashboard effectively replacing the previous onboarding flow
This commit is contained in:
Kevin Ansfield 2024-03-28 16:10:59 +00:00 committed by GitHub
parent 540660a49e
commit 5cb85ff58f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 34 additions and 1 deletions

View file

@ -2,9 +2,24 @@ import Route from '@ember/routing/route';
import {inject as service} from '@ember/service';
export default class SetupFinishingTouchesRoute extends Route {
@service feature;
@service onboarding;
@service router;
@service session;
@service settings;
@service themeManagement;
beforeModel() {
if (!this.session.user.isOwnerOnly) {
return;
}
if (this.feature.onboardingChecklist) {
this.onboarding.startChecklist();
return this.router.transitionTo('dashboard');
}
}
model() {
this.themeManagement.setPreviewType('homepage');
this.themeManagement.updatePreviewHtmlTask.perform();

View file

@ -26,6 +26,7 @@ export default class OnboardingService extends Service {
get isChecklistShown() {
return this.feature.onboardingChecklist
&& this.session.user.isOwnerOnly
&& this.checklistStarted
&& !this.checklistCompleted
&& !this.checklistDismissed;
}
@ -105,6 +106,11 @@ export default class OnboardingService extends Service {
await this._saveSettings(settings);
}
@action
async reset() {
await this._saveSettings(undefined);
}
/* private */
async _saveSettings(settings) {

View file

@ -27,10 +27,22 @@ describe('Acceptance: Onboarding', function () {
return await authenticateSession();
});
it('dashboard shows the checklist', async function () {
it('dashboard does not show checklist by default', async function () {
await visit('/dashboard');
expect(currentURL()).to.equal('/dashboard');
// onboarding isn't shown
expect(find('[data-test-dashboard="onboarding-checklist"]'), 'checklist').to.not.exist;
// other default dashboard elements are visible
expect(find('[data-test-dashboard="header"]'), 'header').to.exist;
expect(find('[data-test-dashboard="attribution"]'), 'attribution section').to.exist;
});
it('dashboard shows the checklist after accessing setup/done', async function () {
await visit('/setup/done');
expect(currentURL()).to.equal('/dashboard');
// main onboarding list is visible
expect(find('[data-test-dashboard="onboarding-checklist"]'), 'checklist').to.exist;