From 3a079433fd12cd1353b46354ecffed1c021dc5ba Mon Sep 17 00:00:00 2001 From: Dariusz Szut Date: Thu, 14 May 2020 10:49:53 +0200 Subject: [PATCH 1/2] EZP-31626: Fixed error in AlloyEditor when embed location --- .../js/alloyeditor/src/widgets/ez-embed-base.js | 16 +++++++++++++++- .../Resources/translations/alloy_editor.en.xliff | 5 +++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/bundle/Resources/public/js/alloyeditor/src/widgets/ez-embed-base.js b/src/bundle/Resources/public/js/alloyeditor/src/widgets/ez-embed-base.js index a10d1ebb80..4d8b121184 100644 --- a/src/bundle/Resources/public/js/alloyeditor/src/widgets/ez-embed-base.js +++ b/src/bundle/Resources/public/js/alloyeditor/src/widgets/ez-embed-base.js @@ -101,7 +101,21 @@ const embedBaseDefinition = { * @method initEditMode */ initEditMode: function() { - const contentId = this.getHref().replace('ezcontent://', ''); + const href = this.getHref(); + const hasEzLocation = href.includes('ezlocation://'); + const contentId = href.replace('ezcontent://', ''); + + if (hasEzLocation) { + const ezLocationError = Translator.trans( + /*@Desc("This embedded item relies on 'ezlocation' imported from Legacy. It's not supported by Online Editor yet.")*/ 'embed.ezlocation.error', + {}, + 'alloy_editor' + ); + + this.renderEmbedPreview(ezLocationError); + + return; + } if (!contentId) { return; diff --git a/src/bundle/Resources/translations/alloy_editor.en.xliff b/src/bundle/Resources/translations/alloy_editor.en.xliff index 805261ee93..1dd8d5b062 100644 --- a/src/bundle/Resources/translations/alloy_editor.en.xliff +++ b/src/bundle/Resources/translations/alloy_editor.en.xliff @@ -66,6 +66,11 @@ Save key: custom_tag_update_btn.save_btn.label + + This embedded item relies on 'ezlocation' imported from Legacy. It's not supported by Online Editor yet. + This embedded item relies on 'ezlocation' imported from Legacy. It's not supported by Online Editor yet. + key: embed.ezlocation.error + Center Center From 157ca056c2e86ac4a3912cfda3b4431ceb56b558 Mon Sep 17 00:00:00 2001 From: Dariusz Szut Date: Thu, 14 May 2020 11:24:36 +0200 Subject: [PATCH 2/2] fixed translation --- .../public/js/alloyeditor/src/widgets/ez-embed-base.js | 2 +- src/bundle/Resources/translations/alloy_editor.en.xliff | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bundle/Resources/public/js/alloyeditor/src/widgets/ez-embed-base.js b/src/bundle/Resources/public/js/alloyeditor/src/widgets/ez-embed-base.js index 4d8b121184..c7d70e20ff 100644 --- a/src/bundle/Resources/public/js/alloyeditor/src/widgets/ez-embed-base.js +++ b/src/bundle/Resources/public/js/alloyeditor/src/widgets/ez-embed-base.js @@ -107,7 +107,7 @@ const embedBaseDefinition = { if (hasEzLocation) { const ezLocationError = Translator.trans( - /*@Desc("This embedded item relies on 'ezlocation' imported from Legacy. It's not supported by Online Editor yet.")*/ 'embed.ezlocation.error', + /*@Desc("This embedded item relies on 'ezlocation' imported from Legacy. It isn't supported by Online Editor yet.")*/ 'embed.ezlocation.error', {}, 'alloy_editor' ); diff --git a/src/bundle/Resources/translations/alloy_editor.en.xliff b/src/bundle/Resources/translations/alloy_editor.en.xliff index 1dd8d5b062..89b87a8ddc 100644 --- a/src/bundle/Resources/translations/alloy_editor.en.xliff +++ b/src/bundle/Resources/translations/alloy_editor.en.xliff @@ -67,8 +67,8 @@ key: custom_tag_update_btn.save_btn.label - This embedded item relies on 'ezlocation' imported from Legacy. It's not supported by Online Editor yet. - This embedded item relies on 'ezlocation' imported from Legacy. It's not supported by Online Editor yet. + This embedded item relies on 'ezlocation' imported from Legacy. It isn't supported by Online Editor yet. + This embedded item relies on 'ezlocation' imported from Legacy. It isn't supported by Online Editor yet. key: embed.ezlocation.error