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

EZP-29328: As a editor I want OE to support formatted text #676

Closed
wants to merge 5 commits into from

Conversation

andrerom
Copy link
Contributor

@andrerom andrerom commented Oct 8, 2018

Question Answer
Tickets EZP-29328
Bug fix? yes and no
New feature? yes and no
BC breaks? no
Tests pass? yes (there are none for js code)
Doc needed? yes
License GPL-2.0

screenshot 2018-10-08 at 11 59 04

Besides being new feature in eZ Platform Admin UI, this allows migration of plain literal tags to eZ Platform as supported since 2.3.0 in kernel and migration scripts. This is why this is suggested for 1.3.1, to avoid customers reporting it as bug once they migrate.

Checklist:

  • Coding standards ($ composer fix-cs)
  • Ready for Code Review

@lserwatka

This comment has been minimized.

@andrerom

This comment has been minimized.

@andrerom
Copy link
Contributor Author

andrerom commented Oct 8, 2018

Updated* and rebased, so ready for review.

* Removed webpack changes not relevant, needed to keep changes in all toolbars where option for formatted is shown, they change because of the change in /base.js here which they extend.

constructor(config) {
super(config);

this.name = 'paragraph';
Copy link
Member

Choose a reason for hiding this comment

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

Probably not a paragraph

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed :)

'ezmoveup',
'ezmovedown',
this.getStyles(config.customStyles),
// NOTE: alignment currently not supported on <pre> so skipping buttons for that
Copy link
Contributor Author

@andrerom andrerom Oct 9, 2018

Choose a reason for hiding this comment

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

@vidarl Actually did not check if this is supported or not on pre/programlisting, besides noticing there where no handling of this in the xsl. However if we did not have it in legacy either there is probably no need to add it on formatted.

Copy link
Member

Choose a reason for hiding this comment

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

We do not have align in legacy ( editor disables align buttons ) on literal.
Docbook does not support it on ProgramListing either, but we are free to add support for ezxhtml:align attribute if we choose to.

However, since it was not a need for it in legacy, it is likely no needed now either.

@andrerom
Copy link
Contributor Author

andrerom commented Oct 9, 2018

@dew326 updated 👍

Note that I have not added this to the "Add block" toolbar, I think we should, but then we probably need a new icon for it and I'm unsure how you guys do that now.

@lserwatka
Copy link
Member

OK, let's move it to QA, we could make 2.3.1 on Friday as I have some other fixes in the pipeline.

Copy link

@katarzynazawada katarzynazawada left a comment

Choose a reason for hiding this comment

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

During the tests I noticed several bugs on different browsers. For other blocks they don’t occur.

Firefox:
screen shot 2018-10-11 at 13 00 15

Cursor appears in the block frame only when you start to write.

Safari:
After switching to Formatted toolbar skips.
screen shot 2018-10-11 at 12 57 32

Chrome:
For more text, scroll appears in edit mode. If clicking Add button in situation when cursor is outside the current view, page and toolbar skips.

screen shot 2018-10-11 at 13 03 33

@katarzynazawada katarzynazawada self-assigned this Oct 11, 2018
@andrerom
Copy link
Contributor Author

andrerom commented Oct 12, 2018

@katarzynazawada which of these issues are unique to the change here? As in, safari issue and chrome add button issue sounds like its unrelated => generic that might also happen with edge cases on other blocks, or?

The Firefox and the chrome scroll bar issues are probably due to <pre> styling, I/someone might need to check it against Alloy's css and see if issue comes from there or if it comes from our own css.

@andrerom
Copy link
Contributor Author

@katarzynazawada If you have those browsers still running, could you cross check against https://alloyeditor.com/ ? (front page, scroll down to "In live demo, click/touch here")

@katarzynazawada
Copy link

@andrerom I’ve checked these issues again both on master and your branch. From my observations, all of them only appear for Formatted block. What is more, on Chrome, there is one more case:



  1. Click on Rich Text Editor

  2. Change style to Formatted.

  3. Click outside the editor.

  4. Go back to Rich Text Editor.



