From 643b80ad4c55ff896776100fdc82f53a9ab6c79e Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Thu, 20 Jun 2024 10:16:54 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fixed=20dashboard=20appearing=20?= =?UTF-8?q?blank=20if=20members=20disabled=20before=20completing=20onboard?= =?UTF-8?q?ing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit closes https://linear.app/tryghost/issue/ONC-106 - moved onboarding display outside of the `isMembersEnabled` conditional block --- ghost/admin/app/templates/dashboard.hbs | 52 +++++++++---------- .../admin/tests/acceptance/onboarding-test.js | 13 +++++ 2 files changed, 37 insertions(+), 28 deletions(-) diff --git a/ghost/admin/app/templates/dashboard.hbs b/ghost/admin/app/templates/dashboard.hbs index b04c643a96..ce1f815381 100644 --- a/ghost/admin/app/templates/dashboard.hbs +++ b/ghost/admin/app/templates/dashboard.hbs @@ -85,38 +85,34 @@ {{#if this.isLoading }} {{else}} - {{#if this.areMembersEnabled}} - - {{#if this.onboarding.isChecklistShown}} - + {{#if this.onboarding.isChecklistShown}} + + {{/if}} + {{#if (and this.areMembersEnabled (not this.onboarding.isChecklistShown))}} + {{#if this.hasPaidTiers}} + {{/if}} - - {{#unless this.onboarding.isChecklistShown}} +
+ {{#if this.hasPaidTiers}} - +
+
+ + +
+
+ {{/if}} + {{#unless this.membersUtils.isMembersInviteOnly}} + + {{/unless}} + {{#if this.areNewslettersEnabled}} + {{/if}} -
- - {{#if this.hasPaidTiers}} -
-
- - -
-
- {{/if}} - {{#unless this.membersUtils.isMembersInviteOnly}} - - {{/unless}} - {{#if this.areNewslettersEnabled}} - - {{/if}} - {{#if this.isTotalMembersZero}} - - {{/if}} -
- {{/unless}} + {{#if this.isTotalMembersZero}} + + {{/if}} +
{{/if}} {{#unless this.onboarding.isChecklistShown}} diff --git a/ghost/admin/tests/acceptance/onboarding-test.js b/ghost/admin/tests/acceptance/onboarding-test.js index bc9077e6cd..a235ee4452 100644 --- a/ghost/admin/tests/acceptance/onboarding-test.js +++ b/ghost/admin/tests/acceptance/onboarding-test.js @@ -50,6 +50,19 @@ describe('Acceptance: Onboarding', function () { expect(find('[data-test-dashboard="header"]'), 'header').to.not.exist; expect(find('[data-test-dashboard="attribution"]'), 'attribution section').to.not.exist; }); + + it('checklist is shown when members disabled', async function () { + this.server.db.settings.update({membersSignupAccess: 'none'}); + await visit('/setup/done'); + await visit('/dashboard'); + + // onboarding is't shown + expect(find('[data-test-dashboard="onboarding-checklist"]'), 'checklist').to.exist; + + // other default dashboard elements are not visible + expect(find('[data-test-dashboard="header"]'), 'header').to.not.exist; + expect(find('[data-test-dashboard="attribution"]'), 'attribution section').to.not.exist; + }); }); describe('checklist (non-owner)', function () {