Remove link to the old form editor

[MAILPOET-2625]
This commit is contained in:
Pavel Dohnal
2020-01-29 13:53:06 +01:00
committed by Jack Kitterhing
parent a8b31d1a74
commit ec42ef4eeb
3 changed files with 8 additions and 23 deletions

View File

@ -28,9 +28,6 @@ SidebarHeader.propTypes = {
]).isRequired,
};
const oldEditorUrl = new URL(window.location.href);
oldEditorUrl.searchParams.set('legacy', 1);
export default () => {
const activeTab = useSelect(
(select) => select('mailpoet-form-editor').getSidebarActiveTab(),
@ -81,8 +78,6 @@ export default () => {
{MailPoet.I18n.t('editorIsUsingGutenberg')}
<br />
<a href="mailto:quentin@mailpoet.com">{MailPoet.I18n.t('giveFeedback')}</a>
{' '}
<a href={oldEditorUrl.toString()}>{MailPoet.I18n.t('useOldEditor')}</a>
</p>
</div>
);

View File

@ -16,20 +16,14 @@ const App = () => (
);
const appElement = document.querySelector('#mailpoet_form_edit');
const oldEditorLinkElement = document.querySelector('#mailpoet_form_edit_old_editor_fallback_link');
if (appElement) {
try {
oldEditorLinkElement.style.display = 'none';
initStore();
initBlocks();
ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
appElement
);
} catch (e) {
oldEditorLinkElement.style.display = 'block';
}
initStore();
initBlocks();
ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
appElement
);
}

View File

@ -10,9 +10,6 @@
<div class="block-editor">
<div id="mailpoet_form_edit" class="block-editor__container">
</div>
<div id="mailpoet_form_edit_old_editor_fallback_link">
<a href="?page=mailpoet-form-editor&id=<%=form['id']%>&legacy=1"><%=__('Use the old editor.')%></a>
</div>
</div>
<script>
@ -114,7 +111,6 @@
'customFieldWithNameExists': __('The custom field [name] already exists. Please choose another name.'),
'editorIsUsingGutenberg': __('This form editor uses the WordPress Block Editor (Gutenberg)'),
'giveFeedback': __('Give feedback.'),
'useOldEditor': __('Use the old editor.')
}) %>
<% endblock %>