From 7a97f04aecfbde62af4428208b4c97981bdb3843 Mon Sep 17 00:00:00 2001 From: Serhey Dolgushev Date: Mon, 8 Jul 2019 13:57:35 +0100 Subject: [PATCH 1/9] EZP-30732: As an Editor I want be able to add embed/images inside table cells --- .../Resources/public/js/alloyeditor/src/plugins/ez-embed.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/bundle/Resources/public/js/alloyeditor/src/plugins/ez-embed.js b/src/bundle/Resources/public/js/alloyeditor/src/plugins/ez-embed.js index 67485f8a45..1ece03607e 100644 --- a/src/bundle/Resources/public/js/alloyeditor/src/plugins/ez-embed.js +++ b/src/bundle/Resources/public/js/alloyeditor/src/plugins/ez-embed.js @@ -21,9 +21,7 @@ const ZERO_WIDTH_SPACE = '​'; init: function(editor) { editor.ezembed = { canBeAdded: () => { - const path = editor.elementPath(); - - return !path || path.contains('table', true) === null; + return true; }, }; From c40b66c45fb9e111c6ed4d3faacb5a53be84c780 Mon Sep 17 00:00:00 2001 From: Serhey Dolgushev Date: Tue, 9 Jul 2019 09:37:23 +0100 Subject: [PATCH 2/9] EZP-30732: Deprecation warning for editor.ezembed.canBeAdded --- .../Resources/public/js/alloyeditor/src/plugins/ez-embed.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/bundle/Resources/public/js/alloyeditor/src/plugins/ez-embed.js b/src/bundle/Resources/public/js/alloyeditor/src/plugins/ez-embed.js index 1ece03607e..51a70c598c 100644 --- a/src/bundle/Resources/public/js/alloyeditor/src/plugins/ez-embed.js +++ b/src/bundle/Resources/public/js/alloyeditor/src/plugins/ez-embed.js @@ -21,6 +21,8 @@ const ZERO_WIDTH_SPACE = '​'; init: function(editor) { editor.ezembed = { canBeAdded: () => { + console.warn('[DEPRECATED] canBeAdded method is deprecated'); + console.warn('[DEPRECATED] it will be removed from ezplatform-admin-ui 2.0'); return true; }, }; From 8b3687bcf93f05e3d5c7cd3fcffd1d0a831eb48b Mon Sep 17 00:00:00 2001 From: Serhey Dolgushev Date: Tue, 9 Jul 2019 09:41:07 +0100 Subject: [PATCH 3/9] EZP-30732: EzBtnImage.isDisabled and EzBtnEmbed.isDisabled are deprecated --- .../public/js/alloyeditor/src/buttons/ez-btn-embed.js | 4 ++-- .../public/js/alloyeditor/src/buttons/ez-btn-image.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-embed.js b/src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-embed.js index 5d73a8b2a0..8ddef7b390 100644 --- a/src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-embed.js +++ b/src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-embed.js @@ -15,6 +15,8 @@ export default class EzBtnEmbed extends EzEmbedDiscoverContentButton { * @return {Boolean} True if the command is disabled, false otherwise. */ isDisabled() { + console.warn('[DEPRECATED] EzBtnEmbed.isDisabled method is deprecated'); + console.warn('[DEPRECATED] it will be removed from ezplatform-admin-ui 2.0'); return !this.props.editor.get('nativeEditor').ezembed.canBeAdded(); } @@ -55,13 +57,11 @@ export default class EzBtnEmbed extends EzEmbedDiscoverContentButton { */ render() { const css = 'ae-button ez-btn-ae ez-btn-ae--embed ' + this.getStateClasses(); - const disabled = this.isDisabled(); const label = Translator.trans(/*@Desc("Embed")*/ 'embed_btn.label', {}, 'alloy_editor'); return (