From 8bfa04876a3c60225fd3f6221889a13185a3ffce Mon Sep 17 00:00:00 2001 From: Vova Yatsyuk Date: Sat, 22 Oct 2016 13:41:37 +0300 Subject: [PATCH 01/34] SpacingTop feature added --- lib/web/mage/sticky.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/web/mage/sticky.js b/lib/web/mage/sticky.js index 13925ea4ea893..ed1a955509842 100644 --- a/lib/web/mage/sticky.js +++ b/lib/web/mage/sticky.js @@ -11,7 +11,8 @@ define([ $.widget('mage.sticky', { options: { - container: '' + container: '', + spacingTop: 0 }, /** @@ -42,6 +43,12 @@ define([ if( !isStatic && this.element.is(':visible') ) { offset = $(document).scrollTop() - this.parentOffset; + if (typeof this.options.spacingTop === 'function') { + offset += this.options.spacingTop(); + } else { + offset += this.options.spacingTop; + } + offset = Math.max( 0, Math.min( offset, this.maxOffset) ); this.element.css( 'top', offset ); From 996d2132fe2c76b806764505747985a863314a89 Mon Sep 17 00:00:00 2001 From: Vova Yatsyuk Date: Sat, 22 Oct 2016 13:42:07 +0300 Subject: [PATCH 02/34] Trailing spaces was removed --- lib/web/mage/sticky.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/web/mage/sticky.js b/lib/web/mage/sticky.js index ed1a955509842..7e36741ea797d 100644 --- a/lib/web/mage/sticky.js +++ b/lib/web/mage/sticky.js @@ -8,7 +8,7 @@ define([ "jquery/ui" ], function($){ "use strict"; - + $.widget('mage.sticky', { options: { container: '', @@ -50,13 +50,13 @@ define([ } offset = Math.max( 0, Math.min( offset, this.maxOffset) ); - + this.element.css( 'top', offset ); } }, /** - * Defines maximum offset value of the element. + * Defines maximum offset value of the element. * @private */ _calculateDimens: function(){ @@ -88,6 +88,6 @@ define([ ._stick(); } }); - + return $.mage.sticky; }); From a7254cfa34ccbbd5511fcae5dde341041b00611b Mon Sep 17 00:00:00 2001 From: Vova Yatsyuk Date: Sat, 22 Oct 2016 14:05:45 +0300 Subject: [PATCH 03/34] Added stickyClass (css class) feature. --- lib/web/mage/sticky.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/web/mage/sticky.js b/lib/web/mage/sticky.js index 7e36741ea797d..dcc5a65310c39 100644 --- a/lib/web/mage/sticky.js +++ b/lib/web/mage/sticky.js @@ -12,7 +12,8 @@ define([ $.widget('mage.sticky', { options: { container: '', - spacingTop: 0 + spacingTop: 0, + stickyClass: '_sticky' }, /** @@ -51,7 +52,9 @@ define([ offset = Math.max( 0, Math.min( offset, this.maxOffset) ); - this.element.css( 'top', offset ); + this.element + .toggleClass(this.options.stickyClass, (offset > 0)) + .css( 'top', offset ); } }, From 798469a90d80d4297c0038643cbbb627ca8fa0c8 Mon Sep 17 00:00:00 2001 From: Vova Yatsyuk Date: Sat, 22 Oct 2016 16:02:09 +0300 Subject: [PATCH 04/34] Added offsetTop feature --- lib/web/mage/sticky.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/lib/web/mage/sticky.js b/lib/web/mage/sticky.js index dcc5a65310c39..54291b3dc130a 100644 --- a/lib/web/mage/sticky.js +++ b/lib/web/mage/sticky.js @@ -13,6 +13,7 @@ define([ options: { container: '', spacingTop: 0, + offsetTop: 0, stickyClass: '_sticky' }, @@ -52,6 +53,22 @@ define([ offset = Math.max( 0, Math.min( offset, this.maxOffset) ); + if (offset && + this.options.offsetTop && + !this.element.hasClass(this.options.stickyClass)) { + + var offsetTop = 0; + if (typeof this.options.offsetTop === 'function') { + offsetTop = this.options.offsetTop(); + } else { + offsetTop = this.options.offsetTop; + } + + if (offset < this.options.offsetTop) { + offset = 0; + } + } + this.element .toggleClass(this.options.stickyClass, (offset > 0)) .css( 'top', offset ); From 766292c7d6efbb7b32eccbeafee93691e5205e6c Mon Sep 17 00:00:00 2001 From: Vova Yatsyuk Date: Tue, 4 Apr 2017 10:27:00 +0300 Subject: [PATCH 05/34] Fixed offsetTop comparing bug --- lib/web/mage/sticky.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/web/mage/sticky.js b/lib/web/mage/sticky.js index c4b003c5a4467..259bfc2b05350 100644 --- a/lib/web/mage/sticky.js +++ b/lib/web/mage/sticky.js @@ -64,7 +64,7 @@ define([ offsetTop = this.options.offsetTop; } - if (offset < this.options.offsetTop) { + if (offset < offsetTop) { offset = 0; } } From 0e479a32b1b998376852ff7e4b71d197f5e7b359 Mon Sep 17 00:00:00 2001 From: Vova Yatsyuk Date: Tue, 4 Apr 2017 11:08:28 +0300 Subject: [PATCH 06/34] Added stuck variable for better 'if' statement readability --- lib/web/mage/sticky.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/web/mage/sticky.js b/lib/web/mage/sticky.js index 259bfc2b05350..a04bd2c6c4ddb 100644 --- a/lib/web/mage/sticky.js +++ b/lib/web/mage/sticky.js @@ -53,10 +53,8 @@ define([ offset = Math.max(0, Math.min(offset, this.maxOffset)); - if (offset && - this.options.offsetTop && - !this.element.hasClass(this.options.stickyClass)) { - + var stuck = this.element.hasClass(this.options.stickyClass); + if (offset && this.options.offsetTop && !stuck) { var offsetTop = 0; if (typeof this.options.offsetTop === 'function') { offsetTop = this.options.offsetTop(); From ae7f764e2967d0fa6c8bfe544946c3bfa47cf9f3 Mon Sep 17 00:00:00 2001 From: Vova Yatsyuk Date: Wed, 5 Apr 2017 17:29:47 +0300 Subject: [PATCH 07/34] Duplicated option value detection logic moved to separate function --- lib/web/mage/sticky.js | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/lib/web/mage/sticky.js b/lib/web/mage/sticky.js index a04bd2c6c4ddb..05b644c47e8d3 100644 --- a/lib/web/mage/sticky.js +++ b/lib/web/mage/sticky.js @@ -17,6 +17,22 @@ define([ stickyClass: '_sticky' }, + _optionToNumber(option) { + var value = this.options[option] || 0; + if (typeof value === 'function') { + value = this.options[option](); + } + + var converted = Number(value); + if (isNaN(converted)) { + throw Error( + 'sticky: Could not convert supplied option "' + + option + '" to Number from "' + value + '"' + ); + } + return converted; + }, + /** * Bind handlers to scroll event * @private @@ -43,25 +59,15 @@ define([ isStatic = this.element.css('position') === 'static'; if (!isStatic && this.element.is(':visible')) { - offset = $(document).scrollTop() - this.parentOffset; - - if (typeof this.options.spacingTop === 'function') { - offset += this.options.spacingTop(); - } else { - offset += this.options.spacingTop; - } + offset = $(document).scrollTop() + - this.parentOffset + + this._optionToNumber('spacingTop'); offset = Math.max(0, Math.min(offset, this.maxOffset)); var stuck = this.element.hasClass(this.options.stickyClass); if (offset && this.options.offsetTop && !stuck) { - var offsetTop = 0; - if (typeof this.options.offsetTop === 'function') { - offsetTop = this.options.offsetTop(); - } else { - offsetTop = this.options.offsetTop; - } - + var offsetTop = this._optionToNumber('offsetTop'); if (offset < offsetTop) { offset = 0; } From a141ce4902e5b6180e27b635c6d1bec70357485c Mon Sep 17 00:00:00 2001 From: Tom Klingenberg Date: Wed, 17 May 2017 16:22:12 +0200 Subject: [PATCH 08/34] Revert minimum stability to stable, tasks #4359 Stability revert from alpha to stable. In 79c9052 set to alpha due to earlier required composer/composer version which was not yet stable. Composer upgrade was blocked due to changes w/ composer autoloading and a PHP 5.3 regression allowing slash-prefixed class names in the past and the unlucky coincidence that di.xml files made use of such class-names, fixed in 0b243b8. Now composer was updated in 0364bf9 and alpha degradation can be lifted. Refs: - #4359 - 79c90524290601c51c501fb7cf4c5dd2454a2a34 - 0b243b899f2c94a9eab18bf8faeb2b87b120f272 - 0364bf93b363fe7923b2fa95ab61f3b715828565 --- composer.json | 1 - composer.lock | 219 +++++++++++++++++++++++++------------------------- 2 files changed, 109 insertions(+), 111 deletions(-) diff --git a/composer.json b/composer.json index 95a1ae33985da..f2a9cd73896ee 100644 --- a/composer.json +++ b/composer.json @@ -258,6 +258,5 @@ "Magento\\TestFramework\\Utility\\": "dev/tests/static/framework/Magento/TestFramework/Utility/" } }, - "minimum-stability": "alpha", "prefer-stable": true } diff --git a/composer.lock b/composer.lock index f4b32154e8370..e6b57183f5000 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "54e536d6a16773c0efc4d6a7a6e668d4", - "content-hash": "83b07861c465af490d6cf0c75adc78fd", + "content-hash": "c12e1b9e849f12d759d832f2977826dc", "packages": [ { "name": "braintree/braintree_php", @@ -52,7 +51,7 @@ } ], "description": "Braintree PHP Client Library", - "time": "2017-02-16 19:59:04" + "time": "2017-02-16T19:59:04+00:00" }, { "name": "colinmollenhour/cache-backend-file", @@ -88,7 +87,7 @@ ], "description": "The stock Zend_Cache_Backend_File backend has extremely poor performance for cleaning by tags making it become unusable as the number of cached items increases. This backend makes many changes resulting in a huge performance boost, especially for tag cleaning.", "homepage": "https://github.com/colinmollenhour/Cm_Cache_Backend_File", - "time": "2016-05-02 16:24:47" + "time": "2016-05-02T16:24:47+00:00" }, { "name": "colinmollenhour/cache-backend-redis", @@ -124,7 +123,7 @@ ], "description": "Zend_Cache backend using Redis with full support for tags.", "homepage": "https://github.com/colinmollenhour/Cm_Cache_Backend_Redis", - "time": "2017-03-25 04:54:24" + "time": "2017-03-25T04:54:24+00:00" }, { "name": "colinmollenhour/credis", @@ -163,7 +162,7 @@ ], "description": "Credis is a lightweight interface to the Redis key-value store which wraps the phpredis library when available for better performance.", "homepage": "https://github.com/colinmollenhour/credis", - "time": "2015-11-28 01:20:04" + "time": "2015-11-28T01:20:04+00:00" }, { "name": "colinmollenhour/php-redis-session-abstract", @@ -200,7 +199,7 @@ ], "description": "A Redis-based session handler with optimistic locking", "homepage": "https://github.com/colinmollenhour/php-redis-session-abstract", - "time": "2017-04-19 14:21:43" + "time": "2017-04-19T14:21:43+00:00" }, { "name": "composer/ca-bundle", @@ -259,7 +258,7 @@ "ssl", "tls" ], - "time": "2017-03-06 11:59:08" + "time": "2017-03-06T11:59:08+00:00" }, { "name": "composer/composer", @@ -336,7 +335,7 @@ "dependency", "package" ], - "time": "2017-03-10 08:29:45" + "time": "2017-03-10T08:29:45+00:00" }, { "name": "composer/semver", @@ -398,7 +397,7 @@ "validation", "versioning" ], - "time": "2016-08-30 16:08:34" + "time": "2016-08-30T16:08:34+00:00" }, { "name": "composer/spdx-licenses", @@ -459,7 +458,7 @@ "spdx", "validator" ], - "time": "2017-04-03 19:08:52" + "time": "2017-04-03T19:08:52+00:00" }, { "name": "container-interop/container-interop", @@ -490,20 +489,20 @@ ], "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", "homepage": "https://github.com/container-interop/container-interop", - "time": "2017-02-14 19:40:03" + "time": "2017-02-14T19:40:03+00:00" }, { "name": "justinrainbow/json-schema", - "version": "5.2.0", + "version": "5.2.1", "source": { "type": "git", "url": "https://github.com/justinrainbow/json-schema.git", - "reference": "e3c9bccdc38bbd09bcac0131c00f3be58368b416" + "reference": "429be236f296ca249d61c65649cdf2652f4a5e80" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/e3c9bccdc38bbd09bcac0131c00f3be58368b416", - "reference": "e3c9bccdc38bbd09bcac0131c00f3be58368b416", + "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/429be236f296ca249d61c65649cdf2652f4a5e80", + "reference": "429be236f296ca249d61c65649cdf2652f4a5e80", "shasum": "" }, "require": { @@ -512,7 +511,7 @@ "require-dev": { "friendsofphp/php-cs-fixer": "^2.1", "json-schema/json-schema-test-suite": "1.2.0", - "phpdocumentor/phpdocumentor": "~2", + "phpdocumentor/phpdocumentor": "^2.7", "phpunit/phpunit": "^4.8.22" }, "bin": [ @@ -557,7 +556,7 @@ "json", "schema" ], - "time": "2017-03-22 22:43:35" + "time": "2017-05-16T21:06:09+00:00" }, { "name": "league/climate", @@ -606,7 +605,7 @@ "php", "terminal" ], - "time": "2015-01-18 14:31:58" + "time": "2015-01-18T14:31:58+00:00" }, { "name": "magento/composer", @@ -642,7 +641,7 @@ "AFL-3.0" ], "description": "Magento composer library helps to instantiate Composer application and run composer commands.", - "time": "2017-04-24 09:57:02" + "time": "2017-04-24T09:57:02+00:00" }, { "name": "magento/magento-composer-installer", @@ -721,7 +720,7 @@ "composer-installer", "magento" ], - "time": "2016-10-06 16:05:07" + "time": "2016-10-06T16:05:07+00:00" }, { "name": "magento/zendframework1", @@ -768,7 +767,7 @@ "ZF1", "framework" ], - "time": "2017-04-24 09:56:59" + "time": "2017-04-24T09:56:59+00:00" }, { "name": "monolog/monolog", @@ -846,7 +845,7 @@ "logging", "psr-3" ], - "time": "2017-03-13 07:08:03" + "time": "2017-03-13T07:08:03+00:00" }, { "name": "oyejorge/less.php", @@ -908,7 +907,7 @@ "php", "stylesheet" ], - "time": "2017-03-28 22:19:25" + "time": "2017-03-28T22:19:25+00:00" }, { "name": "paragonie/random_compat", @@ -956,7 +955,7 @@ "pseudorandom", "random" ], - "time": "2017-03-13 16:27:32" + "time": "2017-03-13T16:27:32+00:00" }, { "name": "pelago/emogrifier", @@ -1012,20 +1011,20 @@ ], "description": "Converts CSS styles into inline style attributes in your HTML code", "homepage": "http://www.pelagodesign.com/sidecar/emogrifier/", - "time": "2015-05-15 11:37:51" + "time": "2015-05-15T11:37:51+00:00" }, { "name": "phpseclib/phpseclib", - "version": "2.0.4", + "version": "2.0.5", "source": { "type": "git", "url": "https://github.com/phpseclib/phpseclib.git", - "reference": "ab8028c93c03cc8d9c824efa75dc94f1db2369bf" + "reference": "f8dd0e18d2328c447dd4190fecd11ef52680d968" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/ab8028c93c03cc8d9c824efa75dc94f1db2369bf", - "reference": "ab8028c93c03cc8d9c824efa75dc94f1db2369bf", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/f8dd0e18d2328c447dd4190fecd11ef52680d968", + "reference": "f8dd0e18d2328c447dd4190fecd11ef52680d968", "shasum": "" }, "require": { @@ -1104,7 +1103,7 @@ "x.509", "x509" ], - "time": "2016-10-04 00:57:04" + "time": "2017-05-08T05:58:35+00:00" }, { "name": "psr/container", @@ -1153,7 +1152,7 @@ "container-interop", "psr" ], - "time": "2017-02-14 16:28:37" + "time": "2017-02-14T16:28:37+00:00" }, { "name": "psr/log", @@ -1200,7 +1199,7 @@ "psr", "psr-3" ], - "time": "2016-10-10 12:19:37" + "time": "2016-10-10T12:19:37+00:00" }, { "name": "ramsey/uuid", @@ -1282,7 +1281,7 @@ "identifier", "uuid" ], - "time": "2017-03-26 20:37:53" + "time": "2017-03-26T20:37:53+00:00" }, { "name": "seld/cli-prompt", @@ -1330,7 +1329,7 @@ "input", "prompt" ], - "time": "2017-03-18 11:32:45" + "time": "2017-03-18T11:32:45+00:00" }, { "name": "seld/jsonlint", @@ -1379,7 +1378,7 @@ "parser", "validator" ], - "time": "2017-03-06 16:42:24" + "time": "2017-03-06T16:42:24+00:00" }, { "name": "seld/phar-utils", @@ -1423,7 +1422,7 @@ "keywords": [ "phra" ], - "time": "2015-10-13 18:44:15" + "time": "2015-10-13T18:44:15+00:00" }, { "name": "sjparkinson/static-review", @@ -1476,7 +1475,7 @@ } ], "description": "An extendable framework for version control hooks.", - "time": "2014-09-22 08:40:36" + "time": "2014-09-22T08:40:36+00:00" }, { "name": "symfony/console", @@ -1537,7 +1536,7 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2017-04-26 01:38:53" + "time": "2017-04-26T01:38:53+00:00" }, { "name": "symfony/debug", @@ -1594,7 +1593,7 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2016-07-30 07:22:48" + "time": "2016-07-30T07:22:48+00:00" }, { "name": "symfony/event-dispatcher", @@ -1654,7 +1653,7 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2017-04-26 16:56:54" + "time": "2017-04-26T16:56:54+00:00" }, { "name": "symfony/filesystem", @@ -1703,7 +1702,7 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2017-04-12 14:13:17" + "time": "2017-04-12T14:13:17+00:00" }, { "name": "symfony/finder", @@ -1752,7 +1751,7 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2017-04-12 14:13:17" + "time": "2017-04-12T14:13:17+00:00" }, { "name": "symfony/polyfill-mbstring", @@ -1811,7 +1810,7 @@ "portable", "shim" ], - "time": "2016-11-14 01:06:16" + "time": "2016-11-14T01:06:16+00:00" }, { "name": "symfony/process", @@ -1860,7 +1859,7 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2017-04-12 14:07:15" + "time": "2017-04-12T14:07:15+00:00" }, { "name": "tedivm/jshrink", @@ -1906,7 +1905,7 @@ "javascript", "minifier" ], - "time": "2015-07-04 07:35:09" + "time": "2015-07-04T07:35:09+00:00" }, { "name": "tubalmartin/cssmin", @@ -1954,7 +1953,7 @@ "minify", "yui" ], - "time": "2017-04-04 14:33:00" + "time": "2017-04-04T14:33:00+00:00" }, { "name": "zendframework/zend-captcha", @@ -2011,7 +2010,7 @@ "captcha", "zf2" ], - "time": "2017-02-23 08:09:44" + "time": "2017-02-23T08:09:44+00:00" }, { "name": "zendframework/zend-code", @@ -2064,7 +2063,7 @@ "code", "zf2" ], - "time": "2016-10-24 13:23:32" + "time": "2016-10-24T13:23:32+00:00" }, { "name": "zendframework/zend-config", @@ -2120,7 +2119,7 @@ "config", "zf2" ], - "time": "2016-02-04 23:01:10" + "time": "2016-02-04T23:01:10+00:00" }, { "name": "zendframework/zend-console", @@ -2172,7 +2171,7 @@ "console", "zf2" ], - "time": "2016-02-09 17:15:12" + "time": "2016-02-09T17:15:12+00:00" }, { "name": "zendframework/zend-crypt", @@ -2222,7 +2221,7 @@ "crypt", "zf2" ], - "time": "2016-02-03 23:46:30" + "time": "2016-02-03T23:46:30+00:00" }, { "name": "zendframework/zend-db", @@ -2279,7 +2278,7 @@ "db", "zf2" ], - "time": "2016-08-09 19:28:55" + "time": "2016-08-09T19:28:55+00:00" }, { "name": "zendframework/zend-di", @@ -2326,7 +2325,7 @@ "di", "zf2" ], - "time": "2016-04-25 20:58:11" + "time": "2016-04-25T20:58:11+00:00" }, { "name": "zendframework/zend-escaper", @@ -2370,7 +2369,7 @@ "escaper", "zf2" ], - "time": "2016-06-30 19:48:38" + "time": "2016-06-30T19:48:38+00:00" }, { "name": "zendframework/zend-eventmanager", @@ -2417,7 +2416,7 @@ "eventmanager", "zf2" ], - "time": "2016-02-18 20:49:05" + "time": "2016-02-18T20:49:05+00:00" }, { "name": "zendframework/zend-filter", @@ -2477,7 +2476,7 @@ "filter", "zf2" ], - "time": "2016-04-18 18:32:43" + "time": "2016-04-18T18:32:43+00:00" }, { "name": "zendframework/zend-form", @@ -2554,7 +2553,7 @@ "form", "zf2" ], - "time": "2017-04-26 21:27:43" + "time": "2017-04-26T21:27:43+00:00" }, { "name": "zendframework/zend-http", @@ -2604,7 +2603,7 @@ "http", "zf2" ], - "time": "2017-01-31 14:41:02" + "time": "2017-01-31T14:41:02+00:00" }, { "name": "zendframework/zend-hydrator", @@ -2662,7 +2661,7 @@ "hydrator", "zf2" ], - "time": "2016-02-18 22:38:26" + "time": "2016-02-18T22:38:26+00:00" }, { "name": "zendframework/zend-i18n", @@ -2729,7 +2728,7 @@ "i18n", "zf2" ], - "time": "2016-06-07 21:08:30" + "time": "2016-06-07T21:08:30+00:00" }, { "name": "zendframework/zend-inputfilter", @@ -2784,7 +2783,7 @@ "inputfilter", "zf2" ], - "time": "2016-08-18 18:40:34" + "time": "2016-08-18T18:40:34+00:00" }, { "name": "zendframework/zend-json", @@ -2839,7 +2838,7 @@ "json", "zf2" ], - "time": "2016-02-04 21:20:26" + "time": "2016-02-04T21:20:26+00:00" }, { "name": "zendframework/zend-loader", @@ -2883,7 +2882,7 @@ "loader", "zf2" ], - "time": "2015-06-03 14:05:47" + "time": "2015-06-03T14:05:47+00:00" }, { "name": "zendframework/zend-log", @@ -2954,7 +2953,7 @@ "logging", "zf2" ], - "time": "2016-08-11 13:44:10" + "time": "2016-08-11T13:44:10+00:00" }, { "name": "zendframework/zend-math", @@ -3004,7 +3003,7 @@ "math", "zf2" ], - "time": "2016-04-07 16:29:53" + "time": "2016-04-07T16:29:53+00:00" }, { "name": "zendframework/zend-modulemanager", @@ -3063,7 +3062,7 @@ "modulemanager", "zf2" ], - "time": "2016-05-16 21:21:11" + "time": "2016-05-16T21:21:11+00:00" }, { "name": "zendframework/zend-mvc", @@ -3150,7 +3149,7 @@ "mvc", "zf2" ], - "time": "2016-02-23 15:24:59" + "time": "2016-02-23T15:24:59+00:00" }, { "name": "zendframework/zend-serializer", @@ -3207,7 +3206,7 @@ "serializer", "zf2" ], - "time": "2016-06-21 17:01:55" + "time": "2016-06-21T17:01:55+00:00" }, { "name": "zendframework/zend-server", @@ -3253,7 +3252,7 @@ "server", "zf2" ], - "time": "2016-06-20 22:27:55" + "time": "2016-06-20T22:27:55+00:00" }, { "name": "zendframework/zend-servicemanager", @@ -3305,7 +3304,7 @@ "servicemanager", "zf2" ], - "time": "2016-12-19 19:14:29" + "time": "2016-12-19T19:14:29+00:00" }, { "name": "zendframework/zend-session", @@ -3371,7 +3370,7 @@ "session", "zf2" ], - "time": "2016-07-05 18:32:50" + "time": "2016-07-05T18:32:50+00:00" }, { "name": "zendframework/zend-soap", @@ -3423,7 +3422,7 @@ "soap", "zf2" ], - "time": "2016-04-21 16:06:27" + "time": "2016-04-21T16:06:27+00:00" }, { "name": "zendframework/zend-stdlib", @@ -3482,7 +3481,7 @@ "stdlib", "zf2" ], - "time": "2016-04-12 21:17:31" + "time": "2016-04-12T21:17:31+00:00" }, { "name": "zendframework/zend-text", @@ -3529,7 +3528,7 @@ "text", "zf2" ], - "time": "2016-02-08 19:03:52" + "time": "2016-02-08T19:03:52+00:00" }, { "name": "zendframework/zend-uri", @@ -3576,7 +3575,7 @@ "uri", "zf2" ], - "time": "2016-02-17 22:38:51" + "time": "2016-02-17T22:38:51+00:00" }, { "name": "zendframework/zend-validator", @@ -3647,7 +3646,7 @@ "validator", "zf2" ], - "time": "2017-03-17 10:15:50" + "time": "2017-03-17T10:15:50+00:00" }, { "name": "zendframework/zend-view", @@ -3734,7 +3733,7 @@ "view", "zf2" ], - "time": "2017-03-21 15:05:56" + "time": "2017-03-21T15:05:56+00:00" } ], "packages-dev": [ @@ -3790,7 +3789,7 @@ "constructor", "instantiate" ], - "time": "2015-06-14 21:17:01" + "time": "2015-06-14T21:17:01+00:00" }, { "name": "friendsofphp/php-cs-fixer", @@ -3860,7 +3859,7 @@ } ], "description": "A tool to automatically fix PHP code style", - "time": "2017-03-31 12:59:38" + "time": "2017-03-31T12:59:38+00:00" }, { "name": "ircmaxell/password-compat", @@ -3902,7 +3901,7 @@ "hashing", "password" ], - "time": "2014-11-20 16:49:30" + "time": "2014-11-20T16:49:30+00:00" }, { "name": "lusitanian/oauth", @@ -3969,7 +3968,7 @@ "oauth", "security" ], - "time": "2016-07-12 22:15:40" + "time": "2016-07-12T22:15:40+00:00" }, { "name": "pdepend/pdepend", @@ -4009,7 +4008,7 @@ "BSD-3-Clause" ], "description": "Official version of pdepend to be handled with Composer", - "time": "2017-01-19 14:23:36" + "time": "2017-01-19T14:23:36+00:00" }, { "name": "phpmd/phpmd", @@ -4075,7 +4074,7 @@ "phpmd", "pmd" ], - "time": "2017-01-20 14:41:10" + "time": "2017-01-20T14:41:10+00:00" }, { "name": "phpunit/php-code-coverage", @@ -4137,7 +4136,7 @@ "testing", "xunit" ], - "time": "2015-10-06 15:47:00" + "time": "2015-10-06T15:47:00+00:00" }, { "name": "phpunit/php-file-iterator", @@ -4182,7 +4181,7 @@ "filesystem", "iterator" ], - "time": "2013-10-10 15:34:57" + "time": "2013-10-10T15:34:57+00:00" }, { "name": "phpunit/php-text-template", @@ -4223,7 +4222,7 @@ "keywords": [ "template" ], - "time": "2015-06-21 13:50:34" + "time": "2015-06-21T13:50:34+00:00" }, { "name": "phpunit/php-timer", @@ -4272,7 +4271,7 @@ "keywords": [ "timer" ], - "time": "2017-02-26 11:10:40" + "time": "2017-02-26T11:10:40+00:00" }, { "name": "phpunit/php-token-stream", @@ -4321,7 +4320,7 @@ "keywords": [ "tokenizer" ], - "time": "2017-02-27 10:12:30" + "time": "2017-02-27T10:12:30+00:00" }, { "name": "phpunit/phpunit", @@ -4395,7 +4394,7 @@ "testing", "xunit" ], - "time": "2014-05-02 07:13:40" + "time": "2014-05-02T07:13:40+00:00" }, { "name": "phpunit/phpunit-mock-objects", @@ -4451,7 +4450,7 @@ "mock", "xunit" ], - "time": "2015-10-02 06:51:40" + "time": "2015-10-02T06:51:40+00:00" }, { "name": "sebastian/comparator", @@ -4515,7 +4514,7 @@ "compare", "equality" ], - "time": "2017-01-29 09:50:25" + "time": "2017-01-29T09:50:25+00:00" }, { "name": "sebastian/diff", @@ -4567,7 +4566,7 @@ "keywords": [ "diff" ], - "time": "2015-12-08 07:14:41" + "time": "2015-12-08T07:14:41+00:00" }, { "name": "sebastian/environment", @@ -4617,7 +4616,7 @@ "environment", "hhvm" ], - "time": "2016-08-18 05:49:44" + "time": "2016-08-18T05:49:44+00:00" }, { "name": "sebastian/exporter", @@ -4684,7 +4683,7 @@ "export", "exporter" ], - "time": "2016-06-17 09:04:28" + "time": "2016-06-17T09:04:28+00:00" }, { "name": "sebastian/finder-facade", @@ -4723,7 +4722,7 @@ ], "description": "FinderFacade is a convenience wrapper for Symfony's Finder component.", "homepage": "https://github.com/sebastianbergmann/finder-facade", - "time": "2016-02-17 07:02:23" + "time": "2016-02-17T07:02:23+00:00" }, { "name": "sebastian/phpcpd", @@ -4774,7 +4773,7 @@ ], "description": "Copy/Paste Detector (CPD) for PHP code.", "homepage": "https://github.com/sebastianbergmann/phpcpd", - "time": "2016-04-17 19:32:49" + "time": "2016-04-17T19:32:49+00:00" }, { "name": "sebastian/recursion-context", @@ -4827,7 +4826,7 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2016-10-03 07:41:43" + "time": "2016-10-03T07:41:43+00:00" }, { "name": "sebastian/version", @@ -4862,7 +4861,7 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2015-06-21 13:59:46" + "time": "2015-06-21T13:59:46+00:00" }, { "name": "squizlabs/php_codesniffer", @@ -4937,7 +4936,7 @@ "phpcs", "standards" ], - "time": "2014-05-01 03:07:07" + "time": "2014-05-01T03:07:07+00:00" }, { "name": "symfony/config", @@ -4993,7 +4992,7 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2017-04-12 14:13:17" + "time": "2017-04-12T14:13:17+00:00" }, { "name": "symfony/dependency-injection", @@ -5053,7 +5052,7 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2017-01-28 00:04:57" + "time": "2017-01-28T00:04:57+00:00" }, { "name": "symfony/polyfill-php54", @@ -5111,7 +5110,7 @@ "portable", "shim" ], - "time": "2016-11-14 01:06:16" + "time": "2016-11-14T01:06:16+00:00" }, { "name": "symfony/polyfill-php55", @@ -5167,7 +5166,7 @@ "portable", "shim" ], - "time": "2016-11-14 01:06:16" + "time": "2016-11-14T01:06:16+00:00" }, { "name": "symfony/polyfill-php70", @@ -5226,7 +5225,7 @@ "portable", "shim" ], - "time": "2016-11-14 01:06:16" + "time": "2016-11-14T01:06:16+00:00" }, { "name": "symfony/polyfill-xml", @@ -5284,7 +5283,7 @@ "portable", "shim" ], - "time": "2016-11-14 01:06:16" + "time": "2016-11-14T01:06:16+00:00" }, { "name": "symfony/stopwatch", @@ -5333,7 +5332,7 @@ ], "description": "Symfony Stopwatch Component", "homepage": "https://symfony.com", - "time": "2017-04-12 14:13:17" + "time": "2017-04-12T14:13:17+00:00" }, { "name": "symfony/yaml", @@ -5382,7 +5381,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2017-05-01 14:31:55" + "time": "2017-05-01T14:31:55+00:00" }, { "name": "theseer/fdomdocument", @@ -5422,11 +5421,11 @@ ], "description": "The classes contained within this repository extend the standard DOM to use exceptions at all occasions of errors instead of PHP warnings or notices. They also add various custom methods and shortcuts for convenience and to simplify the usage of DOM.", "homepage": "https://github.com/theseer/fDOMDocument", - "time": "2017-04-21 14:50:31" + "time": "2017-04-21T14:50:31+00:00" } ], "aliases": [], - "minimum-stability": "alpha", + "minimum-stability": "stable", "stability-flags": { "phpmd/phpmd": 0 }, From c198a1f3bb0c698519e99faf4ad49bb9c8214ac1 Mon Sep 17 00:00:00 2001 From: Pascal Brouwers Date: Thu, 18 May 2017 11:08:36 +0200 Subject: [PATCH 09/34] Issue 9680: Use parent name for variations --- .../view/adminhtml/web/js/variations/steps/summary.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/steps/summary.js b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/steps/summary.js index e16af3c1cb4b8..dc83a58899981 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/steps/summary.js +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/steps/summary.js @@ -91,6 +91,7 @@ define([ var productSku = this.variationsComponent().getProductValue('sku'), productPrice = this.variationsComponent().getProductPrice(), productWeight = this.variationsComponent().getProductValue('weight'), + productName = this.variationsComponent().getProductValue('name'), variationsKeys = [], gridExisting = [], gridNew = [], @@ -98,7 +99,7 @@ define([ this.variations = []; _.each(variations, function (options) { - var product, images, sku, quantity, price, variation, + var product, images, sku, name, quantity, price, variation, productId = this.variationsComponent().getProductIdByOptions(options); if (productId) { @@ -110,6 +111,9 @@ define([ sku = productSku + _.reduce(options, function (memo, option) { return memo + '-' + option.label; }, ''); + name = productName + _.reduce(options, function (memo, option) { + return memo + '-' + option.label; + }, ''); quantity = getSectionValue('quantity', options); if (!quantity && productId) { @@ -128,7 +132,7 @@ define([ options: options, images: images, sku: sku, - name: sku, + name: name, quantity: quantity, price: price, productId: productId, From dde585c8040bf4c97fb52130b0f7399ab664c3e4 Mon Sep 17 00:00:00 2001 From: Vova Yatsyuk Date: Wed, 14 Jun 2017 10:32:13 +0300 Subject: [PATCH 10/34] Shorthand method definition syntax replaced with standard one --- lib/web/mage/sticky.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/web/mage/sticky.js b/lib/web/mage/sticky.js index 05b644c47e8d3..28ee0437c6298 100644 --- a/lib/web/mage/sticky.js +++ b/lib/web/mage/sticky.js @@ -17,7 +17,7 @@ define([ stickyClass: '_sticky' }, - _optionToNumber(option) { + _optionToNumber: function (option) { var value = this.options[option] || 0; if (typeof value === 'function') { value = this.options[option](); From 5071e5459b43594f5dbb46f3a3ae4517bd1a5262 Mon Sep 17 00:00:00 2001 From: Vova Yatsyuk Date: Wed, 14 Jun 2017 10:34:29 +0300 Subject: [PATCH 11/34] OptionToNumber method refactored: - Removed option type validation - Renamed into getOptionValue as it can be used for any option types --- lib/web/mage/sticky.js | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/lib/web/mage/sticky.js b/lib/web/mage/sticky.js index 28ee0437c6298..e25f7082d13e5 100644 --- a/lib/web/mage/sticky.js +++ b/lib/web/mage/sticky.js @@ -17,20 +17,12 @@ define([ stickyClass: '_sticky' }, - _optionToNumber: function (option) { + _getOptionValue: function (option) { var value = this.options[option] || 0; if (typeof value === 'function') { value = this.options[option](); } - - var converted = Number(value); - if (isNaN(converted)) { - throw Error( - 'sticky: Could not convert supplied option "' + - option + '" to Number from "' + value + '"' - ); - } - return converted; + return value; }, /** @@ -61,13 +53,13 @@ define([ if (!isStatic && this.element.is(':visible')) { offset = $(document).scrollTop() - this.parentOffset - + this._optionToNumber('spacingTop'); + + this._getOptionValue('spacingTop'); offset = Math.max(0, Math.min(offset, this.maxOffset)); var stuck = this.element.hasClass(this.options.stickyClass); if (offset && this.options.offsetTop && !stuck) { - var offsetTop = this._optionToNumber('offsetTop'); + var offsetTop = this._getOptionValue('offsetTop'); if (offset < offsetTop) { offset = 0; } From e6795cbcc206eb35a0668d74fe361dcb8a158e54 Mon Sep 17 00:00:00 2001 From: Vova Yatsyuk Date: Wed, 14 Jun 2017 10:47:32 +0300 Subject: [PATCH 12/34] Better code readability --- lib/web/mage/sticky.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/web/mage/sticky.js b/lib/web/mage/sticky.js index e25f7082d13e5..e76720b528964 100644 --- a/lib/web/mage/sticky.js +++ b/lib/web/mage/sticky.js @@ -57,12 +57,10 @@ define([ offset = Math.max(0, Math.min(offset, this.maxOffset)); - var stuck = this.element.hasClass(this.options.stickyClass); - if (offset && this.options.offsetTop && !stuck) { - var offsetTop = this._getOptionValue('offsetTop'); - if (offset < offsetTop) { - offset = 0; - } + var stuck = this.element.hasClass(this.options.stickyClass), + offsetTop = this._getOptionValue('offsetTop'); + if (offset && !stuck && offset < offsetTop) { + offset = 0; } this.element From 7ae6be0578e633055f13cc400224e325d08ea855 Mon Sep 17 00:00:00 2001 From: Vova Yatsyuk Date: Wed, 14 Jun 2017 10:49:28 +0300 Subject: [PATCH 13/34] Fixed JSHint notices --- lib/web/mage/sticky.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/web/mage/sticky.js b/lib/web/mage/sticky.js index e76720b528964..3fa0a786b2ef7 100644 --- a/lib/web/mage/sticky.js +++ b/lib/web/mage/sticky.js @@ -51,9 +51,9 @@ define([ isStatic = this.element.css('position') === 'static'; if (!isStatic && this.element.is(':visible')) { - offset = $(document).scrollTop() - - this.parentOffset - + this._getOptionValue('spacingTop'); + offset = $(document).scrollTop() - + this.parentOffset + + this._getOptionValue('spacingTop'); offset = Math.max(0, Math.min(offset, this.maxOffset)); From db648a67fdde4a5598699a28cf9d8ca3b7783bda Mon Sep 17 00:00:00 2001 From: Vova Yatsyuk Date: Wed, 14 Jun 2017 11:09:03 +0300 Subject: [PATCH 14/34] ESLint and JSCS fixes --- lib/web/mage/sticky.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/lib/web/mage/sticky.js b/lib/web/mage/sticky.js index 3fa0a786b2ef7..fb080062a6a9c 100644 --- a/lib/web/mage/sticky.js +++ b/lib/web/mage/sticky.js @@ -17,11 +17,19 @@ define([ stickyClass: '_sticky' }, + /** + * Retrieve option value + * @param {String} option + * @return {*} + * @private + */ _getOptionValue: function (option) { var value = this.options[option] || 0; + if (typeof value === 'function') { value = this.options[option](); } + return value; }, @@ -46,7 +54,9 @@ define([ */ _stick: function () { var offset, - isStatic; + isStatic, + stuck, + offsetTop; isStatic = this.element.css('position') === 'static'; @@ -57,14 +67,15 @@ define([ offset = Math.max(0, Math.min(offset, this.maxOffset)); - var stuck = this.element.hasClass(this.options.stickyClass), - offsetTop = this._getOptionValue('offsetTop'); + stuck = this.element.hasClass(this.options.stickyClass); + offsetTop = this._getOptionValue('offsetTop'); + if (offset && !stuck && offset < offsetTop) { offset = 0; } this.element - .toggleClass(this.options.stickyClass, (offset > 0)) + .toggleClass(this.options.stickyClass, offset > 0) .css('top', offset); } }, From fc0ae57359c210e1945e3ea60c452f03eba270ce Mon Sep 17 00:00:00 2001 From: Vova Yatsyuk Date: Mon, 19 Jun 2017 11:37:00 +0300 Subject: [PATCH 15/34] offsetTop option renamed into stickAfter as it has nothing with element's offsetTop property --- lib/web/mage/sticky.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/web/mage/sticky.js b/lib/web/mage/sticky.js index fb080062a6a9c..eccd1dd8c0797 100644 --- a/lib/web/mage/sticky.js +++ b/lib/web/mage/sticky.js @@ -13,7 +13,7 @@ define([ options: { container: '', spacingTop: 0, - offsetTop: 0, + stickAfter: 0, stickyClass: '_sticky' }, @@ -56,7 +56,7 @@ define([ var offset, isStatic, stuck, - offsetTop; + stickAfter; isStatic = this.element.css('position') === 'static'; @@ -68,9 +68,9 @@ define([ offset = Math.max(0, Math.min(offset, this.maxOffset)); stuck = this.element.hasClass(this.options.stickyClass); - offsetTop = this._getOptionValue('offsetTop'); + stickAfter = this._getOptionValue('stickAfter'); - if (offset && !stuck && offset < offsetTop) { + if (offset && !stuck && offset < stickAfter) { offset = 0; } From fb3b97720e378d26300791fe33cfcb5b9fd70601 Mon Sep 17 00:00:00 2001 From: Fabian Schmengler Date: Mon, 19 Jun 2017 23:51:00 +0200 Subject: [PATCH 16/34] Add specific type hints and docblocks for Quote\Address\Total --- app/code/Magento/Quote/Model/Quote.php | 2 +- app/code/Magento/Quote/Model/Quote/Address/Total.php | 3 +++ app/code/Magento/Quote/Model/Quote/TotalsReader.php | 10 +++++----- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/Quote/Model/Quote.php b/app/code/Magento/Quote/Model/Quote.php index 7481fc76a6478..7aa3cb13df74a 100644 --- a/app/code/Magento/Quote/Model/Quote.php +++ b/app/code/Magento/Quote/Model/Quote.php @@ -1944,7 +1944,7 @@ public function collectTotals() /** * Get all quote totals (sorted by priority) * - * @return array + * @return Address\Total[] */ public function getTotals() { diff --git a/app/code/Magento/Quote/Model/Quote/Address/Total.php b/app/code/Magento/Quote/Model/Quote/Address/Total.php index 76363fd707d0e..4babf52cc1ada 100644 --- a/app/code/Magento/Quote/Model/Quote/Address/Total.php +++ b/app/code/Magento/Quote/Model/Quote/Address/Total.php @@ -5,6 +5,9 @@ */ namespace Magento\Quote\Model\Quote\Address; +/** + * @method string getCode() + */ class Total extends \Magento\Framework\DataObject { /** diff --git a/app/code/Magento/Quote/Model/Quote/TotalsReader.php b/app/code/Magento/Quote/Model/Quote/TotalsReader.php index c6c7bd9aacf03..914405b5c87ff 100644 --- a/app/code/Magento/Quote/Model/Quote/TotalsReader.php +++ b/app/code/Magento/Quote/Model/Quote/TotalsReader.php @@ -35,7 +35,7 @@ public function __construct( /** * @param \Magento\Quote\Model\Quote $quote * @param array $total - * @return array + * @return Total[] */ public function fetch(\Magento\Quote\Model\Quote $quote, array $total) { @@ -62,7 +62,7 @@ public function fetch(\Magento\Quote\Model\Quote $quote, array $total) /** * @param array $total - * @return Total|array + * @return Total|Total[] */ protected function convert($total) { @@ -85,10 +85,10 @@ protected function convert($total) /** * @param Total $totalInstance - * @param array $output - * @return array + * @param Total[] $output + * @return Total[] */ - protected function merge($totalInstance, $output) + protected function merge(Total $totalInstance, $output) { if (array_key_exists($totalInstance->getCode(), $output)) { $output[$totalInstance->getCode()] = $output[$totalInstance->getCode()]->addData( From 160327bc077af34313b72eaec4763041c77a17bc Mon Sep 17 00:00:00 2001 From: Fabian Schmengler Date: Mon, 19 Jun 2017 23:53:04 +0200 Subject: [PATCH 17/34] Add default behavior to Quote\Address\TotalFactory The factory is used like a default generated factory in TotalsReader but needed to pass the class name to create(). This violates the POLA. Also, the return type hint is adjusted now (Total is no subtype of Total\AbstractTotal) --- .../Magento/Quote/Model/Quote/Address/TotalFactory.php | 4 ++-- app/code/Magento/Quote/Model/Quote/TotalsReader.php | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/app/code/Magento/Quote/Model/Quote/Address/TotalFactory.php b/app/code/Magento/Quote/Model/Quote/Address/TotalFactory.php index a997eada2d4a2..bef6f48a97267 100644 --- a/app/code/Magento/Quote/Model/Quote/Address/TotalFactory.php +++ b/app/code/Magento/Quote/Model/Quote/Address/TotalFactory.php @@ -33,9 +33,9 @@ public function __construct(\Magento\Framework\ObjectManagerInterface $objManage * * @param string $instanceName * @param array $data - * @return \Magento\Quote\Model\Quote\Address\Total\AbstractTotal + * @return Total\AbstractTotal|Total */ - public function create($instanceName, array $data = []) + public function create($instanceName = Total::class, array $data = []) { return $this->_objectManager->create($instanceName, $data); } diff --git a/app/code/Magento/Quote/Model/Quote/TotalsReader.php b/app/code/Magento/Quote/Model/Quote/TotalsReader.php index 914405b5c87ff..d0417c3455f5e 100644 --- a/app/code/Magento/Quote/Model/Quote/TotalsReader.php +++ b/app/code/Magento/Quote/Model/Quote/TotalsReader.php @@ -40,7 +40,7 @@ public function __construct( public function fetch(\Magento\Quote\Model\Quote $quote, array $total) { $output = []; - $total = $this->totalFactory->create(\Magento\Quote\Model\Quote\Address\Total::class)->setData($total); + $total = $this->totalFactory->create()->setData($total); /** @var ReaderInterface $reader */ foreach ($this->collectorList->getCollectors($quote->getStoreId()) as $reader) { $data = $reader->fetch($quote, $total); @@ -73,14 +73,12 @@ protected function convert($total) if (count(array_column($total, 'code')) > 0) { $totals = []; foreach ($total as $item) { - $totals[] = $this->totalFactory->create( - \Magento\Quote\Model\Quote\Address\Total::class - )->setData($item); + $totals[] = $this->totalFactory->create()->setData($item); } return $totals; } - return $this->totalFactory->create(\Magento\Quote\Model\Quote\Address\Total::class)->setData($total); + return $this->totalFactory->create()->setData($total); } /** From f7aea8349536b8ff858df7472fc16acec4f025c4 Mon Sep 17 00:00:00 2001 From: Fabian Schmengler Date: Mon, 19 Jun 2017 23:56:39 +0200 Subject: [PATCH 18/34] Properly initialize $totalAmounts Otherwise getAllTotalAmounts() does not return an array if no totals have been added. Same goes for $baseTotalAmounts --- app/code/Magento/Quote/Model/Quote/Address/Total.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Quote/Model/Quote/Address/Total.php b/app/code/Magento/Quote/Model/Quote/Address/Total.php index 4babf52cc1ada..3571bdc36bee2 100644 --- a/app/code/Magento/Quote/Model/Quote/Address/Total.php +++ b/app/code/Magento/Quote/Model/Quote/Address/Total.php @@ -13,12 +13,12 @@ class Total extends \Magento\Framework\DataObject /** * @var array */ - protected $totalAmounts; + protected $totalAmounts = []; /** * @var array */ - protected $baseTotalAmounts; + protected $baseTotalAmounts = []; /** * Serializer interface instance. From 5bc035baacce13267e49588db18a27d1ace72d23 Mon Sep 17 00:00:00 2001 From: Bart-art Date: Fri, 23 Jun 2017 09:47:58 +0200 Subject: [PATCH 19/34] Allow option disabling for optgroup binding The optgroup Knockout binding formats its options before usage in the optionsAfterRender of the form/element/select.html knockout template. In this process all extra data of the options will be stripped and the optionsAfterRenderer cannot access the disabled value of any option. Because of this the delimiter option in the country_id select in checkout is choosable by the customer. --- .../Ui/view/base/web/js/lib/knockout/bindings/optgroup.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/optgroup.js b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/optgroup.js index 1a90a46d60db6..ef82dd6e5a7a3 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/optgroup.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/optgroup.js @@ -297,10 +297,15 @@ define([ ko.utils.arrayForEach(options, function (option) { var value = applyToObject(option, optionsValue, option), label = applyToObject(option, optionsText, value) || '', + disabled = applyToObject(option, 'disabled', false) || false, obj = {}, space = '\u2007\u2007\u2007'; obj[optionTitle] = applyToObject(option, optionsText + 'title', value); + + if(disabled) { + obj['disabled'] = disabled; + } label = label.replace(nbspRe, '').trim(); From 48de2860bec16981ec4f1e6fbbba78ced0ae60a1 Mon Sep 17 00:00:00 2001 From: Bart-art Date: Fri, 23 Jun 2017 11:20:02 +0200 Subject: [PATCH 20/34] Adjusted format to safisfy coding standard --- .../Ui/view/base/web/js/lib/knockout/bindings/optgroup.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/optgroup.js b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/optgroup.js index ef82dd6e5a7a3..6a2bc031c331c 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/optgroup.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/optgroup.js @@ -302,9 +302,8 @@ define([ space = '\u2007\u2007\u2007'; obj[optionTitle] = applyToObject(option, optionsText + 'title', value); - - if(disabled) { - obj['disabled'] = disabled; + if (disabled) { + obj.disabled = disabled; } label = label.replace(nbspRe, '').trim(); From 3db94422ca601810a6621e63b4afc099d841f81f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Niklas=20Bartholom=C3=A4us?= Date: Fri, 23 Jun 2017 12:16:54 +0200 Subject: [PATCH 21/34] added missing newline --- .../Ui/view/base/web/js/lib/knockout/bindings/optgroup.js | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/optgroup.js b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/optgroup.js index 6a2bc031c331c..bf9e8ebe6eaa1 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/optgroup.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/optgroup.js @@ -302,6 +302,7 @@ define([ space = '\u2007\u2007\u2007'; obj[optionTitle] = applyToObject(option, optionsText + 'title', value); + if (disabled) { obj.disabled = disabled; } From 3620da4207cc46f58f6de700be61e47433041352 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Niklas=20Bartholom=C3=A4us?= Date: Fri, 23 Jun 2017 14:37:36 +0200 Subject: [PATCH 22/34] Removed github editor auto indendtion --- .../Ui/view/base/web/js/lib/knockout/bindings/optgroup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/optgroup.js b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/optgroup.js index bf9e8ebe6eaa1..2925c5859eddd 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/optgroup.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/optgroup.js @@ -302,7 +302,7 @@ define([ space = '\u2007\u2007\u2007'; obj[optionTitle] = applyToObject(option, optionsText + 'title', value); - + if (disabled) { obj.disabled = disabled; } From febbd884a24abba2bc6d80bc17556a545a4dad93 Mon Sep 17 00:00:00 2001 From: Vova Yatsyuk Date: Fri, 23 Jun 2017 20:52:44 +0300 Subject: [PATCH 23/34] DocBlocks added for the new options --- lib/web/mage/sticky.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib/web/mage/sticky.js b/lib/web/mage/sticky.js index eccd1dd8c0797..3e7c877a35923 100644 --- a/lib/web/mage/sticky.js +++ b/lib/web/mage/sticky.js @@ -12,8 +12,24 @@ define([ $.widget('mage.sticky', { options: { container: '', + + /** + * Spacing in pixels above the stuck element + * @type {Number|Function} Number or Function that will return a Number + */ spacingTop: 0, + + /** + * Allows postponing sticking, until element will go out of the + * screen for the number of pixels. + * @type {Number|Function} Number or Function that will return a Number + */ stickAfter: 0, + + /** + * CSS class for active sticky state + * @type {String} + */ stickyClass: '_sticky' }, From d715b42af2c017ce07744032a82de0c522fc28fb Mon Sep 17 00:00:00 2001 From: Vova Yatsyuk Date: Fri, 23 Jun 2017 20:54:10 +0300 Subject: [PATCH 24/34] DocBlock added for the 'container' option --- lib/web/mage/sticky.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/web/mage/sticky.js b/lib/web/mage/sticky.js index 3e7c877a35923..c7aabd2662b99 100644 --- a/lib/web/mage/sticky.js +++ b/lib/web/mage/sticky.js @@ -11,6 +11,12 @@ define([ $.widget('mage.sticky', { options: { + /** + * Element selector, who's height that will be used to restrict the + * maximum offsetTop position of the stuck element. + * Default uses document body. + * @type {String} + */ container: '', /** From 62b822c0f3bfc05a55a96fa337884f8c8bbf49e8 Mon Sep 17 00:00:00 2001 From: Vova Yatsyuk Date: Fri, 23 Jun 2017 20:57:18 +0300 Subject: [PATCH 25/34] Typo error in DocBlock fixed --- lib/web/mage/sticky.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/web/mage/sticky.js b/lib/web/mage/sticky.js index c7aabd2662b99..f98774e203ea4 100644 --- a/lib/web/mage/sticky.js +++ b/lib/web/mage/sticky.js @@ -12,7 +12,7 @@ define([ $.widget('mage.sticky', { options: { /** - * Element selector, who's height that will be used to restrict the + * Element selector, who's height will be used to restrict the * maximum offsetTop position of the stuck element. * Default uses document body. * @type {String} From 4cffc97aef9dde14f0dc46eb5a477d352ab8b1ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Corr=C3=AAa=20Gomes?= Date: Mon, 26 Jun 2017 16:05:23 -0300 Subject: [PATCH 26/34] Adding escapeHtml to Newsletter phtml --- .../Magento/Newsletter/view/frontend/templates/subscribe.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Newsletter/view/frontend/templates/subscribe.phtml b/app/code/Magento/Newsletter/view/frontend/templates/subscribe.phtml index 751c2779a2336..70d174873725f 100644 --- a/app/code/Magento/Newsletter/view/frontend/templates/subscribe.phtml +++ b/app/code/Magento/Newsletter/view/frontend/templates/subscribe.phtml @@ -10,7 +10,7 @@ ?>