Result:
screen shot 2018-10-12 at 12 29 48

Besides being new feature in eZ Platform, this allows migration of
plain literal tags to eZ Platform, as recently added in migration script.
@andrerom andrerom changed the base branch from master to 1.3 October 21, 2018 13:37
@andrerom
Copy link
Contributor Author

andrerom commented Oct 21, 2018

Pushed CSS that tries to solve some of the issues.

@lserwatka btw some of those seems fixed in Alloy 1.5.x: liferay/alloy-editor#867, liferay/alloy-editor#868, liferay/alloy-editor#888

@dew326 do you have suggestion on what might cause the remaining toolbar issue on empty tag? I see Alloy adds a br inside paragraphs which is probably to avoid this, anyway we can emulate that in CSS too?

@lserwatka

This comment has been minimized.

@andrerom

This comment has been minimized.

@lserwatka

This comment has been minimized.

@andrerom

This comment has been minimized.

@andrerom
Copy link
Contributor Author

andrerom commented Oct 28, 2018

Pushed ezplatform-admin-ui-assets 3.2.0-rc1 to test with newer Alloy version, feel free to remove it.

On closer look the toolbar issue here is not caused by Alloy, as it's our own toolbar. Code responsible for remaining set of toolbar position bugs is class EzConfigBase.

@lserwatka

This comment has been minimized.

@andrerom

This comment has been minimized.

@andrerom
Copy link
Contributor Author

andrerom commented Oct 29, 2018

@katarzynazawada Added fix for:

  • toolbar position when scrolling* & when empty**
  • height of formatted box when empty***
  • made pre use scroll in all browsers (added comment inline in css for how you can enable wrapped style instead, but non wrapped is the normal behavior for pre, so I stayed with that)
  • added <> when empty as placeholder.

screenshot 2018-10-29 at 21 51 46

You should not need to update Alloy for this, in the end the bugs where caused by our code, so you don't need new asset package to test this.


For devs:
* Needed to take .scrollLeft into account.
** Caused by block not being considered empty by code.
*** Added pre:empty::after where some placeholder content is set when empty.

@katarzynazawada
Copy link

@andrerom After fixes I noticed some issues:

  • Safari

Toolbar skips:

A)

  1. Click on Rich Text Editor
  2. Change style to Formatted.
  3. Click outside Rich Text Editor but within a short distance.
  4. Click on Rich Text Editor again.


See movie: http://recordit.co/tsiwhvKKza

B)

  1. Click on Rich Text Editor
  2. Change style to Formatted.
  3. Change style to Paragraph (or another one)

screenshot 2018-10-30 at 12 34 58

  • Chrome:

Placeholder sometimes disappears


  1. Click on Rich Text Editor
  2. Change style to Formatted.
  3. Change style to Paragraph (or another one)
  4. Change style to Formatted again.

screenshot 2018-10-30 at 11 14 28

After publishing ,in Content item view, there is a blank space in field instead of This field is empty text

screenshot 2018-10-30 at 11 14 38

  • Firefox:

Pre use scroll is not added.

  • If clicking Add button in situation when cursor is outside the current view, page and toolbar skips. - this issue still occurs for scroll.

@andrerom
Copy link
Contributor Author

@SylvainGuittard If you want this feature, please get someone else to take over at some point. The level of deep issues in Alloy / browsers here is beyond what I have time to reverse engineer any time soon.

@andrerom andrerom closed this Oct 30, 2018
@andrerom
Copy link
Contributor Author

andrerom commented Oct 31, 2018

UPDATE: Placeholder issue was fixed in branch here in 45feb2f (by removing placeholder, it's not important). However the toolbar issue is something else, maybe deeper in the editor, so if we want to cover all edge cases on first try here, it's better if a frontend guy can dig into it. /cc @lserwatka

ViniTou added a commit that referenced this pull request May 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

6 participants