Cleaned up onboardingChecklist GA labs flag
no issue - removed labs flag - removed labs flag conditionals - removed code related to old setup/done screen - fixed tests that weren't correctly running against the GA flag code
This commit is contained in:
parent
643b80ad4c
commit
524fe6ee19
@ -51,10 +51,6 @@ const features = [{
|
||||
title: 'AdminX Demo',
|
||||
description: 'Adds a navigation link to the AdminX demo app',
|
||||
flag: 'adminXDemo'
|
||||
},{
|
||||
title: 'Onboarding checklist',
|
||||
description: 'Onboarding checklist that helps new customers get started',
|
||||
flag: 'onboardingChecklist'
|
||||
},{
|
||||
title: 'NestJS Playground',
|
||||
description: 'Wires up the Ghost NestJS App to the Admin API',
|
||||
|
@ -97,18 +97,7 @@
|
||||
</p>
|
||||
{{else}}
|
||||
<p class="gh-publish-confirmation gh-publish-confirmation-with-feedback">
|
||||
{{#if (feature "onboardingChecklist")}}
|
||||
<LinkTo @route="dashboard" class="gh-back-to-editor">Back to dashboard</LinkTo>
|
||||
{{else}}
|
||||
<button
|
||||
type="button"
|
||||
class="gh-back-to-editor"
|
||||
{{on "click" @close}}
|
||||
data-test-button="back-to-editor"
|
||||
>
|
||||
<span>Back to editor</span>
|
||||
</button>
|
||||
{{/if}}
|
||||
<LinkTo @route="dashboard" class="gh-back-to-editor" data-test-button="back-to-dashboard">Back to dashboard</LinkTo>
|
||||
</p>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
@ -1,72 +0,0 @@
|
||||
import Controller from '@ember/controller';
|
||||
import {isEmpty} from '@ember/utils';
|
||||
import {inject as service} from '@ember/service';
|
||||
import {task} from 'ember-concurrency';
|
||||
import {tracked} from '@glimmer/tracking';
|
||||
|
||||
const THEME_PROPERTIES = {
|
||||
casper: ['description', 'color', 'coverImage'],
|
||||
source: ['description', 'color', 'coverImage'],
|
||||
edition: ['description', 'color', 'coverImage'],
|
||||
dawn: ['description', 'color', 'icon'],
|
||||
dope: ['description', 'color', 'logo'],
|
||||
bulletin: ['description', 'color', 'logo'],
|
||||
alto: ['description', 'color', 'logo'],
|
||||
journal: ['description', 'color', 'logo'],
|
||||
wave: ['description', 'color', 'logo', 'coverImage'],
|
||||
edge: ['description', 'color', 'logo'],
|
||||
ease: ['description', 'color', 'logo', 'coverImage'],
|
||||
ruby: ['description', 'color', 'logo', 'coverImage'],
|
||||
london: ['description', 'color', 'logo'],
|
||||
digest: ['description', 'color', 'logo']
|
||||
};
|
||||
|
||||
export default class SetupFinishingTouchesController extends Controller {
|
||||
@service modals;
|
||||
@service router;
|
||||
@service settings;
|
||||
@service store;
|
||||
@service themeManagement;
|
||||
|
||||
@tracked descriptionVisible;
|
||||
@tracked colorVisible;
|
||||
@tracked logoVisible;
|
||||
@tracked iconVisible;
|
||||
@tracked coverImageVisible;
|
||||
|
||||
themes = null;
|
||||
|
||||
// Default properties to display
|
||||
themeProperties = ['description', 'color', 'coverImage'];
|
||||
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.initThemeProperties.perform();
|
||||
}
|
||||
|
||||
@task({drop: true})
|
||||
*initThemeProperties() {
|
||||
this.themes = yield this.store.peekAll('theme');
|
||||
if (isEmpty(this.themes)) {
|
||||
this.themes = yield this.store.findAll('theme');
|
||||
}
|
||||
|
||||
const activeTheme = this.themes.findBy('active', true);
|
||||
|
||||
if (activeTheme && THEME_PROPERTIES[activeTheme.name]) {
|
||||
this.themeProperties = THEME_PROPERTIES[activeTheme.name];
|
||||
}
|
||||
|
||||
this.descriptionVisible = this.themeProperties.includes('description');
|
||||
this.logoVisible = this.themeProperties.includes('logo');
|
||||
this.iconVisible = this.themeProperties.includes('icon');
|
||||
this.colorVisible = this.themeProperties.includes('color');
|
||||
this.coverImageVisible = this.themeProperties.includes('coverImage');
|
||||
}
|
||||
|
||||
@task
|
||||
*saveAndContinueTask() {
|
||||
yield this.settings.save();
|
||||
this.router.transitionTo('home');
|
||||
}
|
||||
}
|
@ -12,23 +12,10 @@ export default class SetupFinishingTouchesRoute extends AuthenticatedRoute {
|
||||
beforeModel() {
|
||||
super.beforeModel(...arguments);
|
||||
|
||||
if (!this.session.user.isOwnerOnly) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.feature.onboardingChecklist) {
|
||||
if (this.session.user.isOwnerOnly) {
|
||||
this.onboarding.startChecklist();
|
||||
return this.router.transitionTo('dashboard');
|
||||
}
|
||||
}
|
||||
|
||||
model() {
|
||||
this.themeManagement.setPreviewType('homepage');
|
||||
this.themeManagement.updatePreviewHtmlTask.perform();
|
||||
}
|
||||
|
||||
deactivate() {
|
||||
// rollback any unsaved setting changes when leaving
|
||||
this.settings.rollbackAttributes();
|
||||
return this.router.transitionTo('dashboard');
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,11 @@
|
||||
import Route from '@ember/routing/route';
|
||||
import {inject as service} from '@ember/service';
|
||||
|
||||
export default class IndexRoute extends Route {
|
||||
@service router;
|
||||
|
||||
beforeModel() {
|
||||
super.beforeModel(...arguments);
|
||||
this.transitionTo('setup.one');
|
||||
this.router.transitionTo('setup.one');
|
||||
}
|
||||
}
|
||||
|
@ -80,7 +80,6 @@ export default class FeatureService extends Service {
|
||||
@feature('filterEmailDisabled') filterEmailDisabled;
|
||||
@feature('adminXDemo') adminXDemo;
|
||||
@feature('portalImprovements') portalImprovements;
|
||||
@feature('onboardingChecklist') onboardingChecklist;
|
||||
@feature('ActivityPub') ActivityPub;
|
||||
@feature('internalLinking') internalLinking;
|
||||
@feature('editorExcerpt') editorExcerpt;
|
||||
|
@ -7,7 +7,6 @@ const EMPTY_SETTINGS = {
|
||||
};
|
||||
|
||||
export default class OnboardingService extends Service {
|
||||
@service feature;
|
||||
@service session;
|
||||
|
||||
ONBOARDING_STEPS = [
|
||||
@ -24,8 +23,7 @@ export default class OnboardingService extends Service {
|
||||
}
|
||||
|
||||
get isChecklistShown() {
|
||||
return this.feature.onboardingChecklist
|
||||
&& this.session.user.isOwnerOnly
|
||||
return this.session.user.isOwnerOnly
|
||||
&& this.checklistStarted
|
||||
&& !this.checklistCompleted
|
||||
&& !this.checklistDismissed;
|
||||
|
@ -1,46 +0,0 @@
|
||||
<div class="gh-flow gh-done">
|
||||
<main class="flex flex-row h-100">
|
||||
<div class="gh-done-sidebar">
|
||||
<div class="flex flex-column h-100">
|
||||
<div class="gh-nav-body">
|
||||
<div class="gh-done-panel">
|
||||
<div class="gh-stack">
|
||||
<header>
|
||||
<h1>All done!</h1>
|
||||
<p>Your brand new publication is set up and ready to go.</p>
|
||||
</header>
|
||||
<h4>What do you want to do first?</h4>
|
||||
<section>
|
||||
<LinkTo class="gh-done-yellow" @route="lexical-editor.new" @model="post">
|
||||
<span>{{svg-jar "posts"}}</span>
|
||||
<h6>Write your first post</h6>
|
||||
<p>Test out the editor and get a feel for creating content inside Ghost.</p>
|
||||
</LinkTo>
|
||||
<LinkTo class="gh-done-green" @route="settings-x.settings-x" @model="design/edit?ref=setup">
|
||||
<span>{{svg-jar "paint-palette"}}</span>
|
||||
<h6>Customize your site</h6>
|
||||
<p>Review your settings and tweak the design to make your site just right.</p>
|
||||
</LinkTo>
|
||||
<LinkTo class="gh-done-blue" @route="members.import">
|
||||
<span>{{svg-jar "members"}}</span>
|
||||
<h6>Import members</h6>
|
||||
<p>Move your audience over to Ghost with our migration tools and guides.</p>
|
||||
</LinkTo>
|
||||
<LinkTo class="gh-done-pink" @route="dashboard">
|
||||
<span>{{svg-jar "house"}}</span>
|
||||
<h6>Explore Ghost admin</h6>
|
||||
<p>View the dashboard, click around, and explore Ghost for yourself.</p>
|
||||
</LinkTo>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="gh-done-preview">
|
||||
<GhBrowserPreview>
|
||||
<GhHtmlIframe class="site-frame" @html={{this.themeManagement.previewHtml}} />
|
||||
</GhBrowserPreview>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
@ -125,7 +125,7 @@ describe('Acceptance: Publish flow', function () {
|
||||
expect(find('[data-test-button="publish-flow-preview"]'), 'preview button on complete step').to.not.exist;
|
||||
expect(find('[data-test-button="publish-flow-publish"]'), 'publish button on complete step').to.not.exist;
|
||||
|
||||
await click('[data-test-button="back-to-editor"]');
|
||||
await click('[data-test-button="close-publish-flow"]');
|
||||
|
||||
expect(find('[data-test-button="publish-flow"]'), 'publish button after publishing').to.not.exist;
|
||||
expect(find('[data-test-button="update-flow"]'), 'update button after publishing').to.exist;
|
||||
|
@ -1,7 +1,6 @@
|
||||
import {authenticateSession, invalidateSession} from 'ember-simple-auth/test-support';
|
||||
import {currentURL, find, visit} from '@ember/test-helpers';
|
||||
import {describe, it} from 'mocha';
|
||||
import {enableLabsFlag} from '../helpers/labs-flag';
|
||||
import {enableMembers} from '../helpers/members';
|
||||
import {expect} from 'chai';
|
||||
import {setupApplicationTest} from 'ember-mocha';
|
||||
@ -16,7 +15,6 @@ describe('Acceptance: Onboarding', function () {
|
||||
this.server.loadFixtures('settings');
|
||||
this.server.loadFixtures('themes');
|
||||
|
||||
enableLabsFlag(this.server, 'onboardingChecklist');
|
||||
enableMembers(this.server);
|
||||
});
|
||||
|
||||
|
@ -84,7 +84,7 @@ describe('Acceptance: Setup', function () {
|
||||
|
||||
// it redirects to the dashboard
|
||||
expect(currentURL(), 'url after submitting account details')
|
||||
.to.equal('/setup/done');
|
||||
.to.equal('/dashboard');
|
||||
});
|
||||
|
||||
it('handles validation errors in setup', async function () {
|
||||
@ -182,9 +182,9 @@ describe('Acceptance: Setup', function () {
|
||||
await authenticateSession();
|
||||
});
|
||||
|
||||
it('transitions to done screen', async function () {
|
||||
it('transitions to dashboard', async function () {
|
||||
await visit('/?firstStart=true');
|
||||
expect(currentURL()).to.equal('/setup/done');
|
||||
expect(currentURL()).to.equal('/dashboard');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -25,7 +25,6 @@ const GA_FEATURES = [
|
||||
'filterEmailDisabled',
|
||||
'newEmailAddresses',
|
||||
'portalImprovements',
|
||||
'onboardingChecklist',
|
||||
'newsletterExcerpt'
|
||||
];
|
||||
|
||||
|
@ -1155,7 +1155,7 @@ exports[`Settings API Edit Can edit a setting 2: [headers] 1`] = `
|
||||
Object {
|
||||
"access-control-allow-origin": "http://127.0.0.1:2369",
|
||||
"cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0",
|
||||
"content-length": "4618",
|
||||
"content-length": "4589",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"content-version": StringMatching /v\\\\d\\+\\\\\\.\\\\d\\+/,
|
||||
"etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/,
|
||||
|
Loading…
Reference in New Issue
Block a user