Preparation of merge with master
This commit is contained in:
parent
6648028270
commit
cd798b5af7
26 changed files with 607 additions and 285 deletions
|
@ -188,6 +188,8 @@ export default class CUD extends Component {
|
|||
click_tracking_disabled: false,
|
||||
open_trackings_disabled: false,
|
||||
|
||||
unsubscribe_url: '',
|
||||
|
||||
source: CampaignSource.TEMPLATE,
|
||||
|
||||
// This is for CampaignSource.TEMPLATE and CampaignSource.CUSTOM_FROM_TEMPLATE
|
||||
|
@ -531,6 +533,8 @@ export default class CUD extends Component {
|
|||
|
||||
{sendSettings}
|
||||
|
||||
<InputField id="unsubscribe_url" label={t('Custom unsubscribe URL')}/>
|
||||
|
||||
<hr/>
|
||||
|
||||
<CheckBox id="open_trackings_disabled" text={t('Disable opened tracking')}/>
|
||||
|
|
|
@ -63,6 +63,7 @@ export default class CUD extends Component {
|
|||
|
||||
if (data.type === ImportType.CSV_FILE) {
|
||||
data.csvFileName = data.settings.csv.originalname;
|
||||
data.csvDelimiter = data.settings.csv.delimiter;
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -71,7 +72,8 @@ export default class CUD extends Component {
|
|||
name: '',
|
||||
description: '',
|
||||
type: ImportType.CSV_FILE,
|
||||
csvFileName: ''
|
||||
csvFileName: '',
|
||||
csvDelimiter: ','
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -93,6 +95,10 @@ export default class CUD extends Component {
|
|||
if (!this.csvFile || this.csvFile.files.length === 0) {
|
||||
state.setIn(['csvFileName', 'error'], t('File must be selected'));
|
||||
}
|
||||
|
||||
if (!state.getIn(['csvDelimiter', 'value']).trim()) {
|
||||
state.setIn(['csvDelimiter', 'error'], t('CSV delimiter must not be empty'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -119,7 +125,12 @@ export default class CUD extends Component {
|
|||
|
||||
const formData = new FormData();
|
||||
if (!isEdit && data.type === ImportType.CSV_FILE) {
|
||||
data.settings.csv = {};
|
||||
formData.append('csvFile', this.csvFile.files[0]);
|
||||
data.settings.csv.delimiter = data.csvDelimiter.trim();
|
||||
|
||||
delete data.csvFile;
|
||||
delete data.csvDelimiter;
|
||||
}
|
||||
|
||||
formData.append('entity', JSON.stringify(data));
|
||||
|
@ -151,9 +162,17 @@ export default class CUD extends Component {
|
|||
let settings = null;
|
||||
if (type === ImportType.CSV_FILE) {
|
||||
if (isEdit) {
|
||||
settings = <StaticField id="csvFileName" className={styles.formDisabled} label={t('File')}>{this.getFormValue('csvFileName')}</StaticField>;
|
||||
settings =
|
||||
<div>
|
||||
<StaticField id="csvFileName" className={styles.formDisabled} label={t('File')}>{this.getFormValue('csvFileName')}</StaticField>
|
||||
<StaticField id="csvDelimiter" className={styles.formDisabled} label={t('Delimiter')}>{this.getFormValue('csvDelimiter')}</StaticField>
|
||||
</div>;
|
||||
} else {
|
||||
settings = <StaticField withValidation id="csvFileName" label={t('File')}><input ref={node => this.csvFile = node} type="file" onChange={::this.onFileSelected}/></StaticField>;
|
||||
settings =
|
||||
<div>
|
||||
<StaticField withValidation id="csvFileName" label={t('File')}><input ref={node => this.csvFile = node} type="file" onChange={::this.onFileSelected}/></StaticField>
|
||||
<InputField id="csvDelimiter" label={t('Delimiter')}/>
|
||||
</div>;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -11,10 +11,14 @@ export function getImportTypes(t) {
|
|||
};
|
||||
|
||||
const importStatusLabels = {
|
||||
[ImportStatus.NOT_READY]: t('Preparing'),
|
||||
[ImportStatus.RUNNING]: t('Running'),
|
||||
[ImportStatus.SCHEDULED]: t('Scheduled'),
|
||||
[ImportStatus.FINISHED]: t('Finished')
|
||||
[ImportStatus.PREP_SCHEDULED]: t('Created'),
|
||||
[ImportStatus.PREP_RUNNING]: t('Preparing'),
|
||||
[ImportStatus.PREP_FINISHED]: t('Ready'),
|
||||
[ImportStatus.PREP_FAILED]: t('Preparation failed'),
|
||||
[ImportStatus.RUN_SCHEDULED]: t('Scheduled'),
|
||||
[ImportStatus.RUN_RUNNING]: t('Running'),
|
||||
[ImportStatus.RUN_FINISHED]: t('Finished'),
|
||||
[ImportStatus.RUN_FAILED]: t('Failed')
|
||||
};
|
||||
|
||||
return {
|
||||
|
|
|
@ -91,6 +91,7 @@ export default class CUD extends Component {
|
|||
subject_overridable: false,
|
||||
verpEnabled: false,
|
||||
verp_hostname: '',
|
||||
x_mailer: '',
|
||||
mailer_type: MailerType.ZONE_MTA,
|
||||
...this.mailerTypes[MailerType.ZONE_MTA].initData()
|
||||
});
|
||||
|
@ -200,6 +201,7 @@ export default class CUD extends Component {
|
|||
<CheckBox id="reply_to_overridable" text={t('Overridable')}/>
|
||||
<InputField id="subject" label={t('Subject')}/>
|
||||
<CheckBox id="subject_overridable" text={t('Overridable')}/>
|
||||
<InputField id="x_mailer" label={t('X-Mailer')}/>
|
||||
</Fieldset>
|
||||
|
||||
{mailerForm}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue