Skip to content

Commit 710b9cc

Browse files
authored
Merge pull request #6815 from magento-lynx/MC-41128_upgrade-knockout
[Lynx] Upgrade knockout.js to 3.5.1
2 parents 4b439a6 + 33765be commit 710b9cc

File tree

9 files changed

+6201
-5507
lines changed

9 files changed

+6201
-5507
lines changed

app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleSetEditRelatedProductsTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
<conditionalClick selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDropdown}}" dependentSelector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDependent}}" visible="false" stepKey="openDropDownIfClosedRelatedSee2"/>
101101
<see selector="{{AdminProductFormRelatedUpSellCrossSellSection.selectedRelatedProduct}}" userInput="$$simpleProduct6.name$$" stepKey="seeSixthRelatedProduct"/>
102102
<selectOption selector=".admin__collapsible-block-wrapper[data-index='related'] .admin__control-select" userInput="5" stepKey="selectFivePerPage"/>
103+
<waitForPageLoad stepKey="waitForLoadingAfterSelectFivePerPage"/>
103104
<dontSee selector="{{AdminProductFormRelatedUpSellCrossSellSection.selectedRelatedProduct}}" userInput="$$simpleProduct6.name$$" stepKey="dontSeeSixthRelatedProduct"/>
104105

105106
<!--See related product in storefront-->

app/code/Magento/GiftMessage/view/frontend/web/template/gift-message-item-level.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,17 @@
3333
<!-- ko text: getObservable('message') --><!-- /ko -->
3434
</div>
3535
<!-- /ko -->
36-
36+
3737
<div class="actions-toolbar">
3838
<div class="secondary">
3939
<button type="submit" class="action action-edit" data-bind="
4040
click: $data.editOptions.bind($data),
41-
attr: {title: $t('Edit')">
41+
attr: {title: $t('Edit')}">
4242
<span data-bind="i18n: 'Edit'"></span>
4343
</button>
4444
<button class="action action-delete" data-bind="
4545
click: $data.deleteOptions.bind($data),
46-
attr: {title: $t('Delete')">
46+
attr: {title: $t('Delete')}">
4747
<span data-bind="i18n: 'Delete'"></span>
4848
</button>
4949
</div>

app/code/Magento/Ui/view/base/web/js/dynamic-rows/dynamic-rows.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ define([
1313
'uiLayout',
1414
'uiCollection',
1515
'uiRegistry',
16-
'mage/translate'
17-
], function (ko, utils, _, layout, uiCollection, registry, $t) {
16+
'mage/translate',
17+
'jquery'
18+
], function (ko, utils, _, layout, uiCollection, registry, $t, $) {
1819
'use strict';
1920

2021
/**
@@ -975,6 +976,18 @@ define([
975976
this._reducePages();
976977
},
977978

979+
/**
980+
* Update page size based on select change event.
981+
* The value needs to be retrieved from select as ko value handler is executed after the event handler.
982+
*
983+
* @param {Object} component
984+
* @param {jQuery.Event} event
985+
*/
986+
updatePageSize: function (component, event) {
987+
this.pageSize = $(event.target).val();
988+
this.reload();
989+
},
990+
978991
/**
979992
* Destroy all dynamic-rows elems
980993
*

app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/optgroup.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ define([
1919
ko.bindingHandlers.optgroup = {
2020
/**
2121
* @param {*} element
22-
* @returns {Object}
2322
*/
2423
init: function (element) {
2524
if (ko.utils.tagNameLower(element) !== 'select') {
@@ -30,11 +29,6 @@ define([
3029
while (element.length > 0) {
3130
element.remove(0);
3231
}
33-
34-
// Ensures that the binding processor doesn't try to bind the options
35-
return {
36-
'controlsDescendantBindings': true
37-
};
3832
},
3933

4034
/**
@@ -333,5 +327,4 @@ define([
333327
}
334328
}
335329
};
336-
ko.bindingHandlers.selectedOptions.after.push('optgroup');
337330
});

app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/scope.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ define([
2929
$t: $t
3030
});
3131

32-
ko.utils.arrayForEach(el.childNodes, ko.cleanNode);
32+
ko.utils.arrayForEach(ko.virtualElements.childNodes(el), ko.cleanNode);
3333

3434
ko.applyBindingsToDescendants(component, el);
3535
}

app/code/Magento/Ui/view/base/web/templates/dynamic-rows/templates/grid.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<div class="admin__field-control" data-role="grid-wrapper">
1818
<div class="admin__control-table-pagination" visible="!!$data.getRecordCount()">
1919
<div class="admin__data-grid-pager-wrap">
20-
<select class="admin__control-select" data-bind="value:pageSize, event:{change: reload}">
20+
<select class="admin__control-select" data-bind="value:pageSize, event:{change: updatePageSize}">
2121
<option value="5">5</option>
2222
<option value="20" selected="selected">20</option>
2323
<option value="30">30</option>

app/code/Magento/Ui/view/frontend/web/templates/form/field.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,3 @@
5050
<!-- /ko -->
5151
</div>
5252
</div>
53-
<!-- /ko -->

dev/tests/js/jasmine/tests/app/code/Magento/Paypal/frontend/js/view/payment/method-renderer/paypal-express-abstract.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ define([
7373
['Magento_Paypal/js/view/payment/method-renderer/paypal-express-abstract'],
7474
function (Constr) {
7575
paypalExpressAbstract = new Constr({
76+
isChecked: ko.observable(true),
7677
provider: 'provName',
7778
name: 'test',
7879
index: 'test',

0 commit comments

Comments
 (0)