Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OD-378 [Feature] Upgrade TinyMCE 4 to TinyMCE 5 for Form component #375

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

ivandevupp
Copy link
Contributor

@ivandevupp ivandevupp commented Mar 25, 2021

@sofiiakvasnevska

Issue

OD-378 https://weboo.atlassian.net/browse/OD-378

Description

Upgraded TinyMCE from version 4 to 5.7.0.
Removed TinyMCE from interface.
Added paste as plain text and clear formating plugins.

Screenshots/screencasts

https://monosnap.com/file/lwX7YXRHRnWSfDU4NZs7cn1pdtIrEY

Backward compatibility

This change is fully backward compatible.

Reviewers

@upplabs-alex-levchenko @AndrRyaz @YaroslavOvdii

@@ -750,56 +750,6 @@ new Vue({
this.accessRules.splice(accessRuleIndex, 1);
}
},
setupCodeEditor: function() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like we're removing code editor from somewhere else in the form builder that's unrelated to the Rich Text field. It looks like the form submission confirmation HTML. We can't remove that.

What version of TinyMCE is running in the builder interface? If it's TinyMCE 4, then we can keep this running without having to change anything, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I returned setup for builder.

@tonytlwu
Copy link
Contributor

The video at 0:20 showed that the Rich Text editor in the form builder just looks like an ordinary textarea. Once the field is relabelled to something custom, e.g. "Content" or "Bio", then it's indistinguishable from a text area field.

We were OK not having TinyMCE initiated in the page preview in edit mode, but it's important that it's initiated in the form builder interface.

What can we do here? Initialize TinyMCE? If we're stopping the initialization because it's running TinyMCE 4, then maybe our best bet is to run 2 different versions of the initialization config object.

@ivandevupp
Copy link
Contributor Author

@tonytlwu If i got it correctly tinymce should be initialised:

  1. Email templates (v4)
  2. Form template (v4)
  3. Preview mode (v5)
  4. Published/native apps (v5)

And not initialised in edit-preview
image

Copy link
Contributor

@tonytlwu tonytlwu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rejected +1

statusbar: false,
toolbar: this.readonly || $vm.isInterface
? ['bold italic underline alignleft aligncenter alignright alignjustify'].join(' | ')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would it have a toolbar if it's readonly? The previous code suggested that if it's readonly then toolbar: false.

branding: false,
setup: function(editor) {
$vm.editor = editor;

editor.on('init', function() {
$vm.addPlaceholder();
if ($vm.isInterface) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's not interface, e.g. preview/live app, placeholder should also work as it currently does.

@@ -983,29 +982,6 @@ new Vue({
$(selector).removeClass('is-loading');
}

$($vm.$refs.templateDescription).tinymce({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this removed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants