Add names to constants, rename vars for clarity [MAILPOET-877]
This commit is contained in:
@@ -34,7 +34,7 @@ $grey-stat-color = #707070
|
|||||||
&_spaced
|
&_spaced
|
||||||
margin-bottom: 1rem
|
margin-bottom: 1rem
|
||||||
|
|
||||||
&_tplspaced
|
&_triple-spaced
|
||||||
margin-bottom: 3rem
|
margin-bottom: 3rem
|
||||||
|
|
||||||
&_hidden
|
&_hidden
|
||||||
|
@@ -144,14 +144,14 @@ const _QueueMixin = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const _StatisticsMixin = {
|
const _StatisticsMixin = {
|
||||||
renderStatistics: function(newsletter, sent_condition, current_time) {
|
renderStatistics: function(newsletter, is_sent, current_time) {
|
||||||
if (sent_condition === undefined) {
|
if (is_sent === undefined) {
|
||||||
// condition for standard and post notification listings
|
// condition for standard and post notification listings
|
||||||
sent_condition = newsletter.statistics
|
is_sent = newsletter.statistics
|
||||||
&& newsletter.queue
|
&& newsletter.queue
|
||||||
&& newsletter.queue.status !== 'scheduled'
|
&& newsletter.queue.status !== 'scheduled'
|
||||||
}
|
}
|
||||||
if (!sent_condition) {
|
if (!is_sent) {
|
||||||
return (
|
return (
|
||||||
<span>{MailPoet.I18n.t('notSentYet')}</span>
|
<span>{MailPoet.I18n.t('notSentYet')}</span>
|
||||||
);
|
);
|
||||||
@@ -199,9 +199,13 @@ const _StatisticsMixin = {
|
|||||||
|
|
||||||
const improveStatsKBLink = 'http://beta.docs.mailpoet.com/article/191-how-to-improve-my-open-and-click-rates';
|
const improveStatsKBLink = 'http://beta.docs.mailpoet.com/article/191-how-to-improve-my-open-and-click-rates';
|
||||||
|
|
||||||
|
// thresholds to display badges
|
||||||
|
const min_newsletters_sent = 20;
|
||||||
|
const min_newsletter_opens = 5;
|
||||||
|
|
||||||
let content;
|
let content;
|
||||||
if (total_sent >= 20
|
if (total_sent >= min_newsletters_sent
|
||||||
&& newsletter.statistics.opened >= 5
|
&& newsletter.statistics.opened >= min_newsletter_opens
|
||||||
&& !too_early_for_stats
|
&& !too_early_for_stats
|
||||||
) {
|
) {
|
||||||
// display stats with badges
|
// display stats with badges
|
||||||
@@ -250,11 +254,16 @@ const _StatisticsMixin = {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// thresholds to display bad open rate help
|
||||||
|
const max_percentage_opened = 5;
|
||||||
|
const min_sent_hours_ago = 24;
|
||||||
|
const min_total_sent = 10;
|
||||||
|
|
||||||
let after_content;
|
let after_content;
|
||||||
if (show_kb_link
|
if (show_kb_link
|
||||||
&& percentage_opened < 5
|
&& percentage_opened < max_percentage_opened
|
||||||
&& sent_hours_ago >= 24
|
&& sent_hours_ago >= min_sent_hours_ago
|
||||||
&& total_sent >= 10
|
&& total_sent >= min_total_sent
|
||||||
) {
|
) {
|
||||||
// help link for bad open rate
|
// help link for bad open rate
|
||||||
after_content = (
|
after_content = (
|
||||||
|
Reference in New Issue
Block a user