Confirmation modal when launching campaign
This commit is contained in:
parent
5d08db67b3
commit
75daaa1a65
3 changed files with 18 additions and 2 deletions
|
@ -225,6 +225,18 @@ class SendControls extends Component {
|
||||||
await this.refreshEntity();
|
await this.refreshEntity();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async confirmStart() {
|
||||||
|
const t = this.props.t;
|
||||||
|
this.actionDialog(
|
||||||
|
t('confirmLaunch'),
|
||||||
|
t('doYouWantToLaunchTheCampaign?All'),
|
||||||
|
async () => {
|
||||||
|
await this.startAsync();
|
||||||
|
await this.refreshEntity();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
async resetAsync() {
|
async resetAsync() {
|
||||||
const t = this.props.t;
|
const t = this.props.t;
|
||||||
this.actionDialog(
|
this.actionDialog(
|
||||||
|
@ -306,7 +318,7 @@ class SendControls extends Component {
|
||||||
{this.getFormValue('sendLater') ?
|
{this.getFormValue('sendLater') ?
|
||||||
<Button className="btn-primary" icon="send" label={(entity.scheduled ? t('rescheduleSend') : t('scheduleSend')) + subscrInfo} onClickAsync={::this.scheduleAsync}/>
|
<Button className="btn-primary" icon="send" label={(entity.scheduled ? t('rescheduleSend') : t('scheduleSend')) + subscrInfo} onClickAsync={::this.scheduleAsync}/>
|
||||||
:
|
:
|
||||||
<Button className="btn-primary" icon="send" label={t('send') + subscrInfo} onClickAsync={::this.startAsync}/>
|
<Button className="btn-primary" icon="send" label={t('send') + subscrInfo} onClickAsync={::this.confirmStart}/>
|
||||||
}
|
}
|
||||||
{entity.status === CampaignStatus.PAUSED && <LinkButton className="btn-secondary" icon="signal" label={t('viewStatistics')} to={`/campaigns/${entity.id}/statistics`}/>}
|
{entity.status === CampaignStatus.PAUSED && <LinkButton className="btn-secondary" icon="signal" label={t('viewStatistics')} to={`/campaigns/${entity.id}/statistics`}/>}
|
||||||
</ButtonRow>
|
</ButtonRow>
|
||||||
|
@ -335,7 +347,7 @@ class SendControls extends Component {
|
||||||
{t('allMessagesSent!HitContinueIfYouYouWant')}
|
{t('allMessagesSent!HitContinueIfYouYouWant')}
|
||||||
</AlignedRow>
|
</AlignedRow>
|
||||||
<ButtonRow>
|
<ButtonRow>
|
||||||
<Button className="btn-primary" icon="play" label={t('continue') + subscrInfo} onClickAsync={::this.startAsync}/>
|
<Button className="btn-primary" icon="play" label={t('continue') + subscrInfo} onClickAsync={::this.confirmStart}/>
|
||||||
<Button className="btn-primary" icon="refresh" label={t('reset')} onClickAsync={::this.resetAsync}/>
|
<Button className="btn-primary" icon="refresh" label={t('reset')} onClickAsync={::this.resetAsync}/>
|
||||||
<LinkButton className="btn-secondary" icon="signal" label={t('viewStatistics')} to={`/campaigns/${entity.id}/statistics`}/>
|
<LinkButton className="btn-secondary" icon="signal" label={t('viewStatistics')} to={`/campaigns/${entity.id}/statistics`}/>
|
||||||
</ButtonRow>
|
</ButtonRow>
|
||||||
|
|
|
@ -245,7 +245,9 @@
|
||||||
"timeMustNotBeEmpty": "Time must not be empty",
|
"timeMustNotBeEmpty": "Time must not be empty",
|
||||||
"timeIsInvalid": "Time is invalid",
|
"timeIsInvalid": "Time is invalid",
|
||||||
"confirmReset": "Confirm reset",
|
"confirmReset": "Confirm reset",
|
||||||
|
"confirmLaunch": "Confirm launch",
|
||||||
"doYouWantToResetTheCampaign?All": "Do you want to reset the campaign? All statistics and the track of delivered messages will be lost.",
|
"doYouWantToResetTheCampaign?All": "Do you want to reset the campaign? All statistics and the track of delivered messages will be lost.",
|
||||||
|
"doYouWantToLaunchTheCampaign?All": "Do you want to launch the campaign?",
|
||||||
"no": "No",
|
"no": "No",
|
||||||
"yes": "Yes",
|
"yes": "Yes",
|
||||||
"subscribers-1": "subscribers",
|
"subscribers-1": "subscribers",
|
||||||
|
|
|
@ -245,7 +245,9 @@
|
||||||
"timeMustNotBeEmpty": "Time must not be empty",
|
"timeMustNotBeEmpty": "Time must not be empty",
|
||||||
"timeIsInvalid": "Time is invalid",
|
"timeIsInvalid": "Time is invalid",
|
||||||
"confirmReset": "Confirm reset",
|
"confirmReset": "Confirm reset",
|
||||||
|
"confirmLaunch": "Confirm launch",
|
||||||
"doYouWantToResetTheCampaign?All": "Do you want to reset the campaign? All statistics and the track of delivered messages will be lost.",
|
"doYouWantToResetTheCampaign?All": "Do you want to reset the campaign? All statistics and the track of delivered messages will be lost.",
|
||||||
|
"doYouWantToLaunchTheCampaign?All": "Do you want to launch the campaign?",
|
||||||
"no": "No",
|
"no": "No",
|
||||||
"yes": "Yes",
|
"yes": "Yes",
|
||||||
"subscribers-1": "subscribers",
|
"subscribers-1": "subscribers",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue