Remove background images editor announcement

[MAILPOET-1672]
This commit is contained in:
Rostislav Wolny
2019-01-03 15:51:18 +01:00
parent 3adb2331e5
commit 5d453eabfa
7 changed files with 1 additions and 53 deletions

View File

@ -37,7 +37,7 @@
top: -3px top: -3px
left: 8px left: 8px
.mailpoet_in_app_announcement_background_videos, .mailpoet_drag_and_drop_tutorial .mailpoet_drag_and_drop_tutorial
text-align: center text-align: center
h2 h2
font-size: 28px font-size: 28px

View File

@ -20,8 +20,3 @@
p p
margin: 0 margin: 0
.mailpoet_editor_announcement
position: absolute
right: 20px
top: 90px

View File

@ -4,7 +4,6 @@ $content-border-color = $structure-border-color
#mailpoet_editor #mailpoet_editor
width: 100% width: 100%
clear: both clear: both
position: relative
#mailpoet_editor_heading #mailpoet_editor_heading
padding-left: 15px padding-left: 15px

View File

@ -1,27 +0,0 @@
import PropTypes from 'prop-types';
import React from 'react';
import MailPoet from 'mailpoet';
import InAppAnnouncement from 'announcements/in_app_announcement.jsx';
const BackgroundImageAnnouncement = props => (
<InAppAnnouncement
validUntil={new Date('2018-10-06')}
height="700px"
showOnlyOnceSlug="background_image"
>
<div className="mailpoet_in_app_announcement_background_videos">
<h2>
{MailPoet.I18n.t('announcementBackgroundImagesHeading').replace('%username%', props.username)}
</h2>
<p>{MailPoet.I18n.t('announcementBackgroundImagesMessage')}</p>
<video src={props.videoUrl} controls autoPlay><track kind="captions" /></video>
</div>
</InAppAnnouncement>
);
BackgroundImageAnnouncement.propTypes = {
username: PropTypes.string.isRequired,
videoUrl: PropTypes.string.isRequired,
};
export default BackgroundImageAnnouncement;

View File

@ -3,7 +3,6 @@ import Breadcrumb from 'newsletters/breadcrumb.jsx';
import MailPoet from 'mailpoet'; import MailPoet from 'mailpoet';
import React from 'react'; import React from 'react';
import ReactDOM from 'react-dom'; import ReactDOM from 'react-dom';
import BackgroundImageAnnouncement from './background_image_announcement.jsx';
import displayTutorial from './tutorial.jsx'; import displayTutorial from './tutorial.jsx';
const renderBreadcrumb = (newsletterType) => { const renderBreadcrumb = (newsletterType) => {
@ -18,16 +17,6 @@ const renderBreadcrumb = (newsletterType) => {
ReactDOM.render(breadcrumb, breadcrumbContainer); ReactDOM.render(breadcrumb, breadcrumbContainer);
}; };
const renderAnnouncement = () => {
const container = document.getElementById('mailpoet_editor_announcement');
ReactDOM.render(
<BackgroundImageAnnouncement
username={window.config.currentUserFirstName || window.config.currentUserUsername}
videoUrl={window.config.backgroundImageDemoUrl}
/>, container
);
};
const initializeEditor = (config) => { const initializeEditor = (config) => {
const editorContainer = document.getElementById('mailpoet_editor'); const editorContainer = document.getElementById('mailpoet_editor');
const getUrlParam = param => (location.search.split(`${param}=`)[1] || '').split('&')[0]; const getUrlParam = param => (location.search.split(`${param}=`)[1] || '').split('&')[0];
@ -62,7 +51,6 @@ const initializeEditor = (config) => {
}); });
renderBreadcrumb(newsletter.type); renderBreadcrumb(newsletter.type);
renderAnnouncement();
if (newsletter.status === 'sending' && newsletter.queue && newsletter.queue.status === null) { if (newsletter.status === 'sending' && newsletter.queue && newsletter.queue.status === null) {
MailPoet.Ajax.post({ MailPoet.Ajax.post({

View File

@ -248,7 +248,6 @@
<h1 style="display:none"><%= __('Newsletter Editor') %></h1> <h1 style="display:none"><%= __('Newsletter Editor') %></h1>
<div id="mailpoet_editor"> <div id="mailpoet_editor">
<div id="mailpoet_editor_breadcrumb" class="mailpoet_breadcrumbs"></div> <div id="mailpoet_editor_breadcrumb" class="mailpoet_breadcrumbs"></div>
<div id="mailpoet_editor_announcement" class="mailpoet_editor_announcement"></div>
<div id="mailpoet_editor_top"></div> <div id="mailpoet_editor_top"></div>
<div id="mailpoet_editor_heading"></div> <div id="mailpoet_editor_heading"></div>
<div class="clearfix"></div> <div class="clearfix"></div>
@ -367,8 +366,6 @@
'cancelColorSelection': _x('Cancel', 'cancel color selection'), 'cancelColorSelection': _x('Cancel', 'cancel color selection'),
'newsletterIsPaused': __('Email sending has been paused.'), 'newsletterIsPaused': __('Email sending has been paused.'),
'tutorialVideoTitle': __('Before you start, this is how you drag and drop in MailPoet'), 'tutorialVideoTitle': __('Before you start, this is how you drag and drop in MailPoet'),
'announcementBackgroundImagesHeading': __('Hey %username%, you can now put text over any image.'),
'announcementBackgroundImagesMessage': __('Simply edit any column block to add a background image. It works in pretty much every email client, even on mobile.'),
'selectType': __('Select type'), 'selectType': __('Select type'),
'events': __('Events'), 'events': __('Events'),
'conditions': _x('Conditions', 'Configuration options for automatic email events'), 'conditions': _x('Conditions', 'Configuration options for automatic email events'),
@ -1342,14 +1339,10 @@
) %>', ) %>',
}, },
dragDemoUrl: '<%= cdn_url('newsletter-editor/editor-drag-demo.20181121-1440.mp4') %>', dragDemoUrl: '<%= cdn_url('newsletter-editor/editor-drag-demo.20181121-1440.mp4') %>',
backgroundImageDemoUrl: '<%= cdn_url('newsletter-editor/background-image-demo.20181121-1440.mp4') %>',
currentUserId: '<%= current_wp_user.wp_user_id %>', currentUserId: '<%= current_wp_user.wp_user_id %>',
currentUserFirstName: '<%= current_wp_user.first_name %>',
currentUserUsername: '<%= current_wp_user.login %>',
dragDemoUrlSettings: '<%= settings["user_seen_editor_tutorial" ~ current_wp_user.wp_user_id] %>', dragDemoUrlSettings: '<%= settings["user_seen_editor_tutorial" ~ current_wp_user.wp_user_id] %>',
installedAt: '<%= settings["installed_at"] %>', installedAt: '<%= settings["installed_at"] %>',
}; };
var mailpoet_in_app_announcements = <%= json_encode(settings.in_app_announcements) %>;
wp.hooks.doAction('mailpoet_newsletters_editor_initialize', config); wp.hooks.doAction('mailpoet_newsletters_editor_initialize', config);
</script> </script>