Skip to content

Commit edae2f0

Browse files
committed
Merge remote-tracking branch 'origin/2.3-develop' into MAGETWO-94070
2 parents b5e761b + e981850 commit edae2f0

File tree

21 files changed

+178
-33
lines changed

21 files changed

+178
-33
lines changed

app/code/Magento/Cms/Api/BlockRepositoryInterface.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
*/
66
namespace Magento\Cms\Api;
77

8-
use Magento\Framework\Api\SearchCriteriaInterface;
9-
108
/**
119
* CMS block CRUD interface.
1210
* @api

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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
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"/>
23+
<element name="ImageAlt" type="text" selector="//img[contains(@alt,'{{var1}}')]" parameterized="true"/>
2224
</section>
2325
<section name="CmsDesignSection">
2426
<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: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
<element name="Browse" type="button" selector=".mce-i-browse"/>
3737
<element name="BrowseUploadImage" type="file" selector=".fileupload" />
3838
<element name="image" type="text" selector="//small[text()='{{var1}}']" parameterized="true"/>
39-
<element name="imageOrImageCopy" type="text" selector="//img[contains(@alt, '{{arg1}}.{{arg2}}')]|//img[contains(@alt,'{{arg1}}_') and contains(@alt,'.{{arg2}}')]" parameterized="true"/>
39+
<element name="imageOrImageCopy" type="text" selector="//div[contains(@class,'media-gallery-modal')]//img[contains(@alt, '{{arg1}}.{{arg2}}')]|//img[contains(@alt,'{{arg1}}_') and contains(@alt,'.{{arg2}}')]" parameterized="true"/>
4040
<element name="imageSelected" type="text" selector="//small[text()='{{var1}}']/parent::*[@class='filecnt selected']" parameterized="true"/>
4141
<element name="ImageSource" type="input" selector=".mce-combobox.mce-abs-layout-item.mce-last.mce-has-open" />
4242
<element name="ImageDescription" type="input" selector=".mce-textbox.mce-abs-layout-item.mce-last" />
@@ -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"/>

app/code/Magento/Config/Test/Mftf/ActionGroup/ConfigWYSIWYGActionGroup.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,17 @@
2929
<click selector="{{ContentManagementSection.WYSIWYGOptions}}" stepKey="collapseWYSIWYGOptions" />
3030
<click selector="{{ContentManagementSection.Save}}" stepKey="saveConfig" />
3131
</actionGroup>
32+
<actionGroup name="UseStaticURLForMediaContentInWYSIWYG">
33+
<arguments>
34+
<argument name="value" defaultValue="Yes" type="string"/>
35+
</arguments>
36+
<amOnPage url="{{ConfigurationStoresPage.url}}" stepKey="navigateToWYSIWYGConfigPage1"/>
37+
<waitForPageLoad stepKey="waitForPageLoad1"/>
38+
<conditionalClick stepKey="expandWYSIWYGOptions" selector="{{ContentManagementSection.WYSIWYGOptions}}" dependentSelector="{{ContentManagementSection.CheckIfTabExpand}}" visible="true" />
39+
<waitForElementVisible selector="{{ContentManagementSection.EnableWYSIWYG}}" stepKey="waitForEnableWYSIWYGDropdown1" />
40+
<selectOption selector="{{ContentManagementSection.StaticURL}}" userInput="{{value}}" stepKey="selectOption1"/>
41+
<click selector="{{ContentManagementSection.WYSIWYGOptions}}" stepKey="collapseWYSIWYGOptions" />
42+
<click selector="{{ContentManagementSection.Save}}" stepKey="saveConfig" />
43+
<waitForPageLoad stepKey="waitForPageLoad2" />
44+
</actionGroup>
3245
</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

app/code/Magento/Ui/view/base/web/js/form/element/abstract.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ define([
408408
this.bubble('error', message);
409409

410410
//TODO: Implement proper result propagation for form
411-
if (!isValid) {
411+
if (this.source && !isValid) {
412412
this.source.set('params.invalid', true);
413413
}
414414

app/code/Magento/Ui/view/base/web/js/form/element/file-uploader.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
/**
77
* @api
88
*/
9+
/* global Base64 */
910
define([
1011
'jquery',
1112
'underscore',
@@ -168,6 +169,10 @@ define([
168169
processFile: function (file) {
169170
file.previewType = this.getFilePreviewType(file);
170171

172+
if (!file.id && file.name) {
173+
file.id = Base64.mageEncode(file.name);
174+
}
175+
171176
this.observe.call(file, true, [
172177
'previewWidth',
173178
'previewHeight'

app/code/Magento/Ui/view/base/web/js/form/element/image-uploader.js

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ define([
1717
'use strict';
1818

1919
return Element.extend({
20+
/**
21+
* {@inheritDoc}
22+
*/
23+
initialize: function () {
24+
this._super();
25+
26+
// Listen for file deletions from the media browser
27+
$(window).on('fileDeleted.mediabrowser', this.onDeleteFile.bind(this));
28+
},
2029

2130
/**
2231
* Assign uid for media gallery
@@ -76,6 +85,40 @@ define([
7685
browser.openDialog(openDialogUrl, null, null, this.mediaGallery.openDialogTitle);
7786
},
7887

88+
/**
89+
* @param {jQuery.event} e
90+
* @param {Object} data
91+
* @returns {Object} Chainables
92+
*/
93+
onDeleteFile: function (e, data) {
94+
var fileId = this.getFileId(),
95+
deletedFileIds = data.ids;
96+
97+
if (fileId && $.inArray(fileId, deletedFileIds) > -1) {
98+
this.clear();
99+
}
100+
101+
return this;
102+
},
103+
104+
/**
105+
* {@inheritDoc}
106+
*/
107+
clear: function () {
108+
this.value([]);
109+
110+
return this;
111+
},
112+
113+
/**
114+
* Gets the ID of the file used if set
115+
*
116+
* @return {String|Null} ID
117+
*/
118+
getFileId: function () {
119+
return this.hasData() ? this.value()[0].id : null;
120+
},
121+
79122
/**
80123
* Trigger native browser file upload UI via clicking on 'Upload' button
81124
*

app/code/Magento/Ui/view/base/web/js/modal/modal.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,12 @@ define([
340340
var zIndex = this.modal.zIndex(),
341341
baseIndex = zIndex + this._getVisibleCount();
342342

343+
if (this.modal.data('active')) {
344+
return;
345+
}
346+
347+
this.modal.data('active', true);
348+
343349
this.overlay.zIndex(++baseIndex);
344350
this.prevOverlayIndex = this.overlay.zIndex();
345351
this.modal.zIndex(this.overlay.zIndex() + 1);
@@ -354,6 +360,7 @@ define([
354360
*/
355361
_unsetActive: function () {
356362
this.modal.removeAttr('style');
363+
this.modal.data('active', false);
357364

358365
if (this.overlay) {
359366
// In cases when one modal is closed but there is another modal open (e.g. admin notifications)

dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutOfflinePaymentMethodsTest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
<constraint name="Magento\Sales\Test\Constraint\AssertOrderStatusIsCorrect" />
103103
<constraint name="Magento\Sales\Test\Constraint\AssertOrderButtonsAvailable" />
104104
<constraint name="Magento\Sales\Test\Constraint\AssertOrderGrandTotal" />
105-
<data name="issue" xsi:type="string">MAGETWO-66737: Magento\Checkout\Test\TestCase\OnePageCheckoutTest with OnePageCheckoutTestVariation3 is not stable</data>
105+
<data name="issue" xsi:type="string">MAGETWO-66737: Magento\Checkout\Test\TestCase\OnePageCheckoutTest with OnePageCheckoutTestVariation3 and 4 is not stable</data>
106106
</variation>
107107
<variation name="OnePageCheckoutTestVariation4" summary="One Page Checkout Products with Special Prices" ticketId="MAGETWO-12429">
108108
<data name="tag" xsi:type="string">test_type:acceptance_test, test_type:extended_acceptance_test, severity:S0</data>
@@ -125,6 +125,7 @@
125125
<constraint name="Magento\Shipping\Test\Constraint\AssertShipmentSuccessCreateMessage" />
126126
<constraint name="Magento\Checkout\Test\Constraint\AssertMinicartEmpty" />
127127
<constraint name="Magento\Sales\Test\Constraint\AssertOrderGrandTotal"/>
128+
<data name="issue" xsi:type="string">MAGETWO-66737: Magento\Checkout\Test\TestCase\OnePageCheckoutTest with OnePageCheckoutTestVariation3 and 4 is not stable</data>
128129
</variation>
129130
<variation name="OnePageCheckoutTestVariation5" summary="Guest Checkout using Check/Money Order and Free Shipping with Prices/Taxes Verifications" ticketId="MAGETWO-12412">
130131
<data name="tag" xsi:type="string">test_type:acceptance_test, test_type:extended_acceptance_test, severity:S0</data>

dev/tests/functional/tests/app/Magento/Setup/Test/Constraint/AssertSuccessfulReadinessCheck.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,13 @@ public function processAssert(SetupWizard $setupWizard)
6767
$setupWizard->getReadiness()->getDependencyCheck(),
6868
'Dependency check is incorrect.'
6969
);
70-
\PHPUnit\Framework\Assert::assertContains(
71-
self::PHP_VERSION_MESSAGE,
72-
$setupWizard->getReadiness()->getPhpVersionCheck(),
73-
'PHP version is incorrect.'
74-
);
70+
if ($setupWizard->getReadiness()->isPhpVersionCheckVisible()) {
71+
\PHPUnit\Framework\Assert::assertContains(
72+
self::PHP_VERSION_MESSAGE,
73+
$setupWizard->getReadiness()->getPhpVersionCheck(),
74+
'PHP version is incorrect.'
75+
);
76+
}
7577
\PHPUnit\Framework\Assert::assertContains(
7678
self::PHP_SETTING_REGEXP,
7779
$setupWizard->getReadiness()->getSettingsCheck(),

lib/web/mage/adminhtml/browser.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,10 @@ define([
435435
}).done($.proxy(function () {
436436
self.reload();
437437
self.element.find('#delete_files').toggleClass(self.options.hidden, true);
438+
439+
$(window).trigger('fileDeleted.mediabrowser', {
440+
ids: ids
441+
});
438442
}, this));
439443
},
440444

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
});

lib/web/mage/adminhtml/wysiwyg/tiny_mce/themes/ui.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
font-style: normal;
1616
font-size: 14px;
1717
color: #000;
18+
box-sizing: initial;
19+
word-break: break-all;
1820
}
1921

2022
.magento-placeholder-error {

0 commit comments

Comments
 (0)