Skip to content

Commit 0384fe0

Browse files
committed
Merge branch 'MC-1416' into team3-delivery
2 parents a5107ab + b8d3786 commit 0384fe0

File tree

13 files changed

+114
-23
lines changed

13 files changed

+114
-23
lines changed

app/code/Magento/Cms/Test/Mftf/ActionGroup/VerifyTinyMCEActionGroup.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
1010
<actionGroup name="VerifyTinyMCEActionGroup">
11-
<waitForElementVisible selector="{{TinyMCESection.TinyMCE4}}" stepKey="waitForTinyMCE" time="30" />
12-
<seeElement selector="{{TinyMCESection.TinyMCE4}}" stepKey="seeTinyMCE4" />
1311
<seeElement selector="{{TinyMCESection.Style}}" stepKey="assertInfo2"/>
1412
<seeElement selector="{{TinyMCESection.Bold}}" stepKey="assertInfo3"/>
1513
<seeElement selector="{{TinyMCESection.Italic}}" stepKey="assertInfo4"/>

app/code/Magento/Cms/Test/Mftf/Data/CmsPageData.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
<data key="extension">jpg</data>
7676
<data key="content">Image content. Yeah.</data>
7777
<data key="height">1000</data>
78+
<data key="path">wysiwyg</data>
7879
</entity>
7980
<entity name="ImageFolder" type="uploadImage">
8081
<data key="name" unique="suffix">Test</data>

app/code/Magento/Cms/Test/Mftf/Section/CmsNewPagePageContentSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<element name="InsertWidgetBtn" type="button" selector=".action-add-widget"/>
2020
<element name="InsertVariableBtn" type="button" selector=".scalable.add-variable.plugin"/>
2121
<element name="InsertImageBtn" type="button" selector=".scalable.action-add-image.plugin"/>
22+
<element name="imageSource" type="text" selector="//img[contains(@src,'{{var1}}')]" parameterized="true"/>
2223
</section>
2324
<section name="CmsDesignSection">
2425
<element name="DesignTab" type="button" selector="//strong[@class='admin__collapsible-title']//span[text()='Design']"/>

app/code/Magento/Cms/Test/Mftf/Section/TinyMCESection.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,6 @@
9898
<element name="PageSize" type="input" selector="input[name='parameters[page_size]']"/>
9999
<element name="ProductAttribute" type="multiselect" selector="select[name='parameters[show_attributes][]']" />
100100
<element name="ButtonToShow" type="multiselect" selector="select[name='parameters[show_buttons][]']"/>
101-
<!--Widget on Storefront-->
102-
<element name="CategoryWidget" type="text" selector="//a[@href='http://magento2.vagrant42/{{var1}}.html?___store=default']" parameterized="true"/>
103-
<element name="CMSPageWidget" type="text" selector="//a[@href='http://magento2.vagrant42/home']"/>
104101
<!--Compare on Storefront-->
105102
<element name="ProductName" type="text" selector=".product.name.product-item-name" />
106103
<element name="CompareBtn" type="button" selector=".action.tocompare"/>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="useStaticURLForMediaContentInWYSIWYGActionGroup">
12+
<amOnPage url="{{ConfigurationStoresPage.url}}" stepKey="navigateToWYSIWYGConfigPage1"/>
13+
<waitForPageLoad stepKey="waitForPageLoad"/>
14+
<conditionalClick stepKey="expandWYSIWYGOptions" selector="{{ContentManagementSection.WYSIWYGOptions}}" dependentSelector="{{ContentManagementSection.CheckIfTabExpand}}" visible="true" />
15+
<waitForElementVisible selector="{{ContentManagementSection.EnableWYSIWYG}}" stepKey="waitForEnableWYSIWYGDropdown1" />
16+
<selectOption selector="{{ContentManagementSection.StaticURL}}" userInput="Yes" stepKey="selectOption1"/>
17+
<click selector="{{ContentManagementSection.WYSIWYGOptions}}" stepKey="collapseWYSIWYGOptions" />
18+
<click selector="{{ContentManagementSection.Save}}" stepKey="saveConfig" />
19+
</actionGroup>
20+
</actionGroups>

