From 6b1cd8dc2302d5c289ec0e2a55bf9ec221a614d7 Mon Sep 17 00:00:00 2001 From: Rish Date: Mon, 14 Oct 2019 00:43:15 +0530 Subject: [PATCH] Enabled members by default no-issue This removes the need for `enableDeveloperExperiments` flag for members --- ghost/admin/app/routes/members.js | 5 -- ghost/admin/app/templates/settings/labs.hbs | 60 ++++++++++---------- ghost/admin/tests/acceptance/members-test.js | 13 ----- 3 files changed, 29 insertions(+), 49 deletions(-) diff --git a/ghost/admin/app/routes/members.js b/ghost/admin/app/routes/members.js index e327b6120d..181067ab9d 100644 --- a/ghost/admin/app/routes/members.js +++ b/ghost/admin/app/routes/members.js @@ -5,16 +5,11 @@ export default AuthenticatedRoute.extend({ config: service(), // redirect to posts screen if: - // - developer experiments aren't enabled // - TODO: members is disabled? // - logged in user isn't owner/admin beforeModel() { this._super(...arguments); - if (!this.config.get('enableDeveloperExperiments')) { - return this.transitionTo('home'); - } - return this.session.user.then((user) => { if (!user.isOwnerOrAdmin) { return this.transitionTo('home'); diff --git a/ghost/admin/app/templates/settings/labs.hbs b/ghost/admin/app/templates/settings/labs.hbs index 1c2a822568..86ff4a8225 100644 --- a/ghost/admin/app/templates/settings/labs.hbs +++ b/ghost/admin/app/templates/settings/labs.hbs @@ -201,42 +201,40 @@ {{#if session.user.isOwner}} - {{#if config.enableDeveloperExperiments}} -
Members (BETA)
-
-
-
-
-
-
Members
-
Enable membership for your site
-
-
-
{{gh-feature-flag "members"}}
-
+
Members (BETA)
+
+
+
+
+
+
Members
+
Enable membership for your site
- - {{#liquid-if feature.labs.members}} - {{gh-members-lab-setting - settings=settings - setDefaultContentVisibility=(action "setDefaultContentVisibility") - setMembersSubscriptionSettings=(action "setMembersSubscriptionSettings") - }} - -
- {{gh-task-button "Save members settings" - task=saveSettings - successText="Saved" - runningText="Saving" - class="gh-btn gh-btn-blue gh-btn-icon" - }} +
+
{{gh-feature-flag "members"}}
- {{/liquid-if}}
- + + {{#liquid-if feature.labs.members}} + {{gh-members-lab-setting + settings=settings + setDefaultContentVisibility=(action "setDefaultContentVisibility") + setMembersSubscriptionSettings=(action "setMembersSubscriptionSettings") + }} + +
+ {{gh-task-button "Save members settings" + task=saveSettings + successText="Saved" + runningText="Saving" + class="gh-btn gh-btn-blue gh-btn-icon" + }} +
+ {{/liquid-if}}
+
- {{/if}} +
{{/if}} diff --git a/ghost/admin/tests/acceptance/members-test.js b/ghost/admin/tests/acceptance/members-test.js index d0b8a2b90c..78127ac671 100644 --- a/ghost/admin/tests/acceptance/members-test.js +++ b/ghost/admin/tests/acceptance/members-test.js @@ -32,8 +32,6 @@ describe('Acceptance: Members', function () { describe('as admin', function () { beforeEach(async function () { this.server.loadFixtures('configs'); - let config = this.server.schema.configs.first(); - config.update({enableDeveloperExperiments: true}); let role = this.server.create('role', {name: 'Administrator'}); this.server.create('user', {roles: [role]}); @@ -41,17 +39,6 @@ describe('Acceptance: Members', function () { return await authenticateSession(); }); - it('redirects to home if developer experiments is disabled', async function () { - let config = this.server.schema.configs.first(); - config.update({enableDeveloperExperiments: false}); - - await visit('/members'); - - expect(currentURL()).to.equal('/site'); - expect(find('[data-test-nav="members"]'), 'sidebar link') - .to.not.exist; - }); - it('shows sidebar link which navigates to members list', async function () { await visit('/settings/labs'); await click('#labs-members');