Cleaned up removed feature flags

refs https://github.com/TryGhost/Team/issues/1616
This commit is contained in:
Simon Backx 2022-05-25 09:50:29 +02:00
parent edbdcb410d
commit 49c0a64184
10 changed files with 29 additions and 92 deletions

View File

@ -46,14 +46,11 @@ export default class extends Component {
}
get hasSingleNewsletter() {
if (!this.feature.get('multipleNewsletters')) {
return true;
}
return this.newslettersList?.length === 1;
}
get hasMultipleNewsletters() {
return !!(this.feature.get('multipleNewsletters') && this.newslettersList?.length > 1);
return !!(this.newslettersList?.length > 1);
}
get isCreatingComplimentary() {
@ -124,9 +121,7 @@ export default class extends Component {
@action
setup() {
this.fetchTiers.perform();
if (this.feature.get('multipleNewsletters')) {
this.fetchNewsletters.perform();
}
this.fetchNewsletters.perform();
}
@action

View File

@ -22,25 +22,23 @@
</div>
</div>
</LinkTo>
{{#if (feature "membersTableStatus")}}
{{#if this.hasMultipleTiers}}
<LinkTo @route="member" @model={{@member}} class="gh-list-data">
{{#if (not (is-empty @member.status))}}
<span>{{capitalize @member.status}}</span>
{{else}}
<span class="midlightgrey">-</span>
{{/if}}
<div class="midgrey">{{this.tiers}}</div>
</LinkTo>
{{else}}
<LinkTo @route="member" @model={{@member}} class="gh-list-data" data-test-table-data="status">
{{#if (not (is-empty @member.status))}}
<span>{{capitalize @member.status}}</span>
{{else}}
<span class="midlightgrey">-</span>
{{/if}}
</LinkTo>
{{/if}}
{{#if this.hasMultipleTiers}}
<LinkTo @route="member" @model={{@member}} class="gh-list-data" data-test-table-data="status">
{{#if (not (is-empty @member.status))}}
<span>{{capitalize @member.status}}</span>
{{else}}
<span class="midlightgrey">-</span>
{{/if}}
<div class="midgrey">{{this.tiers}}</div>
</LinkTo>
{{else}}
<LinkTo @route="member" @model={{@member}} class="gh-list-data" data-test-table-data="status">
{{#if (not (is-empty @member.status))}}
<span>{{capitalize @member.status}}</span>
{{else}}
<span class="midlightgrey">-</span>
{{/if}}
</LinkTo>
{{/if}}
{{#if @newsletterEnabled}}
{{#if (feature "emailAnalytics")}}

View File

@ -1,10 +1,6 @@
<div class="gh-main-section gh-newsletters">
<div class="flex justify-between items-center">
{{#if (feature "multipleNewslettersUI")}}
<h4 class="gh-main-section-header small bn">Newsletters</h4>
{{else}}
<h4 class="gh-main-section-header small bn">Newsletter</h4>
{{/if}}
<h4 class="gh-main-section-header small bn">Newsletters</h4>
{{#if this.archivedNewsletters}}
<div>
<div>

View File

@ -161,10 +161,7 @@ export default class MembersController extends Controller {
}
get filterColumns() {
const defaultColumns = ['name', 'email', 'email_open_rate', 'created_at'];
if (this.feature.get('membersTableStatus')) {
defaultColumns.push('status', 'tier');
}
const defaultColumns = ['name', 'email', 'email_open_rate', 'created_at', 'status', 'tier'];
const availableFilters = this.filters.length ? this.filters : this.softFilters;
return availableFilters.map((filter) => {
return filter.type;

View File

@ -56,13 +56,9 @@ export default class FeatureService extends Service {
nightShift;
// labs flags
@feature('membersActivity') membersActivity;
@feature('urlCache') urlCache;
@feature('beforeAfterCard') beforeAfterCard;
@feature('multipleNewsletters') multipleNewsletters;
@feature('multipleNewslettersUI') multipleNewslettersUI;
@feature('tweetGridCard') tweetGridCard;
@feature('membersTableStatus') membersTableStatus;
@feature('selectablePortalLinks') selectablePortalLinks;
_user = null;

View File

@ -112,9 +112,7 @@
<thead>
<tr>
<th>{{this.listHeader}}</th>
{{#if (feature "membersTableStatus")}}
<th data-test-table-column="status">Status</th>
{{/if}}
<th data-test-table-column="status">Status</th>
{{#if (not-eq this.settings.editorDefaultEmailRecipients "disabled")}}
<th data-test-table-column="email_open_rate">Open rate</th>
{{/if}}

View File

@ -187,19 +187,6 @@
<div class="gh-main-section">
<h4 class="gh-main-section-header small bn">Alpha Features</h4>
<div class="gh-expandable">
<div class="gh-expandable-block">
<div class="gh-expandable-header">
<div>
<h4 class="gh-expandable-title">Members Activity</h4>
<p class="gh-expandable-description">
Enable recording of member activity for analytics
</p>
</div>
<div class="for-switch">
<GhFeatureFlag @flag="membersActivity" />
</div>
</div>
</div>
<div class="gh-expandable-block">
<div class="gh-expandable-header">
<div>
@ -239,32 +226,6 @@
</div>
</div>
</div>
<div class="gh-expandable-block">
<div class="gh-expandable-header">
<div>
<h4 class="gh-expandable-title">Multiple newsletters</h4>
<p class="gh-expandable-description">
Manage and send multiple newsletter lists
</p>
</div>
<div class="for-switch">
<GhFeatureFlag @flag="multipleNewsletters" />
</div>
</div>
</div>
<div class="gh-expandable-block">
<div class="gh-expandable-header">
<div>
<h4 class="gh-expandable-title">Multiple newsletters UI</h4>
<p class="gh-expandable-description">
Enables creating multiple newsletters
</p>
</div>
<div class="for-switch">
<GhFeatureFlag @flag="multipleNewslettersUI" />
</div>
</div>
</div>
</div>
</div>
{{/if}}

View File

@ -75,8 +75,6 @@ export default [
key: 'labs',
value: JSON.stringify({
// Keep the GA flags that are not yet cleaned up in frontend code here
multipleNewsletters: true,
multipleNewslettersUI: true
}),
group: 'labs',
created_at: '2015-01-12T18:29:01.000Z',

View File

@ -1,7 +1,6 @@
import {authenticateSession, invalidateSession} from 'ember-simple-auth/test-support';
import {currentURL, visit} from '@ember/test-helpers';
import {describe, it} from 'mocha';
import {enableLabsFlag} from '../helpers/labs-flag';
import {expect} from 'chai';
import {setupApplicationTest} from 'ember-mocha';
import {setupMirage} from 'ember-cli-mirage/test-support';
@ -13,7 +12,6 @@ describe('Acceptance: Dashboard', function () {
beforeEach(async function () {
this.server.loadFixtures('configs');
this.server.loadFixtures('settings');
enableLabsFlag(this.server, 'membersActivity');
let role = this.server.create('role', {name: 'Administrator'});
this.server.create('user', {roles: [role]});

View File

@ -58,7 +58,7 @@ describe('Acceptance: Members filtering', function () {
expect(find('[data-test-button="members-filter-actions"] span'), 'filter button').to.not.have.class('gh-btn-label-green');
// standard columns are shown
expect(findAll('[data-test-table="members"] [data-test-table-column]').length).to.equal(3);
expect(findAll('[data-test-table="members"] [data-test-table-column]').length).to.equal(4);
});
describe('filtering', function () {
@ -112,15 +112,15 @@ describe('Acceptance: Members filtering', function () {
});
it('can filter by tier', async function () {
// add some labels to test the selection dropdown
// add multiple tiers to activate tiers filtering
const newsletter = this.server.create('newsletter', {status: 'active'});
this.server.createList('tier', 4);
// add a labelled member so we can test the filter includes correctly
// add some members with tiers
const tier = this.server.create('tier');
this.server.createList('member', 3, {tiers: [tier], newsletters: [newsletter]});
// add some non-labelled members so we can see the filter excludes correctly
// add some free members so we can see the filter excludes correctly
this.server.createList('member', 4, {newsletters: [newsletter]});
await visit('/members');
@ -149,9 +149,9 @@ describe('Acceptance: Members filtering', function () {
expect(findAll('[data-test-list="members-list-item"]').length, `# of filtered member rows - ${tier.name}`)
.to.equal(3);
// table shows labels column+data
expect(find('[data-test-table-column="tier"]')).to.exist;
expect(findAll('[data-test-table-data="tier"]').length).to.equal(3);
expect(find('[data-test-table-data="tier"]')).to.contain.text(tier.name);
expect(find('[data-test-table-column="status"]')).to.exist;
expect(findAll('[data-test-table-data="status"]').length).to.equal(3);
expect(find('[data-test-table-data="status"]')).to.contain.text(tier.name);
// can delete filter
await click('[data-test-delete-members-filter="0"]');