mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-23 03:42:27 +03:00
✨ Moved Milestone emails to GA
- Moves Milestone emails from public beta to GA✨ Moved Milestone emails to GA - Moves Milestone emails from public beta to GA✨ Moved Milestone emails to GA - Moves Milestone emails from public beta to GA✨ Moved Milestone emails to GA - Moves Milestone emails from public beta to GA✨ Moved Milestone emails to GA - Moves Milestone emails from public beta to GA✨ Moved Milestone emails to GA - Moves Milestone emails from public beta to GA✨ Moved Milestone emails to GA - Moves Milestone emails from public beta to GA✨ Moved Milestone emails to GA - Moves Milestone emails from public beta to GA✨ Moved Milestone emails to GA - Moves Milestone emails from public beta to GA
This commit is contained in:
parent
846a9cdafc
commit
37383fde90
@ -68,7 +68,6 @@ export default class FeatureService extends Service {
|
||||
@feature('webmentions') webmentions;
|
||||
@feature('webmentionEmails') webmentionEmails;
|
||||
@feature('emailErrors') emailErrors;
|
||||
@feature('milestoneEmails') milestoneEmails;
|
||||
@feature('websockets') websockets;
|
||||
@feature('stripeAutomaticTax') stripeAutomaticTax;
|
||||
@feature('makingItRain') makingItRain;
|
||||
|
@ -153,19 +153,6 @@
|
||||
</div>
|
||||
</GhUploader>
|
||||
</div>
|
||||
<div class="gh-expandable-block">
|
||||
<div class="gh-expandable-header">
|
||||
<div>
|
||||
<h4 class="gh-expandable-title">Milestones</h4>
|
||||
<p class="gh-expandable-description">
|
||||
Occasional summaries of your audience & revenue growth
|
||||
</p>
|
||||
</div>
|
||||
<div class="for-switch">
|
||||
<GhFeatureFlag @flag="milestoneEmails" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -346,7 +346,6 @@
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{#if (feature 'milestoneEmails') }}
|
||||
<div class="user-setting-toggle">
|
||||
<div>
|
||||
<label for="user-email">Milestones</label>
|
||||
@ -368,7 +367,6 @@
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</GhFormGroup>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
@ -82,7 +82,6 @@ describe('Acceptance: Staff', function () {
|
||||
enableStripe(this.server);
|
||||
enableLabsFlag(this.server, 'webmentions');
|
||||
enableLabsFlag(this.server, 'webmentionEmails');
|
||||
enableLabsFlag(this.server, 'milestoneEmails');
|
||||
|
||||
admin = this.server.create('user', {email: 'admin@example.com', roles: [adminRole]});
|
||||
|
||||
|
@ -60,9 +60,6 @@ module.exports = {
|
||||
* @returns {Promise<object>}
|
||||
*/
|
||||
async run() {
|
||||
const labs = require('../../../shared/labs');
|
||||
|
||||
if (labs.isSet('milestoneEmails')) {
|
||||
const members = await this.api.checkMilestones('members');
|
||||
let arr;
|
||||
const stripeLiveEnabled = getStripeLiveEnabled();
|
||||
@ -75,7 +72,6 @@ module.exports = {
|
||||
members,
|
||||
arr
|
||||
};
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -1,6 +1,5 @@
|
||||
const DomainEvents = require('@tryghost/domain-events');
|
||||
const config = require('../../../shared/config');
|
||||
const labs = require('../../../shared/labs');
|
||||
const logging = require('@tryghost/logging');
|
||||
|
||||
class SlackNotificationsServiceWrapper {
|
||||
@ -48,7 +47,7 @@ class SlackNotificationsServiceWrapper {
|
||||
const hostSettings = config.get('hostSettings');
|
||||
const urlUtils = require('../../../shared/url-utils');
|
||||
const siteUrl = urlUtils.getSiteUrl();
|
||||
const isEnabled = (labs.isSet('milestoneEmails') && hostSettings?.milestones?.enabled && hostSettings?.milestones?.url) ? true : false;
|
||||
const isEnabled = !!(hostSettings?.milestones?.enabled && hostSettings?.milestones?.url);
|
||||
const webhookUrl = hostSettings?.milestones?.url;
|
||||
|
||||
this.#api = SlackNotificationsServiceWrapper.create({siteUrl, isEnabled, webhookUrl});
|
||||
|
@ -28,8 +28,7 @@ const GA_FEATURES = [
|
||||
// input for the "labs" setting value
|
||||
const BETA_FEATURES = [
|
||||
'activitypub',
|
||||
'webmentions',
|
||||
'milestoneEmails'
|
||||
'webmentions'
|
||||
];
|
||||
|
||||
const ALPHA_FEATURES = [
|
||||
|
@ -166,7 +166,6 @@ describe('Milestones Service', function () {
|
||||
});
|
||||
sinon.createSandbox();
|
||||
configUtils.set('milestones', milestonesConfig);
|
||||
mockManager.mockLabsEnabled('milestoneEmails');
|
||||
mockManager.mockMail();
|
||||
});
|
||||
|
||||
@ -298,15 +297,4 @@ describe('Milestones Service', function () {
|
||||
|
||||
assert(loggingStub.called);
|
||||
});
|
||||
|
||||
it('Does not run when milestoneEmails labs flag is not set', async function () {
|
||||
mockManager.mockLabsDisabled('milestoneEmails');
|
||||
|
||||
const resultPromise = milestonesService.initAndRun(fifteenDays);
|
||||
await clock.tickAsync(fifteenDays);
|
||||
const result = await resultPromise;
|
||||
assert(result === undefined);
|
||||
|
||||
assert(loggingStub.called);
|
||||
});
|
||||
});
|
||||
|
@ -1,4 +1,4 @@
|
||||
const {mockManager, configUtils} = require('../../../../utils/e2e-framework');
|
||||
const {configUtils} = require('../../../../utils/e2e-framework');
|
||||
const assert = require('assert');
|
||||
const nock = require('nock');
|
||||
const DomainEvents = require('@tryghost/domain-events');
|
||||
@ -11,8 +11,6 @@ describe('Slack Notifications Service', function () {
|
||||
beforeEach(function () {
|
||||
configUtils.set('hostSettings', {milestones: {enabled: true, url: 'https://testhooks.slack.com/'}});
|
||||
|
||||
mockManager.mockLabsEnabled('milestoneEmails');
|
||||
|
||||
scope = nock('https://testhooks.slack.com/')
|
||||
.post('/')
|
||||
.reply(200, {ok: true});
|
||||
@ -21,7 +19,6 @@ describe('Slack Notifications Service', function () {
|
||||
afterEach(async function () {
|
||||
nock.cleanAll();
|
||||
await configUtils.restore();
|
||||
mockManager.restore();
|
||||
});
|
||||
|
||||
it('Can send a milestone created event', async function () {
|
||||
|
@ -17,7 +17,6 @@ describe('Staff Service:', function () {
|
||||
mockManager.mockMail();
|
||||
mockManager.mockSlack();
|
||||
mockManager.mockSetting('title', 'The Weekly Roundup');
|
||||
mockManager.mockLabsEnabled('milestoneEmails');
|
||||
|
||||
sinon.stub(models.User, 'getEmailAlertUsers').resolves([{
|
||||
email: 'owner@ghost.org',
|
||||
|
@ -78,7 +78,7 @@ class StaffService {
|
||||
|
||||
/** @private */
|
||||
async handleEvent(type, event) {
|
||||
if (type === MilestoneCreatedEvent && event.data.milestone && this.labs.isSet('milestoneEmails')) {
|
||||
if (type === MilestoneCreatedEvent && event.data.milestone) {
|
||||
await this.emails.notifyMilestoneReceived(event.data);
|
||||
}
|
||||
|
||||
|
@ -121,10 +121,7 @@ describe('StaffService', function () {
|
||||
};
|
||||
let stubs;
|
||||
let labs = {
|
||||
isSet: (flag) => {
|
||||
if (flag === 'milestoneEmails') {
|
||||
return true;
|
||||
}
|
||||
isSet: () => {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
@ -341,10 +338,7 @@ describe('StaffService', function () {
|
||||
urlUtils,
|
||||
settingsHelpers,
|
||||
labs: {
|
||||
isSet: (flag) => {
|
||||
if (flag === 'milestoneEmails') {
|
||||
return true;
|
||||
}
|
||||
isSet: () => {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user