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();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    async confirmStart() {
 | 
			
		||||
        const t = this.props.t;
 | 
			
		||||
        this.actionDialog(
 | 
			
		||||
            t('confirmLaunch'),
 | 
			
		||||
            t('doYouWantToLaunchTheCampaign?All'),
 | 
			
		||||
            async () => {
 | 
			
		||||
                await this.startAsync();
 | 
			
		||||
                await this.refreshEntity();
 | 
			
		||||
            }
 | 
			
		||||
        );
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    async resetAsync() {
 | 
			
		||||
        const t = this.props.t;
 | 
			
		||||
        this.actionDialog(
 | 
			
		||||
| 
						 | 
				
			
			@ -306,7 +318,7 @@ class SendControls extends Component {
 | 
			
		|||
                        {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={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`}/>}
 | 
			
		||||
                    </ButtonRow>
 | 
			
		||||
| 
						 | 
				
			
			@ -335,7 +347,7 @@ class SendControls extends Component {
 | 
			
		|||
                        {t('allMessagesSent!HitContinueIfYouYouWant')}
 | 
			
		||||
                    </AlignedRow>
 | 
			
		||||
                    <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}/>
 | 
			
		||||
                        <LinkButton className="btn-secondary" icon="signal" label={t('viewStatistics')} to={`/campaigns/${entity.id}/statistics`}/>
 | 
			
		||||
                    </ButtonRow>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -245,7 +245,9 @@
 | 
			
		|||
  "timeMustNotBeEmpty": "Time must not be empty",
 | 
			
		||||
  "timeIsInvalid": "Time is invalid",
 | 
			
		||||
  "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.",
 | 
			
		||||
  "doYouWantToLaunchTheCampaign?All": "Do you want to launch the campaign?",
 | 
			
		||||
  "no": "No",
 | 
			
		||||
  "yes": "Yes",
 | 
			
		||||
  "subscribers-1": "subscribers",
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -245,7 +245,9 @@
 | 
			
		|||
    "timeMustNotBeEmpty": "Time must not be empty",
 | 
			
		||||
    "timeIsInvalid": "Time is invalid",
 | 
			
		||||
    "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.",
 | 
			
		||||
    "doYouWantToLaunchTheCampaign?All": "Do you want to launch the campaign?",
 | 
			
		||||
    "no": "No",
 | 
			
		||||
    "yes": "Yes",
 | 
			
		||||
    "subscribers-1": "subscribers",
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue