Various fixes.
This commit is contained in:
parent
dd9b8b464a
commit
83ce716d94
21 changed files with 99 additions and 114 deletions
|
@ -109,12 +109,10 @@ export default class List extends Component {
|
|||
link: `/campaigns/${data[0]}/status`
|
||||
});
|
||||
|
||||
if (status === CampaignStatus.SENDING || status === CampaignStatus.PAUSED || status === CampaignStatus.FINISHED) {
|
||||
actions.push({
|
||||
label: <Icon icon="signal" title={t('statistics')}/>,
|
||||
link: `/campaigns/${data[0]}/statistics`
|
||||
});
|
||||
}
|
||||
actions.push({
|
||||
label: <Icon icon="signal" title={t('statistics')}/>,
|
||||
link: `/campaigns/${data[0]}/statistics`
|
||||
});
|
||||
}
|
||||
|
||||
if (perms.includes('edit')) {
|
||||
|
|
|
@ -35,7 +35,6 @@ export default class Statistics extends Component {
|
|||
|
||||
this.state = {
|
||||
entity: props.entity,
|
||||
statisticsOverview: props.statisticsOverview
|
||||
};
|
||||
|
||||
this.refreshTimeoutHandler = ::this.periodicRefreshTask;
|
||||
|
@ -43,8 +42,7 @@ export default class Statistics extends Component {
|
|||
}
|
||||
|
||||
static propTypes = {
|
||||
entity: PropTypes.object,
|
||||
statisticsOverview: PropTypes.object
|
||||
entity: PropTypes.object
|
||||
}
|
||||
|
||||
@withAsyncErrorHandler
|
||||
|
@ -54,12 +52,8 @@ export default class Statistics extends Component {
|
|||
resp = await axios.get(getUrl(`rest/campaigns-stats/${this.props.entity.id}`));
|
||||
const entity = resp.data;
|
||||
|
||||
resp = await axios.get(getUrl(`rest/campaign-statistics/${this.props.entity.id}/overview`));
|
||||
const statisticsOverview = resp.data;
|
||||
|
||||
this.setState({
|
||||
entity,
|
||||
statisticsOverview
|
||||
entity
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -85,11 +79,10 @@ export default class Statistics extends Component {
|
|||
render() {
|
||||
const t = this.props.t;
|
||||
const entity = this.state.entity;
|
||||
|
||||
const stats = this.state.statisticsOverview;
|
||||
const total = entity.subscriptionsToSend === undefined ? undefined : entity.subscriptionsToSend + entity.delivered;
|
||||
|
||||
const renderMetrics = (key, label, showZoomIn = true) => {
|
||||
const val = stats[key]
|
||||
const val = entity[key]
|
||||
|
||||
return (
|
||||
<AlignedRow label={label}><span className={styles.statsMetrics}>{val}</span>{showZoomIn && <span className={styles.zoomIn}><Link to={`/campaigns/${entity.id}/statistics/${key}`}><Icon icon="zoom-in"/></Link></span>}</AlignedRow>
|
||||
|
@ -97,13 +90,13 @@ export default class Statistics extends Component {
|
|||
}
|
||||
|
||||
const renderMetricsWithProgress = (key, label, progressBarClass, showZoomIn = true) => {
|
||||
const val = stats[key]
|
||||
const val = entity[key]
|
||||
|
||||
if (!stats.total) {
|
||||
if (!total) {
|
||||
return renderMetrics(key, label);
|
||||
}
|
||||
|
||||
const rate = Math.round(val / stats.total * 100);
|
||||
const rate = Math.round(val / total * 100);
|
||||
|
||||
return (
|
||||
<AlignedRow label={label}>
|
||||
|
@ -112,9 +105,6 @@ export default class Statistics extends Component {
|
|||
<div
|
||||
className={`progress-bar progress-bar-${progressBarClass}`}
|
||||
role="progressbar"
|
||||
aria-valuenow={stats.bounced}
|
||||
aria-valuemin="0"
|
||||
aria-valuemax="100"
|
||||
style={{minWidth: '6em', width: rate + '%'}}>
|
||||
{val} ({rate}%)
|
||||
</div>
|
||||
|
|
|
@ -60,7 +60,7 @@ export default class StatisticsOpened extends Component {
|
|||
async refreshEntity() {
|
||||
let resp;
|
||||
|
||||
resp = await axios.get(getUrl(`rest/campaigns-stats/${this.props.entity.id}`));
|
||||
resp = await axios.get(getUrl(`rest/campaigns-settings/${this.props.entity.id}`));
|
||||
const entity = resp.data;
|
||||
|
||||
resp = await axios.get(getUrl(`rest/campaign-statistics/${this.props.entity.id}/opened`));
|
||||
|
@ -132,7 +132,7 @@ export default class StatisticsOpened extends Component {
|
|||
<h4 className={styles.chartTitle}>{t('Distribution by device type')}</h4>
|
||||
<Chart
|
||||
width="100%"
|
||||
height="300px"
|
||||
height="380px"
|
||||
chartType="PieChart"
|
||||
loader={<div>{t('Loading chart')}</div>}
|
||||
data={[
|
||||
|
@ -144,7 +144,7 @@ export default class StatisticsOpened extends Component {
|
|||
left: "25%",
|
||||
top: 15,
|
||||
width: "100%",
|
||||
height: 270
|
||||
height: 350
|
||||
},
|
||||
tooltip: {
|
||||
showColorCode: true
|
||||
|
@ -169,7 +169,7 @@ export default class StatisticsOpened extends Component {
|
|||
<div className={`col-md-6 ${styles.chart}`}>
|
||||
<Chart
|
||||
width="100%"
|
||||
height="300px"
|
||||
height="380px"
|
||||
chartType="PieChart"
|
||||
loader={<div>{t('Loading chart')}</div>}
|
||||
data={[
|
||||
|
@ -181,7 +181,7 @@ export default class StatisticsOpened extends Component {
|
|||
left: "25%",
|
||||
top: 15,
|
||||
width: "100%",
|
||||
height: 270
|
||||
height: 350
|
||||
},
|
||||
tooltip: {
|
||||
showColorCode: true
|
||||
|
@ -199,7 +199,7 @@ export default class StatisticsOpened extends Component {
|
|||
<div className={`col-md-6 ${styles.chart}`}>
|
||||
<Chart
|
||||
width="100%"
|
||||
height="300px"
|
||||
height="380px"
|
||||
chartType="GeoChart"
|
||||
data={[
|
||||
['Country', 'Count'],
|
||||
|
|
|
@ -273,7 +273,7 @@ class SendControls extends Component {
|
|||
|
||||
if (entity.status === CampaignStatus.IDLE || entity.status === CampaignStatus.PAUSED || (entity.status === CampaignStatus.SCHEDULED && entity.scheduled)) {
|
||||
|
||||
const subscrInfo = entity.subscriptionsTotal === undefined ? '' : ` (${entity.subscriptionsToSend} ${t('subscribers-1')})`;
|
||||
const subscrInfo = entity.subscriptionsToSend === undefined ? '' : ` (${entity.subscriptionsToSend} ${t('subscribers-1')})`;
|
||||
|
||||
return (
|
||||
<div>{yesNoDialog}
|
||||
|
@ -316,7 +316,7 @@ class SendControls extends Component {
|
|||
);
|
||||
|
||||
} else if (entity.status === CampaignStatus.FINISHED) {
|
||||
const subscrInfo = entity.subscriptionsTotal === undefined ? '' : ` (${entity.subscriptionsToSend} ${t('subscribers-1')})`;
|
||||
const subscrInfo = entity.subscriptionsToSend === undefined ? '' : ` (${entity.subscriptionsToSend} ${t('subscribers-1')})`;
|
||||
|
||||
return (
|
||||
<div>{yesNoDialog}
|
||||
|
@ -479,7 +479,7 @@ export default class Status extends Component {
|
|||
<Title>{t('campaignStatus')}</Title>
|
||||
|
||||
<AlignedRow label={t('name')}>{entity.name}</AlignedRow>
|
||||
<AlignedRow label={t('subscribers')}>{entity.subscriptionsTotal === undefined ? t('computing') : entity.subscriptionsTotal}</AlignedRow>
|
||||
<AlignedRow label={t('Delivered')}>{entity.delivered}</AlignedRow>
|
||||
<AlignedRow label={t('status')}>{this.campaignStatusLabels[entity.status]}</AlignedRow>
|
||||
|
||||
{sendSettings}
|
||||
|
|
|
@ -62,12 +62,9 @@ function getMenus(t) {
|
|||
},
|
||||
statistics: {
|
||||
title: t('statistics'),
|
||||
resolve: {
|
||||
statisticsOverview: params => `rest/campaign-statistics/${params.campaignId}/overview`
|
||||
},
|
||||
link: params => `/campaigns/${params.campaignId}/statistics`,
|
||||
visible: resolved => resolved.campaign.permissions.includes('viewStats') && (resolved.campaign.status === CampaignStatus.SENDING || resolved.campaign.status === CampaignStatus.PAUSED || resolved.campaign.status === CampaignStatus.FINISHED),
|
||||
panelRender: props => <Statistics entity={props.resolved.campaign} statisticsOverview={props.resolved.statisticsOverview} />,
|
||||
visible: resolved => resolved.campaign.permissions.includes('viewStats'),
|
||||
panelRender: props => <Statistics entity={props.resolved.campaign} />,
|
||||
children: {
|
||||
delivered: {
|
||||
title: t('Delivered'),
|
||||
|
|
|
@ -201,7 +201,7 @@ export class UntrustedContentRoot extends Component {
|
|||
this.clientHeight = newHeight;
|
||||
this.sendMessage('clientHeight', newHeight);
|
||||
}
|
||||
//this.periodicTimeoutId = setTimeout(this.periodicTimeoutHandler, 250);
|
||||
this.periodicTimeoutId = setTimeout(this.periodicTimeoutHandler, 250);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -216,7 +216,7 @@ export default class CUD extends Component {
|
|||
|
||||
<TextArea id="description" label={t('description')}/>
|
||||
|
||||
<InputField id="contact_email" label={t('contactEmail')} help={t('contactEmailUsedInSubscriptionFormsAnd')}/>
|
||||
<InputField id="contact_email" label={t('contactEmail')} help={t('Contact email shown in the list subscription and management forms. If no contact email is given, the admin email from Global settings is used.')}/>
|
||||
<InputField id="homepage" label={t('homepage')} help={t('homepageUrlUsedInSubscriptionFormsAnd')}/>
|
||||
<InputField id="to_name" label={t('recipientsNameTemplate')} help={t('specifyUsingMergeTagsOfThisListHowTo')}/>
|
||||
<TableSelect id="send_configuration" label={t('sendConfiguration')} withHeader dropdown dataUrl='rest/send-configurations-table' columns={sendConfigurationsColumns} selectionLabelIndex={1} help={t('sendConfigurationThatWillBeUsedFor')}/>
|
||||
|
|
|
@ -90,7 +90,7 @@ export default class CUD extends Component {
|
|||
' Email\n' +
|
||||
' </th>\n' +
|
||||
' <th>\n' +
|
||||
' Tracker Count\n' +
|
||||
' Open Count\n' +
|
||||
' </th>\n' +
|
||||
' </thead>\n' +
|
||||
' {{#if results}}\n' +
|
||||
|
|
|
@ -271,7 +271,7 @@ export function getMailerTypes(t) {
|
|||
beforeSaveGenericSMTP(data, zoneMtaType === ZoneMTAType.BUILTIN);
|
||||
|
||||
data.mailer_settings.zoneMtaType = zoneMtaType;
|
||||
if (zoneMtaType === ZoneMTAType.WITH_HTTP_CONF || zoneMtaType === ZoneMTAType.WITH_MAILTRAIN_HEADER_CONF) {
|
||||
if (zoneMtaType === ZoneMTAType.BUILTIN || zoneMtaType === ZoneMTAType.WITH_HTTP_CONF || zoneMtaType === ZoneMTAType.WITH_MAILTRAIN_HEADER_CONF) {
|
||||
data.mailer_settings.dkimDomain = data.dkimDomain;
|
||||
data.mailer_settings.dkimSelector = data.dkimSelector;
|
||||
data.mailer_settings.dkimPrivateKey = data.dkimPrivateKey;
|
||||
|
@ -334,4 +334,4 @@ export function getMailerTypes(t) {
|
|||
};
|
||||
|
||||
return mailerTypes;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue