mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
[chore] runs native classes codemod for apps/helpers (#2241)
refs https://github.com/TryGhost/Admin/pull/2227 - a continuation of #2227 that runs the native classes codemod against app/helpers
This commit is contained in:
parent
a1ba715d0a
commit
c849bea549
2 changed files with 16 additions and 7 deletions
|
@ -1,10 +1,13 @@
|
||||||
import Helper from '@ember/component/helper';
|
import Helper from '@ember/component/helper';
|
||||||
|
import classic from 'ember-classic-decorator';
|
||||||
import md5 from 'blueimp-md5';
|
import md5 from 'blueimp-md5';
|
||||||
import {isEmpty} from '@ember/utils';
|
import {isEmpty} from '@ember/utils';
|
||||||
import {inject as service} from '@ember/service';
|
import {inject as service} from '@ember/service';
|
||||||
|
|
||||||
export default Helper.extend({
|
@classic
|
||||||
config: service(),
|
export default class Gravatar extends Helper {
|
||||||
|
@service
|
||||||
|
config;
|
||||||
|
|
||||||
compute([email], {size = 180, d = 'blank'}/*, hash*/) {
|
compute([email], {size = 180, d = 'blank'}/*, hash*/) {
|
||||||
if (!this.get('config.useGravatar')) {
|
if (!this.get('config.useGravatar')) {
|
||||||
|
@ -17,4 +20,4 @@ export default Helper.extend({
|
||||||
|
|
||||||
return `https://www.gravatar.com/avatar/${md5(email)}?s=${size}&d=${d}`;
|
return `https://www.gravatar.com/avatar/${md5(email)}?s=${size}&d=${d}`;
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
|
|
@ -1,14 +1,20 @@
|
||||||
import Helper from '@ember/component/helper';
|
import Helper from '@ember/component/helper';
|
||||||
|
import classic from 'ember-classic-decorator';
|
||||||
import {isBlank} from '@ember/utils';
|
import {isBlank} from '@ember/utils';
|
||||||
import {inject as service} from '@ember/service';
|
import {inject as service} from '@ember/service';
|
||||||
|
|
||||||
export const EMAIL_EVENTS = ['email_delivered_event','email_opened_event','email_failed_event'];
|
export const EMAIL_EVENTS = ['email_delivered_event','email_opened_event','email_failed_event'];
|
||||||
export const NEWSLETTER_EVENTS = ['newsletter_event'];
|
export const NEWSLETTER_EVENTS = ['newsletter_event'];
|
||||||
|
|
||||||
export default Helper.extend({
|
@classic
|
||||||
settings: service(),
|
export default class MembersEventFilter extends Helper {
|
||||||
|
@service
|
||||||
|
settings;
|
||||||
|
|
||||||
compute(positionalParams, {excludedEvents = [], member = '', excludeEmailEvents = false}) {
|
compute(
|
||||||
|
positionalParams,
|
||||||
|
{excludedEvents = [], member = '', excludeEmailEvents = false}
|
||||||
|
) {
|
||||||
const excludedEventsSet = new Set();
|
const excludedEventsSet = new Set();
|
||||||
|
|
||||||
if (this.settings.get('editorDefaultEmailRecipients') === 'disabled') {
|
if (this.settings.get('editorDefaultEmailRecipients') === 'disabled') {
|
||||||
|
@ -36,4 +42,4 @@ export default Helper.extend({
|
||||||
|
|
||||||
return filterParts.join('+');
|
return filterParts.join('+');
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue