mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Enabled members by default
no-issue This removes the need for `enableDeveloperExperiments` flag for members
This commit is contained in:
parent
49b28e4493
commit
6b1cd8dc23
3 changed files with 29 additions and 49 deletions
|
@ -5,16 +5,11 @@ export default AuthenticatedRoute.extend({
|
||||||
config: service(),
|
config: service(),
|
||||||
|
|
||||||
// redirect to posts screen if:
|
// redirect to posts screen if:
|
||||||
// - developer experiments aren't enabled
|
|
||||||
// - TODO: members is disabled?
|
// - TODO: members is disabled?
|
||||||
// - logged in user isn't owner/admin
|
// - logged in user isn't owner/admin
|
||||||
beforeModel() {
|
beforeModel() {
|
||||||
this._super(...arguments);
|
this._super(...arguments);
|
||||||
|
|
||||||
if (!this.config.get('enableDeveloperExperiments')) {
|
|
||||||
return this.transitionTo('home');
|
|
||||||
}
|
|
||||||
|
|
||||||
return this.session.user.then((user) => {
|
return this.session.user.then((user) => {
|
||||||
if (!user.isOwnerOrAdmin) {
|
if (!user.isOwnerOrAdmin) {
|
||||||
return this.transitionTo('home');
|
return this.transitionTo('home');
|
||||||
|
|
|
@ -201,42 +201,40 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{#if session.user.isOwner}}
|
{{#if session.user.isOwner}}
|
||||||
{{#if config.enableDeveloperExperiments}}
|
<div class="gh-setting-header">Members (BETA) </div>
|
||||||
<div class="gh-setting-header">Members (BETA) </div>
|
<div class="flex flex-column br3 shadow-1 bg-grouped-table mt2">
|
||||||
<div class="flex flex-column br3 shadow-1 bg-grouped-table mt2">
|
<div class="gh-setting-first gh-setting-last">
|
||||||
<div class="gh-setting-first gh-setting-last">
|
<div class="gh-members-setting-content">
|
||||||
<div class="gh-members-setting-content">
|
<div class="flex">
|
||||||
<div class="flex">
|
<div class="flex flex-column flex-grow-1">
|
||||||
<div class="flex flex-column flex-grow-1">
|
<div class="gh-setting-title pl5 pt5">Members</div>
|
||||||
<div class="gh-setting-title pl5 pt5">Members</div>
|
<div class="gh-setting-desc pl5 pb5">Enable membership for your site</div>
|
||||||
<div class="gh-setting-desc pl5 pb5">Enable membership for your site</div>
|
|
||||||
</div>
|
|
||||||
<div class="gh-setting-action">
|
|
||||||
<div class="for-switch pa5">{{gh-feature-flag "members"}}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="gh-setting-action">
|
||||||
{{#liquid-if feature.labs.members}}
|
<div class="for-switch pa5">{{gh-feature-flag "members"}}</div>
|
||||||
{{gh-members-lab-setting
|
|
||||||
settings=settings
|
|
||||||
setDefaultContentVisibility=(action "setDefaultContentVisibility")
|
|
||||||
setMembersSubscriptionSettings=(action "setMembersSubscriptionSettings")
|
|
||||||
}}
|
|
||||||
|
|
||||||
<div class="mt5 pl5 pr5 pb5">
|
|
||||||
{{gh-task-button "Save members settings"
|
|
||||||
task=saveSettings
|
|
||||||
successText="Saved"
|
|
||||||
runningText="Saving"
|
|
||||||
class="gh-btn gh-btn-blue gh-btn-icon"
|
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
{{/liquid-if}}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{{#liquid-if feature.labs.members}}
|
||||||
|
{{gh-members-lab-setting
|
||||||
|
settings=settings
|
||||||
|
setDefaultContentVisibility=(action "setDefaultContentVisibility")
|
||||||
|
setMembersSubscriptionSettings=(action "setMembersSubscriptionSettings")
|
||||||
|
}}
|
||||||
|
|
||||||
|
<div class="mt5 pl5 pr5 pb5">
|
||||||
|
{{gh-task-button "Save members settings"
|
||||||
|
task=saveSettings
|
||||||
|
successText="Saved"
|
||||||
|
runningText="Saving"
|
||||||
|
class="gh-btn gh-btn-blue gh-btn-icon"
|
||||||
|
}}
|
||||||
|
</div>
|
||||||
|
{{/liquid-if}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
|
|
|
@ -32,8 +32,6 @@ describe('Acceptance: Members', function () {
|
||||||
describe('as admin', function () {
|
describe('as admin', function () {
|
||||||
beforeEach(async function () {
|
beforeEach(async function () {
|
||||||
this.server.loadFixtures('configs');
|
this.server.loadFixtures('configs');
|
||||||
let config = this.server.schema.configs.first();
|
|
||||||
config.update({enableDeveloperExperiments: true});
|
|
||||||
|
|
||||||
let role = this.server.create('role', {name: 'Administrator'});
|
let role = this.server.create('role', {name: 'Administrator'});
|
||||||
this.server.create('user', {roles: [role]});
|
this.server.create('user', {roles: [role]});
|
||||||
|
@ -41,17 +39,6 @@ describe('Acceptance: Members', function () {
|
||||||
return await authenticateSession();
|
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 () {
|
it('shows sidebar link which navigates to members list', async function () {
|
||||||
await visit('/settings/labs');
|
await visit('/settings/labs');
|
||||||
await click('#labs-members');
|
await click('#labs-members');
|
||||||
|
|
Loading…
Add table
Reference in a new issue