Remove preview from sidebar

[MAILPOET-2981]
This commit is contained in:
Pavel Dohnal
2020-08-28 13:05:03 +02:00
committed by Veljko V
parent 8ebba76c0f
commit 33b2a4923a
5 changed files with 0 additions and 62 deletions

View File

@ -104,7 +104,6 @@ SidebarView = Marionette.View.extend({
availableStyles: App.getAvailableStyles(),
isWoocommerceTransactional: this.model.isWoocommerceTransactional(),
}));
this.showChildView('previewRegion', new Module.SidebarPreviewView());
},
updateHorizontalScroll: function () {
// Fixes the sidebar so that on narrower screens the horizontal
@ -246,24 +245,6 @@ Module.SidebarStylesView = Marionette.View.extend({
},
});
Module.SidebarPreviewView = Marionette.View.extend({
getTemplate: function () { return window.templates.sidebarPreview; },
templateContext: function () {
return {
mssKeyPendingApproval: window.mailpoet_mss_key_pending_approval,
};
},
events: {
},
onBeforeDestroy: function () {
if (this.previewView) {
this.previewView.destroy();
this.previewView = null;
}
},
});
App.on('before:start', function (BeforeStartApp) {
var Application = BeforeStartApp;
Application.registerWidget = Module.registerWidget;

View File

@ -197,7 +197,6 @@ global.templates = {
sidebarContent: Handlebars.compile(jQuery('#newsletter_editor_template_sidebar_content').html()),
sidebarLayout: Handlebars.compile(jQuery('#newsletter_editor_template_sidebar_layout').html()),
sidebarStyles: Handlebars.compile(jQuery('#newsletter_editor_template_sidebar_styles').html()),
sidebarPreview: Handlebars.compile(jQuery('#newsletter_editor_template_sidebar_preview').html()),
genericBlockTools: Handlebars.compile(jQuery('#newsletter_editor_template_tools_generic').html()),

View File

@ -180,15 +180,4 @@ describe('Sidebar', function () {
});
});
});
describe('preview view', function () {
var view;
beforeEach(function () {
view = new (SidebarComponent.SidebarPreviewView)();
});
it('renders', function () {
expect(view.render).to.not.throw();
});
});
});

View File

@ -265,10 +265,6 @@
'newsletter_editor_template_sidebar_layout',
'newsletter/templates/components/sidebar/layout.hbs'
) %>
<%= partial(
'newsletter_editor_template_sidebar_preview',
'newsletter/templates/components/sidebar/preview.hbs'
) %>
<%= partial(
'newsletter_editor_template_sidebar_styles',
'newsletter/templates/components/sidebar/styles.hbs'
@ -449,9 +445,6 @@
sidebarStyles: Handlebars.compile(
jQuery('#newsletter_editor_template_sidebar_styles').html()
),
sidebarPreview: Handlebars.compile(
jQuery('#newsletter_editor_template_sidebar_preview').html()
),
newsletterPreview: Handlebars.compile(
jQuery('#newsletter_editor_template_newsletter_preview').html()
),

View File

@ -1,24 +0,0 @@
<div class="handlediv" title="Click to toggle"><br></div>
<h3 data-automation-id="sidebar_preview_region_heading"><%= __('Preview') %></h3>
<div class="mailpoet_region_content">
<iframe name="mailpoet_save_preview_email_for_autocomplete" style="display:none" src="about:blank"></iframe>
<form target="mailpoet_save_preview_email_for_autocomplete">
<div class="mailpoet_form_field">
<label>
<%= __('Send preview to') %><br />
<input id="mailpoet_preview_to_email" class="mailpoet_input mailpoet_input_full" type="text" name="to_email" value="<%= current_wp_user.email %>" autocomplete="email" />
</label>
</div>
<div class="mailpoet_form_field relative-holder">
<input type="submit" id="mailpoet_send_preview" class="button button-primary mailpoet_button_full" value="<%= __('Send preview') %>" />
<span id="tooltip-send-preview" class="tooltip-help-send-preview"></span>
</div>
</form>
{{#if mssKeyPendingApproval }}
<div class="mailpoet_error">
<%= __('Youll soon be able to send once our team reviews your account. In the meantime, you can send previews to [link]your authorized emails[/link].')|replaceLinkTags('https://account.mailpoet.com/authorization', {'target': '_blank', 'rel': 'noopener noreferrer'})|raw %>
</div>
{{/if}}
</div>