app/code/Magento/Config/Test/Mftf/Section/GeneralSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<element name="EnableWYSIWYG" type="button" selector="#cms_wysiwyg_enabled"/>
1616
<element name="SwitcherSystemValue" type="button" selector="#cms_wysiwyg_editor_inherit"/>
1717
<element name="Switcher" type="button" selector="#cms_wysiwyg_editor" />
18+
<element name="StaticURL" type="button" selector="#cms_wysiwyg_use_static_urls_in_catalog" />
1819
<element name="Save" type="button" selector="#save"/>
1920
</section>
2021
<section name="WebSection">

app/code/Magento/Tinymce3/view/base/web/tinymce3Adapter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ define([
495495
*/
496496
encodeDirectives: function (content) {
497497
// collect all HTML tags with attributes that contain directives
498-
return content.gsub(/<([a-z0-9\-\_]+[^>]+?)([a-z0-9\-\_]+=".*?\{\{.+?\}\}.*?".*?)>/i, function (match) {
498+
return content.gsub(/<([a-z0-9\-\_]+[^>]+?)([a-z0-9\-\_]+="[^"]*?\{\{.+?\}\}.*?".*?)>/i, function (match) {
499499
var attributesString = match[2],
500500
decodedDirectiveString;
501501

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* Copyright © Magento, Inc. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
6+
define([], function () {
7+
'use strict';
8+
9+
return {
10+
afterInitialization: 'afterInitialization',
11+
afterChangeContent: 'afterChangeContent',
12+
afterUndo: 'afterUndo',
13+
afterPaste: 'afterPaste',
14+
beforeSetContent: 'beforeSetContent',
15+
afterSetContent: 'afterSetContent',
16+
afterSave: 'afterSave',
17+
afterOpenFileBrowser: 'afterOpenFileBrowser',
18+
afterFormSubmit: 'afterFormSubmit',
19+
afterBlur: 'afterBlur',
20+
afterFocus: 'afterFocus'
21+
};
22+
});

lib/web/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentowidget/editor_plugin.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
/* eslint-disable strict */
88
define([
99
'wysiwygAdapter',
10-
'mage/adminhtml/events'
10+
'mage/adminhtml/events',
11+
'mage/adminhtml/wysiwyg/widget'
1112
], function (wysiwyg, varienGlobalEvents) {
1213
return function (config) {
1314
tinymce.create('tinymce.plugins.magentowidget', {

lib/web/mage/adminhtml/wysiwyg/tiny_mce/setup.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ define([
88
'jquery',
99
'underscore',
1010
'wysiwygAdapter',
11+
'module',
1112
'mage/translate',
1213
'prototype',
1314
'mage/adminhtml/events',
1415
'mage/adminhtml/browser'
15-
], function (jQuery, _, wysiwygAdapter) {
16-
var wysiwygSetup = Class.create({
16+
], function (jQuery, _, wysiwygAdapter, module) {
17+
var baseConfig = module.config().config || {},
18+
wysiwygSetup = Class.create({
1719
wysiwygInstance: null
1820
});
1921

@@ -27,7 +29,10 @@ define([
2729
var WysiwygInstancePrototype = new wysiwygAdapter.getAdapterPrototype();
2830

2931
_.bindAll(this, 'openFileBrowser');
32+
33+
config = Object.assign({}, baseConfig, config || {});
3034
this.wysiwygInstance = new WysiwygInstancePrototype(htmlId, config);
35+
this.wysiwygInstance.eventBus = this.eventBus = new window.varienEvents();
3136
},
3237

3338
/**
@@ -67,6 +72,9 @@ define([
6772
updateContent: function (content) {
6873
return this.wysiwygInstance.encodeContent(content);
6974
}
75+
7076
};
7177
window.wysiwygSetup = wysiwygSetup;
78+
79+
return wysiwygSetup;
7280
});

0 commit comments

Comments
 (0)