Skip to content

Commit 8071f1c

Browse files
author
Oleksii Korshenko
committed
MAGETWO-52571: [Github][PR] Add HttpInterface methods and add up-casts for type safety #3746
- Merge branch 'develop' into okapis-pr-branch
2 parents c306c2c + 6a5eb1b commit 8071f1c

File tree

6 files changed

+38
-23
lines changed

6 files changed

+38
-23
lines changed

app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Websites.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ protected function getFieldsForFieldset()
154154
$tooltip = [
155155
'link' => 'http://docs.magento.com/m2/ce/user_guide/configuration/scope.html',
156156
'description' => __(
157-
'If your Magento site has multiple views, ' .
158-
'you can set the scope to apply to a specific view.'
157+
'If your Magento installation has multiple websites, ' .
158+
'you can edit the scope to use the product on specific sites.'
159159
),
160160
];
161161
$sortOrder = 0;

app/code/Magento/Customer/view/base/ui_component/customer_form.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
</item>
105105
<item name="tooltip" xsi:type="array">
106106
<item name="link" xsi:type="string">http://docs.magento.com/m2/ce/user_guide/configuration/scope.html</item>
107-
<item name="description" xsi:type="string" translate="true">If your Magento site has multiple views, you can set the scope to apply to a specific view.</item>
107+
<item name="description" xsi:type="string" translate="true">If your Magento installation has multiple websites, you can edit the scope to associate the customer with a specific site.</item>
108108
</item>
109109
</item>
110110
</argument>

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

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -158,16 +158,20 @@ define([
158158
* @returns {Abstract} Chainable.
159159
*/
160160
_setClasses: function () {
161-
var additional = this.additionalClasses,
162-
classes;
161+
var additional = this.additionalClasses;
163162

164-
if (_.isString(additional) && additional.trim().length) {
165-
additional = this.additionalClasses.trim().split(' ');
166-
classes = this.additionalClasses = {};
163+
if (_.isString(additional)){
164+
this.additionalClasses = {};
167165

168-
additional.forEach(function (name) {
169-
classes[name] = true;
170-
}, this);
166+
if (additional.trim().length) {
167+
additional = additional.trim().split(' ');
168+
169+
additional.forEach(function (name) {
170+
if (name.length) {
171+
this.additionalClasses[name] = true;
172+
}
173+
}, this);
174+
}
171175
}
172176

173177
_.extend(this.additionalClasses, {

dev/tests/functional/utils/generate.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,24 @@
55
*/
66
require_once dirname(__FILE__) . '/' . 'bootstrap.php';
77

8-
// Generate page
9-
$objectManager->create(\Magento\Mtf\Util\Generate\Page::class)->launch();
10-
118
// Generate fixtures
129
$magentoObjectManagerFactory = \Magento\Framework\App\Bootstrap::createObjectManagerFactory(BP, $_SERVER);
1310
$magentoObjectManager = $magentoObjectManagerFactory->create($_SERVER);
14-
$objectManager->create(\Magento\Mtf\Util\Generate\Fixture::class)->launch();
1511

1612
// Generate repositories
1713
$magentoObjectManager->get(\Magento\Framework\App\State::class)->setAreaCode('frontend');
18-
$objectManager->create(\Magento\Mtf\Util\Generate\Repository::class)->launch();
1914

2015
// Generate factories for old end-to-end tests
2116
$magentoObjectManager->create(\Magento\Mtf\Util\Generate\Factory::class)->launch();
2217

18+
$generatorPool = $objectManager->get('Magento\Mtf\Util\Generate\Pool');
19+
foreach ($generatorPool->getGenerators() as $generator) {
20+
if (!$generator instanceof \Magento\Mtf\Util\Generate\LauncherInterface) {
21+
throw new \InvalidArgumentException(
22+
'Generator ' . get_class($generator) . ' should implement LauncherInterface'
23+
);
24+
}
25+
$generator->launch();
26+
}
27+
2328
\Magento\Mtf\Util\Generate\GenerateResult::displayResults();

lib/internal/Magento/Framework/View/Result/Layout.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
* A generic layout response can be used for rendering any kind of layout
1717
* So it comprises a response body from the layout elements it has and sets it to the HTTP response
1818
*
19+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
20+
*
1921
* @api
2022
*/
2123
class Layout extends AbstractResult
@@ -160,10 +162,10 @@ public function renderResult(ResponseInterface $httpResponse)
160162
{
161163
\Magento\Framework\Profiler::start('LAYOUT');
162164
\Magento\Framework\Profiler::start('layout_render');
163-
165+
164166
$this->eventManager->dispatch('layout_render_before');
165167
$this->eventManager->dispatch('layout_render_before_' . $this->request->getFullActionName());
166-
168+
167169
$this->applyHttpHeaders($httpResponse);
168170
$this->render($httpResponse);
169171

lib/web/mage/edit-trigger.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,16 @@
9898
* @protected
9999
*/
100100
_onMouseMove: function(e) {
101-
var target = $(e.target);
102-
target = target.is(this.trigger) || target.is(this.options.editSelector) ?
103-
target :
104-
target.parents(this.options.editSelector).first();
101+
var target = $(e.target),
102+
inner = target.find(this.options.editSelector);
105103

106-
if (target.size()) {
104+
if ($(e.target).is('button') && inner.length) {
105+
target = inner;
106+
} else if (!target.is(this.trigger) && !target.is(this.options.editSelector)) {
107+
target = target.parents(this.options.editSelector).first();
108+
}
109+
110+
if (target.length) {
107111
if (!target.is(this.trigger)) {
108112
this._setPosition(target);
109113
this.currentTarget = target;

0 commit comments

Comments
 (0)