Fix new code

This commit is contained in:
Pavel Dohnal
2019-01-29 12:35:41 +01:00
parent 3128da45b3
commit 6ffac49364
11 changed files with 1748 additions and 1741 deletions

View File

@ -56,7 +56,8 @@ const SenderEmailAddressWarning = ({ emailAddress }) => {
const emailAddressDomain = emailAddress.split('@').pop().toLowerCase();
if (badDomains.indexOf(emailAddressDomain) > -1) {
const userHostDomain = window.location.hostname.replace('www.', '');
return (<React.Fragment>
return (
<React.Fragment>
<p className="sender_email_address_warning">{MailPoet.I18n.t('senderEmailAddressWarning1')}</p>
<p className="sender_email_address_warning">
{ReactStringReplace(
@ -78,7 +79,8 @@ const SenderEmailAddressWarning = ({ emailAddress }) => {
{MailPoet.I18n.t('senderEmailAddressWarning3')}
</a>
</p>
</React.Fragment>);
</React.Fragment>
);
}
return null;
};

View File

@ -4,10 +4,9 @@ define('modal', ['mailpoet', 'jquery'],
'use strict';
var MailPoet = mp;
var closeModalImage =
'<svg viewBox="0 0 23 23" xmlns="http://www.w3.org/2000/svg">' +
'<path d="M21.454 1.546L1.546 21.454M1.546 1.546L21.454 21.454" stroke-width="3" stroke-linecap="round" />' +
'</svg>';
var closeModalImage = '<svg viewBox="0 0 23 23" xmlns="http://www.w3.org/2000/svg">'
+ '<path d="M21.454 1.546L1.546 21.454M1.546 1.546L21.454 21.454" stroke-width="3" stroke-linecap="round" />'
+ '</svg>';
/** *************************************************************************
MailPoet Modal:
@ -85,27 +84,27 @@ define('modal', ['mailpoet', 'jquery'],
options: {},
templates: {
overlay: '<div id="mailpoet_modal_overlay" class="mailpoet_modal_overlay" style="display:none;"></div>',
popup: '<div id="mailpoet_popup" class="mailpoet_popup" tabindex="-1">' +
'<div class="mailpoet_popup_wrapper">' +
'<a href="javascript:;" id="mailpoet_modal_close" class="mailpoet_modal_close">' + closeModalImage + '</a>' +
'<div id="mailpoet_popup_title" class="mailpoet_popup_title"><h2></h2></div>' +
'<div class="mailpoet_popup_body clearfix"></div>' +
'</div>' +
'</div>',
loading: '<div id="mailpoet_loading" class="mailpoet_loading" style="display:none;">' +
'<div id="mailpoet_modal_loading_1" class="mailpoet_modal_loading mailpoet_modal_loading_1"></div>' +
'<div id="mailpoet_modal_loading_2" class="mailpoet_modal_loading mailpoet_modal_loading_2"></div>' +
'<div id="mailpoet_modal_loading_3" class="mailpoet_modal_loading mailpoet_modal_loading_3"></div>' +
'</div>',
panel: '<div id="mailpoet_panel" class="mailpoet_panel">' +
'<a href="javascript:;" id="mailpoet_modal_close" class="mailpoet_modal_close">' + closeModalImage + '</a>' +
'<div class="mailpoet_panel_wrapper" tabindex="-1">' +
'<div class="mailpoet_panel_body clearfix"></div>' +
'</div>' +
'</div>',
subpanel: '<div class="mailpoet_panel_wrapper" tabindex="-1">' +
'<div class="mailpoet_panel_body clearfix"></div>' +
'</div>'
popup: '<div id="mailpoet_popup" class="mailpoet_popup" tabindex="-1">'
+ '<div class="mailpoet_popup_wrapper">'
+ '<a href="javascript:;" id="mailpoet_modal_close" class="mailpoet_modal_close">' + closeModalImage + '</a>'
+ '<div id="mailpoet_popup_title" class="mailpoet_popup_title"><h2></h2></div>'
+ '<div class="mailpoet_popup_body clearfix"></div>'
+ '</div>'
+ '</div>',
loading: '<div id="mailpoet_loading" class="mailpoet_loading" style="display:none;">'
+ '<div id="mailpoet_modal_loading_1" class="mailpoet_modal_loading mailpoet_modal_loading_1"></div>'
+ '<div id="mailpoet_modal_loading_2" class="mailpoet_modal_loading mailpoet_modal_loading_2"></div>'
+ '<div id="mailpoet_modal_loading_3" class="mailpoet_modal_loading mailpoet_modal_loading_3"></div>'
+ '</div>',
panel: '<div id="mailpoet_panel" class="mailpoet_panel">'
+ '<a href="javascript:;" id="mailpoet_modal_close" class="mailpoet_modal_close">' + closeModalImage + '</a>'
+ '<div class="mailpoet_panel_wrapper" tabindex="-1">'
+ '<div class="mailpoet_panel_body clearfix"></div>'
+ '</div>'
+ '</div>',
subpanel: '<div class="mailpoet_panel_wrapper" tabindex="-1">'
+ '<div class="mailpoet_panel_body clearfix"></div>'
+ '</div>'
},
getContentContainer: function () {
return jQuery('.mailpoet_' + this.options.type + '_body');

View File

@ -18,7 +18,8 @@ class SenderField extends React.Component {
}
render() {
return (<React.Fragment>
return (
<React.Fragment>
<FormFieldText
{...this.props}
onValueChange={this.onChange}
@ -26,7 +27,8 @@ class SenderField extends React.Component {
<div className="regular-text">
<SenderEmailAddressWarning emailAddress={this.state.emailAddress} />
</div>
</React.Fragment>);
</React.Fragment>
);
}
}

View File

@ -35,7 +35,7 @@ class AutomaticEmailEvent extends React.PureComponent {
className="button button-primary"
disabled={disabled}
onClick={onClick}
role="button"
role="presentation"
data-automation-id={`create_${event.slug}`}
onKeyDown={(keyEvent) => {
if ((['keydown', 'keypress'].includes(keyEvent.type) && ['Enter', ' '].includes(keyEvent.key))

View File

@ -23,7 +23,8 @@ class DefaultSender extends React.Component {
}
render() {
return (<React.Fragment>
return (
<React.Fragment>
<p>
<label htmlFor="settings[from_name]">{MailPoet.I18n.t('from')}</label>
<input
@ -38,8 +39,8 @@ class DefaultSender extends React.Component {
<input
type="email"
id="settings[from_email]"
data-automation-id="settings-page-from-email-field"
name="sender[address]"
data-automation-id="settings-page-from-email-field"
value={this.state.senderAddress}
onChange={partial(this.onChange, 'senderAddress')}
placeholder="from@mydomain.com"
@ -67,7 +68,8 @@ class DefaultSender extends React.Component {
<div className="regular-text">
<SenderEmailAddressWarning emailAddress={this.state.senderAddress} />
</div>
</React.Fragment>);
</React.Fragment>
);
}
}

View File

@ -46,7 +46,8 @@ const WelcomeWizardSenderStep = props => (
/>
</label>
<label htmlFor="replyToAddress">
{MailPoet.I18n.t('replyToAddress')}:
{MailPoet.I18n.t('replyToAddress')}
:
<input
name="replyToAddress"
type="text"

View File

@ -80,9 +80,9 @@ class WelcomeWizardStepsController extends React.Component {
}
updateReplyTo(data) {
this.setState({
replyTo: Object.assign({}, this.state.replyTo, data),
});
this.setState(prevState => ({
sender: Object.assign({}, prevState.replyTo, data),
}));
}
submitSender() {

3215
package-lock.json generated

File diff suppressed because it is too large Load Diff