Skip to content

Commit 3648e57

Browse files
committed
Merge branch 'MAGETWO-37555' into PR-bugs
2 parents f7c36c1 + 9089799 commit 3648e57

File tree

2 files changed

+10
-32
lines changed

2 files changed

+10
-32
lines changed

app/code/Magento/GroupedProduct/view/adminhtml/web/js/grouped-product.js

Lines changed: 8 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ define([
77
'jquery',
88
'mage/template',
99
'jquery/ui',
10+
'Magento_Ui/js/modal/modal',
1011
'mage/translate',
1112
'mage/adminhtml/grid'
1213
], function ($, mageTemplate) {
@@ -94,7 +95,7 @@ define([
9495
},
9596

9697
/**
97-
* Create dialog for show product
98+
* Create modal for show product
9899
*
99100
* @private
100101
*/
@@ -103,30 +104,14 @@ define([
103104
selectedProductList = {},
104105
popup = $('[data-role=add-product-dialog]');
105106

106-
popup.dialog({
107+
popup.modal({
108+
type: 'slide',
109+
innerScroll: true,
107110
title: $.mage.__('Add Products to Group'),
108-
autoOpen: false,
109-
minWidth: 980,
110-
width: '75%',
111-
modal: true,
112-
resizable: true,
113-
dialogClass: 'grouped',
114-
position: {
115-
my: 'left top',
116-
at: 'center top',
117-
of: 'body'
118-
},
111+
modalClass: 'grouped',
119112
open: function () {
120-
$(this).closest('.ui-dialog').addClass('ui-dialog-active');
121-
122-
var topMargin = $(this).closest('.ui-dialog').children('.ui-dialog-titlebar').outerHeight() + 55;
123-
$(this).closest('.ui-dialog').css('margin-top', topMargin);
124-
125113
$(this).addClass('admin__scope-old'); // ToDo UI: remove with old styles removal
126114
},
127-
close: function () {
128-
$(this).closest('.ui-dialog').removeClass('ui-dialog-active');
129-
},
130115
buttons: [{
131116
id: 'grouped-product-dialog-apply-button',
132117
text: $.mage.__('Add Selected Products'),
@@ -137,14 +122,7 @@ define([
137122
});
138123
widget._resort();
139124
widget._updateGridVisibility();
140-
$(this).dialog('close');
141-
}
142-
}, {
143-
id: 'grouped-product-dialog-cancel-button',
144-
text: $.mage.__('Cancel'),
145-
'class': 'action-close',
146-
click: function () {
147-
$(this).dialog('close');
125+
popup.modal('closeModal');
148126
}
149127
}]
150128
});
@@ -186,7 +164,7 @@ define([
186164

187165
$('[data-role=add-product]').on('click', function (event) {
188166
event.preventDefault();
189-
popup.dialog('open');
167+
popup.modal('openModal');
190168
gridPopup.reload();
191169
selectedProductList = {};
192170
});

dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Block/Adminhtml/Product/Grouped/AssociatedProducts.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class AssociatedProducts extends Tab
2929
*
3030
* @var string
3131
*/
32-
protected $productSearchGrid = "./ancestor::body//div[div[contains(@data-role,'add-product-dialog')]]";
32+
protected $productSearchGrid = './/*[@data-role="modal"][.//*[@data-role="add-product-dialog"]]';
3333

3434
/**
3535
* Associated products list block
@@ -54,7 +54,7 @@ protected function getSearchGridBlock()
5454
{
5555
return $this->blockFactory->create(
5656
'Magento\GroupedProduct\Test\Block\Adminhtml\Product\Grouped\AssociatedProducts\Search\Grid',
57-
['element' => $this->_rootElement->find($this->productSearchGrid, Locator::SELECTOR_XPATH)]
57+
['element' => $this->browser->find($this->productSearchGrid, Locator::SELECTOR_XPATH)]
5858
);
5959
}
6060

0 commit comments

Comments
 (0)