Rename sidebar form type to others

[MAILPOET-2743]
This commit is contained in:
Rostislav Wolny
2020-04-23 11:24:50 +02:00
committed by Veljko V
parent cd0b9d49c5
commit d81c0d490b
5 changed files with 10 additions and 10 deletions

View File

@@ -79,7 +79,7 @@ const FormPreview = () => {
value={previewSettings.formType}
data-automation-id="form_type_selection"
>
<option value="sidebar">{MailPoet.I18n.t('placeFormSidebar')}</option>
<option value="others">{MailPoet.I18n.t('placeFormOthers')}</option>
<option value="below_post">{MailPoet.I18n.t('placeFormBellowPages')}</option>
<option value="fixed_bar">{MailPoet.I18n.t('placeFixedBarFormOnPages')}</option>
<option value="popup">{MailPoet.I18n.t('placePopupFormOnPages')}</option>
@@ -102,11 +102,11 @@ const FormPreview = () => {
title={MailPoet.I18n.t('formPreview')}
onLoad={() => setIframeLoaded(true)}
data-automation-id="form_preview_iframe"
scrolling={previewSettings.formType === 'sidebar' ? 'no' : 'yes'}
scrolling={previewSettings.formType === 'others' ? 'no' : 'yes'}
/>
{previewSettings.formType === 'sidebar' && previewSettings.displayType === 'desktop' && (
{previewSettings.formType === 'others' && previewSettings.displayType === 'desktop' && (
<div className="mailpoet_form_preview_disclaimer">
{MailPoet.I18n.t('formPreviewSidebarDisclaimer')}
{MailPoet.I18n.t('formPreviewOthersDisclaimer')}
</div>
)}
</Preview>

View File

@@ -60,7 +60,7 @@ export default {
// Otherwise create one based on settings
const previewSettings = {
displayType: 'desktop',
formType: 'sidebar',
formType: 'others',
};
const settings = state.formData.settings;
if (settings.placeFormBellowAllPages || settings.placeFormBellowAllPosts) {

View File

@@ -88,8 +88,8 @@ class PreviewPage {
'styles' => $this->formRenderer->renderStyles($formData, '#' . $htmlId),
'html' => $this->formRenderer->renderHTML($formData),
'form_element_styles' => $this->formRenderer->renderFormElementStyles($formData),
'success' => $formType === 'sidebar',
'error' => $formType === 'sidebar',
'success' => $formType === 'others',
'error' => $formType === 'others',
'delay' => 1,
'position' => $formData['settings'][$formType . '_form_position'] ?? '',
'backgroundColor' => $formData['settings']['backgroundColor'] ?? '',

View File

@@ -71,7 +71,7 @@
'placeFormBellowPagesDescription': __('This form placement allows you to add this form at the end of all the pages or posts, below the content.'),
'placeFormBellowAllPages': _x('Display on all pages', 'This is a text on a switch if a form should be displayed bellow all pages'),
'placeFormBellowAllPosts': _x('Display on all posts', 'This is a text on a switch if a form should be displayed bellow all posts'),
'placeFormSidebar': _x('Sidebar (theme widget)', 'Placement of the form using theme widget'),
'placeFormOthers': _x('Others (widget)', 'Placement of the form using theme widget'),
'formPlacementDelay': _x('Display with a delay of', 'Label on a selection of different times'),
'formPlacementPlacementPosition': _x('Position', 'Placement of a fixed bar form, on top of the page or on the bottom'),
'formPlacementPlacementPositionTop': _x('top', 'Placement of a fixed bar form, on top of the page or on the bottom'),
@@ -155,7 +155,7 @@
'formPreview': __('Form Preview'),
'formPreviewDesktop': _x('Desktop', 'Desktop browser preview mode'),
'formPreviewMobile': _x('Mobile', 'Mobile browser preview mode'),
'formPreviewSidebarDisclaimer': __('Psssst. We try our best to show you what the widget might look like, but better check the final result on your website.'),
'formPreviewOthersDisclaimer': __('Psssst. We try our best to show you what the widget might look like, but better check the final result on your website.'),
'noName': _x('no name', 'fallback for forms without a name in a form list'),
}) %>
<% endblock %>

View File

@@ -1,5 +1,5 @@
<% block content %>
<% if(formType == 'sidebar') %>
<% if(formType == 'others') %>
<div id="mailpoet_widget_preview" class="mailpoet_widget_preview">
<div id="sidebar" class="sidebar widget-area si-sidebar-container">
<div class="widget si-widget">