diff --git a/app/components/gh-launch-wizard/connect-stripe.hbs b/app/components/gh-launch-wizard/connect-stripe.hbs deleted file mode 100644 index 28f28fc8d..000000000 --- a/app/components/gh-launch-wizard/connect-stripe.hbs +++ /dev/null @@ -1,94 +0,0 @@ -

Connect Stripe

- -
-
- {{#if this.config.stripeDirect}} -
-
-
- - -
-
- - - - Find your Stripe API keys here » - -
-
-
-
-
-

How you get paid

- {{svg-jar "stripe-verified-partner-badge" class="gh-members-stripe-badge"}} -
-

- Stripe is our exclusive direct payments partner.
- Ghost collects no fees on any payments! If you don’t have a Stripe account yet, you can sign up here. -

-
-
-
- {{else}} -
-
- -
- Connect with Stripe -
- {{if this.stripeConnectTestMode "Using" "Use"}} test mode -
- -
-
-
-
- - {{#if this.stripeConnectError}}

{{this.stripeConnectError}}

{{/if}} -
-
-
-
-
-

How you get paid

- {{svg-jar "stripe-verified-partner-badge" class="gh-members-stripe-badge"}} -
-

- Stripe is our exclusive direct payments partner.
- Ghost collects no fees on any payments! If you don’t have a Stripe account yet, you can sign up here. -

-
-
-
- {{/if}} -
-
- -{{!-- TODO: reset "failed" state automatically --}} - \ No newline at end of file diff --git a/app/components/gh-launch-wizard/connect-stripe.js b/app/components/gh-launch-wizard/connect-stripe.js deleted file mode 100644 index 85c38a610..000000000 --- a/app/components/gh-launch-wizard/connect-stripe.js +++ /dev/null @@ -1,67 +0,0 @@ -import Component from '@glimmer/component'; -import {action} from '@ember/object'; -import {inject as service} from '@ember/service'; -import {task} from 'ember-concurrency-decorators'; -import {tracked} from '@glimmer/tracking'; - -export default class GhLaunchWizardConnectStripeComponent extends Component { - @service config; - @service ghostPaths; - @service settings; - - @tracked stripeConnectTestMode = false; - @tracked stripeConnectError = null; - - get stripeConnectAuthUrl() { - const mode = this.stripeConnectTestMode ? 'test' : 'live'; - return `${this.ghostPaths.url.api('members/stripe_connect')}?mode=${mode}`; - } - - willDestroy() { - // clear any unsaved settings changes when going back/forward/closing - this.settings.rollbackAttributes(); - } - - @action - setStripeDirectPublicKey(event) { - this.settings.set('stripeProductName', this.settings.get('title')); - this.settings.set('stripePublishableKey', event.target.value); - } - - @action - setStripeDirectSecretKey(event) { - this.settings.set('stripeProductName', this.settings.get('title')); - this.settings.set('stripePublishableKey', event.target.value); - } - - @action - toggleStripeConnectTestMode() { - this.stripeConnectTestMode = !this.stripeConnectTestMode; - } - - @action - setStripeConnectIntegrationToken(event) { - this.settings.set('stripeProductName', this.settings.get('title')); - this.settings.set('stripeConnectIntegrationToken', event.target.value); - this.stripeConnectError = null; - } - - @task - *saveAndContinue() { - if (this.settings.get('stripeConnectIntegrationToken')) { - try { - yield this.settings.save(); - } catch (error) { - if (error.payload?.errors) { - this.stripeConnectError = 'Invalid secure key'; - return false; - } - - throw error; - } - } - - // skip when no token supplied - this.args.afterComplete(); - } -} diff --git a/app/components/gh-launch-wizard/customise-design.hbs b/app/components/gh-launch-wizard/customise-design.hbs deleted file mode 100644 index 89795263b..000000000 --- a/app/components/gh-launch-wizard/customise-design.hbs +++ /dev/null @@ -1,112 +0,0 @@ -
-
-

Customise

- -
- -
-
Publication icon
-
A square, social icon used in the UI of your publication, at least 60x60px
- {{#each uploader.errors as |error|}} -
{{or error.context error.message}}
- {{/each}} -
- -
- {{#if uploader.isUploading}} - {{uploader.progressBar}} - {{else if this.settings.icon}} - icon - - {{else}} - - {{/if}} -
- -
-
-
-
- -
- -
-
Publication logo
-
The primary logo for your brand displayed across your theme, should be transparent and at least 600px x 72px
- {{#each uploader.errors as |error|}} -
{{or error.context error.message}}
- {{/each}} -
-
- {{#if uploader.isUploading}} - {{uploader.progressBar}} - {{else if this.settings.logo}} - - - {{else}} - - {{/if}} -
- -
-
-
-
- -
- -
-
Publication cover
-
An optional large background image for your site
- {{#each uploader.errors as |error|}} -
{{or error.context error.message}}
- {{/each}} -
-
- {{#if uploader.isUploading}} - {{uploader.progressBar}} - {{else if this.settings.coverImage}} - cover photo - - {{else}} - - {{/if}} -
- -
-
-
-
-
- -
- -
-
- - \ No newline at end of file diff --git a/app/components/gh-launch-wizard/customise-design.js b/app/components/gh-launch-wizard/customise-design.js deleted file mode 100644 index f400855b4..000000000 --- a/app/components/gh-launch-wizard/customise-design.js +++ /dev/null @@ -1,51 +0,0 @@ -import Component from '@glimmer/component'; -import { - ICON_EXTENSIONS, - ICON_MIME_TYPES, - IMAGE_EXTENSIONS, - IMAGE_MIME_TYPES -} from 'ghost-admin/components/gh-image-uploader'; -import {action} from '@ember/object'; -import {inject as service} from '@ember/service'; -import {tracked} from '@glimmer/tracking'; - -export default class GhLaunchWizardCustomiseDesignComponent extends Component { - @service settings; - - @tracked previewGuid; - - iconExtensions = ICON_EXTENSIONS; - iconMimeTypes = ICON_MIME_TYPES; - imageExtensions = IMAGE_EXTENSIONS; - imageMimeTypes = IMAGE_MIME_TYPES; - - constructor() { - super(...arguments); - this.refreshPreview(); - } - - @action - triggerFileDialog({target}) { - target.closest('.gh-setting-action')?.querySelector('input[type="file"]')?.click(); - } - - @action - async imageUploaded(property, results) { - if (results[0]) { - this.settings.set(property, results[0].url); - await this.settings.save(); - this.refreshPreview(); - } - } - - @action - async removeImage(imageName) { - this.settings.set(imageName, ''); - await this.settings.save(); - this.refreshPreview(); - } - - refreshPreview() { - this.previewGuid = (new Date()).valueOf(); - } -} diff --git a/app/components/gh-launch-wizard/set-pricing.hbs b/app/components/gh-launch-wizard/set-pricing.hbs deleted file mode 100644 index 3b499ff1b..000000000 --- a/app/components/gh-launch-wizard/set-pricing.hbs +++ /dev/null @@ -1,83 +0,0 @@ -

Set subscription pricing

- -
-
-
-
- - - - - {{svg-jar "arrow-down-small"}} - - -
-
-
-
- - - -
- - {{this.stripePlans.monthly.currency}}/month -
-
-
-
- - -
- - {{this.stripePlans.yearly.currency}}/year -
-
-
-
-
- -
- -
-
-

Allow free member signup

-

If disabled, members can only be signed up via payment checkout or API integration

-
-
-
- -
-
-
-
-
- -{{!-- TODO: reset "failed" state automatically --}} - \ No newline at end of file diff --git a/app/components/gh-launch-wizard/set-pricing.js b/app/components/gh-launch-wizard/set-pricing.js deleted file mode 100644 index 37a3392b3..000000000 --- a/app/components/gh-launch-wizard/set-pricing.js +++ /dev/null @@ -1,130 +0,0 @@ -import Component from '@glimmer/component'; -import {CURRENCIES} from 'ghost-admin/components/gh-members-lab-setting'; -import {action} from '@ember/object'; -import {inject as service} from '@ember/service'; -import {task} from 'ember-concurrency-decorators'; -import {tracked} from '@glimmer/tracking'; - -export default class GhLaunchWizardSetPricingComponent extends Component { - @service settings; - - currencies = CURRENCIES; - - @tracked stripeMonthlyAmount = null; - @tracked stripeYearlyAmount = null; - - get stripePlans() { - const plans = this.settings.get('stripePlans') || []; - const monthly = plans.find(plan => plan.interval === 'month'); - const yearly = plans.find(plan => plan.interval === 'year' && plan.name !== 'Complimentary'); - - return { - monthly: { - amount: (parseInt(monthly?.amount) || 0) / 100 || 5, - currency: monthly?.currency || this.currencies[0].value - }, - yearly: { - amount: (parseInt(yearly?.amount) || 0) / 100 || 50, - currency: yearly?.currency || this.currencies[0].value - } - }; - } - - get selectedCurrency() { - return this.currencies.findBy('value', this.stripePlans.monthly.currency); - } - - willDestroy() { - // clear any unsaved settings changes when going back/forward/closing - this.settings.rollbackAttributes(); - } - - @action - setStripePlansCurrency(event) { - const newCurrency = event.value; - - const updatedPlans = this.settings.get('stripePlans').map((plan) => { - if (plan.name !== 'Complimentary') { - return Object.assign({}, plan, { - currency: newCurrency - }); - } - return plan; - }); - - const currentComplimentaryPlan = updatedPlans.find((plan) => { - return plan.name === 'Complimentary' && plan.currency === event.value; - }); - - if (!currentComplimentaryPlan) { - updatedPlans.push({ - name: 'Complimentary', - currency: event.value, - interval: 'year', - amount: 0 - }); - } - - this.settings.set('stripePlans', updatedPlans); - } - - @action - toggleSelfSignup() { - this.settings.set('membersAllowFreeSignup', !this.settings.get('membersAllowFreeSignup')); - } - - @action - validateStripePlans() { - this.settings.errors.remove('stripePlans'); - this.settings.hasValidated.removeObject('stripePlans'); - - if (this.stripeYearlyAmount === null) { - this.stripeYearlyAmount = this.stripePlans.yearly.amount; - } - if (this.stripeMonthlyAmount === null) { - this.stripeMonthlyAmount = this.stripePlans.monthly.amount; - } - - try { - const selectedCurrency = this.selectedCurrency; - const yearlyAmount = parseInt(this.stripeYearlyAmount); - const monthlyAmount = parseInt(this.stripeMonthlyAmount); - if (!yearlyAmount || yearlyAmount < 1 || !monthlyAmount || monthlyAmount < 1) { - throw new TypeError(`Subscription amount must be at least ${selectedCurrency.symbol}1.00`); - } - - const updatedPlans = this.settings.get('stripePlans').map((plan) => { - if (plan.name !== 'Complimentary') { - let newAmount; - if (plan.interval === 'year') { - newAmount = yearlyAmount * 100; - } else if (plan.interval === 'month') { - newAmount = monthlyAmount * 100; - } - return Object.assign({}, plan, { - amount: newAmount - }); - } - return plan; - }); - - this.settings.set('stripePlans', updatedPlans); - } catch (err) { - this.settings.errors.add('stripePlans', err.message); - } finally { - this.settings.hasValidated.pushObject('stripePlans'); - } - } - - @task - *saveAndContinue() { - yield this.validateStripePlans(); - - if (this.settings.errors.length > 0) { - return false; - } - - yield this.settings.save(); - this.args.afterComplete(); - } -} diff --git a/app/controllers/launch.js b/app/controllers/launch.js deleted file mode 100644 index 8f6b5ddd3..000000000 --- a/app/controllers/launch.js +++ /dev/null @@ -1,12 +0,0 @@ -import Controller from '@ember/controller'; -import {action} from '@ember/object'; -import {inject as service} from '@ember/service'; - -export default class LaunchController extends Controller { - @service router; - - @action - close() { - this.router.transitionTo('dashboard'); - } -} diff --git a/app/controllers/launch/complete.js b/app/controllers/launch/complete.js deleted file mode 100644 index b6ef14361..000000000 --- a/app/controllers/launch/complete.js +++ /dev/null @@ -1,17 +0,0 @@ -import Controller from '@ember/controller'; -import {action} from '@ember/object'; -import {inject as service} from '@ember/service'; - -export default class LaunchCompleteController extends Controller { - @service router; - - @action - finish() { - this.router.transitionTo('dashboard'); - } - - @action - goBack() { - this.router.transitionTo('launch.set-pricing'); - } -} diff --git a/app/controllers/launch/connect-stripe.js b/app/controllers/launch/connect-stripe.js deleted file mode 100644 index 5161108f7..000000000 --- a/app/controllers/launch/connect-stripe.js +++ /dev/null @@ -1,17 +0,0 @@ -import Controller from '@ember/controller'; -import {action} from '@ember/object'; -import {inject as service} from '@ember/service'; - -export default class LaunchConnectStripeController extends Controller { - @service router; - - @action - goToNext() { - this.router.transitionTo('launch.set-pricing'); - } - - @action - goBack() { - this.router.transitionTo('launch.customise-design'); - } -} diff --git a/app/controllers/launch/customise-design.js b/app/controllers/launch/customise-design.js deleted file mode 100644 index 3da1e5ff0..000000000 --- a/app/controllers/launch/customise-design.js +++ /dev/null @@ -1,12 +0,0 @@ -import Controller from '@ember/controller'; -import {action} from '@ember/object'; -import {inject as service} from '@ember/service'; - -export default class LaunchCustomiseDesignController extends Controller { - @service router; - - @action - goToNext() { - this.router.transitionTo('launch.connect-stripe'); - } -} diff --git a/app/controllers/launch/set-pricing.js b/app/controllers/launch/set-pricing.js deleted file mode 100644 index c0d66be1e..000000000 --- a/app/controllers/launch/set-pricing.js +++ /dev/null @@ -1,17 +0,0 @@ -import Controller from '@ember/controller'; -import {action} from '@ember/object'; -import {inject as service} from '@ember/service'; - -export default class LaunchSetPricingController extends Controller { - @service router; - - @action - goToNext() { - this.router.transitionTo('launch.complete'); - } - - @action - goBack() { - this.router.transitionTo('launch.connect-stripe'); - } -} diff --git a/app/router.js b/app/router.js index 9183978c0..f10dfc350 100644 --- a/app/router.js +++ b/app/router.js @@ -21,13 +21,6 @@ Router.map(function () { this.route('signup', {path: '/signup/:token'}); this.route('reset', {path: '/reset/:token'}); - this.route('launch', function () { - this.route('customise-design'); - this.route('connect-stripe'); - this.route('set-pricing'); - this.route('complete'); - }); - this.route('about'); this.route('site'); this.route('dashboard'); diff --git a/app/routes/launch.js b/app/routes/launch.js deleted file mode 100644 index b5fd79072..000000000 --- a/app/routes/launch.js +++ /dev/null @@ -1,12 +0,0 @@ -import AuthenticatedRoute from 'ghost-admin/routes/authenticated'; -import {inject as service} from '@ember/service'; - -export default class LaunchRoute extends AuthenticatedRoute { - @service config; - - beforeModel() { - if (!this.config.get('enableDeveloperExperiments')) { - this.transitionTo('site'); - } - } -} diff --git a/app/routes/launch/complete.js b/app/routes/launch/complete.js deleted file mode 100644 index 831279c20..000000000 --- a/app/routes/launch/complete.js +++ /dev/null @@ -1,4 +0,0 @@ -import Route from '@ember/routing/route'; - -export default class LaunchCompleteRoute extends Route { -} diff --git a/app/routes/launch/connect-stripe.js b/app/routes/launch/connect-stripe.js deleted file mode 100644 index 337ca4aa1..000000000 --- a/app/routes/launch/connect-stripe.js +++ /dev/null @@ -1,4 +0,0 @@ -import Route from '@ember/routing/route'; - -export default class LaunchConnectStripeRoute extends Route { -} diff --git a/app/routes/launch/customise-design.js b/app/routes/launch/customise-design.js deleted file mode 100644 index 4cb812960..000000000 --- a/app/routes/launch/customise-design.js +++ /dev/null @@ -1,4 +0,0 @@ -import Route from '@ember/routing/route'; - -export default class LaunchCustomiseDesignRoute extends Route { -} diff --git a/app/routes/launch/index.js b/app/routes/launch/index.js deleted file mode 100644 index 21b8d09c7..000000000 --- a/app/routes/launch/index.js +++ /dev/null @@ -1,7 +0,0 @@ -import AuthenticatedRoute from 'ghost-admin/routes/authenticated'; - -export default class LaunchIndexRoute extends AuthenticatedRoute { - beforeModel() { - this.transitionTo('launch.customise-design'); - } -} diff --git a/app/routes/launch/set-pricing.js b/app/routes/launch/set-pricing.js deleted file mode 100644 index d97084303..000000000 --- a/app/routes/launch/set-pricing.js +++ /dev/null @@ -1,4 +0,0 @@ -import Route from '@ember/routing/route'; - -export default class LaunchSetPricingRoute extends Route { -} diff --git a/app/templates/dashboard.hbs b/app/templates/dashboard.hbs index c3f66bcd9..9824a9e4a 100644 --- a/app/templates/dashboard.hbs +++ b/app/templates/dashboard.hbs @@ -4,8 +4,4 @@ Dashboard - -
- Launch site - Finish setup -
\ No newline at end of file diff --git a/app/templates/launch/complete.hbs b/app/templates/launch/complete.hbs deleted file mode 100644 index fa7ad3cd4..000000000 --- a/app/templates/launch/complete.hbs +++ /dev/null @@ -1,12 +0,0 @@ - - -
-

Congrats

-
-
You're all set up!
-
- -
\ No newline at end of file diff --git a/app/templates/launch/connect-stripe.hbs b/app/templates/launch/connect-stripe.hbs deleted file mode 100644 index e4abbcb2d..000000000 --- a/app/templates/launch/connect-stripe.hbs +++ /dev/null @@ -1,10 +0,0 @@ - - -
- -
\ No newline at end of file diff --git a/app/templates/launch/customise-design.hbs b/app/templates/launch/customise-design.hbs deleted file mode 100644 index cdbc952e6..000000000 --- a/app/templates/launch/customise-design.hbs +++ /dev/null @@ -1,5 +0,0 @@ -
- -
\ No newline at end of file diff --git a/app/templates/launch/set-pricing.hbs b/app/templates/launch/set-pricing.hbs deleted file mode 100644 index 48e447d02..000000000 --- a/app/templates/launch/set-pricing.hbs +++ /dev/null @@ -1,10 +0,0 @@ - - -
- -
\ No newline at end of file diff --git a/tests/acceptance/launch-flow-test.js b/tests/acceptance/launch-flow-test.js deleted file mode 100644 index b42999e25..000000000 --- a/tests/acceptance/launch-flow-test.js +++ /dev/null @@ -1,104 +0,0 @@ -import {authenticateSession} from 'ember-simple-auth/test-support'; -import {currentURL, visit} from '@ember/test-helpers'; -import {describe, it} from 'mocha'; -import {expect} from 'chai'; -import {setupApplicationTest} from 'ember-mocha'; -import {setupMirage} from 'ember-cli-mirage/test-support'; - -describe('Acceptance: Launch flow', function () { - const hooks = setupApplicationTest(); - setupMirage(hooks); - - it('is not accessible when logged out', async function () { - await visit('/launch'); - expect(currentURL()).to.equal('/signin'); - - await visit('/launch/customise-design'); - expect(currentURL()).to.equal('/signin'); - - await visit('/launch/connect-stripe'); - expect(currentURL()).to.equal('/signin'); - - await visit('/launch/set-pricing'); - expect(currentURL()).to.equal('/signin'); - - await visit('/launch/complete'); - expect(currentURL()).to.equal('/signin'); - }); - - describe('when logged in', function () { - beforeEach(async function () { - // TODO: remove this setup when out of dev experiments - this.server.loadFixtures('configs'); - const config = this.server.schema.configs.first(); - config.update({ - enableDeveloperExperiments: true - }); - - let role = this.server.create('role', {name: 'Administrator'}); - this.server.create('user', {roles: [role]}); - - return await authenticateSession(); - }); - - it('can visit /launch', async function () { - await visit('/launch'); - expect(currentURL()).to.equal('/launch/customise-design'); - }); - - it('can visit /launch/customise-design', async function () { - await visit('/launch/customise-design'); - expect(currentURL()).to.equal('/launch/customise-design'); - }); - - it('can visit /launch/connect-stripe', async function () { - await visit('/launch/connect-stripe'); - expect(currentURL()).to.equal('/launch/connect-stripe'); - }); - - it('can visit /launch/set-pricing', async function () { - await visit('/launch/set-pricing'); - expect(currentURL()).to.equal('/launch/set-pricing'); - }); - - it('can visit /launch/complete', async function () { - await visit('/launch/complete'); - expect(currentURL()).to.equal('/launch/complete'); - }); - }); - - // TODO: remove this whole section when out of dev experiments - describe('developer experiments', function () { - describe('when disabled', function () { - beforeEach(async function () { - this.server.loadFixtures('configs'); - const config = this.server.schema.configs.first(); - config.update({ - enableDeveloperExperiments: false - }); - - let role = this.server.create('role', {name: 'Administrator'}); - this.server.create('user', {roles: [role]}); - - return await authenticateSession(); - }); - - it('redirects all routes to /site', async function () { - await visit('/launch'); - expect(currentURL()).to.equal('/site'); - - await visit('/launch/customise-design'); - expect(currentURL()).to.equal('/site'); - - await visit('/launch/connect-stripe'); - expect(currentURL()).to.equal('/site'); - - await visit('/launch/set-pricing'); - expect(currentURL()).to.equal('/site'); - - await visit('/launch/complete'); - expect(currentURL()).to.equal('/site'); - }); - }); - }); -}); diff --git a/tests/integration/components/gh-launch-wizard/connect-stripe-test.js b/tests/integration/components/gh-launch-wizard/connect-stripe-test.js deleted file mode 100644 index 49478211f..000000000 --- a/tests/integration/components/gh-launch-wizard/connect-stripe-test.js +++ /dev/null @@ -1,18 +0,0 @@ -import {describe, it} from 'mocha'; -import {expect} from 'chai'; -import {hbs} from 'ember-cli-htmlbars'; -import {render} from '@ember/test-helpers'; -import {setupRenderingTest} from 'ember-mocha'; - -describe('Integration: Component: gh-launch-wizard/connect-stripe', function () { - setupRenderingTest(); - - it('renders', async function () { - // Set any properties with this.set('myProperty', 'value'); - // Handle any actions with this.set('myAction', function(val) { ... }); - - await render(hbs``); - - expect(this.element.textContent.trim()).to.have.string('Connect Stripe'); - }); -}); diff --git a/tests/integration/components/gh-launch-wizard/customise-design-test.js b/tests/integration/components/gh-launch-wizard/customise-design-test.js deleted file mode 100644 index ec9ca1a85..000000000 --- a/tests/integration/components/gh-launch-wizard/customise-design-test.js +++ /dev/null @@ -1,18 +0,0 @@ -import {describe, it} from 'mocha'; -import {expect} from 'chai'; -import {hbs} from 'ember-cli-htmlbars'; -import {render} from '@ember/test-helpers'; -import {setupRenderingTest} from 'ember-mocha'; - -describe('Integration: Component: gh-launch-wizard/customise-design', function () { - setupRenderingTest(); - - it('renders', async function () { - // Set any properties with this.set('myProperty', 'value'); - // Handle any actions with this.set('myAction', function(val) { ... }); - - await render(hbs``); - - expect(this.element.textContent.trim()).to.have.string('Customise'); - }); -}); diff --git a/tests/integration/components/gh-launch-wizard/set-pricing-test.js b/tests/integration/components/gh-launch-wizard/set-pricing-test.js deleted file mode 100644 index ff6d57417..000000000 --- a/tests/integration/components/gh-launch-wizard/set-pricing-test.js +++ /dev/null @@ -1,18 +0,0 @@ -import {describe, it} from 'mocha'; -import {expect} from 'chai'; -import {hbs} from 'ember-cli-htmlbars'; -import {render} from '@ember/test-helpers'; -import {setupRenderingTest} from 'ember-mocha'; - -describe('Integration: Component: gh-launch-wizard/set-pricing', function () { - setupRenderingTest(); - - it('renders', async function () { - // Set any properties with this.set('myProperty', 'value'); - // Handle any actions with this.set('myAction', function(val) { ... }); - - await render(hbs``); - - expect(this.element.textContent.trim()).to.have.string('Set subscription pricing'); - }); -});