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-30393: Moved all Online Editor front-end code to the RichText Bundle #46

Merged
merged 25 commits into from
Aug 28, 2019

Conversation

dew326
Copy link
Member

@dew326 dew326 commented Jun 13, 2019

Question Answer
JIRA issue EZP-30393
Requires:
Improvement yes
New feature no
Target version master (2.0@dev) for eZ Platform v3.0
BC breaks yes
Tests pass yes
Doc needed yes

Summary

This PR moves front-end code and back-end configuration related to AlloyEditor from AdminUI, keeping there minimal code just for embedding RichText.

Backward incompatible changes

  • eZ.richText with proper keys replaced eZ.adminUiConfig.alloyEditor, eZ.adminUiConfig.richTextCustomTags, and eZ.adminUiConfig.richTextCustomStyles,
  • All assets (js, scss, svg, fonts, etc.) have been moved from AdminUI bundle here, custom 3rd party development around OE needs to align with that.

New features

  • Configuration for front-end is exposed as eZ.richText.
  • Configuration can be also used in Twig templates using The ez_richtext_config Twig function.
  • Configuration is now exposed via PHP API by means of auto-wirable \EzSystems\EzPlatformRichText\API\Configuration\ProviderService Symfony service.
  • Auto-configurable Service Provider Interface \EzSystems\EzPlatformRichText\SPI\Configuration\Provider allows extending configuration by custom settings.

Documentation

eZ Platform RichText Bundle exposes Twig global variable ez_richtext_config which contains RichText and AlloyEditor configuration. In AdminUI this configuration is exposed for front-end as eZ.richText JavaScript variable and currently out-of-the-box provides the following configs: alloyEditor, customStyles, customTags. Please note that in any case AdminUI requires the RichText Bundle to be enabled.

The bundle also provides PHP API to retrieve that configuration. To use it, inject \EzSystems\EzPlatformRichText\API\Configuration\ProviderService (the service supports autowiring).

It is also possible to extend the configuration by implementing the SPI \EzSystems\EzPlatformRichText\SPI\Configuration\Provider. It's enough to register service implementing that interface and autoconfigure it.

TODO:

@dew326 dew326 force-pushed the ezp-30393-move-ae branch from 826410b to 14584b3 Compare June 26, 2019 12:30
@alongosz alongosz changed the title [WIP] EZP-30393: Move all Online Editor front-end code to the RichText Bundle [WIP] EZP-30393: Moved all Online Editor front-end code to the RichText Bundle Aug 8, 2019
@alongosz alongosz added Improvement New feature or request Work in progress labels Aug 8, 2019
@alongosz alongosz self-assigned this Aug 8, 2019
@alongosz alongosz force-pushed the ezp-30393-move-ae branch from 14584b3 to 2405988 Compare August 8, 2019 13:49
@dew326 dew326 changed the title [WIP] EZP-30393: Moved all Online Editor front-end code to the RichText Bundle EZP-30393: Moved all Online Editor front-end code to the RichText Bundle Aug 20, 2019

/**
* @deprecated 3.0.0 The alternative and more flexible solution will be introduced.
* @deprecated 3.0.0 So you will need to update Online Editor Extra Buttons as part of eZ Platform 3.x upgrade.
Copy link
Member

Choose a reason for hiding this comment

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

Note: to be resolved later on.

@alongosz alongosz removed their assignment Aug 22, 2019
@alongosz alongosz requested a review from pawbuj August 22, 2019 09:26
src/lib/Configuration/Provider/AlloyEditor.php Outdated Show resolved Hide resolved
src/lib/Configuration/Provider/CustomStyle.php Outdated Show resolved Hide resolved
src/lib/Configuration/Provider/CustomStyle.php Outdated Show resolved Hide resolved
src/lib/Configuration/Provider/CustomTag.php Outdated Show resolved Hide resolved
src/lib/Configuration/UI/Mapper/OnlineEditor.php Outdated Show resolved Hide resolved
src/lib/Configuration/UI/Mapper/OnlineEditor.php Outdated Show resolved Hide resolved
tests/lib/Configuration/UI/Mapper/OnlineEditorTest.php Outdated Show resolved Hide resolved
@alongosz
Copy link
Member

Addressed all CR issues, please review:

Copy link
Contributor

@webhdx webhdx left a comment

Choose a reason for hiding this comment

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

Good work, just a few comments from my side. What I find lacking is a description on what was added. I was not sure if I should write comments on the code which was most likely just moved and not even belong to you.

composer.json Show resolved Hide resolved
src/bundle/Resources/config/configuration.yaml Outdated Show resolved Hide resolved
@alongosz
Copy link
Member

Good work, just a few comments from my side. What I find lacking is a description on what was added. I was not sure if I should write comments on the code which was most likely just moved and not even belong to you.

@webhdx I've addressed all your comments. I value your input regardless of if this is a copied code or a new one. All the reviews for this PR prove that reviewing copied code is also useful.
That said, I've updated the description as well so it's more clear.

@lserwatka lserwatka merged commit 885a744 into ezsystems:master Aug 28, 2019
@dew326 dew326 deleted the ezp-30393-move-ae branch October 18, 2019 07:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Improvement New feature or request QA approved
Development

Successfully merging this pull request may close these issues.

7 participants