diff --git a/CHANGELOG.md b/CHANGELOG.md index 0fe6136eae11b77787726d44f517df9e536c0cdb..a1d98332be0d5c39a997f7ce570933320e08c8e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,42 @@ +0.74.0-beta14 +============= +* Framework improvements: + * Introduced an ability to uninstall modules which were installed via composer (bin/magento module:uninstall <moduleName>) + * Introduced an ability to uninstall themes (bin/magento theme:uninstall <themeName>) + * Introduced an ability to backup and rollback DB and Media via CLI (bin/magento setup:backup, options are --code, --db or --media) + * Introduced an ability to uninstall language packages (bin/magento i18n:uninstall <languagePack>) + * Introduced API notation for the following modules: Backend, Backup, Cron, Log, PageCache + * Added join processors to search services, joined config for services with extension attributes + * Renamed hidden_tax to discount_tax_compensation + * The customer address entity table was transformed from EAV into a flat model to minimize database operations +* Fixed bugs: + * Fixed an issue where Setup Wizard failed on readiness check when Magento was deployed by composer create-project + * Fixed the local file path disclosure when trying to browse image cache directory + * Fixed an issue where development errors resulted in too many redirects + * Fixed an integration test failure in Reports ViewedTest + * Fixed an issue where it was impossible to save existent Grouped Product with no child items + * Fixed an issue where message "We don't have as many "conf1" as you requested" appeared + * Fixed an issue where second product from bundle product was ordered as separate item after checkout + * Fixed an issue where configs for payments and shippings were not encrypted + * Fixed an issue where Table Rates shipping method did not work + * Fixed an issue where admin could not set locale properly on Account page + * Fixed incomplete generated results of single tenant compiler + * Fixed an issue with full page caching where one set of prices was cached for all customers + * Fixed incorrect urls for private content + * Fixed an issue where it was not possible to assign a product link to another product using API + * Fixed an issue where zipcode was not displayed as required field on Create New Order page + * Fixed the Sample Data re-installation + * Fixed random fails on inventory tab for test CreateSimpleProductEntityTest +* Tests: + * Covered various modules with unit tests + * Functional tests fixed and maintained +* GitHub issues: + * [#1156](https://github.com/magento/magento2/pull/1156) -- Moves common code to all auto-generated Interceptor classes into a trait + * [#1206](https://github.com/magento/magento2/pull/1206) -- Allow modules to live outside of app/code directory + * [#1245](https://github.com/magento/magento2/pull/1245) -- Unable to save product per website wise + * [#1347](https://github.com/magento/magento2/pull/1347) -- Fixed failing Install during integration tests (MAGETWO-38482) + * [#1368](https://github.com/magento/magento2/pull/1368) -- Fix typo in getCurrentCategoryKey + 0.74.0-beta13 ============= * Framework improvements: diff --git a/app/code/Magento/AdminNotification/composer.json b/app/code/Magento/AdminNotification/composer.json index d26dfd7372721000e9973b16a3ea720e1e09a6e5..5ae1d3e4e2009835a572a2c9081ee74619532b51 100644 --- a/app/code/Magento/AdminNotification/composer.json +++ b/app/code/Magento/AdminNotification/composer.json @@ -3,15 +3,15 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/module-media-storage": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-store": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/module-media-storage": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "lib-libxml": "*", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/AdvancedPricingImportExport/composer.json b/app/code/Magento/AdvancedPricingImportExport/composer.json index c8b52c1509eb996357137da8f799be5d85c864d7..3e7abff2e19eca58d7d762c6f90932188af3aef6 100644 --- a/app/code/Magento/AdvancedPricingImportExport/composer.json +++ b/app/code/Magento/AdvancedPricingImportExport/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-catalog": "0.74.0-beta13", - "magento/module-import-export": "0.74.0-beta13", - "magento/module-catalog-import-export": "0.74.0-beta13", - "magento/module-customer": "0.74.0-beta13", - "magento/module-store": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-catalog": "0.74.0-beta14", + "magento/module-import-export": "0.74.0-beta14", + "magento/module-catalog-import-export": "0.74.0-beta14", + "magento/module-customer": "0.74.0-beta14", + "magento/module-store": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Authorization/composer.json b/app/code/Magento/Authorization/composer.json index 9225d004e7ce2f5753e0f21d8f95ca2fb7cbe9cf..9ce77947a0b214ceb0d0dd04c9e35f6e6c602ca2 100644 --- a/app/code/Magento/Authorization/composer.json +++ b/app/code/Magento/Authorization/composer.json @@ -3,12 +3,12 @@ "description": "Authorization module provides access to Magento ACL functionality.", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-backend": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-backend": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Backend/composer.json b/app/code/Magento/Backend/composer.json index b7e2b7bc15ba6f54e72cc1d6b084c18876592c52..b2b20216cf652a430d51f44492332e150011cd7d 100644 --- a/app/code/Magento/Backend/composer.json +++ b/app/code/Magento/Backend/composer.json @@ -3,27 +3,27 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta13", - "magento/module-directory": "0.74.0-beta13", - "magento/module-developer": "0.74.0-beta13", - "magento/module-eav": "0.74.0-beta13", - "magento/module-cron": "0.74.0-beta13", - "magento/module-theme": "0.74.0-beta13", - "magento/module-reports": "0.74.0-beta13", - "magento/module-sales": "0.74.0-beta13", - "magento/module-quote": "0.74.0-beta13", - "magento/module-catalog": "0.74.0-beta13", - "magento/module-user": "0.74.0-beta13", - "magento/module-backup": "0.74.0-beta13", - "magento/module-customer": "0.74.0-beta13", - "magento/module-translation": "0.74.0-beta13", - "magento/module-require-js": "0.74.0-beta13", - "magento/module-config": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-store": "0.74.0-beta14", + "magento/module-directory": "0.74.0-beta14", + "magento/module-developer": "0.74.0-beta14", + "magento/module-eav": "0.74.0-beta14", + "magento/module-cron": "0.74.0-beta14", + "magento/module-theme": "0.74.0-beta14", + "magento/module-reports": "0.74.0-beta14", + "magento/module-sales": "0.74.0-beta14", + "magento/module-quote": "0.74.0-beta14", + "magento/module-catalog": "0.74.0-beta14", + "magento/module-user": "0.74.0-beta14", + "magento/module-backup": "0.74.0-beta14", + "magento/module-customer": "0.74.0-beta14", + "magento/module-translation": "0.74.0-beta14", + "magento/module-require-js": "0.74.0-beta14", + "magento/module-config": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Backup/composer.json b/app/code/Magento/Backup/composer.json index 30ca528748ce5de5d93f6cf933d2b5bc8bc24cd1..74b0a704e1de9374392c01a64e69b075fc416fde 100644 --- a/app/code/Magento/Backup/composer.json +++ b/app/code/Magento/Backup/composer.json @@ -3,14 +3,14 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/module-cron": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-store": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/module-cron": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Bundle/composer.json b/app/code/Magento/Bundle/composer.json index ddc09411834f50f6715db4ad8103539915f34a44..f3017a3a8dda032fb32a79cff12622d3cb601bc2 100644 --- a/app/code/Magento/Bundle/composer.json +++ b/app/code/Magento/Bundle/composer.json @@ -3,28 +3,28 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta13", - "magento/module-catalog": "0.74.0-beta13", - "magento/module-tax": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/module-sales": "0.74.0-beta13", - "magento/module-checkout": "0.74.0-beta13", - "magento/module-catalog-inventory": "0.74.0-beta13", - "magento/module-customer": "0.74.0-beta13", - "magento/module-catalog-rule": "0.74.0-beta13", - "magento/module-eav": "0.74.0-beta13", - "magento/module-config": "0.74.0-beta13", - "magento/module-gift-message": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", - "magento/module-quote": "0.74.0-beta13", - "magento/module-media-storage": "0.74.0-beta13", + "magento/module-store": "0.74.0-beta14", + "magento/module-catalog": "0.74.0-beta14", + "magento/module-tax": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/module-sales": "0.74.0-beta14", + "magento/module-checkout": "0.74.0-beta14", + "magento/module-catalog-inventory": "0.74.0-beta14", + "magento/module-customer": "0.74.0-beta14", + "magento/module-catalog-rule": "0.74.0-beta14", + "magento/module-eav": "0.74.0-beta14", + "magento/module-config": "0.74.0-beta14", + "magento/module-gift-message": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", + "magento/module-quote": "0.74.0-beta14", + "magento/module-media-storage": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "suggest": { - "magento/module-webapi": "0.74.0-beta13" + "magento/module-webapi": "0.74.0-beta14" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/BundleImportExport/composer.json b/app/code/Magento/BundleImportExport/composer.json index ddbc85cb67cb1d20f44a4bdb9c64ab3bf44f0127..78b23b0ff876b31caff7359c35e625ee986e6100 100755 --- a/app/code/Magento/BundleImportExport/composer.json +++ b/app/code/Magento/BundleImportExport/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-catalog": "0.74.0-beta13", - "magento/module-import-export": "0.74.0-beta13", - "magento/module-catalog-import-export": "0.74.0-beta13", - "magento/module-bundle": "0.74.0-beta13", - "magento/module-eav": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-catalog": "0.74.0-beta14", + "magento/module-import-export": "0.74.0-beta14", + "magento/module-catalog-import-export": "0.74.0-beta14", + "magento/module-bundle": "0.74.0-beta14", + "magento/module-eav": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CacheInvalidate/composer.json b/app/code/Magento/CacheInvalidate/composer.json index 5045f5b065cb0b6b80ecc9810dd84ed828bc7c26..5f5a8b2ce39bfa5fff3162892d333dcbd8c1659f 100644 --- a/app/code/Magento/CacheInvalidate/composer.json +++ b/app/code/Magento/CacheInvalidate/composer.json @@ -3,12 +3,12 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-page-cache": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-page-cache": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Captcha/composer.json b/app/code/Magento/Captcha/composer.json index 8e61f79ac764e5f722d5de600b515d27f5abc4be..044ade39edc271c3b8d5d1b4f9aebcb1cc740e90 100644 --- a/app/code/Magento/Captcha/composer.json +++ b/app/code/Magento/Captcha/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta13", - "magento/module-customer": "0.74.0-beta13", - "magento/module-checkout": "0.74.0-beta13", - "magento/module-quote": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-store": "0.74.0-beta14", + "magento/module-customer": "0.74.0-beta14", + "magento/module-checkout": "0.74.0-beta14", + "magento/module-quote": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Category.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Category.php index 54a51a1a55148aee7edeb0d7fb509d7175b408e4..ee730b9be8157e2d794ff954d9e173676cf4b32b 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Category.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Category.php @@ -132,7 +132,7 @@ class Category extends \Magento\Framework\Data\Form\Element\Multiselect 'id' => 'add_category_button', 'label' => $newCategoryCaption, 'title' => $newCategoryCaption, - 'onclick' => 'jQuery("#new-category").trigger("openModal")', + 'onclick' => 'jQuery("#new-category").modal("openModal")', 'disabled' => $this->getDisabled(), ] ); diff --git a/app/code/Magento/Catalog/composer.json b/app/code/Magento/Catalog/composer.json index 2c1ac69b4bbf736b53a62ea9d6387171ece6e7f4..7c1d49431e273833b821bae24c446d3364c6b458 100644 --- a/app/code/Magento/Catalog/composer.json +++ b/app/code/Magento/Catalog/composer.json @@ -3,37 +3,37 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta13", - "magento/module-eav": "0.74.0-beta13", - "magento/module-cms": "0.74.0-beta13", - "magento/module-indexer": "0.74.0-beta13", - "magento/module-customer": "0.74.0-beta13", - "magento/module-theme": "0.74.0-beta13", - "magento/module-checkout": "0.74.0-beta13", - "magento/module-log": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/module-widget": "0.74.0-beta13", - "magento/module-wishlist": "0.74.0-beta13", - "magento/module-tax": "0.74.0-beta13", - "magento/module-msrp": "0.74.0-beta13", - "magento/module-catalog-inventory": "0.74.0-beta13", - "magento/module-directory": "0.74.0-beta13", - "magento/module-catalog-rule": "0.74.0-beta13", - "magento/module-product-alert": "0.74.0-beta13", - "magento/module-url-rewrite": "0.74.0-beta13", - "magento/module-catalog-url-rewrite": "0.74.0-beta13", - "magento/module-page-cache": "0.74.0-beta13", - "magento/module-quote": "0.74.0-beta13", - "magento/module-config": "0.74.0-beta13", - "magento/module-media-storage": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-store": "0.74.0-beta14", + "magento/module-eav": "0.74.0-beta14", + "magento/module-cms": "0.74.0-beta14", + "magento/module-indexer": "0.74.0-beta14", + "magento/module-customer": "0.74.0-beta14", + "magento/module-theme": "0.74.0-beta14", + "magento/module-checkout": "0.74.0-beta14", + "magento/module-log": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/module-widget": "0.74.0-beta14", + "magento/module-wishlist": "0.74.0-beta14", + "magento/module-tax": "0.74.0-beta14", + "magento/module-msrp": "0.74.0-beta14", + "magento/module-catalog-inventory": "0.74.0-beta14", + "magento/module-directory": "0.74.0-beta14", + "magento/module-catalog-rule": "0.74.0-beta14", + "magento/module-product-alert": "0.74.0-beta14", + "magento/module-url-rewrite": "0.74.0-beta14", + "magento/module-catalog-url-rewrite": "0.74.0-beta14", + "magento/module-page-cache": "0.74.0-beta14", + "magento/module-quote": "0.74.0-beta14", + "magento/module-config": "0.74.0-beta14", + "magento/module-media-storage": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "suggest": { - "magento/module-cookie": "0.74.0-beta13" + "magento/module-cookie": "0.74.0-beta14" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Catalog/view/adminhtml/web/js/new-category-dialog.js b/app/code/Magento/Catalog/view/adminhtml/web/js/new-category-dialog.js index 552e6a3a70ee729d5bcc8367b3f50312d5061adf..d70f2e17193afe202495b505a22cf26416dbdae7 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/js/new-category-dialog.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/js/new-category-dialog.js @@ -111,7 +111,7 @@ define([ $('#new_category_name, #new_category_parent-suggest').val(''); $suggest.val(''); clearParentCategory(); - widget.element.trigger('closeModal'); + $(widget.element).modal('closeModal'); } else { $('#new_category_messages').html(data.messages); } diff --git a/app/code/Magento/CatalogImportExport/composer.json b/app/code/Magento/CatalogImportExport/composer.json index fe82fc10d1355d83dbc6a71cbe7ec882504f4f0d..ca381cabc50404db10ec64a2c7e635b69124c128 100644 --- a/app/code/Magento/CatalogImportExport/composer.json +++ b/app/code/Magento/CatalogImportExport/composer.json @@ -3,21 +3,21 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-catalog": "0.74.0-beta13", - "magento/module-eav": "0.74.0-beta13", - "magento/module-import-export": "0.74.0-beta13", - "magento/module-indexer": "0.74.0-beta13", - "magento/module-store": "0.74.0-beta13", - "magento/module-tax": "0.74.0-beta13", - "magento/module-catalog-inventory": "0.74.0-beta13", - "magento/module-media-storage": "0.74.0-beta13", - "magento/module-customer": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-catalog": "0.74.0-beta14", + "magento/module-eav": "0.74.0-beta14", + "magento/module-import-export": "0.74.0-beta14", + "magento/module-indexer": "0.74.0-beta14", + "magento/module-store": "0.74.0-beta14", + "magento/module-tax": "0.74.0-beta14", + "magento/module-catalog-inventory": "0.74.0-beta14", + "magento/module-media-storage": "0.74.0-beta14", + "magento/module-customer": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "ext-ctype": "*", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CatalogInventory/composer.json b/app/code/Magento/CatalogInventory/composer.json index 17807abf00284e37befeee24f9146e7822ab1675..fa1c799fe739d3bcf87ca6f916bcde0962624808 100644 --- a/app/code/Magento/CatalogInventory/composer.json +++ b/app/code/Magento/CatalogInventory/composer.json @@ -3,18 +3,18 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-config": "0.74.0-beta13", - "magento/module-store": "0.74.0-beta13", - "magento/module-catalog": "0.74.0-beta13", - "magento/module-customer": "0.74.0-beta13", - "magento/module-indexer": "0.74.0-beta13", - "magento/module-eav": "0.74.0-beta13", - "magento/module-quote": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-config": "0.74.0-beta14", + "magento/module-store": "0.74.0-beta14", + "magento/module-catalog": "0.74.0-beta14", + "magento/module-customer": "0.74.0-beta14", + "magento/module-indexer": "0.74.0-beta14", + "magento/module-eav": "0.74.0-beta14", + "magento/module-quote": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CatalogRule/composer.json b/app/code/Magento/CatalogRule/composer.json index 3611281f1c69d49dd4efc8f6044045e0f33614c9..539ca4af208560e40d7f890c9550308bde89485e 100644 --- a/app/code/Magento/CatalogRule/composer.json +++ b/app/code/Magento/CatalogRule/composer.json @@ -3,19 +3,19 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta13", - "magento/module-rule": "0.74.0-beta13", - "magento/module-catalog": "0.74.0-beta13", - "magento/module-customer": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/module-eav": "0.74.0-beta13", - "magento/module-indexer": "0.74.0-beta13", - "magento/module-import-export": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-store": "0.74.0-beta14", + "magento/module-rule": "0.74.0-beta14", + "magento/module-catalog": "0.74.0-beta14", + "magento/module-customer": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/module-eav": "0.74.0-beta14", + "magento/module-indexer": "0.74.0-beta14", + "magento/module-import-export": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CatalogSearch/composer.json b/app/code/Magento/CatalogSearch/composer.json index 307467c3c6217b54f23acdee9766524ef5817723..1d8292288c1c06458eea32cb0b3985d82f3147a4 100644 --- a/app/code/Magento/CatalogSearch/composer.json +++ b/app/code/Magento/CatalogSearch/composer.json @@ -3,20 +3,20 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta13", - "magento/module-catalog": "0.74.0-beta13", - "magento/module-search": "0.74.0-beta13", - "magento/module-customer": "0.74.0-beta13", - "magento/module-directory": "0.74.0-beta13", - "magento/module-indexer": "0.74.0-beta13", - "magento/module-eav": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/module-theme": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-store": "0.74.0-beta14", + "magento/module-catalog": "0.74.0-beta14", + "magento/module-search": "0.74.0-beta14", + "magento/module-customer": "0.74.0-beta14", + "magento/module-directory": "0.74.0-beta14", + "magento/module-indexer": "0.74.0-beta14", + "magento/module-eav": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/module-theme": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CatalogUrlRewrite/composer.json b/app/code/Magento/CatalogUrlRewrite/composer.json index a4fdb35d55615c085511be97e462cfba358b6794..764fb5ed8db3fc88023dba3f275a543386e34315 100644 --- a/app/code/Magento/CatalogUrlRewrite/composer.json +++ b/app/code/Magento/CatalogUrlRewrite/composer.json @@ -3,18 +3,18 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-backend": "0.74.0-beta13", - "magento/module-catalog": "0.74.0-beta13", - "magento/module-catalog-import-export": "0.74.0-beta13", - "magento/module-eav": "0.74.0-beta13", - "magento/module-import-export": "0.74.0-beta13", - "magento/module-store": "0.74.0-beta13", - "magento/module-url-rewrite": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-backend": "0.74.0-beta14", + "magento/module-catalog": "0.74.0-beta14", + "magento/module-catalog-import-export": "0.74.0-beta14", + "magento/module-eav": "0.74.0-beta14", + "magento/module-import-export": "0.74.0-beta14", + "magento/module-store": "0.74.0-beta14", + "magento/module-url-rewrite": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CatalogWidget/composer.json b/app/code/Magento/CatalogWidget/composer.json index 633cc2a7cc48e4ab5bcf48ef3a976ae1bbb6302f..a1708c5aa5d6b1c14848114666f7bb6e520eaa00 100644 --- a/app/code/Magento/CatalogWidget/composer.json +++ b/app/code/Magento/CatalogWidget/composer.json @@ -3,19 +3,19 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-catalog": "0.74.0-beta13", - "magento/module-widget": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/module-rule": "0.74.0-beta13", - "magento/module-eav": "0.74.0-beta13", - "magento/module-customer": "0.74.0-beta13", - "magento/module-store": "0.74.0-beta13", - "magento/module-wishlist": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-catalog": "0.74.0-beta14", + "magento/module-widget": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/module-rule": "0.74.0-beta14", + "magento/module-eav": "0.74.0-beta14", + "magento/module-customer": "0.74.0-beta14", + "magento/module-store": "0.74.0-beta14", + "magento/module-wishlist": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Checkout/composer.json b/app/code/Magento/Checkout/composer.json index db8918bca762e2ed96a00a597bc0291a0138e96e..7aac4e4eeb32402cdcf6a15b14a9a2488203b5a7 100644 --- a/app/code/Magento/Checkout/composer.json +++ b/app/code/Magento/Checkout/composer.json @@ -3,32 +3,32 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta13", - "magento/module-sales": "0.74.0-beta13", - "magento/module-catalog-inventory": "0.74.0-beta13", - "magento/module-config": "0.74.0-beta13", - "magento/module-customer": "0.74.0-beta13", - "magento/module-catalog": "0.74.0-beta13", - "magento/module-payment": "0.74.0-beta13", - "magento/module-shipping": "0.74.0-beta13", - "magento/module-tax": "0.74.0-beta13", - "magento/module-directory": "0.74.0-beta13", - "magento/module-eav": "0.74.0-beta13", - "magento/module-gift-message": "0.74.0-beta13", - "magento/module-wishlist": "0.74.0-beta13", - "magento/module-page-cache": "0.74.0-beta13", - "magento/module-theme": "0.74.0-beta13", - "magento/module-msrp": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", - "magento/module-ui": "0.74.0-beta13", - "magento/module-quote": "0.74.0-beta13", + "magento/module-store": "0.74.0-beta14", + "magento/module-sales": "0.74.0-beta14", + "magento/module-catalog-inventory": "0.74.0-beta14", + "magento/module-config": "0.74.0-beta14", + "magento/module-customer": "0.74.0-beta14", + "magento/module-catalog": "0.74.0-beta14", + "magento/module-payment": "0.74.0-beta14", + "magento/module-shipping": "0.74.0-beta14", + "magento/module-tax": "0.74.0-beta14", + "magento/module-directory": "0.74.0-beta14", + "magento/module-eav": "0.74.0-beta14", + "magento/module-gift-message": "0.74.0-beta14", + "magento/module-wishlist": "0.74.0-beta14", + "magento/module-page-cache": "0.74.0-beta14", + "magento/module-theme": "0.74.0-beta14", + "magento/module-msrp": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", + "magento/module-ui": "0.74.0-beta14", + "magento/module-quote": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "suggest": { - "magento/module-cookie": "0.74.0-beta13" + "magento/module-cookie": "0.74.0-beta14" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CheckoutAgreements/composer.json b/app/code/Magento/CheckoutAgreements/composer.json index bea7e49ea19fc077686d3e7ba0e73bec7beb2978..28936c416e31dc474a95b0687d98edef469ba886 100644 --- a/app/code/Magento/CheckoutAgreements/composer.json +++ b/app/code/Magento/CheckoutAgreements/composer.json @@ -3,15 +3,15 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-checkout": "0.74.0-beta13", - "magento/module-store": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/module-ui": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-checkout": "0.74.0-beta14", + "magento/module-store": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/module-ui": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Cms/Test/Unit/Ui/Component/Listing/Column/PageActionsTest.php b/app/code/Magento/Cms/Test/Unit/Ui/Component/Listing/Column/PageActionsTest.php index a3a2fbda293c06f45808c5087ec56c5d1eeb45de..21c1d2ec4994eac7671fd832e4c5e3e0751313d4 100644 --- a/app/code/Magento/Cms/Test/Unit/Ui/Component/Listing/Column/PageActionsTest.php +++ b/app/code/Magento/Cms/Test/Unit/Ui/Component/Listing/Column/PageActionsTest.php @@ -5,56 +5,84 @@ */ namespace Magento\Cms\Test\Unit\Ui\Component\Listing\Column; +use Magento\Cms\Ui\Component\Listing\Column\PageActions; + class PageActionsTest extends \PHPUnit_Framework_TestCase { public function testPrepareItemsByPageId() { + $pageId = 1; // Create Mocks and SUT $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); /** @var \PHPUnit_Framework_MockObject_MockObject $urlBuilderMock */ $urlBuilderMock = $this->getMockBuilder('Magento\Framework\UrlInterface') ->disableOriginalConstructor() ->getMock(); - $inputUrl = 'href/url/for/edit/action'; /** @var \Magento\Cms\Ui\Component\Listing\Column\PageActions $model */ $model = $objectManager->getObject( 'Magento\Cms\Ui\Component\Listing\Column\PageActions', [ 'urlBuilder' => $urlBuilderMock, - 'url' => $inputUrl ] ); // Define test input and expectations - $items = ['data' => ['items' => [['page_id' => 1]]]]; - $fullUrl = 'full-url-including-base.com/href/url/for/edit/action'; - $name = 'item_name'; - - $editArray = [ - 'href' => $fullUrl, - 'label' => __('Edit'), - 'hidden' => true + $items = [ + 'data' => [ + 'items' => [ + [ + 'page_id' => $pageId + ] + ] + ] ]; + $name = 'item_name'; $expectedItems = [ [ - 'page_id' => 1, - $name => ['edit' => $editArray] + 'page_id' => $pageId, + $name => [ + 'edit' => [ + 'href' => 'test/url/edit', + 'label' => __('Edit'), + ], + 'delete' => [ + 'href' => 'test/url/delete', + 'label' => __('Delete'), + 'confirm' => [ + 'title' => __('Delete "${ $.$data.title }"'), + 'message' => __('Are you sure you wan\'t to delete a "${ $.$data.title }" record?') + ], + ] + ], ] ]; // Configure mocks and object data - $urlBuilderMock->expects($this->once()) + $urlBuilderMock->expects($this->any()) ->method('getUrl') - ->with($inputUrl, ['page_id' => 1]) - ->willReturn($fullUrl); + ->willReturnMap( + [ + [ + PageActions::CMS_URL_PATH_EDIT, + [ + 'page_id' => $pageId + ], + 'test/url/edit', + ], + [ + PageActions::CMS_URL_PATH_DELETE, + [ + 'page_id' => $pageId + ], + 'test/url/delete', + ], + ] + ); $model->setName($name); $model->prepareDataSource($items); // Run test - $this->assertEquals( - $expectedItems, - $items['data']['items'] - ); + $this->assertEquals($expectedItems, $items['data']['items']); } } diff --git a/app/code/Magento/Cms/Ui/Component/Listing/Column/BlockActions.php b/app/code/Magento/Cms/Ui/Component/Listing/Column/BlockActions.php index d93cc635d9e8b716382fd682929cefc4d6e24049..617af42cb6122136cf933ade622dc169846d075b 100644 --- a/app/code/Magento/Cms/Ui/Component/Listing/Column/BlockActions.php +++ b/app/code/Magento/Cms/Ui/Component/Listing/Column/BlockActions.php @@ -18,7 +18,9 @@ class BlockActions extends Column /** * Url path */ - const URL_PATH = 'cms/block/edit'; + const URL_PATH_EDIT = 'cms/block/edit'; + const URL_PATH_DELETE = 'cms/block/delete'; + const URL_PATH_DETAILS = 'cms/block/details'; /** * @var UrlInterface @@ -45,6 +47,10 @@ class BlockActions extends Column parent::__construct($context, $uiComponentFactory, $components, $data); } + /** + * @param array $items + * @return array + */ /** * Prepare Data Source * @@ -58,8 +64,35 @@ class BlockActions extends Column if (isset($item['block_id'])) { $item[$this->getData('name')] = [ 'edit' => [ - 'href' => $this->urlBuilder->getUrl(static::URL_PATH, ['block_id' => $item['block_id']]), - 'label' => __('Edit'), + 'href' => $this->urlBuilder->getUrl( + static::URL_PATH_EDIT, + [ + 'block_id' => $item['block_id'] + ] + ), + 'label' => __('Edit') + ], + 'details' => [ + 'href' => $this->urlBuilder->getUrl( + static::URL_PATH_DETAILS, + [ + 'block_id' => $item['block_id'] + ] + ), + 'label' => __('Details') + ], + 'delete' => [ + 'href' => $this->urlBuilder->getUrl( + static::URL_PATH_DELETE, + [ + 'block_id' => $item['block_id'] + ] + ), + 'label' => __('Delete'), + 'confirm' => [ + 'title' => __('Delete "${ $.$data.title }"'), + 'message' => __('Are you sure you wan\'t to delete a "${ $.$data.title }" record?') + ] ] ]; } diff --git a/app/code/Magento/Cms/Ui/Component/Listing/Column/PageActions.php b/app/code/Magento/Cms/Ui/Component/Listing/Column/PageActions.php index 59edfeded291c2bd809dfa28f4ee9bf0d3a3b1ff..c28a8d4d07093cbd44506b57a0688615e18e78fe 100644 --- a/app/code/Magento/Cms/Ui/Component/Listing/Column/PageActions.php +++ b/app/code/Magento/Cms/Ui/Component/Listing/Column/PageActions.php @@ -17,7 +17,8 @@ use Magento\Framework\UrlInterface; class PageActions extends Column { /** Url path */ - const CMS_URL_PATH = 'cms/page/edit'; + const CMS_URL_PATH_EDIT = 'cms/page/edit'; + const CMS_URL_PATH_DELETE = 'cms/page/delete'; /** @var UrlBuilder */ protected $actionUrlBuilder; @@ -25,10 +26,6 @@ class PageActions extends Column /** @var UrlInterface */ protected $urlBuilder; - /** @var string */ - private $url; - - /** * @param ContextInterface $context * @param UiComponentFactory $uiComponentFactory @@ -36,7 +33,6 @@ class PageActions extends Column * @param UrlInterface $urlBuilder * @param array $components * @param array $data - * @param string $url */ public function __construct( ContextInterface $context, @@ -44,12 +40,10 @@ class PageActions extends Column UrlBuilder $actionUrlBuilder, UrlInterface $urlBuilder, array $components = [], - array $data = [], - $url = self::CMS_URL_PATH + array $data = [] ) { $this->urlBuilder = $urlBuilder; $this->actionUrlBuilder = $actionUrlBuilder; - $this->url = $url; parent::__construct($context, $uiComponentFactory, $components, $data); } @@ -63,15 +57,23 @@ class PageActions extends Column { if (isset($dataSource['data']['items'])) { foreach ($dataSource['data']['items'] as & $item) { + $name = $this->getData('name'); if (isset($item['page_id'])) { - $item[$this->getData('name')]['edit'] = [ - 'href' => $this->urlBuilder->getUrl($this->url, ['page_id' => $item['page_id']]), - 'label' => __('Edit'), - 'hidden' => true + $item[$name]['edit'] = [ + 'href' => $this->urlBuilder->getUrl(self::CMS_URL_PATH_EDIT, ['page_id' => $item['page_id']]), + 'label' => __('Edit') + ]; + $item[$name]['delete'] = [ + 'href' => $this->urlBuilder->getUrl(self::CMS_URL_PATH_DELETE, ['page_id' => $item['page_id']]), + 'label' => __('Delete'), + 'confirm' => [ + 'title' => __('Delete "${ $.$data.title }"'), + 'message' => __('Are you sure you wan\'t to delete a "${ $.$data.title }" record?') + ] ]; } if (isset($item['identifier'])) { - $item[$this->getData('name')]['preview'] = [ + $item[$name]['preview'] = [ 'href' => $this->actionUrlBuilder->getUrl( $item['identifier'], isset($item['_first_store_id']) ? $item['_first_store_id'] : null, diff --git a/app/code/Magento/Cms/composer.json b/app/code/Magento/Cms/composer.json index 73cbc55bc1d1818796bc345b579f2eb594d2d192..74159635377d7d0ac47f23cd8474b47b4415610b 100644 --- a/app/code/Magento/Cms/composer.json +++ b/app/code/Magento/Cms/composer.json @@ -3,20 +3,20 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta13", - "magento/module-theme": "0.74.0-beta13", - "magento/module-widget": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/module-catalog": "0.74.0-beta13", - "magento/module-email": "0.74.0-beta13", - "magento/module-ui": "0.74.0-beta13", - "magento/module-variable": "0.74.0-beta13", - "magento/module-media-storage": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-store": "0.74.0-beta14", + "magento/module-theme": "0.74.0-beta14", + "magento/module-widget": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/module-catalog": "0.74.0-beta14", + "magento/module-email": "0.74.0-beta14", + "magento/module-ui": "0.74.0-beta14", + "magento/module-variable": "0.74.0-beta14", + "magento/module-media-storage": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Cms/view/adminhtml/ui_component/cms_block_listing.xml b/app/code/Magento/Cms/view/adminhtml/ui_component/cms_block_listing.xml index 44f4c1deea21702fdaca687e632e77d087536173..2936cb163fc6f91713a4ebeaa1ae0650b8976702 100644 --- a/app/code/Magento/Cms/view/adminhtml/ui_component/cms_block_listing.xml +++ b/app/code/Magento/Cms/view/adminhtml/ui_component/cms_block_listing.xml @@ -61,6 +61,9 @@ <container name="columns_controls"> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> + <item name="columnsData" xsi:type="array"> + <item name="provider" xsi:type="string">cms_block_listing.cms_block_listing.cms_block_columns</item> + </item> <item name="component" xsi:type="string">Magento_Ui/js/grid/controls/columns</item> <item name="displayArea" xsi:type="string">dataGridActions</item> </item> @@ -225,13 +228,17 @@ <massaction name="listing_massaction"> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> + <item name="selectProvider" xsi:type="string">cms_block_listing.cms_block_listing.cms_block_columns.ids</item> <item name="displayArea" xsi:type="string">bottom</item> <item name="actions" xsi:type="array"> <item name="delete" xsi:type="array"> - <item name="confirm" xsi:type="string" translate="true">Are you sure you want to perform this action?</item> <item name="type" xsi:type="string">delete</item> <item name="label" xsi:type="string" translate="true">Delete</item> <item name="url" xsi:type="string">cms/block/massDelete</item> + <item name="confirm" xsi:type="array"> + <item name="title" xsi:type="string" translate="true">Delete items</item> + <item name="message" xsi:type="string" translate="true">Are you sure you wan't to delete selected items?</item> + </item> </item> </item> <item name="indexField" xsi:type="string">block_id</item> @@ -245,6 +252,7 @@ <item name="provider" xsi:type="string">cms_block_listing.cms_block_listing.listing_top.bookmarks</item> <item name="namespace" xsi:type="string">current.paging</item> </item> + <item name="selectProvider" xsi:type="string">cms_block_listing.cms_block_listing.cms_block_columns.ids</item> <item name="displayArea" xsi:type="string">bottom</item> <item name="options" xsi:type="array"> <item name="20" xsi:type="array"> @@ -275,10 +283,14 @@ <columns name="cms_block_columns"> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> + <item name="storageConfig" xsi:type="array"> + <item name="provider" xsi:type="string">cms_block_listing.cms_block_listing.listing_top.bookmarks</item> + <item name="namespace" xsi:type="string">current</item> + </item> <item name="childDefaults" xsi:type="array"> + <item name="controlVisibility" xsi:type="boolean">true</item> <item name="actionField" xsi:type="string">actions</item> <item name="clickAction" xsi:type="string">edit</item> - <item name="appendTo" xsi:type="string">cms_block_listing.cms_block_listing.listing_top.columns_controls</item> <item name="storageConfig" xsi:type="array"> <item name="provider" xsi:type="string">cms_block_listing.cms_block_listing.listing_top.bookmarks</item> <item name="root" xsi:type="string">columns.${ $.index }</item> @@ -294,14 +306,14 @@ </item> <item name="config" xsi:type="array"> <item name="indexField" xsi:type="string">block_id</item> - <item name="appendTo" xsi:type="boolean">false</item> + <item name="controlVisibility" xsi:type="boolean">false</item> </item> </argument> </column> <column name="block_id"> <argument name="data" xsi:type="array"> <item name="js_config" xsi:type="array"> - <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/sortable</item> + <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/column</item> </item> <item name="config" xsi:type="array"> <item name="dataType" xsi:type="string">text</item> @@ -314,7 +326,7 @@ <column name="title"> <argument name="data" xsi:type="array"> <item name="js_config" xsi:type="array"> - <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/sortable</item> + <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/column</item> </item> <item name="config" xsi:type="array"> <item name="dataType" xsi:type="string">text</item> @@ -326,7 +338,7 @@ <column name="identifier"> <argument name="data" xsi:type="array"> <item name="js_config" xsi:type="array"> - <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/sortable</item> + <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/column</item> </item> <item name="config" xsi:type="array"> <item name="dataType" xsi:type="string">text</item> @@ -397,7 +409,9 @@ <column name="actions" class="Magento\Cms\Ui\Component\Listing\Column\BlockActions"> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> + <item name="draggable" xsi:type="boolean">false</item> <item name="dataType" xsi:type="string">actions</item> + <item name="indexField" xsi:type="string">block_id</item> <item name="align" xsi:type="string">left</item> <item name="label" xsi:type="string" translate="true">Action</item> <item name="data_type" xsi:type="string">actions</item> diff --git a/app/code/Magento/Cms/view/adminhtml/ui_component/cms_page_listing.xml b/app/code/Magento/Cms/view/adminhtml/ui_component/cms_page_listing.xml index 7d154b524cdacc874bbf5a52daf8dc7dcda81d65..5df70e67bcf95379186052a5575a0793fbf0ede3 100644 --- a/app/code/Magento/Cms/view/adminhtml/ui_component/cms_page_listing.xml +++ b/app/code/Magento/Cms/view/adminhtml/ui_component/cms_page_listing.xml @@ -61,6 +61,9 @@ <container name="columns_controls"> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> + <item name="columnsData" xsi:type="array"> + <item name="provider" xsi:type="string">cms_page_listing.cms_page_listing.cms_page_columns</item> + </item> <item name="component" xsi:type="string">Magento_Ui/js/grid/controls/columns</item> <item name="displayArea" xsi:type="string">dataGridActions</item> </item> @@ -237,13 +240,17 @@ <massaction name="listing_massaction"> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> + <item name="selectProvider" xsi:type="string">cms_page_listing.cms_page_listing.cms_page_columns.ids</item> <item name="displayArea" xsi:type="string">bottom</item> <item name="actions" xsi:type="array"> <item name="delete" xsi:type="array"> - <item name="confirm" xsi:type="string" translate="true">Delete selected items?</item> <item name="type" xsi:type="string">delete</item> <item name="label" xsi:type="string" translate="true">Delete</item> <item name="url" xsi:type="string">cms/page/massDelete</item> + <item name="confirm" xsi:type="array"> + <item name="title" xsi:type="string" translate="true">Delete items</item> + <item name="message" xsi:type="string" translate="true">Are you sure you wan't to delete selected items?</item> + </item> </item> <item name="disable" xsi:type="array"> <item name="type" xsi:type="string">disable</item> @@ -267,6 +274,7 @@ <item name="provider" xsi:type="string">cms_page_listing.cms_page_listing.listing_top.bookmarks</item> <item name="namespace" xsi:type="string">current.paging</item> </item> + <item name="selectProvider" xsi:type="string">cms_page_listing.cms_page_listing.cms_page_columns.ids</item> <item name="displayArea" xsi:type="string">bottom</item> <item name="options" xsi:type="array"> <item name="20" xsi:type="array"> @@ -297,10 +305,14 @@ <columns name="cms_page_columns"> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> + <item name="storageConfig" xsi:type="array"> + <item name="provider" xsi:type="string">cms_page_listing.cms_page_listing.listing_top.bookmarks</item> + <item name="namespace" xsi:type="string">current</item> + </item> <item name="childDefaults" xsi:type="array"> <item name="actionField" xsi:type="string">actions</item> <item name="clickAction" xsi:type="string">edit</item> - <item name="appendTo" xsi:type="string">cms_page_listing.cms_page_listing.listing_top.columns_controls</item> + <item name="controlVisibility" xsi:type="boolean">true</item> <item name="storageConfig" xsi:type="array"> <item name="provider" xsi:type="string">cms_page_listing.cms_page_listing.listing_top.bookmarks</item> <item name="root" xsi:type="string">columns.${ $.index }</item> @@ -315,15 +327,16 @@ <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/multiselect</item> </item> <item name="config" xsi:type="array"> + <item name="draggable" xsi:type="boolean">false</item> <item name="indexField" xsi:type="string">page_id</item> - <item name="appendTo" xsi:type="string"></item> + <item name="controlVisibility" xsi:type="boolean">false</item> </item> </argument> </column> <column name="page_id"> <argument name="data" xsi:type="array"> <item name="js_config" xsi:type="array"> - <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/sortable</item> + <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/column</item> </item> <item name="config" xsi:type="array"> <item name="dataType" xsi:type="string">text</item> @@ -336,7 +349,7 @@ <column name="title"> <argument name="data" xsi:type="array"> <item name="js_config" xsi:type="array"> - <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/sortable</item> + <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/column</item> </item> <item name="config" xsi:type="array"> <item name="dataType" xsi:type="string">text</item> @@ -348,7 +361,7 @@ <column name="identifier"> <argument name="data" xsi:type="array"> <item name="js_config" xsi:type="array"> - <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/sortable</item> + <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/column</item> </item> <item name="config" xsi:type="array"> <item name="dataType" xsi:type="string">text</item> @@ -373,7 +386,7 @@ <column name="store_id" class="Magento\Store\Ui\Component\Listing\Column\Store"> <argument name="data" xsi:type="array"> <item name="js_config" xsi:type="array"> - <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/sortable</item> + <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/column</item> </item> <item name="config" xsi:type="array"> <item name="bodyTmpl" xsi:type="string">ui/grid/cells/html</item> @@ -480,7 +493,7 @@ <column name="meta_keywords"> <argument name="data" xsi:type="array"> <item name="js_config" xsi:type="array"> - <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/sortable</item> + <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/column</item> </item> <item name="config" xsi:type="array"> <item name="dataType" xsi:type="string">text</item> @@ -493,7 +506,7 @@ <column name="meta_description"> <argument name="data" xsi:type="array"> <item name="js_config" xsi:type="array"> - <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/sortable</item> + <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/column</item> </item> <item name="config" xsi:type="array"> <item name="dataType" xsi:type="string">text</item> @@ -506,7 +519,9 @@ <column name="actions" class="Magento\Cms\Ui\Component\Listing\Column\PageActions"> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> + <item name="draggable" xsi:type="boolean">false</item> <item name="dataType" xsi:type="string">actions</item> + <item name="indexField" xsi:type="string">page_id</item> <item name="align" xsi:type="string">left</item> <item name="label" xsi:type="string" translate="true">Action</item> <item name="data_type" xsi:type="string">actions</item> diff --git a/app/code/Magento/CmsUrlRewrite/composer.json b/app/code/Magento/CmsUrlRewrite/composer.json index f469ccf9a8a16e50c34bcc66cac4a59c1dc7df58..c5d23577dd32064af54e69ea0c18bf918232f32a 100644 --- a/app/code/Magento/CmsUrlRewrite/composer.json +++ b/app/code/Magento/CmsUrlRewrite/composer.json @@ -3,14 +3,14 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta13", - "magento/module-cms": "0.74.0-beta13", - "magento/module-url-rewrite": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-store": "0.74.0-beta14", + "magento/module-cms": "0.74.0-beta14", + "magento/module-url-rewrite": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Config/composer.json b/app/code/Magento/Config/composer.json index 99e065fbf08f55ac4666e3c27b6944de65d9f4e0..cc83e07515d7c6e3f56c531d84d10edcceb1226e 100644 --- a/app/code/Magento/Config/composer.json +++ b/app/code/Magento/Config/composer.json @@ -3,17 +3,17 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/framework": "0.74.0-beta13", - "magento/module-store": "0.74.0-beta13", - "magento/module-cron": "0.74.0-beta13", - "magento/module-email": "0.74.0-beta13", - "magento/module-directory": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/module-media-storage": "0.74.0-beta13", + "magento/framework": "0.74.0-beta14", + "magento/module-store": "0.74.0-beta14", + "magento/module-cron": "0.74.0-beta14", + "magento/module-email": "0.74.0-beta14", + "magento/module-directory": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/module-media-storage": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/ConfigurableImportExport/composer.json b/app/code/Magento/ConfigurableImportExport/composer.json index 54fb284e622096d698a49ea4154a0ad47fe4f037..8d04a7bae07ab90d74604415193102a43f299075 100644 --- a/app/code/Magento/ConfigurableImportExport/composer.json +++ b/app/code/Magento/ConfigurableImportExport/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-catalog": "0.74.0-beta13", - "magento/module-catalog-import-export": "0.74.0-beta13", - "magento/module-eav": "0.74.0-beta13", - "magento/module-import-export": "0.74.0-beta13", - "magento/module-configurable-product": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-catalog": "0.74.0-beta14", + "magento/module-catalog-import-export": "0.74.0-beta14", + "magento/module-eav": "0.74.0-beta14", + "magento/module-import-export": "0.74.0-beta14", + "magento/module-configurable-product": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/ConfigurableProduct/composer.json b/app/code/Magento/ConfigurableProduct/composer.json index a59d294e11653be15c3407afdddc78db584f82eb..d67c88a3d956bb5c369acb68c95818f9d10047c2 100644 --- a/app/code/Magento/ConfigurableProduct/composer.json +++ b/app/code/Magento/ConfigurableProduct/composer.json @@ -3,27 +3,27 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta13", - "magento/module-catalog": "0.74.0-beta13", - "magento/module-catalog-inventory": "0.74.0-beta13", - "magento/module-sales": "0.74.0-beta13", - "magento/module-checkout": "0.74.0-beta13", - "magento/module-msrp": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/module-eav": "0.74.0-beta13", - "magento/module-customer": "0.74.0-beta13", - "magento/module-catalog-rule": "0.74.0-beta13", - "magento/module-directory": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", - "magento/module-media-storage": "0.74.0-beta13", - "magento/module-quote": "0.74.0-beta13", + "magento/module-store": "0.74.0-beta14", + "magento/module-catalog": "0.74.0-beta14", + "magento/module-catalog-inventory": "0.74.0-beta14", + "magento/module-sales": "0.74.0-beta14", + "magento/module-checkout": "0.74.0-beta14", + "magento/module-msrp": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/module-eav": "0.74.0-beta14", + "magento/module-customer": "0.74.0-beta14", + "magento/module-catalog-rule": "0.74.0-beta14", + "magento/module-directory": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", + "magento/module-media-storage": "0.74.0-beta14", + "magento/module-quote": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "suggest": { - "magento/module-webapi": "0.74.0-beta13" + "magento/module-webapi": "0.74.0-beta14" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Contact/composer.json b/app/code/Magento/Contact/composer.json index 855dc95f1b15efa4b57d63915006bfb38028b121..b439ea140c197b1ed56baf1e2d815da1401ad79b 100644 --- a/app/code/Magento/Contact/composer.json +++ b/app/code/Magento/Contact/composer.json @@ -3,15 +3,15 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-config": "0.74.0-beta13", - "magento/module-store": "0.74.0-beta13", - "magento/module-customer": "0.74.0-beta13", - "magento/module-cms": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-config": "0.74.0-beta14", + "magento/module-store": "0.74.0-beta14", + "magento/module-customer": "0.74.0-beta14", + "magento/module-cms": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Cookie/composer.json b/app/code/Magento/Cookie/composer.json index f407a5b8678efc0b356538691028f981353d3ba4..544fd07a9c3789660daca22b02bfc19ba3f3aef5 100644 --- a/app/code/Magento/Cookie/composer.json +++ b/app/code/Magento/Cookie/composer.json @@ -3,15 +3,15 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-store": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "suggest": { - "magento/module-backend": "0.74.0-beta13" + "magento/module-backend": "0.74.0-beta14" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Cron/composer.json b/app/code/Magento/Cron/composer.json index 2b1ebf6e958d6c4629e5205532dfc0b182d8d6a6..6399fb6b9e9020bfbbdcd39b429d38acd51db867 100644 --- a/app/code/Magento/Cron/composer.json +++ b/app/code/Magento/Cron/composer.json @@ -3,13 +3,13 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-config": "0.74.0-beta13", - "magento/module-store": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-config": "0.74.0-beta14", + "magento/module-store": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CurrencySymbol/composer.json b/app/code/Magento/CurrencySymbol/composer.json index 87a1ae6197aed04f3647858aaf8ae5c6c3b727f7..84def1d3cbe14acfc288d09d027e68ac7ef0514f 100644 --- a/app/code/Magento/CurrencySymbol/composer.json +++ b/app/code/Magento/CurrencySymbol/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-config": "0.74.0-beta13", - "magento/module-store": "0.74.0-beta13", - "magento/module-page-cache": "0.74.0-beta13", - "magento/module-directory": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-config": "0.74.0-beta14", + "magento/module-store": "0.74.0-beta14", + "magento/module-page-cache": "0.74.0-beta14", + "magento/module-directory": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Customer/composer.json b/app/code/Magento/Customer/composer.json index 69fc3efec3823f3e47c02b91eb7c6dc6d3a9a20e..0eece788e93cecb4c80b798123ea44284882baca 100644 --- a/app/code/Magento/Customer/composer.json +++ b/app/code/Magento/Customer/composer.json @@ -3,33 +3,33 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta13", - "magento/module-eav": "0.74.0-beta13", - "magento/module-directory": "0.74.0-beta13", - "magento/module-catalog": "0.74.0-beta13", - "magento/module-newsletter": "0.74.0-beta13", - "magento/module-sales": "0.74.0-beta13", - "magento/module-checkout": "0.74.0-beta13", - "magento/module-wishlist": "0.74.0-beta13", - "magento/module-theme": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/module-review": "0.74.0-beta13", - "magento/module-tax": "0.74.0-beta13", - "magento/module-page-cache": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", - "magento/module-authorization": "0.74.0-beta13", - "magento/module-integration": "0.74.0-beta13", - "magento/module-media-storage": "0.74.0-beta13", - "magento/module-ui": "0.74.0-beta13", - "magento/module-config": "0.74.0-beta13", - "magento/module-quote": "0.74.0-beta13", + "magento/module-store": "0.74.0-beta14", + "magento/module-eav": "0.74.0-beta14", + "magento/module-directory": "0.74.0-beta14", + "magento/module-catalog": "0.74.0-beta14", + "magento/module-newsletter": "0.74.0-beta14", + "magento/module-sales": "0.74.0-beta14", + "magento/module-checkout": "0.74.0-beta14", + "magento/module-wishlist": "0.74.0-beta14", + "magento/module-theme": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/module-review": "0.74.0-beta14", + "magento/module-tax": "0.74.0-beta14", + "magento/module-page-cache": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", + "magento/module-authorization": "0.74.0-beta14", + "magento/module-integration": "0.74.0-beta14", + "magento/module-media-storage": "0.74.0-beta14", + "magento/module-ui": "0.74.0-beta14", + "magento/module-config": "0.74.0-beta14", + "magento/module-quote": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "suggest": { - "magento/module-cookie": "0.74.0-beta13" + "magento/module-cookie": "0.74.0-beta14" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Customer/view/base/ui_component/customer_form.xml b/app/code/Magento/Customer/view/base/ui_component/customer_form.xml index 0f86b821eeed054a234713c3db93a056fedeb4ab..21762022d84e565b42a9808389c03c6777d0d5ae 100644 --- a/app/code/Magento/Customer/view/base/ui_component/customer_form.xml +++ b/app/code/Magento/Customer/view/base/ui_component/customer_form.xml @@ -413,18 +413,6 @@ </item> </argument> </field> - <field name="country_id"> - <argument name="data" xsi:type="array"> - <item name="config" xsi:type="array"> - <item name="dataType" xsi:type="string">text</item> - <item name="formElement" xsi:type="string">select</item> - <item name="source" xsi:type="string">address</item> - <item name="validation" xsi:type="array"> - <item name="required-entry" xsi:type="boolean">true</item> - </item> - </item> - </argument> - </field> <field name="region"> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> @@ -437,7 +425,6 @@ </field> <field name="region_id"> <argument name="data" xsi:type="array"> - <item name="customEntry" xsi:type="string">region</item> <item name="config" xsi:type="array"> <item name="dataType" xsi:type="string">text</item> <item name="formElement" xsi:type="string">select</item> diff --git a/app/code/Magento/CustomerImportExport/composer.json b/app/code/Magento/CustomerImportExport/composer.json index 0fca4e85cc1316d04098a0685fdc613ab7af42c1..b6a1e407f40a90d40681457f8b3c44f71a51810b 100644 --- a/app/code/Magento/CustomerImportExport/composer.json +++ b/app/code/Magento/CustomerImportExport/composer.json @@ -3,17 +3,17 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/module-customer": "0.74.0-beta13", - "magento/module-eav": "0.74.0-beta13", - "magento/module-import-export": "0.74.0-beta13", - "magento/module-directory": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-store": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/module-customer": "0.74.0-beta14", + "magento/module-eav": "0.74.0-beta14", + "magento/module-import-export": "0.74.0-beta14", + "magento/module-directory": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/DesignEditor/composer.json b/app/code/Magento/DesignEditor/composer.json index c74e983baf4c68378fe6735571211cdf05e11cb0..b1da5a0bdcd348ed89d44f6c55133d29d268e728 100644 --- a/app/code/Magento/DesignEditor/composer.json +++ b/app/code/Magento/DesignEditor/composer.json @@ -3,18 +3,18 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta13", - "magento/module-theme": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/module-eav": "0.74.0-beta13", - "magento/module-translation": "0.74.0-beta13", - "magento/module-config": "0.74.0-beta13", - "magento/module-media-storage": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-store": "0.74.0-beta14", + "magento/module-theme": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/module-eav": "0.74.0-beta14", + "magento/module-translation": "0.74.0-beta14", + "magento/module-config": "0.74.0-beta14", + "magento/module-media-storage": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Developer/composer.json b/app/code/Magento/Developer/composer.json index 159132b761c1f3ac35336599634434a2cf489651..a48bb0105867b156433a4addf530adbefcf87e48 100644 --- a/app/code/Magento/Developer/composer.json +++ b/app/code/Magento/Developer/composer.json @@ -3,12 +3,12 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-store": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Dhl/composer.json b/app/code/Magento/Dhl/composer.json index 844caf08a5f13cf23065ae0ed66adcc52014cb3b..02b7d41aa6e9cb7951f25396c7d440274d5b0d56 100644 --- a/app/code/Magento/Dhl/composer.json +++ b/app/code/Magento/Dhl/composer.json @@ -3,22 +3,22 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-config": "0.74.0-beta13", - "magento/module-store": "0.74.0-beta13", - "magento/module-shipping": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/module-directory": "0.74.0-beta13", - "magento/module-sales": "0.74.0-beta13", - "magento/module-checkout": "0.74.0-beta13", - "magento/module-catalog": "0.74.0-beta13", - "magento/module-catalog-inventory": "0.74.0-beta13", - "magento/module-quote": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-config": "0.74.0-beta14", + "magento/module-store": "0.74.0-beta14", + "magento/module-shipping": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/module-directory": "0.74.0-beta14", + "magento/module-sales": "0.74.0-beta14", + "magento/module-checkout": "0.74.0-beta14", + "magento/module-catalog": "0.74.0-beta14", + "magento/module-catalog-inventory": "0.74.0-beta14", + "magento/module-quote": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "lib-libxml": "*", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Directory/composer.json b/app/code/Magento/Directory/composer.json index bc48bec5995d1768c6b6963bd2d72689a5bca4cf..23ab56ed5a4f107e2748d9c98f7a78fe3b762bc4 100644 --- a/app/code/Magento/Directory/composer.json +++ b/app/code/Magento/Directory/composer.json @@ -3,15 +3,15 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-config": "0.74.0-beta13", - "magento/module-store": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-config": "0.74.0-beta14", + "magento/module-store": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "lib-libxml": "*", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Downloadable/composer.json b/app/code/Magento/Downloadable/composer.json index 15f14f91214a75f64c9e6493480b1d972d830b95..fb54763027f3ed9b61617b4c2e2ae63a92ddab6a 100644 --- a/app/code/Magento/Downloadable/composer.json +++ b/app/code/Magento/Downloadable/composer.json @@ -3,28 +3,28 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta13", - "magento/module-catalog": "0.74.0-beta13", - "magento/module-customer": "0.74.0-beta13", - "magento/module-tax": "0.74.0-beta13", - "magento/module-theme": "0.74.0-beta13", - "magento/module-eav": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/module-sales": "0.74.0-beta13", - "magento/module-checkout": "0.74.0-beta13", - "magento/module-directory": "0.74.0-beta13", - "magento/module-wishlist": "0.74.0-beta13", - "magento/module-gift-message": "0.74.0-beta13", - "magento/module-catalog-inventory": "0.74.0-beta13", - "magento/module-msrp": "0.74.0-beta13", - "magento/module-config": "0.74.0-beta13", - "magento/module-media-storage": "0.74.0-beta13", - "magento/module-quote": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-store": "0.74.0-beta14", + "magento/module-catalog": "0.74.0-beta14", + "magento/module-customer": "0.74.0-beta14", + "magento/module-tax": "0.74.0-beta14", + "magento/module-theme": "0.74.0-beta14", + "magento/module-eav": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/module-sales": "0.74.0-beta14", + "magento/module-checkout": "0.74.0-beta14", + "magento/module-directory": "0.74.0-beta14", + "magento/module-wishlist": "0.74.0-beta14", + "magento/module-gift-message": "0.74.0-beta14", + "magento/module-catalog-inventory": "0.74.0-beta14", + "magento/module-msrp": "0.74.0-beta14", + "magento/module-config": "0.74.0-beta14", + "magento/module-media-storage": "0.74.0-beta14", + "magento/module-quote": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Eav/composer.json b/app/code/Magento/Eav/composer.json index 5f243b8986208869e385aebfcbb4b57e28615de6..27a79fab2f4a2d182e3df0749481b2877d6eb5cf 100644 --- a/app/code/Magento/Eav/composer.json +++ b/app/code/Magento/Eav/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/module-catalog": "0.74.0-beta13", - "magento/module-config": "0.74.0-beta13", - "magento/module-media-storage": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-store": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/module-catalog": "0.74.0-beta14", + "magento/module-config": "0.74.0-beta14", + "magento/module-media-storage": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Email/composer.json b/app/code/Magento/Email/composer.json index e1be936adc070dc4d55a948b467c7e147cd8193d..337caab036bcf8efe39b14f1d7d22bf534a38f02 100644 --- a/app/code/Magento/Email/composer.json +++ b/app/code/Magento/Email/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-config": "0.74.0-beta13", - "magento/module-store": "0.74.0-beta13", - "magento/module-cms": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/module-variable": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-config": "0.74.0-beta14", + "magento/module-store": "0.74.0-beta14", + "magento/module-cms": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/module-variable": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Fedex/composer.json b/app/code/Magento/Fedex/composer.json index 2fe10a640638848100355b7e0b1c66a8b5244292..63f7f335ce91ef6b55f722c63265ca6cc57f560a 100644 --- a/app/code/Magento/Fedex/composer.json +++ b/app/code/Magento/Fedex/composer.json @@ -3,20 +3,20 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta13", - "magento/module-shipping": "0.74.0-beta13", - "magento/module-directory": "0.74.0-beta13", - "magento/module-catalog": "0.74.0-beta13", - "magento/module-sales": "0.74.0-beta13", - "magento/module-catalog-inventory": "0.74.0-beta13", - "magento/module-quote": "0.74.0-beta13", - "magento/module-config": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-store": "0.74.0-beta14", + "magento/module-shipping": "0.74.0-beta14", + "magento/module-directory": "0.74.0-beta14", + "magento/module-catalog": "0.74.0-beta14", + "magento/module-sales": "0.74.0-beta14", + "magento/module-catalog-inventory": "0.74.0-beta14", + "magento/module-quote": "0.74.0-beta14", + "magento/module-config": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "lib-libxml": "*", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/GiftMessage/composer.json b/app/code/Magento/GiftMessage/composer.json index 2e2e4b6a8e46e6c2d9cb6a63e3b6a69c5ef0c69d..6159ad811b2306d08af85bd45cd0475e3ca56cfe 100644 --- a/app/code/Magento/GiftMessage/composer.json +++ b/app/code/Magento/GiftMessage/composer.json @@ -3,20 +3,20 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta13", - "magento/module-catalog": "0.74.0-beta13", - "magento/module-checkout": "0.74.0-beta13", - "magento/module-multishipping": "0.74.0-beta13", - "magento/module-sales": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/module-customer": "0.74.0-beta13", - "magento/module-eav": "0.74.0-beta13", - "magento/module-quote": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-store": "0.74.0-beta14", + "magento/module-catalog": "0.74.0-beta14", + "magento/module-checkout": "0.74.0-beta14", + "magento/module-multishipping": "0.74.0-beta14", + "magento/module-sales": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/module-customer": "0.74.0-beta14", + "magento/module-eav": "0.74.0-beta14", + "magento/module-quote": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/GoogleAdwords/composer.json b/app/code/Magento/GoogleAdwords/composer.json index 304cc1bf791158d545194f29f2c3be44a9b8c097..5cc77002b47154ceced14a609d6e0d41282926d7 100644 --- a/app/code/Magento/GoogleAdwords/composer.json +++ b/app/code/Magento/GoogleAdwords/composer.json @@ -3,13 +3,13 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta13", - "magento/module-sales": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-store": "0.74.0-beta14", + "magento/module-sales": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/GoogleAnalytics/composer.json b/app/code/Magento/GoogleAnalytics/composer.json index 92aee5dbd021df882f73761a6b368c905fdcc83e..09c1724be6bc16c662205bef182abc2a677a37b0 100644 --- a/app/code/Magento/GoogleAnalytics/composer.json +++ b/app/code/Magento/GoogleAnalytics/composer.json @@ -3,14 +3,14 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta13", - "magento/module-sales": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", - "magento/module-cookie": "0.74.0-beta13", + "magento/module-store": "0.74.0-beta14", + "magento/module-sales": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", + "magento/module-cookie": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/GoogleOptimizer/composer.json b/app/code/Magento/GoogleOptimizer/composer.json index f046d154cbcf7acf581a241c374e026df489efc2..97573703a09a74e685922b0b3948f6af8e30aa73 100644 --- a/app/code/Magento/GoogleOptimizer/composer.json +++ b/app/code/Magento/GoogleOptimizer/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta13", - "magento/module-google-analytics": "0.74.0-beta13", - "magento/module-catalog": "0.74.0-beta13", - "magento/module-cms": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-store": "0.74.0-beta14", + "magento/module-google-analytics": "0.74.0-beta14", + "magento/module-catalog": "0.74.0-beta14", + "magento/module-cms": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/GoogleShopping/composer.json b/app/code/Magento/GoogleShopping/composer.json index 564c50bd7a9c4929da303ab754797a91b5c26994..1e2387799214e5b48fe356487cc1ea18ce2d030f 100644 --- a/app/code/Magento/GoogleShopping/composer.json +++ b/app/code/Magento/GoogleShopping/composer.json @@ -3,18 +3,18 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/module-catalog": "0.74.0-beta13", - "magento/module-customer": "0.74.0-beta13", - "magento/module-directory": "0.74.0-beta13", - "magento/module-eav": "0.74.0-beta13", - "magento/module-tax": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-store": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/module-catalog": "0.74.0-beta14", + "magento/module-customer": "0.74.0-beta14", + "magento/module-directory": "0.74.0-beta14", + "magento/module-eav": "0.74.0-beta14", + "magento/module-tax": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/GroupedImportExport/composer.json b/app/code/Magento/GroupedImportExport/composer.json index d17ec6ec9e8dfa34f60b13a34725d2c7fea5abca..33a57b24cb7193f6bb5f3b2f0eef591837005946 100644 --- a/app/code/Magento/GroupedImportExport/composer.json +++ b/app/code/Magento/GroupedImportExport/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-catalog": "0.74.0-beta13", - "magento/module-import-export": "0.74.0-beta13", - "magento/module-catalog-import-export": "0.74.0-beta13", - "magento/module-grouped-product": "0.74.0-beta13", - "magento/module-eav": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-catalog": "0.74.0-beta14", + "magento/module-import-export": "0.74.0-beta14", + "magento/module-catalog-import-export": "0.74.0-beta14", + "magento/module-grouped-product": "0.74.0-beta14", + "magento/module-eav": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/GroupedProduct/composer.json b/app/code/Magento/GroupedProduct/composer.json index d108bccbced3c09fa8991ae13fbf15296e7075f4..4ee6e8762d9b6760ce1ad74e9978af483e913f0d 100644 --- a/app/code/Magento/GroupedProduct/composer.json +++ b/app/code/Magento/GroupedProduct/composer.json @@ -3,22 +3,22 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta13", - "magento/module-catalog": "0.74.0-beta13", - "magento/module-catalog-inventory": "0.74.0-beta13", - "magento/module-sales": "0.74.0-beta13", - "magento/module-checkout": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/module-eav": "0.74.0-beta13", - "magento/module-customer": "0.74.0-beta13", - "magento/module-media-storage": "0.74.0-beta13", - "magento/module-msrp": "0.74.0-beta13", - "magento/module-quote": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-store": "0.74.0-beta14", + "magento/module-catalog": "0.74.0-beta14", + "magento/module-catalog-inventory": "0.74.0-beta14", + "magento/module-sales": "0.74.0-beta14", + "magento/module-checkout": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/module-eav": "0.74.0-beta14", + "magento/module-customer": "0.74.0-beta14", + "magento/module-media-storage": "0.74.0-beta14", + "magento/module-msrp": "0.74.0-beta14", + "magento/module-quote": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/GroupedProduct/view/adminhtml/web/js/grouped-product.js b/app/code/Magento/GroupedProduct/view/adminhtml/web/js/grouped-product.js index c5437123aea58b42d4c3cb41d21a076709d3a7eb..b7badba6e79c142c8c1a92e0d60cdb41500507d4 100644 --- a/app/code/Magento/GroupedProduct/view/adminhtml/web/js/grouped-product.js +++ b/app/code/Magento/GroupedProduct/view/adminhtml/web/js/grouped-product.js @@ -7,6 +7,7 @@ define([ 'jquery', 'mage/template', 'jquery/ui', + 'Magento_Ui/js/modal/modal', 'mage/translate', 'mage/adminhtml/grid' ], function ($, mageTemplate) { @@ -94,7 +95,7 @@ define([ }, /** - * Create dialog for show product + * Create modal for show product * * @private */ @@ -103,30 +104,14 @@ define([ selectedProductList = {}, popup = $('[data-role=add-product-dialog]'); - popup.dialog({ + popup.modal({ + type: 'slide', + innerScroll: true, title: $.mage.__('Add Products to Group'), - autoOpen: false, - minWidth: 980, - width: '75%', - modal: true, - resizable: true, - dialogClass: 'grouped', - position: { - my: 'left top', - at: 'center top', - of: 'body' - }, + modalClass: 'grouped', open: function () { - $(this).closest('.ui-dialog').addClass('ui-dialog-active'); - - var topMargin = $(this).closest('.ui-dialog').children('.ui-dialog-titlebar').outerHeight() + 55; - $(this).closest('.ui-dialog').css('margin-top', topMargin); - $(this).addClass('admin__scope-old'); // ToDo UI: remove with old styles removal }, - close: function () { - $(this).closest('.ui-dialog').removeClass('ui-dialog-active'); - }, buttons: [{ id: 'grouped-product-dialog-apply-button', text: $.mage.__('Add Selected Products'), @@ -137,14 +122,7 @@ define([ }); widget._resort(); widget._updateGridVisibility(); - $(this).dialog('close'); - } - }, { - id: 'grouped-product-dialog-cancel-button', - text: $.mage.__('Cancel'), - 'class': 'action-close', - click: function () { - $(this).dialog('close'); + popup.modal('closeModal'); } }] }); @@ -186,7 +164,7 @@ define([ $('[data-role=add-product]').on('click', function (event) { event.preventDefault(); - popup.dialog('open'); + popup.modal('openModal'); gridPopup.reload(); selectedProductList = {}; }); diff --git a/app/code/Magento/ImportExport/composer.json b/app/code/Magento/ImportExport/composer.json index e7cbb957d07e0c2be37df045848e2ba04994930c..e5e58f1eeb8b2d8329b2789124b0a372ca75ef3a 100644 --- a/app/code/Magento/ImportExport/composer.json +++ b/app/code/Magento/ImportExport/composer.json @@ -3,17 +3,17 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/module-eav": "0.74.0-beta13", - "magento/module-indexer": "0.74.0-beta13", - "magento/module-media-storage": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-store": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/module-eav": "0.74.0-beta14", + "magento/module-indexer": "0.74.0-beta14", + "magento/module-media-storage": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "ext-ctype": "*", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Indexer/composer.json b/app/code/Magento/Indexer/composer.json index 5334b4ad74bf65576c1ccec4ad8f4294e9dddf87..5c2d70fd3ba1f4706522b5534b358eed397bb3d7 100644 --- a/app/code/Magento/Indexer/composer.json +++ b/app/code/Magento/Indexer/composer.json @@ -3,14 +3,14 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/module-page-cache": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-store": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/module-page-cache": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Integration/composer.json b/app/code/Magento/Integration/composer.json index e7522cbdd35551484344ff6d2e89df0259344269..71e7696d8ef28184f8fd128d60231cac19b28ca4 100644 --- a/app/code/Magento/Integration/composer.json +++ b/app/code/Magento/Integration/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/module-customer": "0.74.0-beta13", - "magento/module-user": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", - "magento/module-authorization": "0.74.0-beta13", + "magento/module-store": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/module-customer": "0.74.0-beta14", + "magento/module-user": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", + "magento/module-authorization": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/LayeredNavigation/composer.json b/app/code/Magento/LayeredNavigation/composer.json index bdc20c0270c5158053c633cfcfad014a842cbcb3..5fb0f54db609de19157dbbe5a22daf6d3025c950 100644 --- a/app/code/Magento/LayeredNavigation/composer.json +++ b/app/code/Magento/LayeredNavigation/composer.json @@ -3,13 +3,13 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-config": "0.74.0-beta13", - "magento/module-catalog": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-config": "0.74.0-beta14", + "magento/module-catalog": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Log/composer.json b/app/code/Magento/Log/composer.json index 1e5b22c27320a7ab072789131a4b60f59b9dbdac..226458dacc1e2acfe398cfea0d658fb0ec2ab22e 100644 --- a/app/code/Magento/Log/composer.json +++ b/app/code/Magento/Log/composer.json @@ -3,15 +3,15 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta13", - "magento/module-customer": "0.74.0-beta13", - "magento/module-eav": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-store": "0.74.0-beta14", + "magento/module-customer": "0.74.0-beta14", + "magento/module-eav": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/MediaStorage/composer.json b/app/code/Magento/MediaStorage/composer.json index d6eb3484a3966987d8d3278506a3ba04abba6b52..da20bf9f3dc3d8790f4710a3027cbd22335b0d34 100644 --- a/app/code/Magento/MediaStorage/composer.json +++ b/app/code/Magento/MediaStorage/composer.json @@ -3,14 +3,14 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/module-config": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-store": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/module-config": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Msrp/composer.json b/app/code/Magento/Msrp/composer.json index 264b8eb51dba8d26cd6487ab3a4c05374119152b..552af5d5da3518251046821ba504ab4608661fd3 100644 --- a/app/code/Magento/Msrp/composer.json +++ b/app/code/Magento/Msrp/composer.json @@ -3,19 +3,19 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta13", - "magento/module-bundle": "0.74.0-beta13", - "magento/module-catalog": "0.74.0-beta13", - "magento/module-downloadable": "0.74.0-beta13", - "magento/module-eav": "0.74.0-beta13", - "magento/module-grouped-product": "0.74.0-beta13", - "magento/module-tax": "0.74.0-beta13", - "magento/module-quote": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-store": "0.74.0-beta14", + "magento/module-bundle": "0.74.0-beta14", + "magento/module-catalog": "0.74.0-beta14", + "magento/module-downloadable": "0.74.0-beta14", + "magento/module-eav": "0.74.0-beta14", + "magento/module-grouped-product": "0.74.0-beta14", + "magento/module-tax": "0.74.0-beta14", + "magento/module-quote": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Multishipping/composer.json b/app/code/Magento/Multishipping/composer.json index 1d8a0325c2eb0998dc4e53af4125e2204ad25f50..3f6d9e22a139d0932d538424871afc49b49baa40 100644 --- a/app/code/Magento/Multishipping/composer.json +++ b/app/code/Magento/Multishipping/composer.json @@ -3,19 +3,19 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta13", - "magento/module-checkout": "0.74.0-beta13", - "magento/module-sales": "0.74.0-beta13", - "magento/module-payment": "0.74.0-beta13", - "magento/module-tax": "0.74.0-beta13", - "magento/module-customer": "0.74.0-beta13", - "magento/module-theme": "0.74.0-beta13", - "magento/module-quote": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-store": "0.74.0-beta14", + "magento/module-checkout": "0.74.0-beta14", + "magento/module-sales": "0.74.0-beta14", + "magento/module-payment": "0.74.0-beta14", + "magento/module-tax": "0.74.0-beta14", + "magento/module-customer": "0.74.0-beta14", + "magento/module-theme": "0.74.0-beta14", + "magento/module-quote": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Newsletter/composer.json b/app/code/Magento/Newsletter/composer.json index 5e9806a6fab8fd93f56c0a0ccca0256ca1771bc6..1ac1fb8c9d929acbe852fb2c8c0fa93ee1e42409 100644 --- a/app/code/Magento/Newsletter/composer.json +++ b/app/code/Magento/Newsletter/composer.json @@ -3,20 +3,20 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta13", - "magento/module-customer": "0.74.0-beta13", - "magento/module-widget": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/module-cms": "0.74.0-beta13", - "magento/module-email": "0.74.0-beta13", - "magento/module-cron": "0.74.0-beta13", - "magento/module-eav": "0.74.0-beta13", - "magento/module-require-js": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-store": "0.74.0-beta14", + "magento/module-customer": "0.74.0-beta14", + "magento/module-widget": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/module-cms": "0.74.0-beta14", + "magento/module-email": "0.74.0-beta14", + "magento/module-cron": "0.74.0-beta14", + "magento/module-eav": "0.74.0-beta14", + "magento/module-require-js": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/OfflinePayments/composer.json b/app/code/Magento/OfflinePayments/composer.json index 90045a9378f6e5f6b38fe5824ccfb2deea5770b6..5118d798b7ee7a9f2a5c5f1291afd3a9f9ade93d 100644 --- a/app/code/Magento/OfflinePayments/composer.json +++ b/app/code/Magento/OfflinePayments/composer.json @@ -3,13 +3,13 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-checkout": "0.74.0-beta13", - "magento/module-payment": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-checkout": "0.74.0-beta14", + "magento/module-payment": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/OfflineShipping/composer.json b/app/code/Magento/OfflineShipping/composer.json index 9e6c4caa47f24bf81041f76336168cdaf9256b15..5a4bc6de203315f49cc562f6c3561279bc5febe8 100644 --- a/app/code/Magento/OfflineShipping/composer.json +++ b/app/code/Magento/OfflineShipping/composer.json @@ -3,21 +3,21 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-config": "0.74.0-beta13", - "magento/module-store": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/module-shipping": "0.74.0-beta13", - "magento/module-catalog": "0.74.0-beta13", - "magento/module-sales": "0.74.0-beta13", - "magento/module-sales-rule": "0.74.0-beta13", - "magento/module-directory": "0.74.0-beta13", - "magento/module-checkout": "0.74.0-beta13", - "magento/module-quote": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-config": "0.74.0-beta14", + "magento/module-store": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/module-shipping": "0.74.0-beta14", + "magento/module-catalog": "0.74.0-beta14", + "magento/module-sales": "0.74.0-beta14", + "magento/module-sales-rule": "0.74.0-beta14", + "magento/module-directory": "0.74.0-beta14", + "magento/module-checkout": "0.74.0-beta14", + "magento/module-quote": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/PageCache/composer.json b/app/code/Magento/PageCache/composer.json index bc812b12e6d5c3b4ed3047b46623a6a0b2fb5f19..ce7896f50957edfc63dc32ca1c2b335c880bd0d9 100644 --- a/app/code/Magento/PageCache/composer.json +++ b/app/code/Magento/PageCache/composer.json @@ -3,14 +3,14 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-config": "0.74.0-beta13", - "magento/module-store": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-config": "0.74.0-beta14", + "magento/module-store": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Payment/Block/Info.php b/app/code/Magento/Payment/Block/Info.php index d56f2c61fe3559e242c97aecc6bc23a704fe1dd6..94c8b8c998d938519c379f72769d496179fda838 100644 --- a/app/code/Magento/Payment/Block/Info.php +++ b/app/code/Magento/Payment/Block/Info.php @@ -15,7 +15,7 @@ class Info extends \Magento\Framework\View\Element\Template * * @var \Magento\Framework\Object */ - protected $_paymentSpecificInformation = null; + protected $_paymentSpecificInformation; /** * @var string @@ -152,10 +152,6 @@ class Info extends \Magento\Framework\View\Element\Template } elseif (is_array($transport)) { $transport = new \Magento\Framework\Object($transport); } - $this->_eventManager->dispatch( - 'payment_info_block_prepare_specific_information', - ['transport' => $transport, 'payment' => $this->getInfo(), 'block' => $this] - ); $this->_paymentSpecificInformation = $transport; } return $this->_paymentSpecificInformation; diff --git a/app/code/Magento/Payment/Block/Transparent/Form.php b/app/code/Magento/Payment/Block/Transparent/Form.php index 73df0c39c87d95c38a5336530d42802c9c913101..2ff21bae0872b75e9fd03ee53eab79b25dc6564f 100644 --- a/app/code/Magento/Payment/Block/Transparent/Form.php +++ b/app/code/Magento/Payment/Block/Transparent/Form.php @@ -6,6 +6,7 @@ namespace Magento\Payment\Block\Transparent; use Magento\Framework\Exception\LocalizedException; +use Magento\Payment\Model\Method\Adapter; use Magento\Payment\Model\Method\TransparentInterface; use Magento\Checkout\Model\Session; use Magento\Payment\Model\Config; @@ -168,7 +169,11 @@ class Form extends \Magento\Payment\Block\Form\Cc */ public function getMethodConfigData($fieldName) { - return $this->getMethod()->getConfigInterface()->getValue($fieldName); + $method = $this->getMethod(); + if ($method instanceof TransparentInterface) { + return $method->getConfigInterface()->getValue($fieldName); + } + return $method->getConfigData($fieldName); } /** @@ -181,7 +186,7 @@ class Form extends \Magento\Payment\Block\Form\Cc { $method = parent::getMethod(); - if (!$method instanceof TransparentInterface) { + if (!$method instanceof TransparentInterface && !$method instanceof Adapter) { throw new LocalizedException( __('We cannot retrieve the transparent payment method model object.') ); diff --git a/app/code/Magento/Payment/Block/Transparent/Iframe.php b/app/code/Magento/Payment/Block/Transparent/Iframe.php index 3070173f92b36c0bae20d66aadce8981b7c322af..d93f0d076ab64d564bc28a946b7821a369f6b580 100644 --- a/app/code/Magento/Payment/Block/Transparent/Iframe.php +++ b/app/code/Magento/Payment/Block/Transparent/Iframe.php @@ -12,6 +12,8 @@ namespace Magento\Payment\Block\Transparent; */ class Iframe extends \Magento\Framework\View\Element\Template { + const REGISTRY_KEY = 'transparent_form_params'; + /** * Core registry * @@ -42,10 +44,8 @@ class Iframe extends \Magento\Framework\View\Element\Template */ protected function _prepareLayout() { - if ($this->hasRegistryKey()) { - $params = $this->coreRegistry->registry($this->getRegistryKey()); - $this->setParams($params); - } + $params = $this->coreRegistry->registry(self::REGISTRY_KEY); + $this->setParams($params); return parent::_prepareLayout(); } } diff --git a/app/code/Magento/Payment/Gateway/Command/CommandPool.php b/app/code/Magento/Payment/Gateway/Command/CommandPool.php index a6cafee447b83df75cc689ac349d57ed3c83bb8a..6b1014d5aa76d9fefb8a1efb80583147067f2853 100644 --- a/app/code/Magento/Payment/Gateway/Command/CommandPool.php +++ b/app/code/Magento/Payment/Gateway/Command/CommandPool.php @@ -8,21 +8,29 @@ namespace Magento\Payment\Gateway\Command; use Magento\Framework\ObjectManager\TMap; use Magento\Payment\Gateway\CommandInterface; use Magento\Framework\Exception\NotFoundException; +use Magento\Framework\ObjectManager\TMapFactory; class CommandPool implements CommandPoolInterface { /** - * @var CommandInterface[] + * @var CommandInterface[] | TMap */ private $commands; /** - * @param TMap $commands + * @param array $commands + * @param TMapFactory $tmapFactory */ public function __construct( - TMap $commands + array $commands, + TMapFactory $tmapFactory ) { - $this->commands = $commands; + $this->commands = $tmapFactory->create( + [ + 'array' => $commands, + 'type' => 'Magento\Payment\Gateway\CommandInterface' + ] + ); } /** diff --git a/app/code/Magento/Payment/Gateway/Command/GatewayCommand.php b/app/code/Magento/Payment/Gateway/Command/GatewayCommand.php index e2f5e25f75bad6c96dde6d0b2c2800e1f08af2f2..a6044462cded037192b2ca675ba06ce32e89549c 100644 --- a/app/code/Magento/Payment/Gateway/Command/GatewayCommand.php +++ b/app/code/Magento/Payment/Gateway/Command/GatewayCommand.php @@ -7,66 +7,83 @@ namespace Magento\Payment\Gateway\Command; use Magento\Payment\Gateway\CommandInterface; use Magento\Payment\Gateway\Http\ClientInterface; +use Magento\Payment\Gateway\Http\TransferFactoryInterface; use Magento\Payment\Gateway\Request; +use Magento\Payment\Gateway\Request\BuilderInterface; use Magento\Payment\Gateway\Response; +use Magento\Payment\Gateway\Response\HandlerInterface; +use Magento\Payment\Gateway\Validator\ValidatorInterface; class GatewayCommand implements CommandInterface { /** - * @var \Magento\Payment\Gateway\Request\BuilderInterface + * @var BuilderInterface */ private $requestBuilder; /** - * @var \Magento\Payment\Gateway\Http\TransferBuilderInterface + * @var TransferFactoryInterface */ - private $transferBuilder; + private $transferFactory; /** - * @var \Magento\Payment\Gateway\Http\ClientInterface + * @var ClientInterface */ - private $gateway; + private $client; /** - * @var \Magento\Payment\Gateway\Response\HandlerInterface + * @var HandlerInterface */ - private $responseHandler; + private $handler; /** - * @param \Magento\Payment\Gateway\Request\BuilderInterface $requestBuilder - * @param \Magento\Payment\Gateway\Http\TransferBuilderInterface $transferBuilder - * @param \Magento\Payment\Gateway\Http\ClientInterface $gateway - * @param \Magento\Payment\Gateway\Response\HandlerInterface $responseHandler + * @var ValidatorInterface + */ + private $validator; + + /** + * @param BuilderInterface $requestBuilder + * @param TransferFactoryInterface $transferFactory + * @param ClientInterface $client + * @param HandlerInterface $handler + * @param ValidatorInterface $validator */ public function __construct( - \Magento\Payment\Gateway\Request\BuilderInterface $requestBuilder, - \Magento\Payment\Gateway\Http\TransferBuilderInterface $transferBuilder, - ClientInterface $gateway, - \Magento\Payment\Gateway\Response\HandlerInterface $responseHandler + BuilderInterface $requestBuilder, + TransferFactoryInterface $transferFactory, + ClientInterface $client, + HandlerInterface $handler, + ValidatorInterface $validator ) { - $this->requestBuilder = $requestBuilder; - $this->transferBuilder = $transferBuilder; - $this->gateway = $gateway; - $this->responseHandler = $responseHandler; + $this->transferFactory = $transferFactory; + $this->client = $client; + $this->handler = $handler; + $this->validator = $validator; } /** * Executes command basing on business object * * @param array $commandSubject - * @return void + * @return null */ public function execute(array $commandSubject) { // @TODO implement exceptions catching - $transferO = $this->transferBuilder->build( + $transferO = $this->transferFactory->create( $this->requestBuilder->build($commandSubject) ); - $response = $this->gateway->placeRequest($transferO); + $response = $this->client->placeRequest($transferO); + + $result = $this->validator->validate(array_merge($commandSubject, ['response' => $response])); + if ($result !== null && !$result->isValid()) { + $commandSubject['payment']->getPayment()->setIsTransactionPending(true); + return; + } - $this->responseHandler->handle( + $this->handler->handle( $commandSubject, $response ); diff --git a/app/code/Magento/Payment/Gateway/Command/Result/ArrayResult.php b/app/code/Magento/Payment/Gateway/Command/Result/ArrayResult.php new file mode 100644 index 0000000000000000000000000000000000000000..fff6c1dc0125d4e62cc72640a3cd96d392b26292 --- /dev/null +++ b/app/code/Magento/Payment/Gateway/Command/Result/ArrayResult.php @@ -0,0 +1,34 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Payment\Gateway\Command\Result; + +use Magento\Payment\Gateway\Command\ResultInterface; + +class ArrayResult implements ResultInterface +{ + /** + * @var array + */ + private $array; + + /** + * @param array $array + */ + public function __construct(array $array = []) + { + $this->array = $array; + } + + /** + * Returns result interpretation + * + * @return array + */ + public function get() + { + return $this->array; + } +} diff --git a/app/code/Magento/Payment/Gateway/Command/ResultInterface.php b/app/code/Magento/Payment/Gateway/Command/ResultInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..bf26fc8e872516f7e6bc3913c52cf614f8d9d8ab --- /dev/null +++ b/app/code/Magento/Payment/Gateway/Command/ResultInterface.php @@ -0,0 +1,16 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Payment\Gateway\Command; + +interface ResultInterface +{ + /** + * Returns result interpretation + * + * @return mixed + */ + public function get(); +} diff --git a/app/code/Magento/Payment/Gateway/CommandInterface.php b/app/code/Magento/Payment/Gateway/CommandInterface.php index 1537c4d21a80da92d1de2956def17c5bed6815f5..44ef0ee10cf64a79646269e0fdd60a6d6ae3ef95 100644 --- a/app/code/Magento/Payment/Gateway/CommandInterface.php +++ b/app/code/Magento/Payment/Gateway/CommandInterface.php @@ -11,7 +11,7 @@ interface CommandInterface * Executes command basing on business object * * @param array $commandSubject - * @return void + * @return null|Command\ResultInterface */ public function execute(array $commandSubject); } diff --git a/app/code/Magento/Payment/Gateway/Config/ValueHandlerPool.php b/app/code/Magento/Payment/Gateway/Config/ValueHandlerPool.php index ec00f81b18046caea8c2c397384fd492bb8dbc4b..0364336a2ea5e42df84c190359218276bd2aa168 100644 --- a/app/code/Magento/Payment/Gateway/Config/ValueHandlerPool.php +++ b/app/code/Magento/Payment/Gateway/Config/ValueHandlerPool.php @@ -6,6 +6,7 @@ namespace Magento\Payment\Gateway\Config; use Magento\Framework\ObjectManager\TMap; +use Magento\Framework\ObjectManager\TMapFactory; class ValueHandlerPool implements \Magento\Payment\Gateway\Config\ValueHandlerPoolInterface { @@ -15,21 +16,28 @@ class ValueHandlerPool implements \Magento\Payment\Gateway\Config\ValueHandlerPo const DEFAULT_HANDLER = 'default'; /** - * @var ValueHandlerInterface[] + * @var ValueHandlerInterface[] | TMap */ private $handlers; /** - * @param TMap $handlers + * @param array $handlers + * @param TMapFactory $tmapFactory */ public function __construct( - TMap $handlers + array $handlers, + TMapFactory $tmapFactory ) { if (!isset($handlers[self::DEFAULT_HANDLER])) { throw new \LogicException('Default handler should be provided.'); } - $this->handlers = $handlers; + $this->handlers = $tmapFactory->create( + [ + 'array' => $handlers, + 'type' => 'Magento\Payment\Gateway\Config\ValueHandlerInterface' + ] + ); } /** diff --git a/app/code/Magento/Payment/Gateway/Data/AddressAdapterInterface.php b/app/code/Magento/Payment/Gateway/Data/AddressAdapterInterface.php index aeb1f0432f4ccf4ad45752f7835b8182cbdf7b42..ef55a1a67384bbd4ecec2601d8c308fb72bce8c5 100644 --- a/app/code/Magento/Payment/Gateway/Data/AddressAdapterInterface.php +++ b/app/code/Magento/Payment/Gateway/Data/AddressAdapterInterface.php @@ -12,7 +12,7 @@ interface AddressAdapterInterface * * @return string */ - public function getRegion(); + public function getRegionCode(); /** * Get country id diff --git a/app/code/Magento/Payment/Gateway/Data/Order/AddressAdapter.php b/app/code/Magento/Payment/Gateway/Data/Order/AddressAdapter.php index 54f312ccb5afb19081456e15a1a96a48ad526385..b057d9118240bc923e7e1c00b5ddc64344101aab 100644 --- a/app/code/Magento/Payment/Gateway/Data/Order/AddressAdapter.php +++ b/app/code/Magento/Payment/Gateway/Data/Order/AddressAdapter.php @@ -28,9 +28,9 @@ class AddressAdapter implements AddressAdapterInterface * * @return string */ - public function getRegion() + public function getRegionCode() { - return $this->address->getRegion(); + return $this->address->getRegionCode(); } /** diff --git a/app/code/Magento/Payment/Gateway/Data/Order/OrderAdapter.php b/app/code/Magento/Payment/Gateway/Data/Order/OrderAdapter.php index 08ad153f611280c1709efe4660a42d9e02c10888..f01bee1d7c77ab2b4c695ea4f00229f165e29132 100644 --- a/app/code/Magento/Payment/Gateway/Data/Order/OrderAdapter.php +++ b/app/code/Magento/Payment/Gateway/Data/Order/OrderAdapter.php @@ -86,4 +86,24 @@ class OrderAdapter implements OrderAdapterInterface ['address' => $this->order->getShippingAddress()] ); } + + /** + * Returns order store id + * + * @return int + */ + public function getStoreId() + { + return $this->order->getStoreId(); + } + + /** + * Returns order id + * + * @return int + */ + public function getId() + { + return $this->order->getEntityId(); + } } diff --git a/app/code/Magento/Payment/Gateway/Data/OrderAdapterInterface.php b/app/code/Magento/Payment/Gateway/Data/OrderAdapterInterface.php index 60698aa7d943dc28d60a7555d1c4788621d9bf39..0d925d823a9906c6d1bedbe4f488338f33493d64 100644 --- a/app/code/Magento/Payment/Gateway/Data/OrderAdapterInterface.php +++ b/app/code/Magento/Payment/Gateway/Data/OrderAdapterInterface.php @@ -41,4 +41,18 @@ interface OrderAdapterInterface * @return AddressAdapterInterface */ public function getShippingAddress(); + + /** + * Returns order store id + * + * @return int + */ + public function getStoreId(); + + /** + * Returns order id + * + * @return int + */ + public function getId(); } diff --git a/app/code/Magento/Payment/Gateway/Data/Quote/AddressAdapter.php b/app/code/Magento/Payment/Gateway/Data/Quote/AddressAdapter.php index dd846efe7a702d073ff734dba7a3466d43cece60..b73f2bb7bcdf3c04ff07b8bcda6332b0f641b66a 100644 --- a/app/code/Magento/Payment/Gateway/Data/Quote/AddressAdapter.php +++ b/app/code/Magento/Payment/Gateway/Data/Quote/AddressAdapter.php @@ -28,9 +28,9 @@ class AddressAdapter implements AddressAdapterInterface * * @return string */ - public function getRegion() + public function getRegionCode() { - return $this->address->getRegion(); + return $this->address->getRegionCode(); } /** diff --git a/app/code/Magento/Payment/Gateway/Data/Quote/QuoteAdapter.php b/app/code/Magento/Payment/Gateway/Data/Quote/QuoteAdapter.php index b6ed86aa58522080817e7837695245fadde89875..43a6a9ded86e61c539b5f64dfbbd89de57bc1c94 100644 --- a/app/code/Magento/Payment/Gateway/Data/Quote/QuoteAdapter.php +++ b/app/code/Magento/Payment/Gateway/Data/Quote/QuoteAdapter.php @@ -86,4 +86,24 @@ class QuoteAdapter implements OrderAdapterInterface ['address' => $this->quote->getShippingAddress()] ); } + + /** + * Returns order store id + * + * @return int + */ + public function getStoreId() + { + return $this->quote->getStoreId(); + } + + /** + * Returns order id + * + * @return int + */ + public function getId() + { + return $this->quote->getId(); + } } diff --git a/app/code/Magento/Payment/Gateway/Http/Client/Zend.php b/app/code/Magento/Payment/Gateway/Http/Client/Zend.php index fb3b64434c605912f383c3fd77b4a9b91b6fc5b7..0ea8ffbc871b8e49261c641a5bb71e3669e830d2 100644 --- a/app/code/Magento/Payment/Gateway/Http/Client/Zend.php +++ b/app/code/Magento/Payment/Gateway/Http/Client/Zend.php @@ -8,6 +8,8 @@ namespace Magento\Payment\Gateway\Http\Client; use Magento\Framework\HTTP\ZendClientFactory; use Magento\Framework\HTTP\ZendClient; use Magento\Payment\Gateway\Http\ClientInterface; +use Magento\Payment\Gateway\Http\ConverterInterface; +use Magento\Payment\Model\Method\Logger; class Zend implements ClientInterface { @@ -17,20 +19,28 @@ class Zend implements ClientInterface private $clientFactory; /** - * @var \Magento\Payment\Gateway\Http\ConverterInterface + * @var ConverterInterface */ private $converter; + /** + * @var Logger + */ + private $logger; + /** * @param ZendClientFactory $clientFactory - * @param \Magento\Payment\Gateway\Http\ConverterInterface $converter + * @param ConverterInterface $converter + * @param Logger $logger */ public function __construct( ZendClientFactory $clientFactory, - \Magento\Payment\Gateway\Http\ConverterInterface $converter + ConverterInterface $converter, + Logger $logger ) { $this->clientFactory = $clientFactory; $this->converter = $converter; + $this->logger = $logger; } /** @@ -38,6 +48,10 @@ class Zend implements ClientInterface */ public function placeRequest(\Magento\Payment\Gateway\Http\TransferInterface $transferObject) { + $log = [ + 'request' => $transferObject->getBody() + ]; + $result = []; /** @var ZendClient $client */ $client = $this->clientFactory->create(); @@ -61,11 +75,17 @@ class Zend implements ClientInterface try { $response = $client->request(); - return $this->converter->convert($response->getBody()); + + $result = $this->converter->convert($response->getBody()); + $log['response'] = $result; } catch (\Zend_Http_Client_Exception $e) { throw new \Magento\Payment\Gateway\Http\ClientException(__($e->getMessage())); } catch (\Magento\Payment\Gateway\Http\ConverterException $e) { throw $e; + } finally { + $this->logger->debug($log); } + + return $result; } } diff --git a/app/code/Magento/Payment/Gateway/Http/Converter/HtmlFormConverter.php b/app/code/Magento/Payment/Gateway/Http/Converter/HtmlFormConverter.php new file mode 100644 index 0000000000000000000000000000000000000000..588a476bff9eeb0ebd66f37d7d3b9cce15a6a6e5 --- /dev/null +++ b/app/code/Magento/Payment/Gateway/Http/Converter/HtmlFormConverter.php @@ -0,0 +1,46 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Payment\Gateway\Http\Converter; + +use Magento\Payment\Gateway\Http\ConverterException; +use Magento\Payment\Gateway\Http\ConverterInterface; + +class HtmlFormConverter implements ConverterInterface +{ + /** + * Converts gateway response to ENV structure + * + * @param string $response + * @return array + * @throws ConverterException + */ + public function convert($response) + { + $document = new \DOMDocument(); + + libxml_use_internal_errors(true); + if (!$document->loadHTML($response)) { + throw new ConverterException(__('Wrong gateway response format.')); + } + libxml_use_internal_errors(false); + + $document->getElementsByTagName('input'); + + $convertedResponse = []; + /** @var \DOMNode $inputNode */ + foreach ($document->getElementsByTagName('input') as $inputNode) { + if (!$inputNode->attributes->getNamedItem('value') + || !$inputNode->attributes->getNamedItem('name') + ) { + continue; + } + $convertedResponse[$inputNode->attributes->getNamedItem('name')->nodeValue] + = $inputNode->attributes->getNamedItem('value')->nodeValue; + } + + return $convertedResponse; + } +} diff --git a/app/code/Magento/Payment/Gateway/Http/Transfer.php b/app/code/Magento/Payment/Gateway/Http/Transfer.php new file mode 100644 index 0000000000000000000000000000000000000000..6084f9f1c460b47b8f490388bd9ed6ebc091f976 --- /dev/null +++ b/app/code/Magento/Payment/Gateway/Http/Transfer.php @@ -0,0 +1,123 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Payment\Gateway\Http; + +class Transfer implements TransferInterface +{ + /** + * @var array + */ + private $clientConfig; + + /** + * @var array + */ + private $headers; + + /** + * @var string + */ + private $method; + + /** + * @var array + */ + private $body; + + /** + * @var string + */ + private $uri; + + /** + * @var bool + */ + private $encode; + + /** + * @param array $clientConfig + * @param array $headers + * @param array $body + * @param string $method + * @param string $uri + * @param bool $encode + */ + public function __construct( + array $clientConfig, + array $headers, + array $body, + $method, + $uri, + $encode = false + ) { + $this->clientConfig = $clientConfig; + $this->headers = $headers; + $this->method = $method; + $this->body = $body; + $this->uri = $uri; + $this->encode = $encode; + } + + /** + * Returns gateway client configuration + * + * @return array + */ + public function getClientConfig() + { + return $this->clientConfig; + } + + /** + * Returns method used to place request + * + * @return string|int + */ + public function getMethod() + { + return (string)$this->method; + } + + /** + * Returns headers + * + * @return array + */ + public function getHeaders() + { + return $this->headers; + } + + /** + * Whether body should be encoded before place + * + * @return bool + */ + public function shouldEncode() + { + return (bool)$this->encode; + } + + /** + * Returns request body + * + * @return array + */ + public function getBody() + { + return $this->body; + } + + /** + * Returns URI + * + * @return string + */ + public function getUri() + { + return (string)$this->uri; + } +} diff --git a/app/code/Magento/Payment/Gateway/Http/TransferBuilderInterface.php b/app/code/Magento/Payment/Gateway/Http/TransferFactoryInterface.php similarity index 59% rename from app/code/Magento/Payment/Gateway/Http/TransferBuilderInterface.php rename to app/code/Magento/Payment/Gateway/Http/TransferFactoryInterface.php index b1a98abfa9af370c64c5e009ddda1185e917e3be..8a36ba9d1ca9186381ebd50fde4acc59edf9b83c 100644 --- a/app/code/Magento/Payment/Gateway/Http/TransferBuilderInterface.php +++ b/app/code/Magento/Payment/Gateway/Http/TransferFactoryInterface.php @@ -5,15 +5,13 @@ */ namespace Magento\Payment\Gateway\Http; -use Magento\Payment\Gateway\Http\TransferInterface; - -interface TransferBuilderInterface +interface TransferFactoryInterface { /** * Builds gateway transfer object * - * @param array $requestENV + * @param array $request * @return TransferInterface */ - public function build(array $requestENV); + public function create(array $request); } diff --git a/app/code/Magento/Payment/Gateway/Request/BuilderComposite.php b/app/code/Magento/Payment/Gateway/Request/BuilderComposite.php index 33e7df313156a02863e4c1db01d2ffeca9c35816..74395ff812d2513932228457cf5e40fcd14a1dc7 100644 --- a/app/code/Magento/Payment/Gateway/Request/BuilderComposite.php +++ b/app/code/Magento/Payment/Gateway/Request/BuilderComposite.php @@ -6,21 +6,29 @@ namespace Magento\Payment\Gateway\Request; use Magento\Framework\ObjectManager\TMap; +use Magento\Framework\ObjectManager\TMapFactory; class BuilderComposite implements BuilderInterface { /** - * @var BuilderInterface[] + * @var BuilderInterface[] | TMap */ private $builders; /** - * @param TMap $builders + * @param array $builders + * @param TMapFactory $tmapFactory */ public function __construct( - TMap $builders + array $builders, + TMapFactory $tmapFactory ) { - $this->builders = $builders; + $this->builders = $tmapFactory->create( + [ + 'array' => $builders, + 'type' => 'Magento\Payment\Gateway\Request\BuilderInterface' + ] + ); } /** diff --git a/app/code/Magento/Payment/Gateway/Response/HandlerChain.php b/app/code/Magento/Payment/Gateway/Response/HandlerChain.php index 91205ccc844a35733ca07ff903f6390bcba3c332..1425514e7e3fb87054fdb09690d49d53c0b52a72 100644 --- a/app/code/Magento/Payment/Gateway/Response/HandlerChain.php +++ b/app/code/Magento/Payment/Gateway/Response/HandlerChain.php @@ -6,21 +6,29 @@ namespace Magento\Payment\Gateway\Response; use Magento\Framework\ObjectManager\TMap; +use Magento\Framework\ObjectManager\TMapFactory; class HandlerChain implements HandlerInterface { /** - * @var HandlerInterface[] + * @var HandlerInterface[] | TMap */ private $handlers; /** - * @param TMap $handlers + * @param array $handlers + * @param TMapFactory $tmapFactory */ public function __construct( - TMap $handlers + array $handlers, + TMapFactory $tmapFactory ) { - $this->handlers = $handlers; + $this->handlers = $tmapFactory->create( + [ + 'array' => $handlers, + 'type' => 'Magento\Payment\Gateway\Response\HandlerInterface' + ] + ); } /** diff --git a/app/code/Magento/Payment/Gateway/Validator/AbstractValidator.php b/app/code/Magento/Payment/Gateway/Validator/AbstractValidator.php new file mode 100644 index 0000000000000000000000000000000000000000..e82e0605445a367d1bbf528989c2081393f35c2c --- /dev/null +++ b/app/code/Magento/Payment/Gateway/Validator/AbstractValidator.php @@ -0,0 +1,35 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Payment\Gateway\Validator; + +abstract class AbstractValidator implements ValidatorInterface +{ + /** + * @var ResultInterfaceFactory + */ + private $resultInterfaceFactory; + + /** + * @param ResultInterfaceFactory $resultFactory + */ + public function __construct( + ResultInterfaceFactory $resultFactory + ) { + $this->resultInterfaceFactory = $resultFactory; + } + + /** + * Factory method + * + * @param bool $isValid + * @param array $fails + * @return ResultInterface + */ + protected function createResult($isValid, array $fails = []) + { + return $this->resultInterfaceFactory->create(['isValid' => (bool)$isValid, 'failsDescription' => $fails]); + } +} diff --git a/app/code/Magento/Payment/Gateway/Validator/ValidatorComposite.php b/app/code/Magento/Payment/Gateway/Validator/ValidatorComposite.php index 6ee690a2500ee6e520656acc67c5a138ed8a3783..05a476f9743c12a930052fe27c4dfcb057e54ae5 100644 --- a/app/code/Magento/Payment/Gateway/Validator/ValidatorComposite.php +++ b/app/code/Magento/Payment/Gateway/Validator/ValidatorComposite.php @@ -6,12 +6,13 @@ namespace Magento\Payment\Gateway\Validator; use Magento\Framework\ObjectManager\TMap; +use Magento\Framework\ObjectManager\TMapFactory; use Magento\Payment\Gateway\Validator\ResultInterfaceFactory; class ValidatorComposite implements ValidatorInterface { /** - * @var ValidatorInterface[] + * @var ValidatorInterface[] | TMap */ private $validators; @@ -22,13 +23,20 @@ class ValidatorComposite implements ValidatorInterface /** * @param ResultInterfaceFactory $resultFactory - * @param TMap $validators + * @param array $validators + * @param TMapFactory $tmapFactory */ public function __construct( ResultInterfaceFactory $resultFactory, - TMap $validators + array $validators, + TMapFactory $tmapFactory ) { - $this->validators = $validators; + $this->validators = $tmapFactory->create( + [ + 'array' => $validators, + 'type' => 'Magento\Payment\Gateway\Validator\ValidatorInterface' + ] + ); $this->resultFactory = $resultFactory; } diff --git a/app/code/Magento/Payment/Gateway/Validator/ValidatorPool.php b/app/code/Magento/Payment/Gateway/Validator/ValidatorPool.php index c2f2b347de8acff129afbc85f596a16788961754..e2b746ea7334f480ef5fa3a83358081cea3289db 100644 --- a/app/code/Magento/Payment/Gateway/Validator/ValidatorPool.php +++ b/app/code/Magento/Payment/Gateway/Validator/ValidatorPool.php @@ -7,21 +7,29 @@ namespace Magento\Payment\Gateway\Validator; use Magento\Framework\Exception\NotFoundException; use Magento\Framework\ObjectManager\TMap; +use Magento\Framework\ObjectManager\TMapFactory; class ValidatorPool implements \Magento\Payment\Gateway\Validator\ValidatorPoolInterface { /** - * @var ValidatorInterface[] + * @var ValidatorInterface[] | TMap */ private $validators; /** - * @param TMap $validators + * @param array $validators + * @param TMapFactory $tmapFactory */ public function __construct( - TMap $validators + array $validators, + TMapFactory $tmapFactory ) { - $this->validators = $validators; + $this->validators = $tmapFactory->create( + [ + 'array' => $validators, + 'type' => 'Magento\Payment\Gateway\Validator\ValidatorInterface' + ] + ); } /** diff --git a/app/code/Magento/Payment/Model/IframeConfigProvider.php b/app/code/Magento/Payment/Model/IframeConfigProvider.php index a3a48f64f6205766194ecf4a94c7253d81eee099..03520b7b908e8ea642922fe58a67d2da751c0a37 100644 --- a/app/code/Magento/Payment/Model/IframeConfigProvider.php +++ b/app/code/Magento/Payment/Model/IframeConfigProvider.php @@ -21,6 +21,11 @@ use Psr\Log\LoggerInterface; */ class IframeConfigProvider implements ConfigProviderInterface { + /** + * Default length of Cc year field + */ + const DEFAULT_YEAR_LENGTH = 2; + /** * @var Repository */ @@ -92,6 +97,7 @@ class IframeConfigProvider implements ConfigProviderInterface 'cgiUrl' => [$this->methodCode => $this->getCgiUrl()], 'placeOrderUrl' => [$this->methodCode => $this->getPlaceOrderUrl()], 'saveOrderUrl' => [$this->methodCode => $this->getSaveOrderUrl()], + 'expireYearLength' => [$this->methodCode => $this->getExpireDateYearLength()] ] ] ]; @@ -115,6 +121,16 @@ class IframeConfigProvider implements ConfigProviderInterface return $result; } + /** + * Returns Cc expire year length + * + * @return int + */ + protected function getExpireDateYearLength() + { + return (int)$this->getMethodConfigData('cc_year_length') ?: self::DEFAULT_YEAR_LENGTH; + } + /** * Get map of cc_code, cc_num, cc_expdate for gateway * Returns json formatted string diff --git a/app/code/Magento/Payment/Model/Method/AbstractMethod.php b/app/code/Magento/Payment/Model/Method/AbstractMethod.php index c9bc85c757d5c71b4c5b423637ce17d9a3456346..441547499d81b937367dc408fda83270171d32e4 100644 --- a/app/code/Magento/Payment/Model/Method/AbstractMethod.php +++ b/app/code/Magento/Payment/Model/Method/AbstractMethod.php @@ -586,6 +586,7 @@ abstract class AbstractMethod extends \Magento\Framework\Model\AbstractExtensibl * @return $this * @throws \Magento\Framework\Exception\LocalizedException * @api + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function order(\Magento\Payment\Model\InfoInterface $payment, $amount) { @@ -603,6 +604,7 @@ abstract class AbstractMethod extends \Magento\Framework\Model\AbstractExtensibl * @return $this * @throws \Magento\Framework\Exception\LocalizedException * @api + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function authorize(\Magento\Payment\Model\InfoInterface $payment, $amount) { @@ -620,6 +622,7 @@ abstract class AbstractMethod extends \Magento\Framework\Model\AbstractExtensibl * @return $this * @throws \Magento\Framework\Exception\LocalizedException * @api + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function capture(\Magento\Payment\Model\InfoInterface $payment, $amount) { @@ -638,6 +641,7 @@ abstract class AbstractMethod extends \Magento\Framework\Model\AbstractExtensibl * @return $this * @throws \Magento\Framework\Exception\LocalizedException * @api + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function refund(\Magento\Payment\Model\InfoInterface $payment, $amount) { @@ -653,6 +657,7 @@ abstract class AbstractMethod extends \Magento\Framework\Model\AbstractExtensibl * @param \Magento\Framework\Object|InfoInterface $payment * @return $this * @api + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function cancel(\Magento\Payment\Model\InfoInterface $payment) { @@ -666,6 +671,7 @@ abstract class AbstractMethod extends \Magento\Framework\Model\AbstractExtensibl * @return $this * @throws \Magento\Framework\Exception\LocalizedException * @api + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function void(\Magento\Payment\Model\InfoInterface $payment) { @@ -692,6 +698,7 @@ abstract class AbstractMethod extends \Magento\Framework\Model\AbstractExtensibl * @return false * @throws \Magento\Framework\Exception\LocalizedException * @api + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function acceptPayment(InfoInterface $payment) { @@ -708,6 +715,7 @@ abstract class AbstractMethod extends \Magento\Framework\Model\AbstractExtensibl * @return false * @throws \Magento\Framework\Exception\LocalizedException * @api + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function denyPayment(InfoInterface $payment) { @@ -833,7 +841,11 @@ abstract class AbstractMethod extends \Magento\Framework\Model\AbstractExtensibl */ protected function _debug($debugData) { - $this->logger->debug($debugData, $this->getDebugReplacePrivateDataKeys(), $this->getDebugFlag()); + $this->logger->debug( + $debugData, + $this->getDebugReplacePrivateDataKeys(), + $this->getDebugFlag() + ); } /** diff --git a/app/code/Magento/Payment/Model/Method/Logger.php b/app/code/Magento/Payment/Model/Method/Logger.php index 107de086bb90d5ed63e45850d082f67700fbc19f..7e7331b77df73d9f87624d733167eed0b9cdff08 100644 --- a/app/code/Magento/Payment/Model/Method/Logger.php +++ b/app/code/Magento/Payment/Model/Method/Logger.php @@ -15,38 +15,73 @@ use Psr\Log\LoggerInterface; class Logger { const DEBUG_KEYS_MASK = '****'; + /** * @var LoggerInterface */ protected $logger; + /** + * @var \Magento\Payment\Gateway\ConfigInterface + */ + private $config; + /** * @param LoggerInterface $logger + * @param \Magento\Payment\Gateway\ConfigInterface $config */ - public function __construct(LoggerInterface $logger) - { + public function __construct( + LoggerInterface $logger, + \Magento\Payment\Gateway\ConfigInterface $config = null + ) { $this->logger = $logger; + $this->config = $config; } /** * Logs payment related information used for debug * * @param array $debugData - * @param array $debugReplaceKeys - * @param bool $debugFlag + * @param array|null $debugReplaceKeys + * @param bool|null $debugFlag * @return void */ - public function debug(array $debugData, array $debugReplaceKeys, $debugFlag) + public function debug(array $debugData, array $debugReplaceKeys = null, $debugFlag = null) { - if ($debugFlag == true && !empty($debugData) && !empty($debugReplaceKeys)) { - $debugData = $this->filterDebugData( - $debugData, - $debugReplaceKeys - ); + $debugReplaceKeys = $debugReplaceKeys !== null ? $debugReplaceKeys : $this->getDebugReplaceFields(); + $debugFlag = $debugFlag !== null ? $debugFlag : $this->isDebugOn(); + if ($debugFlag === true && !empty($debugData) && !empty($debugReplaceKeys)) { + $debugData = $this->filterDebugData( + $debugData, + $debugReplaceKeys + ); $this->logger->debug(var_export($debugData, true)); } } + /** + * Returns configured keys to be replaced with mask + * + * @return array + */ + private function getDebugReplaceFields() + { + if ($this->config->getValue('debugReplaceKeys')) { + return explode(',', $this->config->getValue('debugReplaceKeys')); + } + return []; + } + + /** + * Whether debug is enabled in configuration + * + * @return bool + */ + private function isDebugOn() + { + return (bool)$this->config->getValue('debug'); + } + /** * Recursive filter data by private conventions * diff --git a/app/code/Magento/Payment/Test/Unit/Gateway/Command/CommandPoolTest.php b/app/code/Magento/Payment/Test/Unit/Gateway/Command/CommandPoolTest.php index e39384caf7849e52bef212c734d5f88f76aed083..92394d8bb330ed66ed9fb6dc98f49666fb725155 100644 --- a/app/code/Magento/Payment/Test/Unit/Gateway/Command/CommandPoolTest.php +++ b/app/code/Magento/Payment/Test/Unit/Gateway/Command/CommandPoolTest.php @@ -13,9 +13,23 @@ class CommandPoolTest extends \PHPUnit_Framework_TestCase { $commandI = $this->getMockBuilder('Magento\Payment\Gateway\CommandInterface') ->getMockForAbstractClass(); + $tMapFactory = $this->getMockBuilder('Magento\Framework\ObjectManager\TMapFactory') + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); $tMap = $this->getMockBuilder('Magento\Framework\ObjectManager\TMap') ->disableOriginalConstructor() ->getMock(); + + $tMapFactory->expects(static::once()) + ->method('create') + ->with( + [ + 'array' => ['Magento\Payment\Gateway\CommandInterface'], + 'type' => 'Magento\Payment\Gateway\CommandInterface' + ] + ) + ->willReturn($tMap); $tMap->expects(static::once()) ->method('offsetExists') ->with('command') @@ -25,7 +39,7 @@ class CommandPoolTest extends \PHPUnit_Framework_TestCase ->with('command') ->willReturn($commandI); - $pool = new CommandPool($tMap); + $pool = new CommandPool(['Magento\Payment\Gateway\CommandInterface'], $tMapFactory); static::assertSame($commandI, $pool->get('command')); } @@ -33,15 +47,30 @@ class CommandPoolTest extends \PHPUnit_Framework_TestCase public function testGetException() { $this->setExpectedException('Magento\Framework\Exception\NotFoundException'); + + $tMapFactory = $this->getMockBuilder('Magento\Framework\ObjectManager\TMapFactory') + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); $tMap = $this->getMockBuilder('Magento\Framework\ObjectManager\TMap') ->disableOriginalConstructor() ->getMock(); + + $tMapFactory->expects(static::once()) + ->method('create') + ->with( + [ + 'array' => [], + 'type' => 'Magento\Payment\Gateway\CommandInterface' + ] + ) + ->willReturn($tMap); $tMap->expects(static::once()) ->method('offsetExists') ->with('command') ->willReturn(false); - $pool = new CommandPool($tMap); + $pool = new CommandPool([], $tMapFactory); $pool->get('command'); } } diff --git a/app/code/Magento/Payment/Test/Unit/Gateway/Command/GatewayCommandTest.php b/app/code/Magento/Payment/Test/Unit/Gateway/Command/GatewayCommandTest.php index 849138ac08114dc69b17ba59f76aa98115080a03..9872e20250bbe2d34c5375f22cbac5916e69cf3a 100644 --- a/app/code/Magento/Payment/Test/Unit/Gateway/Command/GatewayCommandTest.php +++ b/app/code/Magento/Payment/Test/Unit/Gateway/Command/GatewayCommandTest.php @@ -16,36 +16,44 @@ class GatewayCommandTest extends \PHPUnit_Framework_TestCase protected $requestBuilderMock; /** - * @var \Magento\Payment\Gateway\Http\TransferBuilderInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Payment\Gateway\Http\TransferFactoryInterface|\PHPUnit_Framework_MockObject_MockObject */ - protected $transferBuilderMock; + protected $transferFactoryMock; /** * @var \Magento\Payment\Gateway\Http\ClientInterface|\PHPUnit_Framework_MockObject_MockObject */ - protected $gatewayMock; + protected $clientMock; /** * @var \Magento\Payment\Gateway\Response\HandlerInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $responseHandlerMock; + /** + * @var \Magento\Payment\Gateway\Validator\ValidatorInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $validatorMock; + protected function setUp() { $this->requestBuilderMock = $this->getMockBuilder('Magento\Payment\Gateway\Request\BuilderInterface') ->getMockForAbstractClass(); - $this->transferBuilderMock = $this->getMockBuilder('Magento\Payment\Gateway\Http\TransferBuilderInterface') + $this->transferFactoryMock = $this->getMockBuilder('Magento\Payment\Gateway\Http\TransferFactoryInterface') ->getMockForAbstractClass(); - $this->gatewayMock = $this->getMockBuilder('Magento\Payment\Gateway\Http\ClientInterface') + $this->clientMock = $this->getMockBuilder('Magento\Payment\Gateway\Http\ClientInterface') ->getMockForAbstractClass(); $this->responseHandlerMock = $this->getMockBuilder('Magento\Payment\Gateway\Response\HandlerInterface') ->getMockForAbstractClass(); + $this->validatorMock = $this->getMockBuilder('Magento\Payment\Gateway\Validator\ValidatorInterface') + ->getMockForAbstractClass(); $this->model = new \Magento\Payment\Gateway\Command\GatewayCommand( $this->requestBuilderMock, - $this->transferBuilderMock, - $this->gatewayMock, - $this->responseHandlerMock + $this->transferFactoryMock, + $this->clientMock, + $this->responseHandlerMock, + $this->validatorMock ); } @@ -54,26 +62,35 @@ class GatewayCommandTest extends \PHPUnit_Framework_TestCase $commandSubject = ['authorize']; $request = ['request_field1' => 'request_value1', 'request_field2' => 'request_value2']; $response = ['response_field1' => 'response_value1']; + $validationResult = $this->getMockBuilder('Magento\Payment\Gateway\Validator\ResultInterface') + ->getMockForAbstractClass(); $transferO = $this->getMockBuilder('Magento\Payment\Gateway\Http\TransferInterface') ->getMockForAbstractClass(); - $this->requestBuilderMock->expects($this->once()) + $this->requestBuilderMock->expects(static::once()) ->method('build') ->with($commandSubject) ->willReturn($request); - $this->transferBuilderMock->expects($this->once()) - ->method('build') + $this->transferFactoryMock->expects(static::once()) + ->method('create') ->with($request) ->willReturn($transferO); - $this->gatewayMock->expects($this->once()) + $this->clientMock->expects(static::once()) ->method('placeRequest') ->with($transferO) ->willReturn($response); + $this->validatorMock->expects(static::once()) + ->method('validate') + ->with(array_merge($commandSubject, ['response' =>$response])) + ->willReturn($validationResult); + $validationResult->expects(static::once()) + ->method('isValid') + ->willReturn(true); - $this->responseHandlerMock->expects($this->once()) + $this->responseHandlerMock->expects(static::once()) ->method('handle') ->with($commandSubject, $response); diff --git a/app/code/Magento/Payment/Test/Unit/Gateway/Config/ValueHandlerPoolTest.php b/app/code/Magento/Payment/Test/Unit/Gateway/Config/ValueHandlerPoolTest.php index a10523f6496ce70ff9247ac11b89e7edf23d8101..266128b42f6f9ee21b26c83e5e3caf0187163998 100644 --- a/app/code/Magento/Payment/Test/Unit/Gateway/Config/ValueHandlerPoolTest.php +++ b/app/code/Magento/Payment/Test/Unit/Gateway/Config/ValueHandlerPoolTest.php @@ -12,14 +12,14 @@ class ValueHandlerPoolTest extends \PHPUnit_Framework_TestCase public function testConstructorException() { $this->setExpectedException('LogicException'); - $tMap = $this->getMockBuilder('Magento\Framework\ObjectManager\TMap') + $tMapFactory = $this->getMockBuilder('Magento\Framework\ObjectManager\TMapFactory') ->disableOriginalConstructor() + ->setMethods(['create']) ->getMock(); - $tMap->expects(static::once()) - ->method('offsetExists') - ->with(ValueHandlerPool::DEFAULT_HANDLER) - ->willReturn(false); - new ValueHandlerPool($tMap); + + $tMapFactory->expects(static::never()) + ->method('create'); + new ValueHandlerPool([], $tMapFactory); } public function testGet() @@ -30,10 +30,27 @@ class ValueHandlerPoolTest extends \PHPUnit_Framework_TestCase $someValueHandler = $this->getMockBuilder('Magento\Payment\Gateway\Config\ValueHandlerInterface') ->disableOriginalConstructor() ->getMockForAbstractClass(); + $tMapFactory = $this->getMockBuilder('Magento\Framework\ObjectManager\TMapFactory') + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); $tMap = $this->getMockBuilder('Magento\Framework\ObjectManager\TMap') ->disableOriginalConstructor() ->getMock(); - $tMap->expects(static::exactly(4)) + + $tMapFactory->expects(static::once()) + ->method('create') + ->with( + [ + 'array' => [ + ValueHandlerPool::DEFAULT_HANDLER => 'Magento\Payment\Gateway\Config\ValueHandlerInterface', + 'some_value' => 'Magento\Payment\Gateway\Config\ValueHandlerInterface' + ], + 'type' => 'Magento\Payment\Gateway\Config\ValueHandlerInterface' + ] + ) + ->willReturn($tMap); + $tMap->expects(static::exactly(3)) ->method('offsetExists') ->willReturnMap( [ @@ -50,7 +67,13 @@ class ValueHandlerPoolTest extends \PHPUnit_Framework_TestCase ] ); - $pool = new ValueHandlerPool($tMap); + $pool = new ValueHandlerPool( + [ + ValueHandlerPool::DEFAULT_HANDLER => 'Magento\Payment\Gateway\Config\ValueHandlerInterface', + 'some_value' => 'Magento\Payment\Gateway\Config\ValueHandlerInterface' + ], + $tMapFactory + ); static::assertSame($someValueHandler, $pool->get('some_value')); static::assertSame($defaultHandler, $pool->get(ValueHandlerPool::DEFAULT_HANDLER)); static::assertSame($defaultHandler, $pool->get('no_custom_logic_required')); diff --git a/app/code/Magento/Payment/Test/Unit/Gateway/Data/Order/AddressAdapterTest.php b/app/code/Magento/Payment/Test/Unit/Gateway/Data/Order/AddressAdapterTest.php index a31a859d54194ff9093018fef6c0d34d10fb199d..fc8ea141c1abe6641fd41caf6ea62cf74b90d200 100644 --- a/app/code/Magento/Payment/Test/Unit/Gateway/Data/Order/AddressAdapterTest.php +++ b/app/code/Magento/Payment/Test/Unit/Gateway/Data/Order/AddressAdapterTest.php @@ -32,8 +32,8 @@ class AddressAdapterTest extends \PHPUnit_Framework_TestCase public function testGetRegion() { $expected = 'California'; - $this->orderAddressMock->expects($this->once())->method('getRegion')->willReturn($expected); - $this->assertEquals($expected, $this->model->getRegion()); + $this->orderAddressMock->expects($this->once())->method('getRegionCode')->willReturn($expected); + $this->assertEquals($expected, $this->model->getRegionCode()); } public function testGetCountryId() diff --git a/app/code/Magento/Payment/Test/Unit/Gateway/Data/Quote/AddressAdapterTest.php b/app/code/Magento/Payment/Test/Unit/Gateway/Data/Quote/AddressAdapterTest.php index 5674f0eba1c82adf6c6e812ee4079d2953625e58..84ad8947b35ec0c74b9fda544c7d1d7a2016a636 100644 --- a/app/code/Magento/Payment/Test/Unit/Gateway/Data/Quote/AddressAdapterTest.php +++ b/app/code/Magento/Payment/Test/Unit/Gateway/Data/Quote/AddressAdapterTest.php @@ -32,8 +32,8 @@ class AddressAdapterTest extends \PHPUnit_Framework_TestCase public function testGetRegion() { $expected = 'California'; - $this->quoteAddressMock->expects($this->once())->method('getRegion')->willReturn($expected); - $this->assertEquals($expected, $this->model->getRegion()); + $this->quoteAddressMock->expects($this->once())->method('getRegionCode')->willReturn($expected); + $this->assertEquals($expected, $this->model->getRegionCode()); } public function testGetCountryId() diff --git a/app/code/Magento/Payment/Test/Unit/Gateway/Http/Client/ZendTest.php b/app/code/Magento/Payment/Test/Unit/Gateway/Http/Client/ZendTest.php index ec6e6a3e04af5b6d5ceae94cc7bd46edad4d25b0..43f2a400ccd77100161afbd5596ddf4fdbc7b8b1 100644 --- a/app/code/Magento/Payment/Test/Unit/Gateway/Http/Client/ZendTest.php +++ b/app/code/Magento/Payment/Test/Unit/Gateway/Http/Client/ZendTest.php @@ -39,6 +39,11 @@ class ZendTest extends \PHPUnit_Framework_TestCase */ protected $transferObjectMock; + /** + * @var \Magento\Payment\Model\Method\Logger|\PHPUnit_Framework_MockObject_MockObject + */ + protected $loggerMock; + protected function setUp() { $this->converterMock = $this->getMockBuilder('Magento\Payment\Gateway\Http\ConverterInterface') @@ -53,10 +58,14 @@ class ZendTest extends \PHPUnit_Framework_TestCase ->disableOriginalConstructor() ->getMock(); + $this->loggerMock = $this->getMockBuilder('Magento\Payment\Model\Method\Logger') + ->disableOriginalConstructor() + ->getMock(); + $this->transferObjectMock = $this->getMockBuilder('Magento\Payment\Gateway\Http\TransferInterface') ->getMockForAbstractClass(); - $this->model = new Zend($this->zendClientFactoryMock, $this->converterMock); + $this->model = new Zend($this->zendClientFactoryMock, $this->converterMock, $this->loggerMock); } public function testPlaceRequest() @@ -136,7 +145,7 @@ class ZendTest extends \PHPUnit_Framework_TestCase $this->transferObjectMock->expects($this->once())->method('getClientConfig')->willReturn($config); $this->transferObjectMock->expects($this->atLeastOnce())->method('getMethod')->willReturn($method); $this->transferObjectMock->expects($this->once())->method('getHeaders')->willReturn($headers); - $this->transferObjectMock->expects($this->once())->method('getBody')->willReturn($body); + $this->transferObjectMock->expects($this->atLeastOnce())->method('getBody')->willReturn($body); $this->transferObjectMock->expects($this->once())->method('shouldEncode')->willReturn($shouldEncode); $this->transferObjectMock->expects($this->once())->method('getUri')->willReturn($uri); diff --git a/app/code/Magento/Payment/Test/Unit/Gateway/Http/Converter/HtmlFormConverterTest.php b/app/code/Magento/Payment/Test/Unit/Gateway/Http/Converter/HtmlFormConverterTest.php new file mode 100644 index 0000000000000000000000000000000000000000..8f2792fe4b92bddc5b59b1320c52858c294193b9 --- /dev/null +++ b/app/code/Magento/Payment/Test/Unit/Gateway/Http/Converter/HtmlFormConverterTest.php @@ -0,0 +1,57 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Payment\Test\Unit\Gateway\Http\Converter; + +use Magento\Payment\Gateway\Http\Converter\HtmlFormConverter; + +class HtmlFormConverterTest extends \PHPUnit_Framework_TestCase +{ + public function testConvert() + { + $expectedResult = [ + 'parameter1' => 'val1', + 'parameter2' => 'val2', + 'parameter3' => 'val3' + ]; + + $converter = new HtmlFormConverter(); + static::assertEquals($expectedResult, $converter->convert($this->getValidFormHtml())); + } + + public function testConvertNotValidHtml() + { + $converter = new HtmlFormConverter(); + $converter->convert('Not html. Really not.'); + } + + /** + * Returns valid form HTML + * + * @return string + */ + private function getValidFormHtml() + { + return ' + <!DOCTYPE HTML> + <html> + <head> + <meta charset="utf-8"> + <title>Title</title> + </head> + <body> + + <form action="some"> + <p><input type="radio" name="parameter1" value="val1">val1<Br> + <input type="radio" name="parameter2" value="val2">val2<Br> + <input type="radio" name="parameter3" value="val3">val3</p> + <p><input type="submit"></p> + </form> + + </body> + </html> + '; + } +} diff --git a/app/code/Magento/Payment/Test/Unit/Gateway/Http/TransferTest.php b/app/code/Magento/Payment/Test/Unit/Gateway/Http/TransferTest.php new file mode 100644 index 0000000000000000000000000000000000000000..bdecd39bc83feffd20bcb00f45cc62115cb3622c --- /dev/null +++ b/app/code/Magento/Payment/Test/Unit/Gateway/Http/TransferTest.php @@ -0,0 +1,37 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Payment\Test\Unit\Gateway\Http; + +use Magento\Payment\Gateway\Http\Transfer; + +class TransferTest extends \PHPUnit_Framework_TestCase +{ + public function testIO() + { + $clientConfig = ['config']; + $headers = ['Header']; + $body = ['data', 'data2']; + $method = 'POST'; + $uri = 'https://gateway.com'; + $encode = false; + + $transfer = new Transfer( + $clientConfig, + $headers, + $body, + $method, + $uri, + $encode + ); + + static::assertSame($clientConfig, $transfer->getClientConfig()); + static::assertSame($headers, $transfer->getHeaders()); + static::assertSame($body, $transfer->getBody()); + static::assertSame($method, $transfer->getMethod()); + static::assertSame($uri, $transfer->getUri()); + static::assertSame($encode, $transfer->shouldEncode()); + } +} diff --git a/app/code/Magento/Payment/Test/Unit/Gateway/Request/BuilderCompositeTest.php b/app/code/Magento/Payment/Test/Unit/Gateway/Request/BuilderCompositeTest.php index 39d9339d2d93402eee7865cd31b946dfd1097ac3..e1e5ea547456a76f23629322b483718b5cf98e61 100644 --- a/app/code/Magento/Payment/Test/Unit/Gateway/Request/BuilderCompositeTest.php +++ b/app/code/Magento/Payment/Test/Unit/Gateway/Request/BuilderCompositeTest.php @@ -11,13 +11,28 @@ class BuilderCompositeTest extends \PHPUnit_Framework_TestCase { public function testBuildEmpty() { + $tMapFactory = $this->getMockBuilder('Magento\Framework\ObjectManager\TMapFactory') + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); $tMap = $this->getMockBuilder('Magento\Framework\ObjectManager\TMap') ->disableOriginalConstructor() ->getMock(); + + $tMapFactory->expects(static::once()) + ->method('create') + ->with( + [ + 'array' => [], + 'type' => 'Magento\Payment\Gateway\Request\BuilderInterface' + ] + ) + ->willReturn($tMap); $tMap->expects(static::once()) ->method('getIterator') ->willReturn(new \ArrayIterator([])); - $builder = new BuilderComposite($tMap); + + $builder = new BuilderComposite([], $tMapFactory); static::assertEquals([], $builder->build([])); } @@ -27,12 +42,18 @@ class BuilderCompositeTest extends \PHPUnit_Framework_TestCase 'user' => 'Mrs G. Crump', 'url' => 'https://url.in', 'amount' => 10.00, - 'currecy' => 'pound', + 'currency' => 'pound', 'address' => '46 Egernon Crescent', 'item' => 'gas cooker', 'quantity' => 1 ]; - + $tMapFactory = $this->getMockBuilder('Magento\Framework\ObjectManager\TMapFactory') + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + $tMap = $this->getMockBuilder('Magento\Framework\ObjectManager\TMap') + ->disableOriginalConstructor() + ->getMock(); $customerBuilder = $this->getMockBuilder('Magento\Payment\Gateway\Request\BuilderInterface') ->getMockForAbstractClass(); $productBuilder = $this->getMockBuilder('Magento\Payment\Gateway\Request\BuilderInterface') @@ -53,7 +74,7 @@ class BuilderCompositeTest extends \PHPUnit_Framework_TestCase ->willReturn( [ 'amount' => 10.00, - 'currecy' => 'pound', + 'currency' => 'pound', 'item' => 'gas cooker', 'quantity' => 1 ] @@ -66,14 +87,31 @@ class BuilderCompositeTest extends \PHPUnit_Framework_TestCase ] ); - $tMap = $this->getMockBuilder('Magento\Framework\ObjectManager\TMap') - ->disableOriginalConstructor() - ->getMock(); + $tMapFactory->expects(static::once()) + ->method('create') + ->with( + [ + 'array' => [ + 'customer' => 'Magento\Payment\Gateway\Request\BuilderInterface', + 'product' => 'Magento\Payment\Gateway\Request\BuilderInterface', + 'magento' => 'Magento\Payment\Gateway\Request\BuilderInterface' + ], + 'type' => 'Magento\Payment\Gateway\Request\BuilderInterface' + ] + ) + ->willReturn($tMap); $tMap->expects(static::once()) ->method('getIterator') ->willReturn(new \ArrayIterator([$customerBuilder, $productBuilder, $magentoBuilder])); - $builder = new BuilderComposite($tMap); + $builder = new BuilderComposite( + [ + 'customer' => 'Magento\Payment\Gateway\Request\BuilderInterface', + 'product' => 'Magento\Payment\Gateway\Request\BuilderInterface', + 'magento' => 'Magento\Payment\Gateway\Request\BuilderInterface' + ], + $tMapFactory + ); static::assertEquals($expectedRequest, $builder->build([])); } diff --git a/app/code/Magento/Payment/Test/Unit/Gateway/Response/HandlerChainTest.php b/app/code/Magento/Payment/Test/Unit/Gateway/Response/HandlerChainTest.php index 716fe3246ae1d8fa17f6d051e1babd42ddf2779e..c65a826a2624d79adff61fac919ce47385fac6ac 100644 --- a/app/code/Magento/Payment/Test/Unit/Gateway/Response/HandlerChainTest.php +++ b/app/code/Magento/Payment/Test/Unit/Gateway/Response/HandlerChainTest.php @@ -15,10 +15,26 @@ class HandlerChainTest extends \PHPUnit_Framework_TestCase ->getMockForAbstractClass(); $handler2 = $this->getMockBuilder('Magento\Payment\Gateway\Response\HandlerInterface') ->getMockForAbstractClass(); - + $tMapFactory = $this->getMockBuilder('Magento\Framework\ObjectManager\TMapFactory') + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); $tMap = $this->getMockBuilder('Magento\Framework\ObjectManager\TMap') ->disableOriginalConstructor() ->getMock(); + + $tMapFactory->expects(static::once()) + ->method('create') + ->with( + [ + 'array' => [ + 'handler1' => 'Magento\Payment\Gateway\Response\HandlerInterface', + 'handler2' => 'Magento\Payment\Gateway\Response\HandlerInterface' + ], + 'type' => 'Magento\Payment\Gateway\Response\HandlerInterface' + ] + ) + ->willReturn($tMap); $tMap->expects(static::once()) ->method('getIterator') ->willReturn(new \ArrayIterator([$handler1, $handler2])); @@ -32,7 +48,13 @@ class HandlerChainTest extends \PHPUnit_Framework_TestCase ->method('handle') ->with($handlingSubject, $response); - $chain = new HandlerChain($tMap); + $chain = new HandlerChain( + [ + 'handler1' => 'Magento\Payment\Gateway\Response\HandlerInterface', + 'handler2' => 'Magento\Payment\Gateway\Response\HandlerInterface' + ], + $tMapFactory + ); $chain->handle($handlingSubject, $response); } } diff --git a/app/code/Magento/Payment/Test/Unit/Gateway/Validator/ValidatorCompositeTest.php b/app/code/Magento/Payment/Test/Unit/Gateway/Validator/ValidatorCompositeTest.php index 9150e83f0e7363cee65f589cbb8980728f7ac580..8528b65ac6cecf91bd5603009334a0b47f216137 100644 --- a/app/code/Magento/Payment/Test/Unit/Gateway/Validator/ValidatorCompositeTest.php +++ b/app/code/Magento/Payment/Test/Unit/Gateway/Validator/ValidatorCompositeTest.php @@ -16,10 +16,26 @@ class ValidatorCompositeTest extends \PHPUnit_Framework_TestCase ->getMockForAbstractClass(); $validator2 = $this->getMockBuilder('Magento\Payment\Gateway\Validator\ValidatorInterface') ->getMockForAbstractClass(); - + $tMapFactory = $this->getMockBuilder('Magento\Framework\ObjectManager\TMapFactory') + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); $tMap = $this->getMockBuilder('Magento\Framework\ObjectManager\TMap') ->disableOriginalConstructor() ->getMock(); + + $tMapFactory->expects(static::once()) + ->method('create') + ->with( + [ + 'array' => [ + 'validator1' => 'Magento\Payment\Gateway\Validator\ValidatorInterface', + 'validator2' => 'Magento\Payment\Gateway\Validator\ValidatorInterface' + ], + 'type' => 'Magento\Payment\Gateway\Validator\ValidatorInterface' + ] + ) + ->willReturn($tMap); $tMap->expects(static::once()) ->method('getIterator') ->willReturn(new \ArrayIterator([$validator1, $validator2])); @@ -64,7 +80,14 @@ class ValidatorCompositeTest extends \PHPUnit_Framework_TestCase ->willReturn($compositeResult); - $validatorComposite = new ValidatorComposite($resultFactory, $tMap); + $validatorComposite = new ValidatorComposite( + $resultFactory, + [ + 'validator1' => 'Magento\Payment\Gateway\Validator\ValidatorInterface', + 'validator2' => 'Magento\Payment\Gateway\Validator\ValidatorInterface' + ], + $tMapFactory + ); static::assertSame($compositeResult, $validatorComposite->validate($validationSubject)); } } diff --git a/app/code/Magento/Payment/Test/Unit/Gateway/Validator/ValidatorPoolTest.php b/app/code/Magento/Payment/Test/Unit/Gateway/Validator/ValidatorPoolTest.php index c48aca93d6e370462cce2ce0824c5d3927baef56..becc387fab2d91b86cc6ba3b13954c8c0c29ae05 100644 --- a/app/code/Magento/Payment/Test/Unit/Gateway/Validator/ValidatorPoolTest.php +++ b/app/code/Magento/Payment/Test/Unit/Gateway/Validator/ValidatorPoolTest.php @@ -16,6 +16,20 @@ class ValidatorPoolTest extends \PHPUnit_Framework_TestCase $tMap = $this->getMockBuilder('Magento\Framework\ObjectManager\TMap') ->disableOriginalConstructor() ->getMock(); + $tMapFactory = $this->getMockBuilder('Magento\Framework\ObjectManager\TMapFactory') + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + + $tMapFactory->expects(static::once()) + ->method('create') + ->with( + [ + 'array' => ['validator' => 'Magento\Payment\Gateway\Validator\ValidatorInterface'], + 'type' => 'Magento\Payment\Gateway\Validator\ValidatorInterface' + ] + ) + ->willReturn($tMap); $tMap->expects(static::once()) ->method('offsetExists') ->with('validator') @@ -25,7 +39,10 @@ class ValidatorPoolTest extends \PHPUnit_Framework_TestCase ->with('validator') ->willReturn($commandI); - $pool = new ValidatorPool($tMap); + $pool = new ValidatorPool( + ['validator' => 'Magento\Payment\Gateway\Validator\ValidatorInterface'], + $tMapFactory + ); static::assertSame($commandI, $pool->get('validator')); } @@ -33,15 +50,30 @@ class ValidatorPoolTest extends \PHPUnit_Framework_TestCase public function testGetException() { $this->setExpectedException('Magento\Framework\Exception\NotFoundException'); + + $tMapFactory = $this->getMockBuilder('Magento\Framework\ObjectManager\TMapFactory') + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); $tMap = $this->getMockBuilder('Magento\Framework\ObjectManager\TMap') ->disableOriginalConstructor() ->getMock(); + + $tMapFactory->expects(static::once()) + ->method('create') + ->with( + [ + 'array' => [], + 'type' => 'Magento\Payment\Gateway\Validator\ValidatorInterface' + ] + ) + ->willReturn($tMap); $tMap->expects(static::once()) ->method('offsetExists') ->with('validator') ->willReturn(false); - $pool = new ValidatorPool($tMap); + $pool = new ValidatorPool([], $tMapFactory); $pool->get('validator'); } } diff --git a/app/code/Magento/Payment/composer.json b/app/code/Magento/Payment/composer.json index 87f3a9ef1cd080f2b0da3e1e42532f71dc39d4b4..b78f45d789049bbd5d2a03a892e688dbd0d40535 100644 --- a/app/code/Magento/Payment/composer.json +++ b/app/code/Magento/Payment/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-config": "0.74.0-beta13", - "magento/module-store": "0.74.0-beta13", - "magento/module-sales": "0.74.0-beta13", - "magento/module-checkout": "0.74.0-beta13", - "magento/module-quote": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-config": "0.74.0-beta14", + "magento/module-store": "0.74.0-beta14", + "magento/module-sales": "0.74.0-beta14", + "magento/module-checkout": "0.74.0-beta14", + "magento/module-quote": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Payment/etc/payment.xml b/app/code/Magento/Payment/etc/payment.xml index b034e1695e0641056899daeaddb112e4bc47c454..5560a70f11b325ea8d12a85ec5fd2582b29593f1 100644 --- a/app/code/Magento/Payment/etc/payment.xml +++ b/app/code/Magento/Payment/etc/payment.xml @@ -32,5 +32,17 @@ <type id="OT" order="1000"> <label>Other</label> </type> + <type id="DN" order="60"> + <label>Diners</label> + </type> + <type id="JC" order="70"> + <label>JCB</label> + </type> + <type id="MI" order="80"> + <label>Maestro International</label> + </type> + <type id="MD" order="100"> + <label>Maestro Domestic</label> + </type> </credit_cards> </payment> diff --git a/app/code/Magento/Payment/view/adminhtml/templates/transparent/form.phtml b/app/code/Magento/Payment/view/adminhtml/templates/transparent/form.phtml index e9632aa0f89155238a8a659b660687a2bc4ce743..c6a429a0fbe08f624c53f03d7998879281dfde27 100644 --- a/app/code/Magento/Payment/view/adminhtml/templates/transparent/form.phtml +++ b/app/code/Magento/Payment/view/adminhtml/templates/transparent/form.phtml @@ -22,6 +22,7 @@ $code = $block->getMethodCode(); "cardFieldsMap":<?php echo $block->getCardFieldsMap() ?>, "orderSaveUrl":"<?php echo $block->getOrderUrl() ?>", "cgiUrl":"<?php echo $block->getCgiUrl() ?>", + "expireYearLength":"<?php echo $block->getMethodConfigData('cc_year_length') ?>", "nativeAction":"<?php echo $block->getUrl('*/*/save', ['_secure' => $block->getRequest()->isSecure()]) ?>" }, "validation":[]}' style="display:none;"> diff --git a/app/code/Magento/Payment/view/adminhtml/web/transparent.js b/app/code/Magento/Payment/view/adminhtml/web/transparent.js index 1317880d7f062c08ebe1c1fee96be951796b1a53..7edbb30c6318ffd45339c6b55b3b612067f76b62 100644 --- a/app/code/Magento/Payment/view/adminhtml/web/transparent.js +++ b/app/code/Magento/Payment/view/adminhtml/web/transparent.js @@ -23,7 +23,8 @@ define([ controller: null, gateway: null, dateDelim: null, - cardFieldsMap: null + cardFieldsMap: null, + expireYearLength: 2 }, _create: function() { @@ -52,6 +53,9 @@ define([ */ _orderSave: function() { var postData = "form_key="+FORM_KEY; + postData += '&cc_type=' + this.element.find( + '[data-container="' + this.options.gateway + '-cc-type"]' + ).val(); $.ajax({ url: this.options.orderSaveUrl, type: 'post', @@ -135,8 +139,8 @@ define([ this.element.find('[data-container="' + this.options.gateway + '-cc-month"]').val() , 10 ); - if (year.length > 2) { - year = year.substring(2); + if (year.length > this.options.expireYearLength) { + year = year.substring(year.length - this.options.expireYearLength); } if (month < 10) { month = '0' + month; diff --git a/app/code/Magento/Payment/view/frontend/web/js/view/review/actions/iframe.js b/app/code/Magento/Payment/view/frontend/web/js/view/review/actions/iframe.js index a5a78d731cfeac57b02fc28ff488534ea733a1cd..5349dab7b4d93202a4dec1f9924de97d0c564645 100644 --- a/app/code/Magento/Payment/view/frontend/web/js/view/review/actions/iframe.js +++ b/app/code/Magento/Payment/view/frontend/web/js/view/review/actions/iframe.js @@ -39,6 +39,9 @@ define( }, originalPlaceOrder: function(parent) { return parent.placeOrder.bind(parent); + }, + getExpireYearLength: function(parent) { + return window.checkoutConfig.payment.iframe.expireYearLength[this.getCode()]; } }); } diff --git a/app/code/Magento/Payment/view/frontend/web/template/review/actions/iframe.html b/app/code/Magento/Payment/view/frontend/web/template/review/actions/iframe.html index cd9c3342c733f9cd2f4cf3e656b533ccb7b5e655..df5212f51e03f9a2b54332ca117c38d7abb0d5ba 100644 --- a/app/code/Magento/Payment/view/frontend/web/template/review/actions/iframe.html +++ b/app/code/Magento/Payment/view/frontend/web/template/review/actions/iframe.html @@ -14,7 +14,8 @@ 'cgiUrl': getCgiUrl(), 'dateDelim': getDateDelim(), 'cardFieldsMap': getCardFieldsMap(), - 'nativeAction': getSaveOrderUrl() + 'nativeAction': getSaveOrderUrl(), + 'expireYearLength': getExpireYearLength() }, 'validation':[]}"> <!-- ko with: getCcFormView() --> <!-- ko template: getTemplate() --><!-- /ko --> diff --git a/app/code/Magento/Payment/view/frontend/web/transparent.js b/app/code/Magento/Payment/view/frontend/web/transparent.js index 570772d6d430c67d6dcd4ea10325fade6d3407b0..6394cf38fee739a4667b1845efc4e11f4582b913 100644 --- a/app/code/Magento/Payment/view/frontend/web/transparent.js +++ b/app/code/Magento/Payment/view/frontend/web/transparent.js @@ -28,7 +28,8 @@ define([ controller: null, gateway: null, dateDelim: null, - cardFieldsMap: null + cardFieldsMap: null, + expireYearLength: 2 }, _create: function() { @@ -60,6 +61,10 @@ define([ postData += '&' + $(this.options.reviewAgreementForm).serialize(); } postData += '&controller=' + this.options.controller; + postData += '&cc_type=' + this.element.find( + '[data-container="' + this.options.gateway + '-cc-type"]' + ).val(); + $.ajax({ url: this.options.orderSaveUrl, type: 'post', @@ -140,9 +145,10 @@ define([ this.element.find('[data-container="' + this.options.gateway + '-cc-month"]').val(), 10 ); - if (year.length > 2) { - year = year.substring(2); + if (year.length > this.options.expireYearLength) { + year = year.substring(year.length - this.options.expireYearLength); } + if (month < 10) { month = '0' + month; } diff --git a/app/code/Magento/Persistent/composer.json b/app/code/Magento/Persistent/composer.json index 379f16a66b2f4879c1c315c5a33c6d93cd69f64b..b81c38561e3dfc1e24c9565dec1988e79ff43715 100644 --- a/app/code/Magento/Persistent/composer.json +++ b/app/code/Magento/Persistent/composer.json @@ -3,17 +3,17 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta13", - "magento/module-checkout": "0.74.0-beta13", - "magento/module-customer": "0.74.0-beta13", - "magento/module-cron": "0.74.0-beta13", - "magento/module-page-cache": "0.74.0-beta13", - "magento/module-quote": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-store": "0.74.0-beta14", + "magento/module-checkout": "0.74.0-beta14", + "magento/module-customer": "0.74.0-beta14", + "magento/module-cron": "0.74.0-beta14", + "magento/module-page-cache": "0.74.0-beta14", + "magento/module-quote": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/ProductAlert/composer.json b/app/code/Magento/ProductAlert/composer.json index 3e993546d08a901e3e7f7feda86c18e19e2cfd7e..715f9607506075b3e7fd70a2f1f691c63f78f3f5 100644 --- a/app/code/Magento/ProductAlert/composer.json +++ b/app/code/Magento/ProductAlert/composer.json @@ -3,14 +3,14 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta13", - "magento/module-catalog": "0.74.0-beta13", - "magento/module-customer": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-store": "0.74.0-beta14", + "magento/module-catalog": "0.74.0-beta14", + "magento/module-customer": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Quote/Api/Data/CartInterface.php b/app/code/Magento/Quote/Api/Data/CartInterface.php index 64eb62f72a2a7590ecd9decc93d7fdeae5033576..a663618a0b81fba68dca3b123ee9f0b43466e243 100644 --- a/app/code/Magento/Quote/Api/Data/CartInterface.php +++ b/app/code/Magento/Quote/Api/Data/CartInterface.php @@ -54,6 +54,8 @@ interface CartInterface extends \Magento\Framework\Api\ExtensibleDataInterface const KEY_CUSTOMER_TAX_CLASS_ID = 'customer_tax_class_id'; + const KEY_STORE_ID = 'store_id'; + /**#@-*/ /** @@ -350,6 +352,21 @@ interface CartInterface extends \Magento\Framework\Api\ExtensibleDataInterface */ public function setCustomerTaxClassId($customerTaxClassId); + /** + * Get store identifier + * + * @return int + */ + public function getStoreId(); + + /** + * Sets store identifier + * + * @param int $storeId + * @return $this + */ + public function setStoreId($storeId); + /** * Retrieve existing extension attributes object or create a new one. * diff --git a/app/code/Magento/Quote/Model/BillingAddressManagement.php b/app/code/Magento/Quote/Model/BillingAddressManagement.php index 193232fdb2571c685440e5a6e18542ea37a17c92..c710b56797f9008902381457c7f9719967e805ea 100644 --- a/app/code/Magento/Quote/Model/BillingAddressManagement.php +++ b/app/code/Magento/Quote/Model/BillingAddressManagement.php @@ -67,6 +67,7 @@ class BillingAddressManagement implements BillingAddressManagementInterface public function assign($cartId, \Magento\Quote\Api\Data\AddressInterface $address, $useForShipping = false) { $quote = $this->quoteRepository->getActive($cartId); + $this->addressValidator->validate($address); $customerAddressId = $address->getCustomerAddressId(); $shippingAddress = null; diff --git a/app/code/Magento/Quote/Model/Quote.php b/app/code/Magento/Quote/Model/Quote.php index 95fa91f6c6c5c29de29ac69cdb491cacef11ee76..2dd5c4ca3add051bb7c518b939e8a1011e098a10 100644 --- a/app/code/Magento/Quote/Model/Quote.php +++ b/app/code/Magento/Quote/Model/Quote.php @@ -28,7 +28,6 @@ use Magento\Framework\Api\ExtensionAttribute\JoinProcessorInterface; * sales_quote_delete_before * sales_quote_delete_after * - * @method Quote setStoreId(int $value) * @method int getIsMultiShipping() * @method Quote setIsMultiShipping(int $value) * @method float getStoreToBaseRate() @@ -687,16 +686,23 @@ class Quote extends AbstractExtensibleModel implements \Magento\Quote\Api\Data\C //@codeCoverageIgnoreEnd /** - * Get quote store identifier - * - * @return int + * {@inheritdoc} */ public function getStoreId() { if (!$this->hasStoreId()) { return $this->_storeManager->getStore()->getId(); } - return $this->_getData('store_id'); + return (int)$this->_getData(self::KEY_STORE_ID); + } + + /** + * {@inheritdoc} + */ + public function setStoreId($storeId) + { + $this->setData(self::KEY_STORE_ID, (int)$storeId); + return $this; } /** diff --git a/app/code/Magento/Quote/Model/Quote/Payment.php b/app/code/Magento/Quote/Model/Quote/Payment.php index bb98b0d85ca3ac9d216eddcfac9a52f661249c4b..04f583d1c25b950c9cc5bc24b65cdaca9ee08233 100644 --- a/app/code/Magento/Quote/Model/Quote/Payment.php +++ b/app/code/Magento/Quote/Model/Quote/Payment.php @@ -5,6 +5,8 @@ */ namespace Magento\Quote\Model\Quote; +use Magento\Payment\Model\Method\AbstractMethod; + /** * Quote payment information * @@ -209,7 +211,7 @@ class Payment extends \Magento\Payment\Model\Info implements \Magento\Quote\Api\ public function getOrderPlaceRedirectUrl() { $method = $this->getMethodInstance(); - if ($method) { + if ($method && $method instanceof AbstractMethod) { return $method->getOrderPlaceRedirectUrl(); } return ''; diff --git a/app/code/Magento/Quote/Test/Unit/Model/QuoteRepositoryTest.php b/app/code/Magento/Quote/Test/Unit/Model/QuoteRepositoryTest.php index 872cfa989fbdaf24a559265014aa37c6f650de5b..04e919863d29a21a350fd731ccecfe4ed0db00ed 100644 --- a/app/code/Magento/Quote/Test/Unit/Model/QuoteRepositoryTest.php +++ b/app/code/Magento/Quote/Test/Unit/Model/QuoteRepositoryTest.php @@ -133,7 +133,7 @@ class QuoteRepositoryTest extends \PHPUnit_Framework_TestCase $this->quoteFactoryMock->expects($this->once())->method('create')->willReturn($this->quoteMock); $this->storeManagerMock->expects($this->once())->method('getStore')->willReturn($this->storeMock); - $this->storeMock->expects($this->once())->method('getId')->willReturn($this->storeMock); + $this->storeMock->expects($this->once())->method('getId')->willReturn(1); $this->quoteMock->expects($this->never())->method('setSharedStoreIds'); $this->quoteMock->expects($this->once()) ->method('load') @@ -150,7 +150,7 @@ class QuoteRepositoryTest extends \PHPUnit_Framework_TestCase $this->quoteFactoryMock->expects($this->once())->method('create')->willReturn($this->quoteMock); $this->storeManagerMock->expects($this->once())->method('getStore')->willReturn($this->storeMock); - $this->storeMock->expects($this->once())->method('getId')->willReturn($this->storeMock); + $this->storeMock->expects($this->once())->method('getId')->willReturn(1); $this->quoteMock->expects($this->never())->method('setSharedStoreIds'); $this->quoteMock->expects($this->once()) ->method('load') @@ -169,7 +169,7 @@ class QuoteRepositoryTest extends \PHPUnit_Framework_TestCase $this->quoteFactoryMock->expects($this->once())->method('create')->willReturn($this->quoteMock); $this->storeManagerMock->expects($this->once())->method('getStore')->willReturn($this->storeMock); - $this->storeMock->expects($this->once())->method('getId')->willReturn($this->storeMock); + $this->storeMock->expects($this->once())->method('getId')->willReturn(1); $this->quoteMock->expects($this->once()) ->method('setSharedStoreIds') ->with($sharedStoreIds) @@ -191,7 +191,7 @@ class QuoteRepositoryTest extends \PHPUnit_Framework_TestCase $this->quoteFactoryMock->expects($this->once())->method('create')->willReturn($this->quoteMock); $this->storeManagerMock->expects($this->once())->method('getStore')->willReturn($this->storeMock); - $this->storeMock->expects($this->once())->method('getId')->willReturn($this->storeMock); + $this->storeMock->expects($this->once())->method('getId')->willReturn(1); $this->quoteMock->expects($this->never())->method('setSharedStoreIds'); $this->quoteMock->expects($this->once()) ->method('loadByCustomer') @@ -213,7 +213,7 @@ class QuoteRepositoryTest extends \PHPUnit_Framework_TestCase $this->quoteFactoryMock->expects($this->once())->method('create')->willReturn($this->quoteMock); $this->storeManagerMock->expects($this->once())->method('getStore')->willReturn($this->storeMock); - $this->storeMock->expects($this->once())->method('getId')->willReturn($this->storeMock); + $this->storeMock->expects($this->once())->method('getId')->willReturn(1); $this->quoteMock->expects($this->never())->method('setSharedStoreIds'); $this->quoteMock->expects($this->once()) ->method('load') @@ -235,7 +235,7 @@ class QuoteRepositoryTest extends \PHPUnit_Framework_TestCase $this->quoteFactoryMock->expects($this->once())->method('create')->willReturn($this->quoteMock); $this->storeManagerMock->expects($this->once())->method('getStore')->willReturn($this->storeMock); - $this->storeMock->expects($this->once())->method('getId')->willReturn($this->storeMock); + $this->storeMock->expects($this->once())->method('getId')->willReturn(1); $this->quoteMock->expects($this->never())->method('setSharedStoreIds'); $this->quoteMock->expects($this->once()) ->method('load') @@ -253,7 +253,7 @@ class QuoteRepositoryTest extends \PHPUnit_Framework_TestCase $this->quoteFactoryMock->expects($this->once())->method('create')->willReturn($this->quoteMock); $this->storeManagerMock->expects($this->once())->method('getStore')->willReturn($this->storeMock); - $this->storeMock->expects($this->once())->method('getId')->willReturn($this->storeMock); + $this->storeMock->expects($this->once())->method('getId')->willReturn(1); $this->quoteMock->expects($this->never())->method('setSharedStoreIds'); $this->quoteMock->expects($this->once()) ->method('load') @@ -273,7 +273,7 @@ class QuoteRepositoryTest extends \PHPUnit_Framework_TestCase $this->quoteFactoryMock->expects($this->once())->method('create')->willReturn($this->quoteMock); $this->storeManagerMock->expects($this->once())->method('getStore')->willReturn($this->storeMock); - $this->storeMock->expects($this->once())->method('getId')->willReturn($this->storeMock); + $this->storeMock->expects($this->once())->method('getId')->willReturn(1); $this->quoteMock->expects($this->once()) ->method('setSharedStoreIds') ->with($sharedStoreIds) @@ -296,7 +296,7 @@ class QuoteRepositoryTest extends \PHPUnit_Framework_TestCase $this->quoteFactoryMock->expects($this->once())->method('create')->willReturn($this->quoteMock); $this->storeManagerMock->expects($this->once())->method('getStore')->willReturn($this->storeMock); - $this->storeMock->expects($this->once())->method('getId')->willReturn($this->storeMock); + $this->storeMock->expects($this->once())->method('getId')->willReturn(1); $this->quoteMock->expects($this->never())->method('setSharedStoreIds'); $this->quoteMock->expects($this->once()) ->method('loadByCustomer') diff --git a/app/code/Magento/Quote/composer.json b/app/code/Magento/Quote/composer.json index f58331308612ac84cf4b8e0e7a42328671b2450e..05d09f86f706c1689b7d04bf1f05527d584c2ff2 100644 --- a/app/code/Magento/Quote/composer.json +++ b/app/code/Magento/Quote/composer.json @@ -3,26 +3,26 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta13", - "magento/module-catalog": "0.74.0-beta13", - "magento/module-catalog-rule": "0.74.0-beta13", - "magento/module-customer": "0.74.0-beta13", - "magento/module-checkout": "0.74.0-beta13", - "magento/module-authorization": "0.74.0-beta13", - "magento/module-payment": "0.74.0-beta13", - "magento/module-sales": "0.74.0-beta13", - "magento/module-shipping": "0.74.0-beta13", - "magento/module-sales-sequence": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/module-directory": "0.74.0-beta13", - "magento/module-eav": "0.74.0-beta13", - "magento/module-tax": "0.74.0-beta13", - "magento/module-catalog-inventory": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-store": "0.74.0-beta14", + "magento/module-catalog": "0.74.0-beta14", + "magento/module-catalog-rule": "0.74.0-beta14", + "magento/module-customer": "0.74.0-beta14", + "magento/module-checkout": "0.74.0-beta14", + "magento/module-authorization": "0.74.0-beta14", + "magento/module-payment": "0.74.0-beta14", + "magento/module-sales": "0.74.0-beta14", + "magento/module-shipping": "0.74.0-beta14", + "magento/module-sales-sequence": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/module-directory": "0.74.0-beta14", + "magento/module-eav": "0.74.0-beta14", + "magento/module-tax": "0.74.0-beta14", + "magento/module-catalog-inventory": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Reports/composer.json b/app/code/Magento/Reports/composer.json index 099550f07e1ea5ec1812cf7466c1f75732a52e60..89ac5cea8d624dd0d8c836196cda54c80b9daa21 100644 --- a/app/code/Magento/Reports/composer.json +++ b/app/code/Magento/Reports/composer.json @@ -3,28 +3,28 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-config": "0.74.0-beta13", - "magento/module-store": "0.74.0-beta13", - "magento/module-eav": "0.74.0-beta13", - "magento/module-customer": "0.74.0-beta13", - "magento/module-catalog": "0.74.0-beta13", - "magento/module-sales": "0.74.0-beta13", - "magento/module-cms": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/module-widget": "0.74.0-beta13", - "magento/module-log": "0.74.0-beta13", - "magento/module-wishlist": "0.74.0-beta13", - "magento/module-review": "0.74.0-beta13", - "magento/module-catalog-inventory": "0.74.0-beta13", - "magento/module-tax": "0.74.0-beta13", - "magento/module-downloadable": "0.74.0-beta13", - "magento/module-sales-rule": "0.74.0-beta13", - "magento/module-quote": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-config": "0.74.0-beta14", + "magento/module-store": "0.74.0-beta14", + "magento/module-eav": "0.74.0-beta14", + "magento/module-customer": "0.74.0-beta14", + "magento/module-catalog": "0.74.0-beta14", + "magento/module-sales": "0.74.0-beta14", + "magento/module-cms": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/module-widget": "0.74.0-beta14", + "magento/module-log": "0.74.0-beta14", + "magento/module-wishlist": "0.74.0-beta14", + "magento/module-review": "0.74.0-beta14", + "magento/module-catalog-inventory": "0.74.0-beta14", + "magento/module-tax": "0.74.0-beta14", + "magento/module-downloadable": "0.74.0-beta14", + "magento/module-sales-rule": "0.74.0-beta14", + "magento/module-quote": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/RequireJs/composer.json b/app/code/Magento/RequireJs/composer.json index c921a04022f146ff8fe438985fd98d93ef9c3fbe..f36ff58438ce0c1b827ee011308bdf0710623bf6 100644 --- a/app/code/Magento/RequireJs/composer.json +++ b/app/code/Magento/RequireJs/composer.json @@ -3,11 +3,11 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/framework": "0.74.0-beta13", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Review/composer.json b/app/code/Magento/Review/composer.json index 45201df67e97c0cfec3850649adf2b8fdcfbfa74..b8bb07beb0f6fc1ba9a59a47a57b2329e504a074 100644 --- a/app/code/Magento/Review/composer.json +++ b/app/code/Magento/Review/composer.json @@ -3,22 +3,22 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta13", - "magento/module-catalog": "0.74.0-beta13", - "magento/module-customer": "0.74.0-beta13", - "magento/module-eav": "0.74.0-beta13", - "magento/module-theme": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/module-newsletter": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", - "magento/module-ui": "0.74.0-beta13", + "magento/module-store": "0.74.0-beta14", + "magento/module-catalog": "0.74.0-beta14", + "magento/module-customer": "0.74.0-beta14", + "magento/module-eav": "0.74.0-beta14", + "magento/module-theme": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/module-newsletter": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", + "magento/module-ui": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "suggest": { - "magento/module-cookie": "0.74.0-beta13" + "magento/module-cookie": "0.74.0-beta14" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Rss/composer.json b/app/code/Magento/Rss/composer.json index 9e085b9677094ac04fb063a23147c319500255be..ca4231a1f2e5bd6127a2792c31677aca56da011a 100644 --- a/app/code/Magento/Rss/composer.json +++ b/app/code/Magento/Rss/composer.json @@ -3,14 +3,14 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", - "magento/module-customer": "0.74.0-beta13", + "magento/module-store": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", + "magento/module-customer": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Rule/composer.json b/app/code/Magento/Rule/composer.json index d6e66b999c893133d222d72c447801d2b2bff85e..5d0a656ebc0bb6db836a97268ddecc99906ad595 100644 --- a/app/code/Magento/Rule/composer.json +++ b/app/code/Magento/Rule/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta13", - "magento/module-eav": "0.74.0-beta13", - "magento/module-catalog": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-store": "0.74.0-beta14", + "magento/module-eav": "0.74.0-beta14", + "magento/module-catalog": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "lib-libxml": "*", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Sales/Api/Data/OrderAddressInterface.php b/app/code/Magento/Sales/Api/Data/OrderAddressInterface.php index dfd663234daec616b0e77161aed4f89ae858bd5f..3b319b82613c61da32995e744fc8210ded8670a2 100644 --- a/app/code/Magento/Sales/Api/Data/OrderAddressInterface.php +++ b/app/code/Magento/Sales/Api/Data/OrderAddressInterface.php @@ -35,6 +35,10 @@ interface OrderAddressInterface extends \Magento\Framework\Api\ExtensibleDataInt * Region ID. */ const REGION_ID = 'region_id'; + /** + * Region code. + */ + const KEY_REGION_CODE = 'region_code'; /* * Customer ID. */ @@ -247,6 +251,13 @@ interface OrderAddressInterface extends \Magento\Framework\Api\ExtensibleDataInt */ public function getRegion(); + /** + * Gets the region code for the order address + * + * @return string|null Region code. + */ + public function getRegionCode(); + /** * Gets the region ID for the order address. * @@ -494,6 +505,14 @@ interface OrderAddressInterface extends \Magento\Framework\Api\ExtensibleDataInt */ public function setVatRequestId($id); + /** + * Set region code + * + * @param string $regionCode + * @return $this + */ + public function setRegionCode($regionCode); + /** * Sets the VAT request date for the order address. * diff --git a/app/code/Magento/Sales/Model/Order/Address.php b/app/code/Magento/Sales/Model/Order/Address.php index 9486d6e0fb34b74714d5e102c6d1bb1a289c48ab..2ffcb048799e6f7b5f7456487e4cc20cff95d922 100644 --- a/app/code/Magento/Sales/Model/Order/Address.php +++ b/app/code/Magento/Sales/Model/Order/Address.php @@ -702,6 +702,14 @@ class Address extends AbstractModel implements OrderAddressInterface, AddressMod return $this->setData(OrderAddressInterface::VAT_REQUEST_ID, $id); } + /** + * {@inheritdoc} + */ + public function setRegionCode($regionCode) + { + return $this->setData(OrderAddressInterface::KEY_REGION_CODE, $regionCode); + } + /** * {@inheritdoc} */ diff --git a/app/code/Magento/Sales/composer.json b/app/code/Magento/Sales/composer.json index 7f07de89e05f1b012a4d782d2828f7f86dd127eb..e9850b28b5ebbefd68476b14a55a1ea6f8bb63af 100644 --- a/app/code/Magento/Sales/composer.json +++ b/app/code/Magento/Sales/composer.json @@ -3,35 +3,35 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta13", - "magento/module-catalog": "0.74.0-beta13", - "magento/module-customer": "0.74.0-beta13", - "magento/module-authorization": "0.74.0-beta13", - "magento/module-payment": "0.74.0-beta13", - "magento/module-checkout": "0.74.0-beta13", - "magento/module-theme": "0.74.0-beta13", - "magento/module-sales-rule": "0.74.0-beta13", - "magento/module-sales-sequence": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/module-widget": "0.74.0-beta13", - "magento/module-directory": "0.74.0-beta13", - "magento/module-eav": "0.74.0-beta13", - "magento/module-tax": "0.74.0-beta13", - "magento/module-gift-message": "0.74.0-beta13", - "magento/module-reports": "0.74.0-beta13", - "magento/module-catalog-inventory": "0.74.0-beta13", - "magento/module-wishlist": "0.74.0-beta13", - "magento/module-email": "0.74.0-beta13", - "magento/module-shipping": "0.74.0-beta13", - "magento/module-config": "0.74.0-beta13", - "magento/module-media-storage": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", - "magento/module-ui": "0.74.0-beta13", - "magento/module-quote": "0.74.0-beta13", + "magento/module-store": "0.74.0-beta14", + "magento/module-catalog": "0.74.0-beta14", + "magento/module-customer": "0.74.0-beta14", + "magento/module-authorization": "0.74.0-beta14", + "magento/module-payment": "0.74.0-beta14", + "magento/module-checkout": "0.74.0-beta14", + "magento/module-theme": "0.74.0-beta14", + "magento/module-sales-rule": "0.74.0-beta14", + "magento/module-sales-sequence": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/module-widget": "0.74.0-beta14", + "magento/module-directory": "0.74.0-beta14", + "magento/module-eav": "0.74.0-beta14", + "magento/module-tax": "0.74.0-beta14", + "magento/module-gift-message": "0.74.0-beta14", + "magento/module-reports": "0.74.0-beta14", + "magento/module-catalog-inventory": "0.74.0-beta14", + "magento/module-wishlist": "0.74.0-beta14", + "magento/module-email": "0.74.0-beta14", + "magento/module-shipping": "0.74.0-beta14", + "magento/module-config": "0.74.0-beta14", + "magento/module-media-storage": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", + "magento/module-ui": "0.74.0-beta14", + "magento/module-quote": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Sales/view/adminhtml/web/order/edit/message.js b/app/code/Magento/Sales/view/adminhtml/web/order/edit/message.js index 5479b72127223e2f0b98730a965e94a97c845f9d..13511e83106674b301a992ca6a360e69c6c2b7b2 100644 --- a/app/code/Magento/Sales/view/adminhtml/web/order/edit/message.js +++ b/app/code/Magento/Sales/view/adminhtml/web/order/edit/message.js @@ -7,7 +7,7 @@ define([ "jquery", "jquery/ui", - 'Magento_Ui/js/dialog/dialog', + 'Magento_Ui/js/modal/modal', "mage/translate" ], function($){ "use strict"; @@ -15,7 +15,7 @@ define([ options: { url: null, message: null, - dialog: null + modal: null }, /** @@ -26,10 +26,10 @@ define([ }, /** - * Show dialog + * Show modal */ showDialog: function() { - this.options.dialog.html(this.options.message).trigger('openDialog'); + this.options.dialog.html(this.options.message).modal('openModal'); }, /** @@ -40,11 +40,24 @@ define([ }, /** - * Prepare dialog + * Prepare modal * @protected */ _prepareDialog: function() { - this.options.dialog = $('<div class="ui-dialog-content ui-widget-content"></div>').dialog(); + var self = this; + + this.options.dialog = $('<div class="ui-dialog-content ui-widget-content"></div>').modal({ + type: 'popup', + modalClass: 'edit-order-popup', + title: $.mage.__('Edit Order'), + buttons: [{ + text: $.mage.__('Ok'), + 'class': 'action-primary', + click: function(){ + self.redirect(); + } + }] + }); } }); diff --git a/app/code/Magento/SalesRule/composer.json b/app/code/Magento/SalesRule/composer.json index 73ca3c6e1d876da3377b77cc31d0a0a61b398a5a..e842b73e7b207cacc55274b6f11cb78df5d008ab 100644 --- a/app/code/Magento/SalesRule/composer.json +++ b/app/code/Magento/SalesRule/composer.json @@ -3,26 +3,26 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-config": "0.74.0-beta13", - "magento/module-store": "0.74.0-beta13", - "magento/module-rule": "0.74.0-beta13", - "magento/module-catalog": "0.74.0-beta13", - "magento/module-sales": "0.74.0-beta13", - "magento/module-eav": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/module-customer": "0.74.0-beta13", - "magento/module-directory": "0.74.0-beta13", - "magento/module-shipping": "0.74.0-beta13", - "magento/module-payment": "0.74.0-beta13", - "magento/module-reports": "0.74.0-beta13", - "magento/module-catalog-rule": "0.74.0-beta13", - "magento/module-widget": "0.74.0-beta13", - "magento/module-quote": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-config": "0.74.0-beta14", + "magento/module-store": "0.74.0-beta14", + "magento/module-rule": "0.74.0-beta14", + "magento/module-catalog": "0.74.0-beta14", + "magento/module-sales": "0.74.0-beta14", + "magento/module-eav": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/module-customer": "0.74.0-beta14", + "magento/module-directory": "0.74.0-beta14", + "magento/module-shipping": "0.74.0-beta14", + "magento/module-payment": "0.74.0-beta14", + "magento/module-reports": "0.74.0-beta14", + "magento/module-catalog-rule": "0.74.0-beta14", + "magento/module-widget": "0.74.0-beta14", + "magento/module-quote": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/SalesSequence/composer.json b/app/code/Magento/SalesSequence/composer.json index 15ce9855deb2e50bac1d6261380f653585182cfc..825a8e16713a027df4ea0dd1da8d58e2af16c7ea 100644 --- a/app/code/Magento/SalesSequence/composer.json +++ b/app/code/Magento/SalesSequence/composer.json @@ -3,11 +3,11 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/framework": "0.74.0-beta13", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Search/composer.json b/app/code/Magento/Search/composer.json index d0eea2c18d8d8791e84e4b2b396f714ccedd2388..98e1ce97eda1a03ced7574846f0a8d0d3efc2722 100644 --- a/app/code/Magento/Search/composer.json +++ b/app/code/Magento/Search/composer.json @@ -3,15 +3,15 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/framework": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/module-catalog-search": "0.74.0-beta13", - "magento/module-store": "0.74.0-beta13", - "magento/module-reports": "0.74.0-beta13", + "magento/framework": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/module-catalog-search": "0.74.0-beta14", + "magento/module-store": "0.74.0-beta14", + "magento/module-reports": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/SendFriend/composer.json b/app/code/Magento/SendFriend/composer.json index f8e2a4f687541841f0942de6a0805271b6dac339..b6712222a0c651e7a30e4186b029c40789fd30ae 100644 --- a/app/code/Magento/SendFriend/composer.json +++ b/app/code/Magento/SendFriend/composer.json @@ -3,15 +3,15 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta13", - "magento/module-catalog": "0.74.0-beta13", - "magento/module-customer": "0.74.0-beta13", - "magento/module-theme": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-store": "0.74.0-beta14", + "magento/module-catalog": "0.74.0-beta14", + "magento/module-customer": "0.74.0-beta14", + "magento/module-theme": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Shipping/composer.json b/app/code/Magento/Shipping/composer.json index 1960a285405d0b1fb9159a8cbb6905f4b27b57e8..26e8e039f88d70c2292afe9ffeae4601a4f1ea4a 100644 --- a/app/code/Magento/Shipping/composer.json +++ b/app/code/Magento/Shipping/composer.json @@ -3,27 +3,27 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta13", - "magento/module-catalog": "0.74.0-beta13", - "magento/module-sales": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/module-directory": "0.74.0-beta13", - "magento/module-contact": "0.74.0-beta13", - "magento/module-customer": "0.74.0-beta13", - "magento/module-payment": "0.74.0-beta13", - "magento/module-tax": "0.74.0-beta13", - "magento/module-catalog-inventory": "0.74.0-beta13", - "magento/module-quote": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-store": "0.74.0-beta14", + "magento/module-catalog": "0.74.0-beta14", + "magento/module-sales": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/module-directory": "0.74.0-beta14", + "magento/module-contact": "0.74.0-beta14", + "magento/module-customer": "0.74.0-beta14", + "magento/module-payment": "0.74.0-beta14", + "magento/module-tax": "0.74.0-beta14", + "magento/module-catalog-inventory": "0.74.0-beta14", + "magento/module-quote": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "ext-gd": "*", "magento/magento-composer-installer": "*" }, "suggest": { - "magento/module-fedex": "0.74.0-beta13", - "magento/module-ups": "0.74.0-beta13" + "magento/module-fedex": "0.74.0-beta14", + "magento/module-ups": "0.74.0-beta14" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Sitemap/composer.json b/app/code/Magento/Sitemap/composer.json index 7c7137e8db82477d6c3ded19a28dd6969b68fc42..6e9cd7ca7d1d8f9a280952fcccdd76c9b45a844c 100644 --- a/app/code/Magento/Sitemap/composer.json +++ b/app/code/Magento/Sitemap/composer.json @@ -3,18 +3,18 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta13", - "magento/module-catalog": "0.74.0-beta13", - "magento/module-eav": "0.74.0-beta13", - "magento/module-cms": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/module-catalog-url-rewrite": "0.74.0-beta13", - "magento/module-media-storage": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-store": "0.74.0-beta14", + "magento/module-catalog": "0.74.0-beta14", + "magento/module-eav": "0.74.0-beta14", + "magento/module-cms": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/module-catalog-url-rewrite": "0.74.0-beta14", + "magento/module-media-storage": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Store/composer.json b/app/code/Magento/Store/composer.json index e8a224d7a443669cfe35054a4ebb9af15f6138fe..3bb80c7c21ec85900b2c9c7ec5b15ce3a6c99176 100644 --- a/app/code/Magento/Store/composer.json +++ b/app/code/Magento/Store/composer.json @@ -3,15 +3,15 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-directory": "0.74.0-beta13", - "magento/module-ui": "0.74.0-beta13", - "magento/module-config": "0.74.0-beta13", - "magento/module-media-storage": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-directory": "0.74.0-beta14", + "magento/module-ui": "0.74.0-beta14", + "magento/module-config": "0.74.0-beta14", + "magento/module-media-storage": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Tax/composer.json b/app/code/Magento/Tax/composer.json index 3ef7c5e73fc4cd09ad9f1ff4cca1b0b5f56ed1d6..b2d4d6faad79318556340971f6dd6d832e89af6c 100644 --- a/app/code/Magento/Tax/composer.json +++ b/app/code/Magento/Tax/composer.json @@ -3,24 +3,24 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-config": "0.74.0-beta13", - "magento/module-store": "0.74.0-beta13", - "magento/module-catalog": "0.74.0-beta13", - "magento/module-customer": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/module-directory": "0.74.0-beta13", - "magento/module-checkout": "0.74.0-beta13", - "magento/module-shipping": "0.74.0-beta13", - "magento/module-eav": "0.74.0-beta13", - "magento/module-sales": "0.74.0-beta13", - "magento/module-reports": "0.74.0-beta13", - "magento/module-page-cache": "0.74.0-beta13", - "magento/module-quote": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-config": "0.74.0-beta14", + "magento/module-store": "0.74.0-beta14", + "magento/module-catalog": "0.74.0-beta14", + "magento/module-customer": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/module-directory": "0.74.0-beta14", + "magento/module-checkout": "0.74.0-beta14", + "magento/module-shipping": "0.74.0-beta14", + "magento/module-eav": "0.74.0-beta14", + "magento/module-sales": "0.74.0-beta14", + "magento/module-reports": "0.74.0-beta14", + "magento/module-page-cache": "0.74.0-beta14", + "magento/module-quote": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/TaxImportExport/composer.json b/app/code/Magento/TaxImportExport/composer.json index 0cebf5d7d3360dba867fee97e90b3a9d2336ad91..2642b8587938955bd7b651a9485560794002064f 100644 --- a/app/code/Magento/TaxImportExport/composer.json +++ b/app/code/Magento/TaxImportExport/composer.json @@ -3,15 +3,15 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-tax": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/module-directory": "0.74.0-beta13", - "magento/module-store": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-tax": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/module-directory": "0.74.0-beta14", + "magento/module-store": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Theme/composer.json b/app/code/Magento/Theme/composer.json index 7e2129cc460bb0145f4cf7dacf63bb226e4bb049..9fbb0bd754d2cc08791507e25ca35d5d013776d9 100644 --- a/app/code/Magento/Theme/composer.json +++ b/app/code/Magento/Theme/composer.json @@ -3,23 +3,23 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta13", - "magento/module-customer": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/module-cms": "0.74.0-beta13", - "magento/module-eav": "0.74.0-beta13", - "magento/module-widget": "0.74.0-beta13", - "magento/module-config": "0.74.0-beta13", - "magento/module-media-storage": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", - "magento/module-require-js": "0.74.0-beta13", + "magento/module-store": "0.74.0-beta14", + "magento/module-customer": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/module-cms": "0.74.0-beta14", + "magento/module-eav": "0.74.0-beta14", + "magento/module-widget": "0.74.0-beta14", + "magento/module-config": "0.74.0-beta14", + "magento/module-media-storage": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", + "magento/module-require-js": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "suggest": { - "magento/module-translation": "0.74.0-beta13" + "magento/module-translation": "0.74.0-beta14" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Translation/composer.json b/app/code/Magento/Translation/composer.json index 05ce2874e8b195cefb7355cb2208a5ca59b6208d..7de19b36d8a93d4c6640246a5098e529c27e1860 100644 --- a/app/code/Magento/Translation/composer.json +++ b/app/code/Magento/Translation/composer.json @@ -3,15 +3,15 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-backend": "0.74.0-beta13", - "magento/module-developer": "0.74.0-beta13", - "magento/module-store": "0.74.0-beta13", - "magento/module-theme": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-backend": "0.74.0-beta14", + "magento/module-developer": "0.74.0-beta14", + "magento/module-store": "0.74.0-beta14", + "magento/module-theme": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Ui/Component/Bookmark.php b/app/code/Magento/Ui/Component/Bookmark.php index cbb66e064806e28cfc15de7e9dcba59448b2d13c..7c8d54889f13ae6a1028dc2d61e6544f5ba464f1 100644 --- a/app/code/Magento/Ui/Component/Bookmark.php +++ b/app/code/Magento/Ui/Component/Bookmark.php @@ -75,12 +75,17 @@ class Bookmark extends AbstractComponent $bookmarks = $this->bookmarkManagement->loadByNamespace($namespace); /** @var \Magento\Ui\Api\Data\BookmarkInterface $bookmark */ foreach ($bookmarks->getItems() as $bookmark) { - $config['activeIndex'] = ($bookmark->isCurrent() ? $bookmark->getIdentifier() : 'default'); + $activeIndex = ($bookmark->isCurrent() ? $bookmark->getIdentifier() : false); + if ($bookmark->getIdentifier() == 'current') { $config['current'] = $bookmark->getConfig(); } else { $config['views'][$bookmark->getIdentifier()] = $bookmark->getConfig(); } + + if ($activeIndex !== false) { + $config['activeIndex'] = $activeIndex; + } } } diff --git a/app/code/Magento/Ui/Controller/Adminhtml/Bookmark/Save.php b/app/code/Magento/Ui/Controller/Adminhtml/Bookmark/Save.php index f959e11ae83c85cf64e9e9502279005e44c2b738..2128543535b2b0d6823d60046ef60c21001913ce 100644 --- a/app/code/Magento/Ui/Controller/Adminhtml/Bookmark/Save.php +++ b/app/code/Magento/Ui/Controller/Adminhtml/Bookmark/Save.php @@ -23,6 +23,10 @@ class Save extends AbstractAction */ const CURRENT_IDENTIFIER = 'current'; + const ACTIVE_IDENTIFIER = 'activeIndex'; + + const VIEWS_IDENTIFIER = 'views'; + /** * @var BookmarkRepositoryInterface */ @@ -75,30 +79,37 @@ class Save extends AbstractAction { $bookmark = $this->bookmarkFactory->create(); $data = $this->_request->getParam('data'); - if (isset($data['views'])) { - foreach ($data['views'] as $identifier => $data) { - $updateBookmark = $this->checkBookmark($identifier); - if ($updateBookmark !== false) { - $bookmark = $updateBookmark; - } + $action = key($data); + switch($action) { + case self::ACTIVE_IDENTIFIER: + $this->updateCurrentBookmark($data[$action]); + break; + case self::CURRENT_IDENTIFIER: $this->updateBookmark( $bookmark, - $identifier, - (isset($data['label']) ? $data['label'] : ''), - $data + $action, + $bookmark->getTitle(), + $data[$action] ); - } - } else { - $identifier = isset($data['activeIndex']) - ? $data['activeIndex'] - : (isset($data[self::CURRENT_IDENTIFIER]) ? self::CURRENT_IDENTIFIER : ''); - $updateBookmark = $this->checkBookmark($identifier); - if ($updateBookmark !== false) { - $bookmark = $updateBookmark; - } - $this->updateBookmark($bookmark, $identifier, '', $data[$identifier]); + break; + + case self::VIEWS_IDENTIFIER: + foreach ($data[$action] as $identifier => $data) { + $this->updateBookmark( + $bookmark, + $identifier, + isset($data['label']) ? $data['label'] : '', + $data + ); + $this->updateCurrentBookmark($identifier); + } + + break; + + default: + throw new \LogicException(__('Unsupported bookmark action.')); } } @@ -114,20 +125,35 @@ class Save extends AbstractAction protected function updateBookmark(BookmarkInterface $bookmark, $identifier, $title, array $config = []) { $this->filterVars($config); + + $updateBookmark = $this->checkBookmark($identifier); + if ($updateBookmark !== false) { + $bookmark = $updateBookmark; + } + $bookmark->setUserId($this->userContext->getUserId()) ->setNamespace($this->_request->getParam('namespace')) ->setIdentifier($identifier) ->setTitle($title) - ->setConfig($config) - ->setCurrent($identifier !== self::CURRENT_IDENTIFIER); + ->setConfig($config); $this->bookmarkRepository->save($bookmark); + } + /** + * Update current bookmark + * + * @param string $identifier + * @return void + */ + protected function updateCurrentBookmark($identifier) + { $bookmarks = $this->bookmarkManagement->loadByNamespace($this->_request->getParam('namespace')); foreach ($bookmarks->getItems() as $bookmark) { if ($bookmark->getIdentifier() == $identifier) { - continue; + $bookmark->setCurrent(true); + } else { + $bookmark->setCurrent(false); } - $bookmark->setCurrent(false); $this->bookmarkRepository->save($bookmark); } } diff --git a/app/code/Magento/Ui/composer.json b/app/code/Magento/Ui/composer.json index edb3157e7aab2160a922d9f80b68fe3674e946ed..35d8c625925fde44598e7b8524c3e574d51f309e 100644 --- a/app/code/Magento/Ui/composer.json +++ b/app/code/Magento/Ui/composer.json @@ -3,14 +3,14 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-backend": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", - "magento/module-eav": "0.74.0-beta13", - "magento/module-authorization": "0.74.0-beta13", + "magento/module-backend": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", + "magento/module-eav": "0.74.0-beta14", + "magento/module-authorization": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Ui/view/base/web/js/core/renderer/layout.js b/app/code/Magento/Ui/view/base/web/js/core/renderer/layout.js index 882fd49f464af70702a9db2372a988a9462ab35c..4a0ceedf00035b14483671a2ec5caece43324907 100644 --- a/app/code/Magento/Ui/view/base/web/js/core/renderer/layout.js +++ b/app/code/Magento/Ui/view/base/web/js/core/renderer/layout.js @@ -122,6 +122,10 @@ define([ delete node.type; delete node.config; + if (children) { + node.initChildCount = _.size(children); + } + if (node.isTemplate) { node.isTemplate = false; diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/abstract.js b/app/code/Magento/Ui/view/base/web/js/form/element/abstract.js index 84ea34f88934be1e8bc349a149482e3f297b49ee..14ba3ef49693ef7615b5d9052a94a2e60dbed5d2 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/element/abstract.js +++ b/app/code/Magento/Ui/view/base/web/js/form/element/abstract.js @@ -47,8 +47,7 @@ define([ _.bindAll(this, 'reset'); this._super(); - - this.initialValue = this.getInititalValue(); + this.initialValue = this.getInitialValue(); this.value(this.initialValue); @@ -97,7 +96,7 @@ define([ * * @returns {*} Elements' value. */ - getInititalValue: function () { + getInitialValue: function () { var values = [this.value(), this.default], value; diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/boolean.js b/app/code/Magento/Ui/view/base/web/js/form/element/boolean.js index 4782c853d210b11696c71f31d8d855a8e64eb4b0..efe82b0a13a1c4ee16cb71b7581e77ee41393fc8 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/element/boolean.js +++ b/app/code/Magento/Ui/view/base/web/js/form/element/boolean.js @@ -13,7 +13,7 @@ define([ * * @return {Boolean} */ - getInititalValue: function () { + getInitialValue: function () { return !!+this._super(); }, diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/date.js b/app/code/Magento/Ui/view/base/web/js/form/element/date.js index 140f063a315d00b0dd47a5c144503eb28c75b9cd..08f28b0c63722c92fb0e3b9cc580b1eaa1c3d107 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/element/date.js +++ b/app/code/Magento/Ui/view/base/web/js/form/element/date.js @@ -26,7 +26,7 @@ define([ * * @returns {String} */ - getInititalValue: function () { + getInitialValue: function () { var value = this._super(); if (value) { diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/multiselect.js b/app/code/Magento/Ui/view/base/web/js/form/element/multiselect.js index a6dc9e3b3afe600527a5b0fd470b05547b955789..6e7b2ac69a4ff61d6617faf2d0226084660890d5 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/element/multiselect.js +++ b/app/code/Magento/Ui/view/base/web/js/form/element/multiselect.js @@ -20,7 +20,7 @@ define([ * * @returns {Number|String} */ - getInititalValue: function () { + getInitialValue: function () { var value = this._super(); return _.isString(value) ? value.split(',') : value; diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/select.js b/app/code/Magento/Ui/view/base/web/js/form/element/select.js index 3034df1e2c67ad8154be1caa055fd97e0a45bbf2..225a6a3250d350bb55b90b4caeb5f8abc1ae9fa8 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/element/select.js +++ b/app/code/Magento/Ui/view/base/web/js/form/element/select.js @@ -14,9 +14,9 @@ define([ var inputNode = { parent: '${ $.$data.parentName }', type: 'form.input', - name: '<%= $data.index %>_input', - dataScope: '<%= $data.customEntry %>', - customScope: '<%= $data.customScope %>', + name: '${ $.$data.index }_input', + dataScope: '${ $.$data.customEntry }', + customScope: '${ $.$data.customScope }', sortOrder: { after: '${ $.$data.name }' }, @@ -157,6 +157,7 @@ define([ initFilter: function () { var filter = this.filterBy; + this.filter(this.default, filter.field); this.setLinks({ filter: filter.target }, 'imports'); @@ -181,7 +182,7 @@ define([ * * @returns {Number|String} */ - getInititalValue: function () { + getInitialValue: function () { var value = this._super(); if (value !== '') { diff --git a/app/code/Magento/Ui/view/base/web/js/grid/columns/actions.js b/app/code/Magento/Ui/view/base/web/js/grid/columns/actions.js index 33a095e64e806024affa49638b9fe8bb40566e79..e0b7525f007128ec86e7409519c1df011081aa63 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/columns/actions.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/columns/actions.js @@ -4,24 +4,282 @@ */ define([ 'underscore', - './column' -], function (_, Column) { + 'mageUtils', + 'uiRegistry', + './column', + 'Magento_Ui/js/modal/confirm' +], function (_, utils, registry, Column, confirm) { 'use strict'; return Column.extend({ defaults: { - headerTmpl: 'ui/grid/columns/actions', - bodyTmpl: 'ui/grid/cells/actions' + bodyTmpl: 'ui/grid/cells/actions', + actions: [], + rows: [], + templates: { + actions: {} + }, + rowsProvider: '${ $.parentName }', + imports: { + rows: '${ $.rowsProvider }:rows' + }, + listens: { + rows: 'updateActions' + } }, - getDisplayed: function (actions) { - actions = _.filter(actions, function (action) { - return !('hidden' in action) || !action.hidden; + /** + * Initializes observable properties. + * + * @returns {ActionsColumn} Chainable. + */ + initObservable: function () { + this._super() + .observe('actions opened'); + + return this; + }, + + /** + * Returns specific action of a specified row + * or all action objects associated with it. + * + * @param {Number} rowIndex - Index of a row. + * @param {String} [actionIndex] - Action identifier. + * @returns {Array|Object} + */ + getAction: function (rowIndex, actionIndex) { + var rowActions = this.actions()[rowIndex]; + + return rowActions && actionIndex ? + rowActions[actionIndex] : + rowActions; + }, + + /** + * Returns visible actions for a specified row. + * + * @param {Number} rowIndex - Index of a row. + * @returns {Array} Visible actions. + */ + getVisibleActions: function (rowIndex) { + var rowActions = this.getAction(rowIndex); + + return _.filter(rowActions, this.isActionVisible, this); + }, + + /** + * Adds new action. If action with a specfied identifier + * already exists, than the original will be overrided. + * + * @param {String} index - Actions' identifier. + * @param {Object} action - Actions' data. + * @returns {ActionsColumn} Chainable. + */ + addAction: function (index, action) { + var actionTmpls = this.templates.actions; + + actionTmpls[index] = action; + + this.updateActions(); + + return this; + }, + + /** + * Recreates actions for each row. + * + * @returns {ActionsColumn} Chainable. + */ + updateActions: function () { + var rows = this.rows, + actions = rows.map(this._formatActions, this); + + this.actions(actions); + + return this; + }, + + /** + * Processes actions, setting additional information to them and + * evaluating ther properties as a string templates. + * + * @private + * @param {Object} row - Row object. + * @param {Number} rowIndex - Index of a row. + * @returns {Array} + */ + _formatActions: function (row, rowIndex) { + var rowActions = row[this.index] || {}, + recordId = row[this.indexField], + customActions = this.templates.actions; + + /** + * Actions iterator. + */ + function iterate(action, index) { + action = utils.extend({ + index: index, + rowIndex: rowIndex, + recordId: recordId + }, action); + + return utils.template(action, row, true); + } + + rowActions = _.mapObject(rowActions, iterate); + customActions = _.map(customActions, iterate); + + customActions.forEach(function (action) { + rowActions[action.index] = action; + }); + + return rowActions; + }, + + /** + * Applies specified action. + * + * @param {String} actionIndex - Actions' identifier. + * @param {Number} rowIndex - Index of a row. + * @returns {ActionsColumn} Chainable. + */ + applyAction: function (actionIndex, rowIndex) { + var action = this.getAction(rowIndex, actionIndex), + callback; + + if (!action.href && !action.callback) { + return this; + } + + callback = this._getCallback(action); + + action.confirm ? + this._confirm(action, callback) : + callback(); + + return this; + }, + + /** + * Creates action callback based on its' data. If action doesn't spicify + * a callback function than the default one will be used. + * + * @private + * @param {Object} action - Actions' object. + * @returns {Function} Callback function. + */ + _getCallback: function (action) { + var args = [action.index, action.recordId, action], + callback = action.callback; + + if (utils.isObject(callback)) { + args.unshift(callback.target); + + callback = registry.async(callback.provider); + } else if (typeof callback != 'function') { + callback = this.defaultCallback.bind(this); + } + + return function () { + callback.apply(null, args); + }; + }, + + /** + * Default action callback. Redirects to + * the specified in actions' data url. + * + * @param {String} actionIndex - Actions' identifier. + * @param {(Number|String)} recordId - Id of the record accociated + * with a specfied action. + * @param {Object} action - Actions' data. + */ + defaultCallback: function (actionIndex, recordId, action) { + window.location.href = action.href; + }, + + /** + * Shows actions' confirmation window. + * + * @param {Object} action - Actions' data. + * @param {Function} callback - Callback that will be + * invoked if action is confirmed. + */ + _confirm: function (action, callback) { + var confirmData = action.confirm; + + confirm({ + title: confirmData.title, + content: confirmData.message, + actions: { + confirm: callback + } }); + }, + + /** + * Checks if row has only one visible action. + * + * @param {Number} rowIndex - Row index. + * @returns {Boolean} + */ + isSingle: function (rowIndex) { + return this.getVisibleActions(rowIndex).length === 1; + }, + + /** + * Checks if row has more than one visible action. + * + * @param {Number} rowIndex - Row index. + * @returns {Boolean} + */ + isMultiple: function (rowIndex) { + return this.getVisibleActions(rowIndex).length > 1; + }, + + /** + * Checks if action should be displayed. + * + * @param {Object} action - Action object. + * @returns {Boolean} + */ + isActionVisible: function (action) { + return action.hidden !== true; + }, + + /** + * Opens or closes specific actions list. + * + * @param {Number} rowIndex - Index of a row, + * where actions are displayed. + * @returns {ActionsColumn} Chainable. + */ + toggleList: function (rowIndex) { + var state = false; + + if (rowIndex !== this.opened()) { + state = rowIndex; + } + + this.opened(state); + + return this; + }, - this.displayed = actions; + /** + * Closes actions list. + * + * @param {Number} rowIndex - Index of a row, + * where actions are displayed. + * @returns {ActionsColumn} + */ + closeList: function (rowIndex) { + if (this.opened() === rowIndex) { + this.opened(false); + } - return actions; + return this; } }); }); diff --git a/app/code/Magento/Ui/view/base/web/js/grid/columns/column.js b/app/code/Magento/Ui/view/base/web/js/grid/columns/column.js index f0d3202c7f6822eb2c97aa3f89499f18a7048c32..1eb359826b1cff89f423be340531dd34d52c8157 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/columns/column.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/columns/column.js @@ -13,37 +13,111 @@ define([ defaults: { headerTmpl: 'ui/grid/columns/text', bodyTmpl: 'ui/grid/cells/text', - sortable: false, + sortable: true, + sorting: false, visible: true, + draggable: true, links: { - visible: '${ $.storageConfig.path }.visible' + visible: '${ $.storageConfig.path }.visible', + sorting: '${ $.storageConfig.path }.sorting' + }, + imports: { + exportSorting: 'sorting' + }, + listens: { + '${ $.provider }:params.sorting.field': 'onSortChange' + }, + modules: { + source: '${ $.provider }' } }, + /** + * Initializes observable properties. + * + * @returns {Column} Chainable. + */ initObservable: function () { this._super() - .observe('visible'); + .observe('visible dragging dragover sorting'); return this; }, - applyState: function (property, state) { - var storage = this.storage(), - namespace = this.storageConfig.root + '.' + property, - data, - value; + /** + * Applies specified stored state of a column or one of its' properties. + * + * @param {String} state - Defines what state should be used: saved or default. + * @param {String} [property] - Defines what columns' property should be applied. + * If not specfied, than all collumns stored properties will be used. + * @returns {Column} Chainable. + */ + applyState: function (state, property) { + var namespace = this.storageConfig.root; - if (state === 'default') { - data = storage.getDefault(); - } else if (state === 'last') { - data = storage.getSaved(); + if (property) { + namespace += '.' + property; } - value = utils.nested(data, namespace); + this.storage('applyState', state, namespace); - if (!_.isUndefined(value)) { - this.set(property, value); + return this; + }, + + /** + * Sets columns' sorting. If column is currently sorted, + * than its' direction will be toggled. + * + * @param {*} [enable=true] - If false, than sorting will + * be removed from a column. + * @returns {Column} Chainable. + */ + sort: function (enable) { + var direction; + + if (!this.sortable) { + return this; + } + + enable = enable !== false ? true : false; + + direction = enable ? + this.sorting() ? + this.toggleDirection() : + 'asc' : + false; + + this.sorting(direction); + + return this; + }, + + /** + * Exports sorting data to the dataProvider if + * sorting of a column is enabled. + * + * @param {(String|Boolean)} sorting - Columns' sorting state. + */ + exportSorting: function (sorting) { + if (!sorting) { + return; } + + this.source('set', 'params.sorting', { + field: this.index, + direction: sorting + }); + }, + + /** + * Toggles sorting direcction. + * + * @returns {String} New direction. + */ + toggleDirection: function () { + return this.sorting() === 'asc' ? + 'desc' : + 'asc'; }, getClickUrl: function (row) { @@ -61,16 +135,43 @@ define([ window.location.href = url; }, + /** + * Ment to preprocess data associated with a current columns' field. + * + * @param {*} data - Data to be preprocessed. + * @returns {String} + */ getLabel: function (data) { return data; }, + /** + * Returns path to the columns' header template. + * + * @returns {String} + */ getHeader: function () { return this.headerTmpl; }, + /** + * Returns path to the columns' body template. + * + * @returns {String} + */ getBody: function () { return this.bodyTmpl; + }, + + /** + * Listener of the providers' sorting state changes. + * + * @param {Srting} field - Field by which current sorting is performed. + */ + onSortChange: function (field) { + if (field !== this.index) { + this.sort(false); + } } }); }); diff --git a/app/code/Magento/Ui/view/base/web/js/grid/columns/date.js b/app/code/Magento/Ui/view/base/web/js/grid/columns/date.js index 3393c0094a8e8853a5a95b18de6e4805a92ac723..90ace7d79af6ad4eb96d1c0bceb5140ccdc7afe1 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/columns/date.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/columns/date.js @@ -5,23 +5,40 @@ define([ 'mageUtils', 'moment', - './sortable' -], function (utils, moment, Sortable) { + './column' +], function (utils, moment, Column) { 'use strict'; - return Sortable.extend({ + return Column.extend({ defaults: { dateFormat: 'MMM D, YYYY h:mm:ss A' }, + /** + * Initializes components' static properties. + * + * @returns {DateColumn} Chainable. + */ initProperties: function () { this.dateFormat = utils.normalizeDate(this.dateFormat); return this._super(); }, - getLabel: function (data) { - return moment(data).isValid() ? moment(data).format(this.dateFormat) : ''; + /** + * Formats incoming date based on the 'dateFormat' property. + * + * @param {String} date - Date to be formatted. + * @returns {String} Formatted date. + */ + getLabel: function (date) { + date = moment(date); + + date = date.isValid() ? + date.format(this.dateFormat) : + ''; + + return date; } }); }); diff --git a/app/code/Magento/Ui/view/base/web/js/grid/columns/multiselect.js b/app/code/Magento/Ui/view/base/web/js/grid/columns/multiselect.js index e6b33d1e62854e72ea6d8ed311317140cf4ad11b..7ced03bfba9256fd0fa18591e4042f2018339d53 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/columns/multiselect.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/columns/multiselect.js @@ -13,13 +13,13 @@ define([ defaults: { headerTmpl: 'ui/grid/columns/multiselect', bodyTmpl: 'ui/grid/cells/multiselect', + sortable: false, menuVisible: false, excludeMode: false, allSelected: false, indetermine: false, selected: [], excluded: [], - ns: '${ $.provider }:params', actions: [{ value: 'selectAll', label: $t('Select all') @@ -40,13 +40,9 @@ define([ }, listens: { - '${ $.ns }.filters': 'deselectAll', + '${ $.provider }:params.filters': 'deselectAll', selected: 'onSelectedChange', rows: 'onRowsChange' - }, - - modules: { - source: '${ $.provider }' } }, @@ -87,7 +83,10 @@ define([ }, /** - * Selects all grid records, even those that are not visible on the page. + * Selects all grid records, even those that + * are not visible on the page. + * + * @returns {Multiselect} Chainable. */ selectAll: function () { this.excludeMode(true); @@ -100,44 +99,54 @@ define([ /** * Deselects all grid records. + * + * @returns {Multiselect} Chainable. */ deselectAll: function () { this.excludeMode(false); this.clearExcluded() - .deselectPage(); - this.selected.removeAll(); + .selected.removeAll(); return this; }, /** * Selects or deselects all records. + * + * @returns {Multiselect} Chainable. */ toggleSelectAll: function () { - return this.allSelected() ? - this.deselectAll() : - this.selectAll(); + this.allSelected() ? + this.deselectAll() : + this.selectAll(); + + return this; }, /** * Selects all records on the current page. + * + * @returns {Multiselect} Chainable. */ selectPage: function () { - this.selected( - _.union(this.selected(), this.getIds()) - ); + var selected = _.union(this.selected(), this.getIds()); + + this.selected(selected); return this; }, /** * Deselects all records on the current page. + * + * @returns {Multiselect} Chainable. */ deselectPage: function () { - var currentPageIds = this.getIds(); + var pageIds = this.getIds(); + this.selected.remove(function (value) { - return currentPageIds.indexOf(value) !== -1; + return !!~pageIds.indexOf(value); }); return this; @@ -209,18 +218,17 @@ define([ }, /** - * Exports selections to the data provider. + * Returns selections data. + * + * @returns {Object} */ - exportSelections: function () { - var data = {}, - type; - - type = this.excludeMode() ? 'excluded' : 'selected'; - - data[type] = this[type](); - data.total = this.totalSelected(); - - this.source('set', 'config.multiselect', data); + getSelections: function () { + return { + excluded: this.excluded(), + selected: this.selected(), + total: this.totalSelected(), + excludeMode: this.excludeMode() + }; }, /** @@ -231,27 +239,27 @@ define([ */ isActionRelevant: function (actionId) { var pageIds = this.getIds().length, - multiplePages = pageIds < this.totalRecords(); + multiplePages = pageIds < this.totalRecords(), + result = true; switch (actionId) { case 'selectPage': - - return multiplePages && !this.isPageSelected(true); + result = multiplePages && !this.isPageSelected(true); + break; case 'deselectPage': - - return multiplePages && this.isPageSelected(); + result = multiplePages && this.isPageSelected(); + break; case 'selectAll': - - return !this.allSelected(); + result = !this.allSelected(); + break; case 'deselectAll': - - return this.totalSelected() > 0; + result = this.totalSelected() > 0; } - return true; + return result; }, /** @@ -286,6 +294,8 @@ define([ /** * Updates values of the 'allSelected' * and 'indetermine' properties. + * + * @returns {Multiselect} Chainable. */ updateState: function () { var selected = this.selected().length, @@ -309,15 +319,14 @@ define([ }, /** - * Callback method to handle change of the selected items. + * Callback method to handle changes of selected items. * - * @param {Array} selected - List of the currently selected items. + * @param {Array} selected - An array of currently selected items. */ onSelectedChange: function (selected) { this.updateExcluded(selected) .countSelected() - .updateState() - .exportSelections(); + .updateState(); }, /** @@ -325,12 +334,12 @@ define([ * based on "selectMode" property. */ onRowsChange: function () { - var newSelected; + var newSelections; if (this.excludeMode()) { - newSelected = _.union(this.getIds(true), this.selected()); + newSelections = _.union(this.getIds(true), this.selected()); - this.selected(newSelected); + this.selected(newSelections); } } }); diff --git a/app/code/Magento/Ui/view/base/web/js/grid/columns/select.js b/app/code/Magento/Ui/view/base/web/js/grid/columns/select.js index 54185ef6617aa82740e0bb7f76f1650798361f93..46cbff1cf1dfd610ea5a3cd016304493cf880fde 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/columns/select.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/columns/select.js @@ -3,21 +3,30 @@ * See COPYING.txt for license details. */ define([ - './sortable' -], function (Sortable) { + './column' +], function (Column) { 'use strict'; - return Sortable.extend({ - getLabel: function (data) { + return Column.extend({ + /** + * Retrieves label associated with a provided value. + * + * @param {(String|Number)} value - Value of the option. + * @returns {String} + */ + getLabel: function (value) { var options = this.options || [], label = ''; - data = data || ''; + value = value || ''; + + /*eslint-disable eqeqeq*/ options.some(function (item) { label = item.label; - return item.value == data; + return item.value == value; }); + /*eslint-enable eqeqeq*/ return label; } diff --git a/app/code/Magento/Ui/view/base/web/js/grid/columns/sortable.js b/app/code/Magento/Ui/view/base/web/js/grid/columns/sortable.js deleted file mode 100644 index d54971607c37b33ce3a56455d7b7f8bb18aef05b..0000000000000000000000000000000000000000 --- a/app/code/Magento/Ui/view/base/web/js/grid/columns/sortable.js +++ /dev/null @@ -1,81 +0,0 @@ -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -define([ - './column' -], function (Column) { - 'use strict'; - - return Column.extend({ - defaults: { - sortable: true, - sorting: false, - classes: { - 'asc': '_ascend', - 'desc': '_descend' - }, - links: { - sorting: '${ $.storageConfig.path }.sorting' - }, - imports: { - setSortClass: 'sorting', - push: 'sorting' - }, - listens: { - '${ $.provider }:params.sorting.field': 'onSortChange' - }, - modules: { - source: '${ $.provider }' - } - }, - - initObservable: function () { - this._super() - .observe('sorting sortClass'); - - return this; - }, - - sort: function (enabled) { - var direction; - - direction = enabled !== false ? - this.sorting() ? - this.toggleDirection() : - 'asc' : - false; - - this.sorting(direction); - }, - - push: function (sorting) { - if (!sorting) { - return; - } - - this.source('set', 'params.sorting', { - field: this.index, - direction: sorting - }); - }, - - toggleDirection: function () { - return this.sorting() === 'asc' ? - 'desc' : - 'asc'; - }, - - setSortClass: function (sorting) { - var sortClass = this.classes[sorting] || ''; - - this.sortClass(sortClass); - }, - - onSortChange: function (field) { - if (field !== this.index) { - this.sort(false); - } - } - }); -}); diff --git a/app/code/Magento/Ui/view/base/web/js/grid/controls/bookmarks/bookmarks.js b/app/code/Magento/Ui/view/base/web/js/grid/controls/bookmarks/bookmarks.js index 78a115f2498a3068ca02baa8e07922013a91424a..286fe4307408feeaf678c3e778af0adf6a539edb 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/controls/bookmarks/bookmarks.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/controls/bookmarks/bookmarks.js @@ -12,6 +12,22 @@ define([ ], function (_, utils, registry, Storage, Collapsible, layout) { 'use strict'; + /** + * Removes 'current' namespace from a 'path' string. + * + * @param {String} path + * @returns {String} Path without namespace. + */ + function removeStateNs(path) { + path = typeof path == 'string' ? path.split('.') : ''; + + if (path[0] === 'current') { + path.shift(); + } + + return path.join('.'); + } + return Collapsible.extend({ defaults: { template: 'ui/grid/controls/bookmarks/bookmarks', @@ -29,7 +45,7 @@ define([ }, newView: { label: 'New View', - index: '${ Date.now() }', + index: '_${ Date.now() }', editing: true, isNew: true } @@ -59,8 +75,8 @@ define([ */ initialize: function () { utils.limit(this, 'saveSate', 2000); - utils.limit(this, 'checkChanges', 200); utils.limit(this, '_defaultPolyfill', 1000); + utils.limit(this, 'checkChanges', 50); this._super() .initViews(); @@ -223,7 +239,9 @@ define([ */ applyView: function (view) { if (typeof view === 'string') { - view = this.elems.findWhere({index: view}); + view = this.elems.findWhere({ + index: view + }); } view.active(true); @@ -234,6 +252,34 @@ define([ return this; }, + /** + * Applies specified views' data on a current data object. + * + * @param {String} state - Defines what state shultd be used: default or saved. + * @param {String} [path] - Path to the property whose value + * will be inserted to a current data object. + * @returns {Bookmarks} Chainable. + */ + applyState: function (state, path) { + var view, + value; + + view = state === 'default' ? + this.defaultView : + this.activeView(); + + path = removeStateNs(path); + value = view.getData(path); + + if (!_.isUndefined(value)) { + path = path ? 'current.' + path : 'current'; + + this.set(path, value); + } + + return this; + }, + /** * Saves current data state. * @@ -260,24 +306,6 @@ define([ return this; }, - /** - * Retrieves last saved data of a current view. - * - * @returns {Object} - */ - getSaved: function () { - return this.activeView().getData(); - }, - - /** - * Retrieves default data. - * - * @returns {Object} - */ - getDefault: function () { - return this.defaultView.getData(); - }, - /** * Defines default data if it wasn't gathered previously. * Assumes that if theres is no views available, diff --git a/app/code/Magento/Ui/view/base/web/js/grid/controls/bookmarks/view.js b/app/code/Magento/Ui/view/base/web/js/grid/controls/bookmarks/view.js index b42fedfe78dd725567fbb7ed3f7f48b196533af5..afd5d4276de442947da6755cf208f191268226d3 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/controls/bookmarks/view.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/controls/bookmarks/view.js @@ -58,12 +58,19 @@ define([ }, /** - * Retrieves current data. + * Retrieves copied views' data. * - * @returns {Object} + * @param {String} [path] - Path to the specific property. + * @returns {*} */ - getData: function () { - return utils.copy(this.data.items); + getData: function (path) { + var data = this.data.items; + + if (path) { + data = utils.nested(data, path); + } + + return utils.copy(data); }, /** diff --git a/app/code/Magento/Ui/view/base/web/js/grid/controls/columns.js b/app/code/Magento/Ui/view/base/web/js/grid/controls/columns.js index f48a86abab1c2937c1a0076137fa7539fc41f2ca..765e437334285090378e1db15d8ac33753da9ab8 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/controls/columns.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/controls/columns.js @@ -3,10 +3,11 @@ * See COPYING.txt for license details. */ define([ + 'underscore', 'mageUtils', 'mage/translate', 'Magento_Ui/js/lib/collapsible' -], function (utils, $t, Collapsible) { +], function (_, utils, $t, Collapsible) { 'use strict'; return Collapsible.extend({ @@ -15,32 +16,59 @@ define([ minVisible: 1, maxVisible: 30, viewportSize: 18, + columnsData: { + container: 'elems' + }, + imports: { + addColumns: '${ $.columnsData.provider }:${ $.columnsData.container }' + }, templates: { headerMsg: $t('${ $.visible } out of ${ $.total } visible') } }, /** - * Action Reset + * Resets columns visibility to theirs default state. + * + * @returns {Columns} Chainable. */ reset: function () { - this.elems.each('applyState', 'visible', 'default'); + this.elems.each('applyState', 'default', 'visible'); return this; }, /** - * Action Cancel + * Applies last saved state of columns visibility. + * + * @returns {Columns} Chainable. */ cancel: function () { - this.elems.each('applyState', 'visible', 'last'); + this.elems.each('applyState', 'saved', 'visible'); return this; }, /** - * Helper, which helps to stop resizing. - * viewportSize limits number of elements. + * Adds columns whose visibility can be controlled to the component. + * + * @param {Array} columns - Elements array that will be added to component. + * @returns {Columns} Chainable. + */ + addColumns: function (columns) { + columns = _.where(columns, { + controlVisibility: true + }); + + this.insertChild(columns); + + return this; + }, + + /** + * Defines whether child elements array length + * is greater than the 'viewportSize' property. + * * @returns {Boolean} */ hasOverflow: function () { @@ -51,6 +79,7 @@ define([ * Helper, checks * - if less than one item choosen * - if more then viewportMaxSize choosen + * * @param {Object} elem * @returns {Boolean} */ @@ -63,7 +92,8 @@ define([ }, /** - * Helper, returns number of visible checkboxes + * Counts number of visible columns. + * * @returns {Number} */ countVisible: function () { @@ -72,8 +102,7 @@ define([ /** * Compile header message from headerMessage setting. - * Expects Underscore template format - * @param {String} text - underscore-format template + * * @returns {String} */ getHeaderMessage: function () { diff --git a/app/code/Magento/Ui/view/base/web/js/grid/dnd.js b/app/code/Magento/Ui/view/base/web/js/grid/dnd.js new file mode 100644 index 0000000000000000000000000000000000000000..d1eb5ee827c40825b4f7df3620bb7215d4e21b68 --- /dev/null +++ b/app/code/Magento/Ui/view/base/web/js/grid/dnd.js @@ -0,0 +1,473 @@ +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +define([ + 'ko', + 'jquery', + 'underscore', + 'Magento_Ui/js/lib/class' +], function (ko, $, _, Class) { + 'use strict'; + + var isTouchDevice = typeof document.ontouchstart !== 'undefined', + transformProp; + + /** + * Defines supported css 'transform' property. + * + * @returns {String|Undefined} + */ + transformProp = (function () { + var style = document.body.style, + base = 'Transform', + vendors = ['webkit', 'moz', 'ms', 'o'], + vi = vendors.length, + property; + + if (typeof style.transform != 'undefined') { + return 'transform'; + } + + while (vi--) { + property = vendors[vi] + base; + + if (typeof style[property] != 'undefined') { + return property; + } + } + })(); + + /** + * Returns first touch data if it's available. + * + * @param {(MouseEvent|TouchEvent)} e - Event object. + * @returns {Object} + */ + function getTouch(e) { + return e.touches ? e.touches[0] : e; + } + + /** + * Moves specified DOM element to the x and y coordinates. + * + * @param {HTMLElement} elem - Element to be relocated. + * @param {Number} x - X coordinate. + * @param {Number} y - Y coordinate. + */ + function locate(elem, x, y) { + var value = 'translate(' + x + 'px,' + y + 'px)'; + + elem.style[transformProp] = value; + } + + /*eslint-disable no-extra-parens*/ + /** + * Checks if specified coordinate is inside of the provided area. + * + * @param {Number} x - X coordinate. + * @param {Number} y - Y coordinate. + * @param {Object} area - Object which represents area. + * @returns {Boolean} + */ + function isInside(x, y, area) { + return ( + area && + x >= area.left && x <= area.right && + y >= area.top && y <= area.bottom + ); + } + /*eslint-enable no-extra-parens*/ + + /** + * Calculates distance between two points. + * + * @param {Number} x1 - X coordinate of a first point. + * @param {Number} y1 - Y coordinate of a first point. + * @param {Number} x2 - X coordinate of a second point. + * @param {Number} y2 - Y coordinate of a second point. + * @returns {Number} Distance between points. + */ + function distance(x1, y1, x2, y2) { + var dx = x2 - x1, + dy = y2 - y1; + + dx *= dx; + dy *= dy; + + return Math.sqrt(dx + dy); + } + + /** + * Returns viewModel associated with a provided DOM element. + * + * @param {HTMLElement} elem + * @returns {Object|Array} + */ + function getModel(elem) { + return ko.contextFor(elem).$data; + } + + return Class.extend({ + defaults: { + noSelectClass: '_no-select', + hiddenClass: '_hidden', + fixedX: false, + fixedY: true, + minDistance: 2, + columns: [] + }, + + /** + * Initializes Dnd component. + * + * @returns {Dnd} Chainable. + */ + initialize: function () { + _.bindAll(this, 'onMouseMove', 'onMouseUp', 'onMouseDown'); + + this.$body = $('body'); + + this._super() + .initListeners(); + + return this; + }, + + /** + * Binds necessary events listeners. + * + * @returns {Dnd} Chainbale. + */ + initListeners: function () { + var addListener = document.addEventListener; + + if (isTouchDevice) { + addListener('touchmove', this.onMouseMove, false); + addListener('touchend', this.onMouseUp, false); + addListener('touchleave', this.onMouseUp, false); + } else { + addListener('mousemove', this.onMouseMove, false); + addListener('mouseup', this.onMouseUp, false); + } + + return this; + }, + + /** + * Sets specified column as a draggable element. + * + * @param {HTMLTableHeaderCellElement} column - Columns header element. + * @returns {Dnd} Chainable. + */ + addColumn: function (column) { + this.columns.push(column); + + isTouchDevice ? + column.addEventListener('touchstart', this.onMouseDown, false) : + column.addEventListener('mousedown', this.onMouseDown, false); + + return this; + }, + + /** + * Defines specified table element as a main container. + * + * @param {HTMLTableElement} table + * @returns {Dnd} Chainable. + */ + setTable: function (table) { + this.table = table; + + return this; + }, + + /** + * Defines specified table element as a draggable table. + * Only this element will be moved across the screen. + * + * @param {HTMLTableElement} dragTable + * @returns {Dnd} Chainable. + */ + setDragTable: function (dragTable) { + this.dragTable = dragTable; + + return this; + }, + + /** + * Calculates coordinates of draggable elements. + * + * @returns {Dnd} Chainbale. + */ + _cacheCoords: function () { + var container = this.table.getBoundingClientRect(), + bodyRect = document.body.getBoundingClientRect(), + grabbed = this.grabbed, + dragElem = grabbed.elem, + cells = _.toArray(dragElem.parentNode.cells), + rect; + + this.coords = this.columns.map(function (column) { + var data; + + rect = column.getBoundingClientRect(); + + data = { + index: cells.indexOf(column), + target: column, + orig: rect, + left: rect.left - bodyRect.left, + right: rect.right - bodyRect.left, + top: rect.top - bodyRect.top, + bottom: container.bottom - bodyRect.top + }; + + if (column === dragElem) { + this.dragArea = data; + + grabbed.shiftX = rect.left - grabbed.x; + grabbed.shiftY = rect.top - grabbed.y; + } + + return data; + }, this); + + return this; + }, + + /** + * Coppies dimensions of a grabbed column + * to a draggable grid. + * + * @param {HTMLTableHeaderCellElement} elem - Grabbed column. + * @returns {Dnd} Chainable. + */ + _copyDimensions: function (elem) { + var dragTable = this.dragTable, + dragBody = dragTable.tBodies[0], + dragTrs = dragBody ? dragBody.children : [], + origTrs = _.toArray(this.table.tBodies[0].children), + columnIndex = _.toArray(elem.parentNode.cells).indexOf(elem), + origTd, + dragTr; + + dragTable.style.width = elem.offsetWidth + 'px'; + dragTable.tHead.firstElementChild.cells[0].style.height = elem.offsetHeight + 'px'; + + origTrs.forEach(function (origTr, rowIndex) { + origTd = origTr.cells[columnIndex]; + dragTr = dragTrs[rowIndex]; + + if (origTd && dragTr) { + dragTr.cells[0].style.height = origTd.offsetHeight + 'px'; + } + }); + + return this; + }, + + /** + * Matches provided coordinates to available areas. + * + * @param {Number} x - X coordinate of a mouse pointer. + * @param {Number} y - Y coordinate of a mouse pointer. + * @returns {Object|Undefined} Matched area. + */ + _getDropArea: function (x, y) { + return _.find(this.coords, function (area) { + return isInside(x, y, area); + }); + }, + + /** + * Updates state of hovered areas. + * + * @param {Number} x - X coordinate of a mouse pointer. + * @param {Number} y - Y coordinate of a mouse pointer. + */ + _updateAreas: function (x, y) { + var leavedArea = this.dropArea, + area = this.dropArea = this._getDropArea(x, y); + + if (leavedArea) { + this.dragleave(leavedArea); + } + + if (area && area.target !== this.dragArea.target) { + this.dragenter(area); + } + }, + + /** + * Grab action handler. + * + * @param {Number} x - X coordinate of a grabbed point. + * @param {Number} y - Y coordinate of a grabbed point. + * @param {HTMLElement} elem - Grabbed elemenet. + */ + grab: function (x, y, elem) { + this.initDrag = true; + this.grabbed = { + x: x, + y: y, + elem: elem + }; + + this.$body.addClass(this.noSelectClass); + }, + + /** + * Dragstart action handler. + * + * @param {HTMLTableHeaderCellElement} elem - Element which is dragging. + */ + dragstart: function (elem) { + this.initDrag = false; + this.dropArea = false; + this.dragging = true; + + getModel(elem).dragging(true); + + this._cacheCoords() + ._copyDimensions(elem); + + $(this.dragTable).removeClass(this.hiddenClass); + }, + + /** + * Drag action handler. Locates draggable + * grid at a specified coordinates. + * + * @param {Number} x - X coordinate. + * @param {Number} y - Y coordinate. + */ + drag: function (x, y) { + var grabbed = this.grabbed, + dragArea = this.dragArea, + posX = x + grabbed.shiftX, + posY = y + grabbed.shiftY; + + if (this.fixedX) { + x = dragArea.left; + posX = dragArea.orig.left; + } + + if (this.fixedY) { + y = dragArea.top; + posY = dragArea.orig.top; + } + + locate(this.dragTable, posX, posY); + + if (!isInside(x, y, this.dropArea)) { + this._updateAreas(x, y); + } + }, + + /** + * Dragenter action handler. + * + * @param {Object} dropArea + */ + dragenter: function (dropArea) { + var direction = this.dragArea.index < dropArea.index ? + 'left' : + 'right'; + + getModel(dropArea.target).dragover(direction); + }, + + /** + * Dragleave action handler. + * + * @param {Object} dropArea + */ + dragleave: function (dropArea) { + getModel(dropArea.target).dragover(false); + }, + + /** + * Dragend action handler. + * + * @param {Object} dragArea + */ + dragend: function (dragArea) { + var dropArea = this.dropArea, + dragElem = dragArea.target; + + this.dragging = false; + + $(this.dragTable).addClass(this.hiddenClass); + + getModel(dragElem).dragging(false); + + if (dropArea && dropArea.target !== dragElem) { + this.drop(dropArea, dragArea); + } + }, + + /** + * Drop action handler. + * + * @param {Object} dropArea + * @param {Object} dragArea + */ + drop: function (dropArea, dragArea) { + var dropModel = getModel(dropArea.target), + dragModel = getModel(dragArea.target); + + getModel(this.table).insertChild(dragModel, dropModel); + dropModel.dragover(false); + }, + + /** + * Documents' 'mousemove' event handler. + * + * @param {(MouseEvent|TouchEvent)} e - Event object. + */ + onMouseMove: function (e) { + var grab = this.grabbed, + touch = getTouch(e), + x = touch.pageX, + y = touch.pageY; + + if (this.initDrag || this.dragging) { + e.preventDefault(); + } + + if (this.initDrag && distance(x, y, grab.x, grab.y) >= this.minDistance) { + this.dragstart(grab.elem); + } + + if (this.dragging) { + this.drag(x, y); + } + }, + + /** + * Documents' 'mouseup' event handler. + */ + onMouseUp: function () { + if (this.initDrag || this.dragging) { + this.initDrag = false; + this.$body.removeClass(this.noSelectClass); + } + + if (this.dragging) { + this.dragend(this.dragArea); + } + }, + + /** + * Columns' 'mousedown' event handler. + * + * @param {(MouseEvent|TouchEvent)} e - Event object. + */ + onMouseDown: function (e) { + var touch = getTouch(e); + + this.grab(touch.pageX, touch.pageY, e.currentTarget); + } + }); +}); diff --git a/app/code/Magento/Ui/view/base/web/js/grid/filters/filters.js b/app/code/Magento/Ui/view/base/web/js/grid/filters/filters.js index bcd26c0f6fa5ed3f641f455747094a401641a5fd..558e6629a166b5e47676af7513415add275e54c6 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/filters/filters.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/filters/filters.js @@ -5,8 +5,9 @@ define([ 'underscore', 'mageUtils', + 'Magento_Ui/js/core/renderer/layout', 'Magento_Ui/js/lib/collapsible' -], function (_, utils, Collapsible) { +], function (_, utils, layout, Collapsible) { 'use strict'; function extractPreview(elem) { @@ -39,15 +40,15 @@ define([ filters: { placeholder: true }, - listens: { - active: 'extractPreviews', - applied: 'cancel extractActive' - }, links: { applied: '${ $.storageConfig.path }' }, exports: { applied: '${ $.provider }:params.filters' + }, + listens: { + active: 'updatePreviews', + applied: 'cancel extractActive' } }, @@ -57,6 +58,8 @@ define([ * @returns {Filters} Chainable. */ initialize: function () { + this._processedColumns = {}; + this._super() .cancel() .extractActive(); @@ -182,12 +185,12 @@ define([ }, /** - * Extract previews of a specified filters. + * Updates previews of a specified filters. * * @param {Array} filters - Filters to be processed. * @returns {Filters} Chainable. */ - extractPreviews: function (filters) { + updatePreviews: function (filters) { var previews = filters.map(extractPreview); this.previews(_.compact(previews)); diff --git a/app/code/Magento/Ui/view/base/web/js/grid/listing.js b/app/code/Magento/Ui/view/base/web/js/grid/listing.js index fd7d70f9f7fd13f62fb111a70eacc1957655017b..299560ba2bfe5eaa6a4e06319e7388135e6ee941 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/listing.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/listing.js @@ -3,23 +3,54 @@ * See COPYING.txt for license details. */ define([ + 'underscore', 'uiComponent', - 'Magento_Ui/js/lib/spinner' -], function (Component, loader) { + 'Magento_Ui/js/lib/spinner', + 'Magento_Ui/js/core/renderer/layout' +], function (_, Component, loader, layout) { 'use strict'; return Component.extend({ defaults: { template: 'ui/grid/listing', + positions: false, + storageConfig: { + positions: '${ $.storageConfig.path }.positions' + }, + dndConfig: { + name: '${ $.name }_dnd', + component: 'Magento_Ui/js/grid/dnd', + containerTmpl: 'ui/grid/dnd/listing', + enabled: true + }, imports: { rows: '${ $.provider }:data.items' }, listens: { + elems: 'setPositions', '${ $.provider }:reload': 'showLoader', '${ $.provider }:reloaded': 'hideLoader' + }, + modules: { + dnd: '${ $.dndConfig.name }' } }, + /** + * Initializes Listing component. + * + * @returns {Listing} Chainable. + */ + initialize: function () { + this._super(); + + if (this.dndConfig.enabled) { + this.initDnd(); + } + + return this; + }, + /** * Initializes observable properties. * @@ -32,6 +63,90 @@ define([ return this; }, + /** + * Creates drag&drop widget instance. + * + * @returns {Listing} Chainable. + */ + initDnd: function () { + layout([this.dndConfig]); + + return this; + }, + + /** + * Called when another element was added to current component. + * + * @returns {Listing} Chainable. + */ + initElement: function () { + var currentCount = this.elems().length, + totalCount = this.initChildCount; + + if (totalCount === currentCount) { + this.initPositions(); + } + + return this._super(); + }, + + /** + * Defines initial order of child elements. + * + * @returns {Listing} Chainable. + */ + initPositions: function () { + var link = { + positions: this.storageConfig.positions + }; + + this.on('positions', this.applyPositions.bind(this)); + + this.setLinks(link, 'imports') + .setLinks(link, 'exports'); + + return this; + }, + + /** + * Updates current state of child positions. + * + * @returns {Listing} Chainable. + */ + setPositions: function () { + var positions = {}; + + this.elems.each(function (elem, index) { + positions[elem.index] = index; + }); + + this.set('positions', positions); + + return this; + }, + + /** + * Reseorts child elements array according to provided positions. + * + * @param {Object} positions - Object where key represents child + * index and value is its' position. + * @returns {Listing} Chainable. + */ + applyPositions: function (positions) { + var sorting; + + sorting = this.elems.map(function (elem) { + return { + elem: elem, + position: positions[elem.index] + }; + }); + + this.insertChild(sorting); + + return this; + }, + /** * Hides loader. */ diff --git a/app/code/Magento/Ui/view/base/web/js/grid/massactions.js b/app/code/Magento/Ui/view/base/web/js/grid/massactions.js index 35c792feaba23e40c19c68f2609171c798983297..21e86a6d640b2f43aab310774f09ce31d69583de 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/massactions.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/massactions.js @@ -4,37 +4,178 @@ */ define([ 'underscore', + 'uiRegistry', 'mageUtils', - 'Magento_Ui/js/lib/collapsible' -], function (_, utils, Collapsible) { + 'Magento_Ui/js/lib/collapsible', + 'Magento_Ui/js/modal/confirm', + 'Magento_Ui/js/modal/alert', + 'mage/translate' +], function (_, registry, utils, Collapsible, confirm, alert, $t) { 'use strict'; return Collapsible.extend({ defaults: { template: 'ui/grid/actions', - noItems: 'You haven\'t selected any items!' + selectProvider: '', + actions: [], + noItemsMsg: $t('You haven\'t selected any items!'), + modules: { + selections: '${ $.selectProvider }' + } }, - applyAction: function (action) { - var proceed = true, - selections = this.source.get('config.multiselect'); + /** + * Initializes observable properties. + * + * @returns {Massactions} Chainable. + */ + initObservable: function () { + this._super() + .observe('actions'); + + return this; + }, - if (!selections || !selections.total) { - proceed = false; + /** + * Applies specified action. + * + * @param {String} actionIndex - Actions' identifier. + * @returns {Massactions} Chainable. + */ + applyAction: function (actionIndex) { + var data = this.getSelections(), + action, + callback; - alert(this.noItems); - } + if (!data.total) { + alert({ + content: this.noItemsMsg + }); - if (proceed && action.confirm) { - proceed = window.confirm(action.confirm); + return this; } - if (proceed) { - utils.submit({ - url: action.url, - data: selections + action = this.getAction(actionIndex), + callback = this._getCallback(action, data); + + action.confirm ? + this._confirm(action, callback) : + callback(); + + return this; + }, + + /** + * Retrieves selections data from the selections provider. + * + * @returns {Object|Undefined} + */ + getSelections: function () { + var provider = this.selections(), + selections = provider && provider.getSelections(); + + return selections; + }, + + /** + * Retrieves action object associated with a specified index. + * + * @param {String} actionIndex - Actions' identifier. + * @returns {Object} Action object. + */ + getAction: function (actionIndex) { + return _.findWhere(this.actions(), { + type: actionIndex + }); + }, + + /** + * Adds new action. If action with a specfied identifier + * already exists, than the original one will be overrided. + * + * @param {Object} action - Action object. + * @returns {Massactions} Chainable. + */ + addAction: function (action) { + var actions = this.actions(), + index = _.findIdnex(actions, { + type: action.type }); + + ~index ? + actions[index] = action : + actions.push(action); + + this.actions(actions); + + return this; + }, + + /** + * Creates action callback based on its' data. If action doesn't spicify + * a callback function than the default one will be used. + * + * @private + * @param {Object} action - Actions' object. + * @param {Object} selections - Selections data. + * @returns {Function} Callback function. + */ + _getCallback: function (action, selections) { + var callback = action.callback, + args = [action, selections]; + + if (utils.isObject(callback)) { + args.unshift(callback.target); + + callback = registry.async(callback.provider); + } else if (typeof callback != 'function') { + callback = this.defaultCallback.bind(this); } + + return function () { + callback.apply(null, args); + }; + }, + + /** + * Default action callback. Sends selections data + * via POST request. + * + * @param {Object} data - Selections data. + * @param {Object} action - Action data. + */ + defaultCallback: function (data, action) { + var selections = {}; + + if (data.excludeMode) { + selections.excluded = data.excluded; + } else { + selections.selected = data.selected; + } + + utils.submit({ + url: action.url, + data: selections + }); + }, + + /** + * Shows actions' confirmation window. + * + * @param {Object} action - Actions' data. + * @param {Function} callback - Callback that will be + * invoked if action is confirmed. + */ + _confirm: function (action, callback) { + var confirmData = action.confirm; + + confirm({ + title: confirmData.title, + content: confirmData.message, + actions: { + confirm: callback + } + }); } }); }); diff --git a/app/code/Magento/Ui/view/base/web/js/grid/paging.js b/app/code/Magento/Ui/view/base/web/js/grid/paging.js index e04597379afa39323ca1a5700b7d5a14e06017c9..0fd512c3ffc48a3e3b840dbb2d8ef29d2ef0d829 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/paging.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/paging.js @@ -23,9 +23,10 @@ define([ template: 'ui/grid/paging', pageSize: 20, current: 1, + selectProvider: '', imports: { - totalSelected: '${ $.provider }:config.multiselect.total', + totalSelected: '${ $.selectProvider }:totalSelected', totalRecords: '${ $.provider }:data.totalRecords' }, diff --git a/app/code/Magento/Ui/view/base/web/js/lib/component/links.js b/app/code/Magento/Ui/view/base/web/js/lib/component/links.js index 94df6c5d22c3cecb1d53de18eca10c00c01e89b5..deecc3fa9a14acdaf5f59b073a7d0b067c90c7be 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/component/links.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/component/links.js @@ -81,22 +81,19 @@ define([ } function setLinked(map, data) { - var hasLink, - match; - + var match; + if (!map) { return; } - hasLink = map.some(function (item) { - match = item; - - return !item.linked && - item.target === data.target && - item.property === data.property; + match = _.findWhere(map, { + linked: false, + target: data.target, + property: data.property }); - if (hasLink) { + if (match) { match.linked = data; data.linked = match; } @@ -106,6 +103,8 @@ define([ var direction = data.direction, map = maps[direction]; + data.linked = false; + (map[property] = map[property] || []).push(data); direction = direction === 'imports' ? 'exports' : 'imports'; @@ -165,7 +164,7 @@ define([ }); }); }); - + return this; }, diff --git a/app/code/Magento/Ui/view/base/web/js/lib/component/manip.js b/app/code/Magento/Ui/view/base/web/js/lib/component/manip.js index cc82f645030e071a202ae68fca9ccb282ac27de6..a91b3cd38b611151d50068a2c41fc94a818e4085 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/component/manip.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/component/manip.js @@ -10,45 +10,17 @@ define([ ], function (ko, _, utils, registry) { 'use strict'; - function getIndex(container, target) { - var result; - - container.some(function (item, index) { - result = index; - - return item && (item.name === target || item === target); - }); - - return result; - } - function compact(container) { return container.filter(utils.isObject); } - function reserve(container, elem, position) { - var offset = position, - target; - - if (_.isObject(position)) { - target = position.after || position.before; - offset = getIndex(container, target); - - if (position.after) { - ++offset; - } - } - - offset = utils.formatOffset(container, offset); - - container[offset] ? - container.splice(offset, 0, elem) : - container[offset] = elem; - - return offset; - } - return { + /** + * Retrieves requested region. + * Creates region if it was not created yet + * + * @returns {ObservableArray}. + */ getRegion: function (name) { var regions = this.regions = this.regions || {}; @@ -59,23 +31,65 @@ define([ return regions[name]; }, + /** + * Replaces specified regions' data with a provided one. + * Creates region if it was not created yet. + * + * @param {Array} items - New regions' data. + * @param {String} name - Name of the region. + * @returns {Component} Chainable. + */ updateRegion: function (items, name) { var region = this.getRegion(name); region(items); + + return this; }, /** * Requests specified components to insert * them into 'elems' array starting from provided position. * - * @param {String} elem - Name of the component to insert. + * @param {String} elems - Name of the component to insert. * @param {Number} [position=-1] - Position at which to insert elements. * @returns {Component} Chainable. */ - insertChild: function (elem, position) { - reserve(this._elems, elem, position); - registry.get(elem, this._insert); + insertChild: function (elems, position) { + var container = this._elems, + update = false, + newItems = [], + newItem; + + if (Array.isArray(elems)) { + newItems = elems.map(function (item) { + newItem = item.elem ? + utils.insert(item.elem, container, item.position) : + utils.insert(item, container, position); + + return newItem; + }); + } else { + newItems.push(utils.insert(elems, container, position)); + } + + newItems.forEach(function (item) { + if (!item) { + return; + } + + if (item === true) { + update = true; + } else { + _.isString(item) ? + registry.get(item, this._insert) : + this._insert(item); + } + }, this); + + if (update) { + this._update(); + } return this; }, diff --git a/app/code/Magento/Ui/view/base/web/js/lib/ko/bind/after-render.js b/app/code/Magento/Ui/view/base/web/js/lib/ko/bind/after-render.js new file mode 100644 index 0000000000000000000000000000000000000000..2297f2d5cf1764d0198b791ec6011f3b2debf2b8 --- /dev/null +++ b/app/code/Magento/Ui/view/base/web/js/lib/ko/bind/after-render.js @@ -0,0 +1,22 @@ +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +define([ + 'ko' +], function (ko) { + 'use strict'; + + ko.bindingHandlers.afterRender = { + /** + * Binding init callback. + */ + init: function (element, valueAccessor, allBindings, viewModel) { + var callback = valueAccessor(); + + if (typeof callback === 'function') { + callback(element, viewModel); + } + } + }; +}); diff --git a/app/code/Magento/Ui/view/base/web/js/lib/ko/initialize.js b/app/code/Magento/Ui/view/base/web/js/lib/ko/initialize.js index a8bb4a15077772cc66f78d7f85a00f1e94383161..2758b3f8c2391b60ff9fefa818279fc9af09a295 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/ko/initialize.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/ko/initialize.js @@ -14,11 +14,11 @@ define([ './bind/optgroup', './bind/fadeVisible', './bind/mage-init', + './bind/after-render', './extender/observable_array' -], function(ko, templateEngine) { +], function (ko, templateEngine) { 'use strict'; ko.setTemplateEngine(templateEngine); ko.applyBindings(); - }); diff --git a/app/code/Magento/Ui/view/base/web/js/lib/registry/registry.js b/app/code/Magento/Ui/view/base/web/js/lib/registry/registry.js index adf6b9176b4004d6d55c52cffe1fc2398cb13207..4bf6b21f686f8365c90515b2919c108b5fda2d8d 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/registry/registry.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/registry/registry.js @@ -7,23 +7,23 @@ define([ 'underscore', './storage', './events' -], function(utils, _, Storage, Events) { +], function (utils, _, Storage, Events) { 'use strict'; - function async(name, registry, method) { + function async(name, registry, method) { var args = _.toArray(arguments).slice(3); if (_.isString(method)) { registry.get(name, function (component) { - component[method].apply(component, args); + component[method].apply(component, args); }); } else if (_.isFunction(method)) { - registry.get(name, method); + registry.get(name, method); } else if (!args.length) { return registry.get(name); } - } - + } + function Registry() { this.storage = new Storage(); this.events = new Events(this.storage); @@ -35,9 +35,9 @@ define([ /** * Retrieves data from registry. * - * @params {(String|Array)} elems - + * @param {(String|Array)} elems - * An array of elements' names or a string of names divided by spaces. - * @params {Function} [callback] - + * @param {Function} [callback] - * Callback function that will be triggered * when all of the elements are registered. * @returns {Array|*|Undefined} @@ -45,7 +45,7 @@ define([ * or an element itself if only is requested. * If callback function is specified then returns 'undefined'. */ - get: function(elems, callback) { + get: function (elems, callback) { var records; elems = utils.stringToArray(elems) || []; @@ -64,8 +64,8 @@ define([ /** * Sets data to registry. * - * @params {String} elems - Elements' name. - * @params {*} value - Value that will be assigned to the element. + * @param {String} elem - Elements' name. + * @param {*} value - Value that will be assigned to the element. * @returns {registry} Chainable. */ set: function (elem, value) { @@ -77,7 +77,7 @@ define([ /** * Removes specified elements from a storage. - * @params {(String|Array)} elems - + * @param {(String|Array)} elems - * An array of elements' names or a string of names divided by spaces. * @returns {registry} Chainable. */ @@ -92,7 +92,7 @@ define([ /** * Checks whether specified elements has been registered. * - * @params {(String|Array)} elems - + * @param {(String|Array)} elems - * An array of elements' names or a string of names divided by spaces. * @returns {Boolean} */ diff --git a/app/code/Magento/Ui/view/base/web/js/modal/alert.js b/app/code/Magento/Ui/view/base/web/js/modal/alert.js new file mode 100644 index 0000000000000000000000000000000000000000..33be3c8041dea6c2f0586124bc3f1e8120020cef --- /dev/null +++ b/app/code/Magento/Ui/view/base/web/js/modal/alert.js @@ -0,0 +1,40 @@ +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +define([ + 'jquery', + 'underscore', + 'jquery/ui', + 'Magento_Ui/js/modal/confirm', + 'mage/translate' +], function ($, _) { + 'use strict'; + + $.widget('mage.alert', $.mage.confirm, { + options: { + modalClass: 'confirm', + title: $.mage.__('Attention'), + actions: { + always: function () {} + }, + buttons: [{ + text: $.mage.__('OK'), + class: 'action-secondary', + click: function () { + this.closeModal(true); + } + }] + }, + closeModal: function () { + this.options.actions.always(); + this.element.bind('confirmclosed', _.bind(this._remove, this)); + + return this._super(); + } + }); + + return function (config) { + return $('<div></div>').html(config.content).alert(config); + }; +}); diff --git a/app/code/Magento/Ui/view/base/web/js/modal/confirm.js b/app/code/Magento/Ui/view/base/web/js/modal/confirm.js new file mode 100644 index 0000000000000000000000000000000000000000..7bad2023b649b18edeaf710780d8cf0e73a5f6b9 --- /dev/null +++ b/app/code/Magento/Ui/view/base/web/js/modal/confirm.js @@ -0,0 +1,66 @@ +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +define([ + 'jquery', + 'underscore', + 'jquery/ui', + 'Magento_Ui/js/modal/modal', + 'mage/translate' +], function ($, _) { + 'use strict'; + + $.widget('mage.confirm', $.mage.modal, { + options: { + modalClass: 'confirm', + title: '', + actions: { + always: function(){}, + confirm: function(){}, + cancel: function(){} + }, + buttons: [{ + text: $.mage.__('Cancel'), + class: 'action-tertiary', + click: function(){ + this.closeModal(); + } + }, { + text: $.mage.__('OK'), + class: 'action-secondary', + click: function() { + this.closeModal(true); + } + }] + }, + _create: function() { + this._super(); + this.modal.find(this.options.modalCloseBtn).off().on('click', _.bind(this.closeModal, this, false)); + this.openModal(); + }, + _remove: function() { + this.modal.remove(); + }, + openModal: function() { + return this._super(); + }, + closeModal: function(result) { + result = result || false; + + if (result) { + this.options.actions.confirm(); + } else { + this.options.actions.cancel(); + } + this.options.actions.always(); + this.element.bind('confirmclosed', _.bind(this._remove, this)); + + return this._super(); + } + }); + + return function (config) { + return $('<div></div>').html(config.content).confirm(config); + }; +}); diff --git a/app/code/Magento/Ui/view/base/web/js/modal/modalToggle.js b/app/code/Magento/Ui/view/base/web/js/modal/modalToggle.js new file mode 100644 index 0000000000000000000000000000000000000000..65714ef029cf6ba25199057fc8b64ab03515b01f --- /dev/null +++ b/app/code/Magento/Ui/view/base/web/js/modal/modalToggle.js @@ -0,0 +1,28 @@ +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +define([ + 'jquery', + 'Magento_Ui/js/modal/modal' +], function($){ + 'use strict'; + + return function(config, el) { + var widget = $(config.content).modal(config); + + $(el).on(config.toggleEvent, function() { + var state = widget.data('mage-modal').options.isOpen; + + if (state) { + widget.modal('closeModal'); + } else { + widget.modal('openModal'); + } + + return false; + }); + + return widget; + }; +}); \ No newline at end of file diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/actions.html b/app/code/Magento/Ui/view/base/web/templates/grid/actions.html index 685936aa8430382b59ff1b065c74e244aadcd24a..89bf5ba4061d17358994f8a2c3cf9d8158d90d51 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/actions.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/actions.html @@ -18,8 +18,8 @@ <ul class="action-menu" data-bind="css: {'_active': opened}, - foreach: {data: actions, as: 'action'}"> - <li data-bind="click: $parent.applyAction.bind($parent, action)"> + foreach: actions"> + <li data-bind="click: $parent.applyAction.bind($parent, type)"> <span class="action-menu-item" data-bind="text: label"></span> diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/cells/actions.html b/app/code/Magento/Ui/view/base/web/templates/grid/cells/actions.html index 67f195377c669e5ba824a8be13603c69fa2aa0bf..85fba7ed0c6c2d5c725486bd30bf69b65c4ea213 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/cells/actions.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/cells/actions.html @@ -6,25 +6,47 @@ --> <td data-bind="visible: visible" class="data-grid-actions-cell"> - <!-- ko if: getDisplayed(row[field.index]).length > 1 --> - <div class="action-select-wrap _active"> - <button class="action-select"> + <!-- ko if: isSingle($parentContext.$index()) --> + <!-- ko foreach: getVisibleActions($parentContext.$index()) --> + <a + class="action-menu-item" + data-bind=" + attr: { + href: $data.href + }, + click: $parent.applyAction.bind($parent, index, rowIndex), + text: $data.label"></a> + <!-- /ko --> + <!-- /ko --> + + <!-- ko if: isMultiple($parentContext.$index()) --> + <div + class="action-select-wrap" + data-bind=" + css : { + '_active' : opened() === $parentContext.$index() + }, + outerClick: closeList.bind($data, $parentContext.$index())"> + <button class="action-select" data-bind="click: toggleList.bind($data, $parentContext.$index())"> <span data-bind="text: $t('Select')"></span> </button> - <ul class="action-menu _active"> + <ul + class="action-menu" + data-bind=" + css: {'_active': opened() === $parentContext.$index()}"> + <!-- ko foreach: getVisibleActions($parentContext.$index()) --> <li> <a class="action-menu-item" - data-bind="attr: {href: displayed[0].href}, - text: displayed[0].label"></a> + data-bind=" + attr: { + href: $data.href + }, + click: $parent.applyAction.bind($parent, index, rowIndex), + text: $data.label"></a> </li> + <!-- /ko --> </ul> </div> <!-- /ko --> - <!-- ko ifnot: getDisplayed(row[field.index]).length > 1 --> - <a - class="action-menu-item" - data-bind="attr: {href: displayed[0].href}, - text: displayed[0].label"></a> - <!-- /ko --> </td> diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/cells/html.html b/app/code/Magento/Ui/view/base/web/templates/grid/cells/html.html index 27d6bfcf6216b5a5d6ace4d652e681814b99bcaf..166a4f1f9b7e9a7d25b6a973f95e462019e9234e 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/cells/html.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/cells/html.html @@ -5,7 +5,9 @@ */ --> <td - data-bind="visible: visible, - click: isClickable(row) ? redirect.bind($data, getClickUrl(row)) : false, - html: getLabel(row[field.index])" + data-bind=" + visible: visible, + css: { _dragging: dragging }, + click: isClickable(row) ? redirect.bind($data, getClickUrl(row)) : false, + html: getLabel(row[field.index])" data-action="grid-row-edit"></td> \ No newline at end of file diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/cells/multiselect.html b/app/code/Magento/Ui/view/base/web/templates/grid/cells/multiselect.html index 81e6b2c5bc3706a042daf1f6e2b3725e84b681c4..c11acd1f36ecea301095cea6258c9b1a65c781e7 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/cells/multiselect.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/cells/multiselect.html @@ -10,9 +10,12 @@ <input class="admin__control-checkbox" type="checkbox" - data-bind="checked: selected, - value: row[indexField], - attr: {id: 'check' + row[indexField]}"> + data-bind=" + checked: selected, + value: row[indexField], + attr: { + id: 'check' + row[indexField] + }"> <label data-bind="attr: {for: 'check' + row[indexField]}"></label> </label> </td> diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/cells/text.html b/app/code/Magento/Ui/view/base/web/templates/grid/cells/text.html index 257b4b0585d45aec84541ae338780047e16e3852..09ecafbdfbab9bf193a52b0f28063a79693ba68d 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/cells/text.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/cells/text.html @@ -4,8 +4,10 @@ * See COPYING.txt for license details. */ --> -<td - data-bind="visible: visible, - click: isClickable(row) ? redirect.bind($data, getClickUrl(row)) : false, - text: getLabel(row[field.index])" +<td + data-bind=" + visible: visible, + css: { _dragging: dragging }, + click: isClickable(row) ? redirect.bind($data, getClickUrl(row)) : false, + text: getLabel(row[field.index])" data-action="grid-row-edit"></td> \ No newline at end of file diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/columns/actions.html b/app/code/Magento/Ui/view/base/web/templates/grid/columns/actions.html deleted file mode 100644 index 5d3aaa53d9bafc964ba9515d5fa6cb900de9c594..0000000000000000000000000000000000000000 --- a/app/code/Magento/Ui/view/base/web/templates/grid/columns/actions.html +++ /dev/null @@ -1,10 +0,0 @@ -<!-- -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<th class="data-grid-th data-grid-actions-cell" data-bind="visible: visible"> - <span data-bind="text: label"></span> -</th> diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/columns/text.html b/app/code/Magento/Ui/view/base/web/templates/grid/columns/text.html index dc7b883659adb7cc690246acbc840cc12520ef6d..41207503828c1221929d6b0eb96914dcd45b5b00 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/columns/text.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/columns/text.html @@ -4,17 +4,21 @@ * See COPYING.txt for license details. */ --> - -<!-- ko if: sortable --> - <th - class="data-grid-th _sortable" - data-bind="css: sortClass, click: sort, visible: visible"> - <span data-bind="text: label"></span> - </th> -<!-- /ko --> - -<!-- ko ifnot: sortable --> - <th class="data-grid-th" data-bind="visible: visible"> - <span data-bind="text: label"></span> - </th> -<!-- /ko --> +<th + class="data-grid-th" + data-bind=" + afterRender: draggable && $parent.dndConfig.enabled ? + (function (elem) { $parent.dnd('addColumn', elem); }) : + false, + css: { + '_sortable': sortable, + '_draggable': draggable, + '_ascend': sorting() === 'asc', + '_descend': sorting() === 'desc', + '_dragover-left': dragover() === 'right', + '_dragover-right': dragover() === 'left' + }, + click: sort, + visible: visible"> + <span data-bind="text: label"></span> +</th> diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/dnd/listing.html b/app/code/Magento/Ui/view/base/web/templates/grid/dnd/listing.html new file mode 100644 index 0000000000000000000000000000000000000000..38b622cdef6cfe21bfe25e9176b2ff90c8fe1a8b --- /dev/null +++ b/app/code/Magento/Ui/view/base/web/templates/grid/dnd/listing.html @@ -0,0 +1,42 @@ + +<!-- +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<table + class="data-grid _dragging-copy _hidden" + data-bind=" + afterRender: function (elem) { dnd('setDragTable', elem); } + "> + <thead data-part="head"> + <tr data-part="head.row"> + <!-- ko foreach: elems --> + <!-- ko if: dragging --> + <!-- ko template: getHeader() --><!-- /ko --> + <!-- /ko --> + <!-- /ko --> + </tr> + </thead> + <tbody data-part="body"> + <!-- ko if: hasData() --> + <!-- ko foreach: { data: rows, as: 'row' } --> + <tr data-part="body.row"> + <!-- ko foreach: { data: $parent.elems, as: 'field' } --> + <!-- ko if: dragging --> + <!-- ko template: getBody() --><!-- /ko --> + <!-- /ko --> + <!-- /ko --> + </tr> + <!-- /ko --> + <!-- /ko --> + + <!-- ko ifnot: hasData() --> + <tr class="data-grid-tr-no-data"> + <td data-bind="attr: { colspan: getColspan() }, + text: $t('We couldn\'t find any records.')"></td> + </tr> + <!-- /ko --> + </tbody> +</table> \ No newline at end of file diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/listing.html b/app/code/Magento/Ui/view/base/web/templates/grid/listing.html index c3de27d5c7e52f97647170b06fc6a3b1e8b67162..118136c29fd86c65a84adf1fc1b4cd676c67f2fc 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/listing.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/listing.html @@ -4,15 +4,20 @@ * See COPYING.txt for license details. */ --> - <div class="admin__data-grid-wrap"> - <table class="data-grid"> + <table + class="data-grid" + data-bind=" + afterRender: dndConfig.enabled ? + function (elem) { dnd('setTable', elem); } : + false, + css: { + 'data-grid-draggable': dndConfig.enabled + }"> <thead data-part="head"> <tr data-part="head.row"> <!-- ko foreach: elems --> - <!-- ko if: visible --> - <!-- ko template: getHeader() --><!-- /ko --> - <!-- /ko --> + <!-- ko template: getHeader() --><!-- /ko --> <!-- /ko --> </tr> </thead> @@ -21,9 +26,7 @@ <!-- ko foreach: { data: rows, as: 'row' } --> <tr data-part="body.row"> <!-- ko foreach: { data: $parent.elems, as: 'field' } --> - <!-- ko if: visible --> - <!-- ko template: getBody() --><!-- /ko --> - <!-- /ko --> + <!-- ko template: getBody() --><!-- /ko --> <!-- /ko --> </tr> <!-- /ko --> @@ -37,4 +40,7 @@ <!-- /ko --> </tbody> </table> + <!-- ko if: dndConfig.enabled --> + <!-- ko template: dndConfig.containerTmpl --><!-- /ko --> + <!-- /ko --> </div> \ No newline at end of file diff --git a/app/code/Magento/Ups/composer.json b/app/code/Magento/Ups/composer.json index 29ec2510c07e79abb5e21f664e90c98db3554609..871fbcdc12c1d2a6a3055ac20e0b5370575a5489 100644 --- a/app/code/Magento/Ups/composer.json +++ b/app/code/Magento/Ups/composer.json @@ -3,18 +3,18 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/module-sales": "0.74.0-beta13", - "magento/module-shipping": "0.74.0-beta13", - "magento/module-directory": "0.74.0-beta13", - "magento/module-catalog-inventory": "0.74.0-beta13", - "magento/module-quote": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-store": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/module-sales": "0.74.0-beta14", + "magento/module-shipping": "0.74.0-beta14", + "magento/module-directory": "0.74.0-beta14", + "magento/module-catalog-inventory": "0.74.0-beta14", + "magento/module-quote": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/UrlRewrite/composer.json b/app/code/Magento/UrlRewrite/composer.json index 91f18fbea4728a982a17dca4cd56a0ac9f5ab88e..24a2772e11a3c6bf97a534c2fa44c09e672e3d6d 100644 --- a/app/code/Magento/UrlRewrite/composer.json +++ b/app/code/Magento/UrlRewrite/composer.json @@ -3,17 +3,17 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-catalog": "0.74.0-beta13", - "magento/module-store": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/module-catalog-url-rewrite": "0.74.0-beta13", - "magento/module-cms": "0.74.0-beta13", - "magento/module-cms-url-rewrite": "0.74.0-beta13", + "magento/module-catalog": "0.74.0-beta14", + "magento/module-store": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/module-catalog-url-rewrite": "0.74.0-beta14", + "magento/module-cms": "0.74.0-beta14", + "magento/module-cms-url-rewrite": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/User/composer.json b/app/code/Magento/User/composer.json index 82c4b5609f4d62e0499e75a6a4f4147da21ebdf6..b16f88f04a4c5b9cec2efb70b688923490d10226 100644 --- a/app/code/Magento/User/composer.json +++ b/app/code/Magento/User/composer.json @@ -3,15 +3,15 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta13", - "magento/module-authorization": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/module-integration": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-store": "0.74.0-beta14", + "magento/module-authorization": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/module-integration": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Usps/composer.json b/app/code/Magento/Usps/composer.json index 625a904edd642d843d9d02ec910e2616a242dd5f..59b75138b5be4d8cb021390eec32bc8747c00f8e 100644 --- a/app/code/Magento/Usps/composer.json +++ b/app/code/Magento/Usps/composer.json @@ -3,20 +3,20 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta13", - "magento/module-shipping": "0.74.0-beta13", - "magento/module-directory": "0.74.0-beta13", - "magento/module-catalog": "0.74.0-beta13", - "magento/module-sales": "0.74.0-beta13", - "magento/module-catalog-inventory": "0.74.0-beta13", - "magento/module-quote": "0.74.0-beta13", - "magento/module-config": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-store": "0.74.0-beta14", + "magento/module-shipping": "0.74.0-beta14", + "magento/module-directory": "0.74.0-beta14", + "magento/module-catalog": "0.74.0-beta14", + "magento/module-sales": "0.74.0-beta14", + "magento/module-catalog-inventory": "0.74.0-beta14", + "magento/module-quote": "0.74.0-beta14", + "magento/module-config": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "lib-libxml": "*", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Variable/composer.json b/app/code/Magento/Variable/composer.json index b61f8fe802c68ffa61e53966cb117e1f439a4436..58eb8dbd4b6c0be1e41c82dd72972cde940dfe8c 100644 --- a/app/code/Magento/Variable/composer.json +++ b/app/code/Magento/Variable/composer.json @@ -3,14 +3,14 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0|~5.6.0", - "magento/module-backend": "0.74.0-beta13", - "magento/module-email": "0.74.0-beta13", - "magento/module-store": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-backend": "0.74.0-beta14", + "magento/module-email": "0.74.0-beta14", + "magento/module-store": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Version/composer.json b/app/code/Magento/Version/composer.json index 4a3025af599865f283ba05b22341148d4412162e..07feda54cfd8fcfa810c79f28b9775b8abd4951b 100644 --- a/app/code/Magento/Version/composer.json +++ b/app/code/Magento/Version/composer.json @@ -3,11 +3,11 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/framework": "0.74.0-beta13", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Webapi/composer.json b/app/code/Magento/Webapi/composer.json index 94d5b769e85526178ded1e4a57d0488acccca8b6..7c018de1b3b051d135d1fe69741e44a94185723c 100644 --- a/app/code/Magento/Webapi/composer.json +++ b/app/code/Magento/Webapi/composer.json @@ -3,18 +3,18 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta13", - "magento/module-authorization": "0.74.0-beta13", - "magento/module-integration": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-store": "0.74.0-beta14", + "magento/module-authorization": "0.74.0-beta14", + "magento/module-integration": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "suggest": { - "magento/module-user": "0.74.0-beta13" + "magento/module-user": "0.74.0-beta14" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Weee/composer.json b/app/code/Magento/Weee/composer.json index ba0a615bab17ec2d4cd8221715dd418b87785220..7102e797d034a46b70b9724af86c42669e9a8d1b 100644 --- a/app/code/Magento/Weee/composer.json +++ b/app/code/Magento/Weee/composer.json @@ -3,21 +3,21 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta13", - "magento/module-catalog": "0.74.0-beta13", - "magento/module-tax": "0.74.0-beta13", - "magento/module-sales": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/module-directory": "0.74.0-beta13", - "magento/module-eav": "0.74.0-beta13", - "magento/module-customer": "0.74.0-beta13", - "magento/module-quote": "0.74.0-beta13", - "magento/module-checkout": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/module-store": "0.74.0-beta14", + "magento/module-catalog": "0.74.0-beta14", + "magento/module-tax": "0.74.0-beta14", + "magento/module-sales": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/module-directory": "0.74.0-beta14", + "magento/module-eav": "0.74.0-beta14", + "magento/module-customer": "0.74.0-beta14", + "magento/module-quote": "0.74.0-beta14", + "magento/module-checkout": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Widget/composer.json b/app/code/Magento/Widget/composer.json index cfecd20e99f1b7ad876322a228f0868b448e1c05..53ed15c7b6fb5644a930350c0ef7825766161645 100644 --- a/app/code/Magento/Widget/composer.json +++ b/app/code/Magento/Widget/composer.json @@ -3,17 +3,17 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta13", - "magento/module-cms": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/module-catalog": "0.74.0-beta13", - "magento/module-theme": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", - "magento/module-variable": "0.74.0-beta13", + "magento/module-store": "0.74.0-beta14", + "magento/module-cms": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/module-catalog": "0.74.0-beta14", + "magento/module-theme": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", + "magento/module-variable": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Wishlist/composer.json b/app/code/Magento/Wishlist/composer.json index 703058cbf5f90410d1631d2d9dedda1ad6c026f4..31d183b64bb0ae5cafd1f548adcc4c776cf12132 100644 --- a/app/code/Magento/Wishlist/composer.json +++ b/app/code/Magento/Wishlist/composer.json @@ -3,28 +3,28 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta13", - "magento/module-customer": "0.74.0-beta13", - "magento/module-catalog": "0.74.0-beta13", - "magento/module-checkout": "0.74.0-beta13", - "magento/module-theme": "0.74.0-beta13", - "magento/module-catalog-inventory": "0.74.0-beta13", - "magento/module-rss": "0.74.0-beta13", - "magento/module-backend": "0.74.0-beta13", - "magento/module-sales": "0.74.0-beta13", - "magento/module-grouped-product": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", - "magento/module-ui": "0.74.0-beta13", + "magento/module-store": "0.74.0-beta14", + "magento/module-customer": "0.74.0-beta14", + "magento/module-catalog": "0.74.0-beta14", + "magento/module-checkout": "0.74.0-beta14", + "magento/module-theme": "0.74.0-beta14", + "magento/module-catalog-inventory": "0.74.0-beta14", + "magento/module-rss": "0.74.0-beta14", + "magento/module-backend": "0.74.0-beta14", + "magento/module-sales": "0.74.0-beta14", + "magento/module-grouped-product": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", + "magento/module-ui": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "suggest": { - "magento/module-configurable-product": "0.74.0-beta13", - "magento/module-downloadable": "0.74.0-beta13", - "magento/module-bundle": "0.74.0-beta13", - "magento/module-cookie": "0.74.0-beta13" + "magento/module-configurable-product": "0.74.0-beta14", + "magento/module-downloadable": "0.74.0-beta14", + "magento/module-bundle": "0.74.0-beta14", + "magento/module-cookie": "0.74.0-beta14" }, "type": "magento2-module", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/header/actions-group/_search.less b/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/header/actions-group/_search.less index 27524d7d4d0854693596871cd21c5d8f05dd84b8..ff4c338c62faa30c58cd734cf4e1f0025fe74444 100644 --- a/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/header/actions-group/_search.less +++ b/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/header/actions-group/_search.less @@ -95,6 +95,9 @@ display: block; font-size: @font-size__s; padding: @search-global-input__padding-top @search-global-input__padding-side @search-global-input__padding-bottom; + &._active { + background-color: @color-blue-clear-sky; + } } .title { display: block; diff --git a/app/design/adminhtml/Magento/backend/Magento_Ui/web/css/source/module/_data-grid.less b/app/design/adminhtml/Magento/backend/Magento_Ui/web/css/source/module/_data-grid.less index d3ef739a9435a77614ee1bcf3a302cfd274cc7ef..a243bf34f061e922823d54c49ac504676092250b 100644 --- a/app/design/adminhtml/Magento/backend/Magento_Ui/web/css/source/module/_data-grid.less +++ b/app/design/adminhtml/Magento/backend/Magento_Ui/web/css/source/module/_data-grid.less @@ -48,6 +48,10 @@ @data-grid-row-parent-marker__size: 1rem; +@data-grid-td__dragging__opacity: 95%; +@data-grid-dragging-copy__border-color: @color-blue-pure; +@data-grid-dragging-copy__border: 1px solid @data-grid-dragging-copy__border-color; + // .admin__data-grid-outer-wrap { @@ -106,6 +110,9 @@ &:nth-child(even) { td { background-color: @data-grid-td__even__background-color; + &._dragging { + background-color: fade(@data-grid-td__even__background-color, @data-grid-td__dragging__opacity); + } } } &.data-grid-tr-no-data { @@ -154,7 +161,21 @@ &:last-child { border-right-style: @data-grid-td__border-outer-style; } + &._dragging { + color: fade(@table__color, @data-grid-td__dragging__opacity); + background-color: fade(@data-grid-td__odd__background-color, @data-grid-td__dragging__opacity); + a { + color: fade(@link__color, @data-grid-td__dragging__opacity); + &:hover { + color: fade(@link__hover__color, @data-grid-td__dragging__opacity); + } + } + } + // Action select data grid styles (can be action-select-secondary in future) + .action-select-wrap { + position: static; + } .action-select { .link-pattern(); background-color: transparent; @@ -168,6 +189,9 @@ } &:after { border-color: @link__color transparent transparent transparent; + margin: .6rem 0 0 .7rem; + right: auto; + top: auto; } &:before { display: none; @@ -175,6 +199,8 @@ } .action-menu { left: auto; + right: auto; + top: auto; z-index: 1; } } @@ -189,11 +215,22 @@ &:first-child { border-left-color: @data-grid-th__border-color; } + &._dragover-left { + box-shadow: inset 3px 0 0px 0px @color-white; + } + &._dragover-right { + box-shadow: inset -3px 0 0px 0px @color-white; + } } .data-grid-th { color: @data-grid-th__color; padding: @data-grid-th__padding-vertical @data-grid-th__padding-horizontal; vertical-align: middle; + &._draggable { + cursor: -webkit-grab; + cursor: -moz-grab; + cursor: grab; + } &._sortable { background-clip: padding-box; // Fix for border overlay in Firefox cursor: pointer; @@ -281,6 +318,45 @@ } } } + // Draggable columns + &._hidden { + display: none; + } + &.data-grid-draggable { + background-color: @color-black; + } + &._dragging-copy { + background-color: @color-white; + box-shadow: @component__box-shadow__base; + left: 0; + opacity: .95; + position: fixed; + top: 0; + z-index: @overlay__z-index; + .data-grid-th { + border: @data-grid-dragging-copy__border; + border-bottom: none; + } + .data-grid-th, + .data-grid-th._sortable { + cursor: -webkit-grabbing; + cursor: -moz-grabbing; + cursor: grabbing; + } + tbody { + tr { + &:last-child { + td { + border-bottom: @data-grid-dragging-copy__border; + } + } + } + td { + border-left: @data-grid-dragging-copy__border; + border-right: @data-grid-dragging-copy__border; + } + } + } } // Ascend & Descend sort marker @@ -349,4 +425,4 @@ &._col-xs { width: 1%; } -} +} \ No newline at end of file diff --git a/app/design/adminhtml/Magento/backend/composer.json b/app/design/adminhtml/Magento/backend/composer.json index 58fbb8be56c6018d058fc9797820f32babab0f07..a635d2f6368d6f8d066d468efc7a6056820e06e4 100644 --- a/app/design/adminhtml/Magento/backend/composer.json +++ b/app/design/adminhtml/Magento/backend/composer.json @@ -3,11 +3,11 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/framework": "0.74.0-beta13", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-theme", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/design/adminhtml/Magento/backend/web/css/source/_classes.less b/app/design/adminhtml/Magento/backend/web/css/source/_classes.less index 7562f5de527b2a29ee016193b59c95d76b0912d2..ef23f9abd3aba56beb7a5f80218731c402d0081e 100644 --- a/app/design/adminhtml/Magento/backend/web/css/source/_classes.less +++ b/app/design/adminhtml/Magento/backend/web/css/source/_classes.less @@ -19,3 +19,11 @@ .a-center { // ToDo UI: should be renamed to ._text-center text-align: center; } + +// No select +._no-select { + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} diff --git a/app/design/frontend/Magento/blank/composer.json b/app/design/frontend/Magento/blank/composer.json index ed12dd50070e3732d4d1dad3ae1035b8452d9dc4..e715b5304c3a39ca06f52c98c37a438a68cf839d 100644 --- a/app/design/frontend/Magento/blank/composer.json +++ b/app/design/frontend/Magento/blank/composer.json @@ -3,11 +3,11 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/framework": "0.74.0-beta13", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-theme", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/design/frontend/Magento/luma/composer.json b/app/design/frontend/Magento/luma/composer.json index 84cbda7b1c907d6bc7262137162476f6a1d94ca3..011484f9abf79fb35ffa25a064e3debc221029ee 100644 --- a/app/design/frontend/Magento/luma/composer.json +++ b/app/design/frontend/Magento/luma/composer.json @@ -3,12 +3,12 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/theme-frontend-blank": "0.74.0-beta13", - "magento/framework": "0.74.0-beta13", + "magento/theme-frontend-blank": "0.74.0-beta14", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-theme", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/i18n/magento/de_de/composer.json b/app/i18n/magento/de_de/composer.json index 8792a746870334173328153bee80077157349745..752d5584e51535511fc382bd1edfad901affa4fd 100644 --- a/app/i18n/magento/de_de/composer.json +++ b/app/i18n/magento/de_de/composer.json @@ -1,13 +1,13 @@ { "name": "magento/language-de_de", "description": "German (Germany) language", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" ], "require": { - "magento/framework": "0.74.0-beta13", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-language", diff --git a/app/i18n/magento/en_us/composer.json b/app/i18n/magento/en_us/composer.json index 12f592f50bc7f6772183dc3e44a42ecb65fbfb05..4feb2ced23f3e909170d222c43410ff08edc5cd7 100644 --- a/app/i18n/magento/en_us/composer.json +++ b/app/i18n/magento/en_us/composer.json @@ -1,13 +1,13 @@ { "name": "magento/language-en_us", "description": "English (United States) language", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" ], "require": { - "magento/framework": "0.74.0-beta13", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-language", diff --git a/app/i18n/magento/es_es/composer.json b/app/i18n/magento/es_es/composer.json index eec09e8483fbe8846f06947d7d8fef60d284d0d0..c2a70d39babadc84b11b03652e750d590ffd15fa 100644 --- a/app/i18n/magento/es_es/composer.json +++ b/app/i18n/magento/es_es/composer.json @@ -1,13 +1,13 @@ { "name": "magento/language-es_es", "description": "Spanish (Spain) language", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" ], "require": { - "magento/framework": "0.74.0-beta13", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-language", diff --git a/app/i18n/magento/fr_fr/composer.json b/app/i18n/magento/fr_fr/composer.json index 7ff13b7e8f3aa58340613fe97806ecfcc1b174aa..b6c40d9c8fa9be5d193c4f81534ab9cf0bebdd89 100644 --- a/app/i18n/magento/fr_fr/composer.json +++ b/app/i18n/magento/fr_fr/composer.json @@ -1,13 +1,13 @@ { "name": "magento/language-fr_fr", "description": "French (France) language", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" ], "require": { - "magento/framework": "0.74.0-beta13", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-language", diff --git a/app/i18n/magento/nl_nl/composer.json b/app/i18n/magento/nl_nl/composer.json index af92cc0e22f2de55041a7b8d0f6973cfa7244e09..c905b708215fd32745c8c1313fca3649c31f4c7c 100644 --- a/app/i18n/magento/nl_nl/composer.json +++ b/app/i18n/magento/nl_nl/composer.json @@ -1,13 +1,13 @@ { "name": "magento/language-nl_nl", "description": "Dutch (Netherlands) language", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" ], "require": { - "magento/framework": "0.74.0-beta13", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-language", diff --git a/app/i18n/magento/pt_br/composer.json b/app/i18n/magento/pt_br/composer.json index ea475dfb76206af0453c1d37586d71107d2ea7bb..4f80afff03c0adbfab31185741fdb201c6391b50 100644 --- a/app/i18n/magento/pt_br/composer.json +++ b/app/i18n/magento/pt_br/composer.json @@ -1,13 +1,13 @@ { "name": "magento/language-pt_br", "description": "Portuguese (Brazil) language", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" ], "require": { - "magento/framework": "0.74.0-beta13", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-language", diff --git a/app/i18n/magento/zh_cn/composer.json b/app/i18n/magento/zh_cn/composer.json index fe43b44fcdc7f9e7a3f2b31fa64b08e5bee94b3b..63c14d0af900801962fcaa32f179cf375fa451f9 100644 --- a/app/i18n/magento/zh_cn/composer.json +++ b/app/i18n/magento/zh_cn/composer.json @@ -1,13 +1,13 @@ { "name": "magento/language-zh_cn", "description": "Chinese (China) language", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" ], "require": { - "magento/framework": "0.74.0-beta13", + "magento/framework": "0.74.0-beta14", "magento/magento-composer-installer": "*" }, "type": "magento2-language", diff --git a/composer.json b/composer.json index 94549cfd2878cbc97c0476f54c7a7f2d4f1b093f..2fca4d005a36670877caf6253c70e0bb38e92a90 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "magento/magento2ce", "description": "Magento 2 (Community Edition)", "type": "project", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/composer.lock b/composer.lock index 77a18945169153ccdfd51d970fdd2255c499d42b..4e3421ad6e05957d87c2807e67fe0152cbf10bac 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +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": "daa84b5d3ea8eabcd1bb1f33c07e08dd", + "hash": "32f26595c37e07bb66613d23424788e0", "packages": [ { "name": "composer/composer", @@ -49,7 +49,7 @@ "Composer": "src/" } }, - "notification-url": "https://packagist.org/downloads/", + "notification-url": "http://packagist.org/downloads/", "license": [ "MIT" ], @@ -261,7 +261,7 @@ "ZF1", "framework" ], - "time": "2015-06-02 08:04:41" + "time": "2015-02-06 17:25:45" }, { "name": "monolog/monolog", @@ -567,7 +567,7 @@ "Symfony\\Component\\Finder\\": "" } }, - "notification-url": "https://packagist.org/downloads/", + "notification-url": "http://packagist.org/downloads/", "license": [ "MIT" ], @@ -616,7 +616,7 @@ "Symfony\\Component\\Process\\": "" } }, - "notification-url": "https://packagist.org/downloads/", + "notification-url": "http://packagist.org/downloads/", "license": [ "MIT" ], @@ -684,12 +684,12 @@ "source": { "type": "git", "url": "https://github.com/zendframework/zend-code.git", - "reference": "0ed94f842ba60cdc900c46a61bdbd7ac95a3e140" + "reference": "cfd5951ff4348e4430850560416c7ddb755f95d3" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/zendframework/zend-code/zipball/0ed94f842ba60cdc900c46a61bdbd7ac95a3e140", - "reference": "0ed94f842ba60cdc900c46a61bdbd7ac95a3e140", + "reference": "cfd5951ff4348e4430850560416c7ddb755f95d3", "shasum": "" }, "require": { @@ -698,9 +698,6 @@ }, "require-dev": { "doctrine/common": ">=2.1", - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master", "zendframework/zend-stdlib": "self.version" }, "suggest": { @@ -716,7 +713,7 @@ }, "autoload": { "psr-4": { - "Zend\\Code\\": "src/" + "Zend\\Code\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -724,12 +721,12 @@ "BSD-3-Clause" ], "description": "provides facilities to generate arbitrary code using an object oriented interface", - "homepage": "https://github.com/zendframework/zend-code", + "homepage": "https://github.com/zendframework/zf2", "keywords": [ "code", "zf2" ], - "time": "2015-03-31 15:39:14" + "time": "2015-04-01 17:59:08" }, { "name": "zendframework/zend-config", @@ -737,12 +734,12 @@ "source": { "type": "git", "url": "https://github.com/zendframework/zend-config.git", - "reference": "95f3a4b3fa85d49e6f060183122de4596fa6d29d" + "reference": "8682fe4e2923b383bb6472fc84b5796a07589163" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/zendframework/zend-config/zipball/95f3a4b3fa85d49e6f060183122de4596fa6d29d", - "reference": "95f3a4b3fa85d49e6f060183122de4596fa6d29d", + "reference": "8682fe4e2923b383bb6472fc84b5796a07589163", "shasum": "" }, "require": { @@ -750,9 +747,6 @@ "zendframework/zend-stdlib": "self.version" }, "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master", "zendframework/zend-filter": "self.version", "zendframework/zend-i18n": "self.version", "zendframework/zend-json": "self.version", @@ -773,7 +767,7 @@ }, "autoload": { "psr-4": { - "Zend\\Config\\": "src/" + "Zend\\Config\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -781,12 +775,12 @@ "BSD-3-Clause" ], "description": "provides a nested object property based user interface for accessing this configuration data within application code", - "homepage": "https://github.com/zendframework/zend-config", + "homepage": "https://github.com/zendframework/zf2", "keywords": [ "config", "zf2" ], - "time": "2015-03-25 20:55:48" + "time": "2015-04-01 17:59:31" }, { "name": "zendframework/zend-console", @@ -794,23 +788,18 @@ "source": { "type": "git", "url": "https://github.com/zendframework/zend-console.git", - "reference": "54823d9ba6f8ce39046384ee5a043b5b3d5f56d7" + "reference": "94ab6663b07e19f20b3319ecf317bd72b6a72dca" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/zendframework/zend-console/zipball/54823d9ba6f8ce39046384ee5a043b5b3d5f56d7", - "reference": "54823d9ba6f8ce39046384ee5a043b5b3d5f56d7", + "reference": "94ab6663b07e19f20b3319ecf317bd72b6a72dca", "shasum": "" }, "require": { "php": ">=5.3.23", "zendframework/zend-stdlib": "self.version" }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master" - }, "suggest": { "zendframework/zend-filter": "To support DefaultRouteMatcher usage", "zendframework/zend-validator": "To support DefaultRouteMatcher usage" @@ -824,19 +813,19 @@ }, "autoload": { "psr-4": { - "Zend\\Console\\": "src/" + "Zend\\Console\\": "" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], - "homepage": "https://github.com/zendframework/zend-console", + "homepage": "https://github.com/zendframework/zf2", "keywords": [ "console", "zf2" ], - "time": "2015-03-25 20:55:48" + "time": "2015-04-01 17:59:48" }, { "name": "zendframework/zend-di", @@ -844,12 +833,12 @@ "source": { "type": "git", "url": "https://github.com/zendframework/zend-di.git", - "reference": "b9f8de081adecf71a003a569e9ba76c0a4c00bf2" + "reference": "0811f2a67ad0b50dfb8d602ed67cde0b82249190" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/zendframework/zend-di/zipball/b9f8de081adecf71a003a569e9ba76c0a4c00bf2", - "reference": "b9f8de081adecf71a003a569e9ba76c0a4c00bf2", + "reference": "0811f2a67ad0b50dfb8d602ed67cde0b82249190", "shasum": "" }, "require": { @@ -858,9 +847,6 @@ "zendframework/zend-stdlib": "self.version" }, "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master", "zendframework/zend-servicemanager": "self.version" }, "suggest": { @@ -875,19 +861,19 @@ }, "autoload": { "psr-4": { - "Zend\\Di\\": "src/" + "Zend\\Di\\": "" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], - "homepage": "https://github.com/zendframework/zend-di", + "homepage": "https://github.com/zendframework/zf2", "keywords": [ "di", "zf2" ], - "time": "2015-03-25 20:55:48" + "time": "2015-04-01 18:01:30" }, { "name": "zendframework/zend-escaper", @@ -895,22 +881,17 @@ "source": { "type": "git", "url": "https://github.com/zendframework/zend-escaper.git", - "reference": "15e5769e4fcdb4bf07ebd76500810e7070e23a97" + "reference": "65b3328627362b0be1d5e9067bc846511d1fbc96" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/zendframework/zend-escaper/zipball/15e5769e4fcdb4bf07ebd76500810e7070e23a97", - "reference": "15e5769e4fcdb4bf07ebd76500810e7070e23a97", + "reference": "65b3328627362b0be1d5e9067bc846511d1fbc96", "shasum": "" }, "require": { "php": ">=5.3.23" }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master" - }, "type": "library", "extra": { "branch-alias": { @@ -920,19 +901,19 @@ }, "autoload": { "psr-4": { - "Zend\\Escaper\\": "src/" + "Zend\\Escaper\\": "" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], - "homepage": "https://github.com/zendframework/zend-escaper", + "homepage": "https://github.com/zendframework/zf2", "keywords": [ "escaper", "zf2" ], - "time": "2015-03-23 18:29:14" + "time": "2015-04-01 18:02:07" }, { "name": "zendframework/zend-eventmanager", @@ -940,23 +921,18 @@ "source": { "type": "git", "url": "https://github.com/zendframework/zend-eventmanager.git", - "reference": "58d21c95c7005a527262fd536499195f104e83f9" + "reference": "38df5b567d4ff4d22144745c503ba0502d0d5695" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/zendframework/zend-eventmanager/zipball/58d21c95c7005a527262fd536499195f104e83f9", - "reference": "58d21c95c7005a527262fd536499195f104e83f9", + "reference": "38df5b567d4ff4d22144745c503ba0502d0d5695", "shasum": "" }, "require": { "php": ">=5.3.23", "zendframework/zend-stdlib": "self.version" }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master" - }, "type": "library", "extra": { "branch-alias": { @@ -966,19 +942,19 @@ }, "autoload": { "psr-4": { - "Zend\\EventManager\\": "src/" + "Zend\\EventManager\\": "" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], - "homepage": "https://github.com/zendframework/zend-event-manager", + "homepage": "https://github.com/zendframework/zf2", "keywords": [ "eventmanager", "zf2" ], - "time": "2015-03-23 18:29:14" + "time": "2015-04-01 18:05:26" }, { "name": "zendframework/zend-filter", @@ -986,12 +962,12 @@ "source": { "type": "git", "url": "https://github.com/zendframework/zend-filter.git", - "reference": "6d8aed2da81b62a04747346c4370562cdbe34595" + "reference": "b13741a88553351fc52472de529b57b580b8f6f1" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/zendframework/zend-filter/zipball/6d8aed2da81b62a04747346c4370562cdbe34595", - "reference": "6d8aed2da81b62a04747346c4370562cdbe34595", + "reference": "b13741a88553351fc52472de529b57b580b8f6f1", "shasum": "" }, "require": { @@ -999,9 +975,6 @@ "zendframework/zend-stdlib": "self.version" }, "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master", "zendframework/zend-crypt": "self.version", "zendframework/zend-servicemanager": "self.version", "zendframework/zend-uri": "self.version" @@ -1021,7 +994,7 @@ }, "autoload": { "psr-4": { - "Zend\\Filter\\": "src/" + "Zend\\Filter\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -1029,12 +1002,12 @@ "BSD-3-Clause" ], "description": "provides a set of commonly needed data filters", - "homepage": "https://github.com/zendframework/zend-filter", + "homepage": "https://github.com/zendframework/zf2", "keywords": [ "filter", "zf2" ], - "time": "2015-03-25 20:55:48" + "time": "2015-04-01 18:09:25" }, { "name": "zendframework/zend-form", @@ -1042,12 +1015,12 @@ "source": { "type": "git", "url": "https://github.com/zendframework/zend-form.git", - "reference": "bca0db55718355d25c2c10fdd41a83561f1c94b3" + "reference": "09f5bd46ffbf783df22281898e2175b291bd43a3" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/zendframework/zend-form/zipball/bca0db55718355d25c2c10fdd41a83561f1c94b3", - "reference": "bca0db55718355d25c2c10fdd41a83561f1c94b3", + "reference": "09f5bd46ffbf783df22281898e2175b291bd43a3", "shasum": "" }, "require": { @@ -1056,9 +1029,6 @@ "zendframework/zend-stdlib": "self.version" }, "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master", "zendframework/zend-captcha": "self.version", "zendframework/zend-code": "self.version", "zendframework/zend-eventmanager": "self.version", @@ -1089,19 +1059,19 @@ }, "autoload": { "psr-4": { - "Zend\\Form\\": "src/" + "Zend\\Form\\": "" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], - "homepage": "https://github.com/zendframework/zend-form", + "homepage": "https://github.com/zendframework/zf2", "keywords": [ "form", "zf2" ], - "time": "2015-03-28 20:29:18" + "time": "2015-04-01 18:09:25" }, { "name": "zendframework/zend-http", @@ -1109,12 +1079,12 @@ "source": { "type": "git", "url": "https://github.com/zendframework/zend-http.git", - "reference": "9c6047a0bdb3094d3ea07a215ff929cc47de4deb" + "reference": "ee6220609845b32d1b2873c9ac694aef56d508f5" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/zendframework/zend-http/zipball/9c6047a0bdb3094d3ea07a215ff929cc47de4deb", - "reference": "9c6047a0bdb3094d3ea07a215ff929cc47de4deb", + "reference": "ee6220609845b32d1b2873c9ac694aef56d508f5", "shasum": "" }, "require": { @@ -1124,11 +1094,6 @@ "zendframework/zend-uri": "self.version", "zendframework/zend-validator": "self.version" }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master" - }, "type": "library", "extra": { "branch-alias": { @@ -1138,7 +1103,7 @@ }, "autoload": { "psr-4": { - "Zend\\Http\\": "src/" + "Zend\\Http\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -1146,12 +1111,12 @@ "BSD-3-Clause" ], "description": "provides an easy interface for performing Hyper-Text Transfer Protocol (HTTP) requests", - "homepage": "https://github.com/zendframework/zend-http", + "homepage": "https://github.com/zendframework/zf2", "keywords": [ "http", "zf2" ], - "time": "2015-03-27 15:46:30" + "time": "2015-04-01 18:09:25" }, { "name": "zendframework/zend-i18n", @@ -1159,12 +1124,12 @@ "source": { "type": "git", "url": "https://github.com/zendframework/zend-i18n.git", - "reference": "9aebc5287373a802540d75fe5508417f866c2e52" + "reference": "33051775d9a8c341fe3b77d1f3daa0e921e2f4bd" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/zendframework/zend-i18n/zipball/9aebc5287373a802540d75fe5508417f866c2e52", - "reference": "9aebc5287373a802540d75fe5508417f866c2e52", + "reference": "33051775d9a8c341fe3b77d1f3daa0e921e2f4bd", "shasum": "" }, "require": { @@ -1172,9 +1137,6 @@ "zendframework/zend-stdlib": "self.version" }, "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master", "zendframework/zend-cache": "self.version", "zendframework/zend-config": "self.version", "zendframework/zend-eventmanager": "self.version", @@ -1203,19 +1165,19 @@ }, "autoload": { "psr-4": { - "Zend\\I18n\\": "src/" + "Zend\\I18n\\": "" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], - "homepage": "https://github.com/zendframework/zend-i18n", + "homepage": "https://github.com/zendframework/zf2", "keywords": [ "i18n", "zf2" ], - "time": "2015-03-25 20:55:48" + "time": "2015-04-01 18:09:26" }, { "name": "zendframework/zend-inputfilter", @@ -1223,12 +1185,12 @@ "source": { "type": "git", "url": "https://github.com/zendframework/zend-inputfilter.git", - "reference": "4b1398f3635fae3cc5e873c5bb067274f3d10a93" + "reference": "16856fec61f285e41e5492235220a4dec06ab90f" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/zendframework/zend-inputfilter/zipball/4b1398f3635fae3cc5e873c5bb067274f3d10a93", - "reference": "4b1398f3635fae3cc5e873c5bb067274f3d10a93", + "reference": "16856fec61f285e41e5492235220a4dec06ab90f", "shasum": "" }, "require": { @@ -1238,9 +1200,6 @@ "zendframework/zend-validator": "self.version" }, "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master", "zendframework/zend-servicemanager": "self.version" }, "suggest": { @@ -1255,19 +1214,19 @@ }, "autoload": { "psr-4": { - "Zend\\InputFilter\\": "src/" + "Zend\\InputFilter\\": "" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], - "homepage": "https://github.com/zendframework/zend-input-filter", + "homepage": "https://github.com/zendframework/zf2", "keywords": [ "inputfilter", "zf2" ], - "time": "2015-03-23 18:29:14" + "time": "2015-04-01 18:09:26" }, { "name": "zendframework/zend-json", @@ -1275,12 +1234,12 @@ "source": { "type": "git", "url": "https://github.com/zendframework/zend-json.git", - "reference": "2d845e151c1b9a237cf1899ac31e17fb10bd1e3f" + "reference": "76aeb27e4baf39799e5ca3cf6f2fdd6748ee930c" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/zendframework/zend-json/zipball/2d845e151c1b9a237cf1899ac31e17fb10bd1e3f", - "reference": "2d845e151c1b9a237cf1899ac31e17fb10bd1e3f", + "reference": "76aeb27e4baf39799e5ca3cf6f2fdd6748ee930c", "shasum": "" }, "require": { @@ -1288,9 +1247,6 @@ "zendframework/zend-stdlib": "self.version" }, "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master", "zendframework/zend-http": "self.version", "zendframework/zend-server": "self.version" }, @@ -1308,7 +1264,7 @@ }, "autoload": { "psr-4": { - "Zend\\Json\\": "src/" + "Zend\\Json\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -1316,12 +1272,12 @@ "BSD-3-Clause" ], "description": "provides convenience methods for serializing native PHP to JSON and decoding JSON to native PHP", - "homepage": "https://github.com/zendframework/zend-json", + "homepage": "https://github.com/zendframework/zf2", "keywords": [ "json", "zf2" ], - "time": "2015-03-25 20:55:48" + "time": "2015-04-01 18:09:26" }, { "name": "zendframework/zend-loader", @@ -1329,22 +1285,17 @@ "source": { "type": "git", "url": "https://github.com/zendframework/zend-loader.git", - "reference": "65de2c7a56f8eee633c6bf1cfab73e45648880d4" + "reference": "6868b8a0c346f17fb97724c3a63aa2cbf6b94865" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/zendframework/zend-loader/zipball/65de2c7a56f8eee633c6bf1cfab73e45648880d4", - "reference": "65de2c7a56f8eee633c6bf1cfab73e45648880d4", + "reference": "6868b8a0c346f17fb97724c3a63aa2cbf6b94865", "shasum": "" }, "require": { "php": ">=5.3.23" }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master" - }, "type": "library", "extra": { "branch-alias": { @@ -1354,19 +1305,19 @@ }, "autoload": { "psr-4": { - "Zend\\Loader\\": "src/" + "Zend\\Loader\\": "" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], - "homepage": "https://github.com/zendframework/zend-loader", + "homepage": "https://github.com/zendframework/zf2", "keywords": [ "loader", "zf2" ], - "time": "2015-03-23 18:29:14" + "time": "2015-04-01 18:09:26" }, { "name": "zendframework/zend-log", @@ -1374,12 +1325,12 @@ "source": { "type": "git", "url": "https://github.com/zendframework/zend-log.git", - "reference": "002e3c810cad7e31e51c9895e9e3cb6fbd312cdd" + "reference": "2d5d20fd45470506bdaff727c46dc25fe953146e" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/zendframework/zend-log/zipball/002e3c810cad7e31e51c9895e9e3cb6fbd312cdd", - "reference": "002e3c810cad7e31e51c9895e9e3cb6fbd312cdd", + "reference": "2d5d20fd45470506bdaff727c46dc25fe953146e", "shasum": "" }, "require": { @@ -1388,9 +1339,6 @@ "zendframework/zend-stdlib": "self.version" }, "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master", "zendframework/zend-console": "self.version", "zendframework/zend-db": "self.version", "zendframework/zend-escaper": "self.version", @@ -1414,7 +1362,7 @@ }, "autoload": { "psr-4": { - "Zend\\Log\\": "src/" + "Zend\\Log\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -1422,13 +1370,13 @@ "BSD-3-Clause" ], "description": "component for general purpose logging", - "homepage": "https://github.com/zendframework/zend-log", + "homepage": "https://github.com/zendframework/zf2", "keywords": [ "log", "logging", "zf2" ], - "time": "2015-03-25 20:55:48" + "time": "2015-04-01 18:09:26" }, { "name": "zendframework/zend-math", @@ -1436,22 +1384,17 @@ "source": { "type": "git", "url": "https://github.com/zendframework/zend-math.git", - "reference": "f41fe4acfd809c14f2a802d1aa45dec8fcd2cc73" + "reference": "634123f83ca90b6613f132d0d100e6b5e9890a29" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/zendframework/zend-math/zipball/f41fe4acfd809c14f2a802d1aa45dec8fcd2cc73", - "reference": "f41fe4acfd809c14f2a802d1aa45dec8fcd2cc73", + "reference": "634123f83ca90b6613f132d0d100e6b5e9890a29", "shasum": "" }, "require": { "php": ">=5.3.23" }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master" - }, "suggest": { "ext-bcmath": "If using the bcmath functionality", "ext-gmp": "If using the gmp functionality", @@ -1467,19 +1410,19 @@ }, "autoload": { "psr-4": { - "Zend\\Math\\": "src/" + "Zend\\Math\\": "" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], - "homepage": "https://github.com/zendframework/zend-math", + "homepage": "https://github.com/zendframework/zf2", "keywords": [ "math", "zf2" ], - "time": "2015-03-23 18:29:14" + "time": "2015-04-01 18:09:27" }, { "name": "zendframework/zend-modulemanager", @@ -1487,12 +1430,12 @@ "source": { "type": "git", "url": "https://github.com/zendframework/zend-modulemanager.git", - "reference": "af7ae3cd29a1efb73cc66ae1081e606039d5c20f" + "reference": "cbe16b0eafe734a062ed0182381e64b9c953dccf" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/zendframework/zend-modulemanager/zipball/af7ae3cd29a1efb73cc66ae1081e606039d5c20f", - "reference": "af7ae3cd29a1efb73cc66ae1081e606039d5c20f", + "reference": "cbe16b0eafe734a062ed0182381e64b9c953dccf", "shasum": "" }, "require": { @@ -1501,9 +1444,6 @@ "zendframework/zend-stdlib": "self.version" }, "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master", "zendframework/zend-config": "self.version", "zendframework/zend-console": "self.version", "zendframework/zend-loader": "self.version", @@ -1525,19 +1465,19 @@ }, "autoload": { "psr-4": { - "Zend\\ModuleManager\\": "src/" + "Zend\\ModuleManager\\": "" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], - "homepage": "https://github.com/zendframework/zend-module-manager", + "homepage": "https://github.com/zendframework/zf2", "keywords": [ "modulemanager", "zf2" ], - "time": "2015-03-23 18:29:14" + "time": "2015-04-01 18:09:27" }, { "name": "zendframework/zend-mvc", @@ -1545,12 +1485,12 @@ "source": { "type": "git", "url": "https://github.com/zendframework/zend-mvc.git", - "reference": "0b4a4a829b30be510a3f215c4ff00c703ee8b431" + "reference": "bfff0f5f9e4d925ee13b8c159c9d6ae7e0db5412" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/zendframework/zend-mvc/zipball/0b4a4a829b30be510a3f215c4ff00c703ee8b431", - "reference": "0b4a4a829b30be510a3f215c4ff00c703ee8b431", + "reference": "bfff0f5f9e4d925ee13b8c159c9d6ae7e0db5412", "shasum": "" }, "require": { @@ -1561,9 +1501,6 @@ "zendframework/zend-stdlib": "self.version" }, "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master", "zendframework/zend-authentication": "self.version", "zendframework/zend-console": "self.version", "zendframework/zend-di": "self.version", @@ -1612,19 +1549,19 @@ }, "autoload": { "psr-4": { - "Zend\\Mvc\\": "src/" + "Zend\\Mvc\\": "" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], - "homepage": "https://github.com/zendframework/zend-mvc", + "homepage": "https://github.com/zendframework/zf2", "keywords": [ "mvc", "zf2" ], - "time": "2015-03-26 18:55:14" + "time": "2015-04-01 18:09:27" }, { "name": "zendframework/zend-serializer", @@ -1632,12 +1569,12 @@ "source": { "type": "git", "url": "https://github.com/zendframework/zend-serializer.git", - "reference": "3c531789a9882a5deb721356a7bd2642b65d4b09" + "reference": "a46960854d6326f0036d98c9abc7a79e36e25928" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/zendframework/zend-serializer/zipball/3c531789a9882a5deb721356a7bd2642b65d4b09", - "reference": "3c531789a9882a5deb721356a7bd2642b65d4b09", + "reference": "a46960854d6326f0036d98c9abc7a79e36e25928", "shasum": "" }, "require": { @@ -1647,9 +1584,6 @@ "zendframework/zend-stdlib": "self.version" }, "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master", "zendframework/zend-servicemanager": "self.version" }, "suggest": { @@ -1664,7 +1598,7 @@ }, "autoload": { "psr-4": { - "Zend\\Serializer\\": "src/" + "Zend\\Serializer\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -1672,12 +1606,12 @@ "BSD-3-Clause" ], "description": "provides an adapter based interface to simply generate storable representation of PHP types by different facilities, and recover", - "homepage": "https://github.com/zendframework/zend-serializer", + "homepage": "https://github.com/zendframework/zf2", "keywords": [ "serializer", "zf2" ], - "time": "2015-03-25 20:55:48" + "time": "2015-04-01 18:09:28" }, { "name": "zendframework/zend-server", @@ -1685,12 +1619,12 @@ "source": { "type": "git", "url": "https://github.com/zendframework/zend-server.git", - "reference": "d11ff0bd529d202022823d4accf5983cbd50fc49" + "reference": "fc73c34490908ba143af3c57c7e166b40c4b9f8e" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/zendframework/zend-server/zipball/d11ff0bd529d202022823d4accf5983cbd50fc49", - "reference": "d11ff0bd529d202022823d4accf5983cbd50fc49", + "reference": "fc73c34490908ba143af3c57c7e166b40c4b9f8e", "shasum": "" }, "require": { @@ -1698,11 +1632,6 @@ "zendframework/zend-code": "self.version", "zendframework/zend-stdlib": "self.version" }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master" - }, "type": "library", "extra": { "branch-alias": { @@ -1712,19 +1641,19 @@ }, "autoload": { "psr-4": { - "Zend\\Server\\": "src/" + "Zend\\Server\\": "" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], - "homepage": "https://github.com/zendframework/zend-server", + "homepage": "https://github.com/zendframework/zf2", "keywords": [ "server", "zf2" ], - "time": "2015-03-25 20:55:48" + "time": "2015-04-01 18:09:28" }, { "name": "zendframework/zend-servicemanager", @@ -1732,21 +1661,18 @@ "source": { "type": "git", "url": "https://github.com/zendframework/zend-servicemanager.git", - "reference": "57cf99fa5ac08c05a135a8d0d676c52a5e450083" + "reference": "d3c27c708a148a30608f313a5b7a61a531bd9cb9" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/zendframework/zend-servicemanager/zipball/57cf99fa5ac08c05a135a8d0d676c52a5e450083", - "reference": "57cf99fa5ac08c05a135a8d0d676c52a5e450083", + "reference": "d3c27c708a148a30608f313a5b7a61a531bd9cb9", "shasum": "" }, "require": { "php": ">=5.3.23" }, "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master", "zendframework/zend-di": "self.version" }, "suggest": { @@ -1762,19 +1688,19 @@ }, "autoload": { "psr-4": { - "Zend\\ServiceManager\\": "src/" + "Zend\\ServiceManager\\": "" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], - "homepage": "https://github.com/zendframework/zend-service-manager", + "homepage": "https://github.com/zendframework/zf2", "keywords": [ "servicemanager", "zf2" ], - "time": "2015-03-23 18:29:14" + "time": "2015-04-01 18:09:28" }, { "name": "zendframework/zend-soap", @@ -1782,12 +1708,12 @@ "source": { "type": "git", "url": "https://github.com/zendframework/zend-soap.git", - "reference": "a599463aba97ce247faf3fb443e3c7858b46449b" + "reference": "e42b900798ea95a9063fa4922da976d8b3a8ab6f" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/zendframework/zend-soap/zipball/a599463aba97ce247faf3fb443e3c7858b46449b", - "reference": "a599463aba97ce247faf3fb443e3c7858b46449b", + "reference": "e42b900798ea95a9063fa4922da976d8b3a8ab6f", "shasum": "" }, "require": { @@ -1797,9 +1723,6 @@ "zendframework/zend-uri": "self.version" }, "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master", "zendframework/zend-http": "self.version" }, "suggest": { @@ -1814,19 +1737,19 @@ }, "autoload": { "psr-4": { - "Zend\\Soap\\": "src/" + "Zend\\Soap\\": "" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], - "homepage": "https://github.com/zendframework/zend-soap", + "homepage": "https://github.com/zendframework/zf2", "keywords": [ "soap", "zf2" ], - "time": "2015-03-25 20:55:48" + "time": "2015-04-01 18:09:29" }, { "name": "zendframework/zend-stdlib", @@ -1834,21 +1757,18 @@ "source": { "type": "git", "url": "https://github.com/zendframework/zend-stdlib.git", - "reference": "cf05c5ba75606e47ffee91cedc72778da46f74c3" + "reference": "eab586f4c18af3fa63c977611939f1f4a3cf1030" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/zendframework/zend-stdlib/zipball/cf05c5ba75606e47ffee91cedc72778da46f74c3", - "reference": "cf05c5ba75606e47ffee91cedc72778da46f74c3", + "reference": "eab586f4c18af3fa63c977611939f1f4a3cf1030", "shasum": "" }, "require": { "php": ">=5.3.23" }, "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master", "zendframework/zend-eventmanager": "self.version", "zendframework/zend-filter": "self.version", "zendframework/zend-serializer": "self.version", @@ -1869,19 +1789,19 @@ }, "autoload": { "psr-4": { - "Zend\\Stdlib\\": "src/" + "Zend\\Stdlib\\": "" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], - "homepage": "https://github.com/zendframework/zend-stdlib", + "homepage": "https://github.com/zendframework/zf2", "keywords": [ "stdlib", "zf2" ], - "time": "2015-03-25 20:55:48" + "time": "2015-04-01 18:09:29" }, { "name": "zendframework/zend-text", @@ -1889,12 +1809,12 @@ "source": { "type": "git", "url": "https://github.com/zendframework/zend-text.git", - "reference": "d962ea25647b20527f3ca34ae225bbc885dabfc7" + "reference": "35f519e20e575a331c2ee554e5a555a59ce4b9e2" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/zendframework/zend-text/zipball/d962ea25647b20527f3ca34ae225bbc885dabfc7", - "reference": "d962ea25647b20527f3ca34ae225bbc885dabfc7", + "reference": "35f519e20e575a331c2ee554e5a555a59ce4b9e2", "shasum": "" }, "require": { @@ -1902,11 +1822,6 @@ "zendframework/zend-servicemanager": "self.version", "zendframework/zend-stdlib": "self.version" }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master" - }, "type": "library", "extra": { "branch-alias": { @@ -1916,19 +1831,19 @@ }, "autoload": { "psr-4": { - "Zend\\Text\\": "src/" + "Zend\\Text\\": "" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], - "homepage": "https://github.com/zendframework/zend-text", + "homepage": "https://github.com/zendframework/zf2", "keywords": [ "text", "zf2" ], - "time": "2015-03-25 20:55:48" + "time": "2015-04-01 18:09:29" }, { "name": "zendframework/zend-uri", @@ -1936,12 +1851,12 @@ "source": { "type": "git", "url": "https://github.com/zendframework/zend-uri.git", - "reference": "bd9e625639415376f6a82551c73328448d7bc7d1" + "reference": "53f5b162b293f80de8b951eece8e08be83c4fe16" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/zendframework/zend-uri/zipball/bd9e625639415376f6a82551c73328448d7bc7d1", - "reference": "bd9e625639415376f6a82551c73328448d7bc7d1", + "reference": "53f5b162b293f80de8b951eece8e08be83c4fe16", "shasum": "" }, "require": { @@ -1949,11 +1864,6 @@ "zendframework/zend-escaper": "self.version", "zendframework/zend-validator": "self.version" }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master" - }, "type": "library", "extra": { "branch-alias": { @@ -1963,7 +1873,7 @@ }, "autoload": { "psr-4": { - "Zend\\Uri\\": "src/" + "Zend\\Uri\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -1971,12 +1881,12 @@ "BSD-3-Clause" ], "description": "a component that aids in manipulating and validating » Uniform Resource Identifiers (URIs)", - "homepage": "https://github.com/zendframework/zend-uri", + "homepage": "https://github.com/zendframework/zf2", "keywords": [ "uri", "zf2" ], - "time": "2015-03-25 20:55:48" + "time": "2015-04-01 18:09:29" }, { "name": "zendframework/zend-validator", @@ -1984,12 +1894,12 @@ "source": { "type": "git", "url": "https://github.com/zendframework/zend-validator.git", - "reference": "45fac2545a0f2eb66d71cb7966feee481e7c475f" + "reference": "eb678d20256f120a72ca27276bbb2875841701ab" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/zendframework/zend-validator/zipball/45fac2545a0f2eb66d71cb7966feee481e7c475f", - "reference": "45fac2545a0f2eb66d71cb7966feee481e7c475f", + "reference": "eb678d20256f120a72ca27276bbb2875841701ab", "shasum": "" }, "require": { @@ -1997,9 +1907,6 @@ "zendframework/zend-stdlib": "self.version" }, "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master", "zendframework/zend-db": "self.version", "zendframework/zend-filter": "self.version", "zendframework/zend-i18n": "self.version", @@ -2027,7 +1934,7 @@ }, "autoload": { "psr-4": { - "Zend\\Validator\\": "src/" + "Zend\\Validator\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -2035,12 +1942,12 @@ "BSD-3-Clause" ], "description": "provides a set of commonly needed validators", - "homepage": "https://github.com/zendframework/zend-validator", + "homepage": "https://github.com/zendframework/zf2", "keywords": [ "validator", "zf2" ], - "time": "2015-03-25 20:55:48" + "time": "2015-04-01 18:09:30" }, { "name": "zendframework/zend-view", @@ -2048,12 +1955,12 @@ "source": { "type": "git", "url": "https://github.com/zendframework/zend-view.git", - "reference": "37beb1ad46e530f627b4b6c3716efd728e976ba9" + "reference": "e119b4b5f082af58a96eb206e782b62c193227bf" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/zendframework/zend-view/zipball/37beb1ad46e530f627b4b6c3716efd728e976ba9", - "reference": "37beb1ad46e530f627b4b6c3716efd728e976ba9", + "reference": "e119b4b5f082af58a96eb206e782b62c193227bf", "shasum": "" }, "require": { @@ -2063,9 +1970,6 @@ "zendframework/zend-stdlib": "self.version" }, "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master", "zendframework/zend-authentication": "self.version", "zendframework/zend-escaper": "self.version", "zendframework/zend-feed": "self.version", @@ -2104,7 +2008,7 @@ }, "autoload": { "psr-4": { - "Zend\\View\\": "src/" + "Zend\\View\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -2112,12 +2016,12 @@ "BSD-3-Clause" ], "description": "provides a system of helpers, output filters, and variable escaping", - "homepage": "https://github.com/zendframework/zend-view", + "homepage": "https://github.com/zendframework/zf2", "keywords": [ "view", "zf2" ], - "time": "2015-03-25 20:55:48" + "time": "2015-04-01 18:09:30" } ], "packages-dev": [ @@ -2789,7 +2693,7 @@ "src/" ] }, - "notification-url": "https://packagist.org/downloads/", + "notification-url": "http://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], @@ -3288,7 +3192,7 @@ "Symfony\\Component\\Config\\": "" } }, - "notification-url": "https://packagist.org/downloads/", + "notification-url": "http://packagist.org/downloads/", "license": [ "MIT" ], @@ -3348,7 +3252,7 @@ "Symfony\\Component\\DependencyInjection\\": "" } }, - "notification-url": "https://packagist.org/downloads/", + "notification-url": "http://packagist.org/downloads/", "license": [ "MIT" ], @@ -3406,7 +3310,7 @@ "Symfony\\Component\\EventDispatcher\\": "" } }, - "notification-url": "https://packagist.org/downloads/", + "notification-url": "http://packagist.org/downloads/", "license": [ "MIT" ], @@ -3455,7 +3359,7 @@ "Symfony\\Component\\Filesystem\\": "" } }, - "notification-url": "https://packagist.org/downloads/", + "notification-url": "http://packagist.org/downloads/", "license": [ "MIT" ], @@ -3504,7 +3408,7 @@ "Symfony\\Component\\Stopwatch\\": "" } }, - "notification-url": "https://packagist.org/downloads/", + "notification-url": "http://packagist.org/downloads/", "license": [ "MIT" ], @@ -3553,7 +3457,7 @@ "Symfony\\Component\\Yaml\\": "" } }, - "notification-url": "https://packagist.org/downloads/", + "notification-url": "http://packagist.org/downloads/", "license": [ "MIT" ], diff --git a/dev/tests/functional/composer.json b/dev/tests/functional/composer.json index 8ce924bd190d77c558cedd1ff4a7f04b83af3df5..ca4b3bc7f79e43c04109d7162163832f89340ec8 100644 --- a/dev/tests/functional/composer.json +++ b/dev/tests/functional/composer.json @@ -1,6 +1,6 @@ { "require": { - "magento/mtf": "1.0.0-rc26", + "magento/mtf": "1.0.0-rc27", "php": "~5.5.0|~5.6.0", "phpunit/phpunit": "4.1.0", "phpunit/phpunit-selenium": ">=1.2", diff --git a/dev/tests/functional/lib/Magento/Mtf/Client/Element/GlobalsearchElement.php b/dev/tests/functional/lib/Magento/Mtf/Client/Element/GlobalsearchElement.php index e1bcbd54580d6daa2bd2eac1a39657b8dd7c8f24..50307147313fa52285d237b6637cb22244f546a6 100644 --- a/dev/tests/functional/lib/Magento/Mtf/Client/Element/GlobalsearchElement.php +++ b/dev/tests/functional/lib/Magento/Mtf/Client/Element/GlobalsearchElement.php @@ -14,11 +14,6 @@ use Magento\Mtf\Client\ElementInterface; */ class GlobalsearchElement extends SimpleElement { - /** - * "Backspace" key code. - */ - const BACKSPACE = "\xEE\x80\x83"; - /** * Search icon selector. * @@ -63,43 +58,14 @@ class GlobalsearchElement extends SimpleElement public function setValue($value) { $this->eventManager->dispatchEvent(['set_value'], [__METHOD__, $this->getAbsoluteSelector()]); - $this->waitInitElement(); - if (!$this->find($this->searchInput)->isVisible()) { $this->find($this->searchIcon)->click(); } - $this->selectWindow(); - $this->clear(); - $this->find($this->searchInput)->setValue($value); - $this->selectWindow(); - + $this->find($this->searchInput)->keys(str_split($value)); $this->waitResult(); } - /** - * Clear value of element. - * - * @return void - */ - protected function clear() - { - $element = $this->find($this->searchInput); - while ('' != $element->getValue()) { - $element->setValue([self::BACKSPACE]); - } - } - - /** - * Select to last window. - * - * @return void - */ - protected function selectWindow() - { - $this->driver->selectWindow(); - } - /** * Wait init search suggest container. * @@ -130,12 +96,7 @@ class GlobalsearchElement extends SimpleElement $this->driver->waitUntil( function () use ($browser, $selector) { - if ($browser->find($selector)->isVisible()) { - return true; - } else { - $browser->selectWindow(); - return null; - } + return $browser->find($selector)->isVisible() ? true : null; } ); } diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/System/Config/Form/Group.php b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/System/Config/Form/Group.php index 0d3244802c70260eedce3ed996df9856c77a3057..09123d09767bf838415192989cd1f5f06732360b 100644 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/System/Config/Form/Group.php +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/System/Config/Form/Group.php @@ -9,7 +9,7 @@ namespace Magento\Backend\Test\Block\System\Config\Form; use Magento\Mtf\Client\Locator; -use Magento\Backend\Test\Block\Widget\Form; +use Magento\Mtf\Block\Form; /** * Class Group diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Widget/Form.php b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Widget/Form.php deleted file mode 100644 index d57bd1aa4d78f8f9829b08857a27611793b1d462..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Widget/Form.php +++ /dev/null @@ -1,199 +0,0 @@ -<?php -/** - * @api - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\Backend\Test\Block\Widget; - -use Magento\Mtf\Block\Form as FormInstance; -use Magento\Mtf\Client\Locator; -use Magento\Mtf\Factory\Factory; -use Magento\Mtf\Fixture\FixtureInterface; - -/** - * Class Form - * Is used to represent any form on the page - * - * @SuppressWarnings(PHPMD.NumberOfChildren) - */ -class Form extends FormInstance -{ - /** - * 'Save' button - * - * @var string - */ - protected $saveButton = '#save'; - - /** - * 'Save And Continue Edit' button - * - * @var string - */ - protected $saveAndContinueButton = '#save_and_continue'; - - /** - * 'Save And Continue Edit' button - * - * @var string - */ - protected $saveAndContinueEditButton = '#save_and_continue_edit'; - - /** - * Back button - * - * @var string - */ - protected $backButton = '#back'; - - /** - * Reset button - * - * @var string - */ - protected $resetButton = '#reset'; - - /** - * 'Delete' button - * - * @var string - */ - protected $deleteButton = '#delete-button-button'; - - /** - * Backend abstract block - * - * @var string - */ - protected $templateBlock = './ancestor::body'; - - /** - * Selector of element to wait for. If set by child will wait for element after action - * - * @var string - */ - protected $waitForSelector; - - /** - * Locator type of waitForSelector - * - * @var Locator - */ - protected $waitForSelectorType = Locator::SELECTOR_CSS; - - /** - * Wait for should be for visibility or not? - * - * @var boolean - */ - protected $waitForSelectorVisible = true; - - /** - * Update the root form - * - * @param FixtureInterface $fixture - * @return Form - */ - public function update(FixtureInterface $fixture) - { - $this->fill($fixture); - return $this; - } - - /** - * Get backend abstract block - * - * @return \Magento\Backend\Test\Block\Template - */ - protected function getTemplateBlock() - { - return Factory::getBlockFactory()->getMagentoBackendTemplate( - $this->_rootElement->find($this->templateBlock, Locator::SELECTOR_XPATH) - ); - } - - /** - * Save the form - * - * @param FixtureInterface $fixture - * @return Form - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function save(FixtureInterface $fixture = null) - { - $this->_rootElement->find($this->saveButton, Locator::SELECTOR_CSS)->click(); - $this->waitForElement(); - return $this; - } - - /** - * Method that waits for the configured selector using class attributes. - */ - protected function waitForElement() - { - if (!empty($this->waitForSelector)) { - if ($this->waitForSelectorVisible) { - $this->getTemplateBlock()->waitForElementVisible($this->waitForSelector, $this->waitForSelectorType); - } else { - $this->getTemplateBlock()->waitForElementNotVisible($this->waitForSelector, $this->waitForSelectorType); - } - } - } - - /** - * Back action - * - * @return Form - */ - public function back() - { - $this->_rootElement->find($this->backButton, Locator::SELECTOR_CSS)->click(); - return $this; - } - - /** - * Reset the form - * - * @return Form - */ - public function reset() - { - $this->_rootElement->find($this->resetButton, Locator::SELECTOR_CSS)->click(); - return $this; - } - - /** - * Delete current form item - * - * @param FixtureInterface $fixture - * @return Form - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function delete(FixtureInterface $fixture = null) - { - $this->_rootElement->find($this->deleteButton, Locator::SELECTOR_CSS)->click(); - return $this; - } - - /** - * Click save and continue button on form - */ - public function clickSaveAndContinue() - { - $this->_rootElement->find($this->saveAndContinueButton, Locator::SELECTOR_CSS)->click(); - return $this; - } - - /** - * Click save and continue button on form - */ - public function clickSaveAndContinueEdit() - { - $this->_rootElement->find($this->saveAndContinueEditButton, Locator::SELECTOR_CSS)->click(); - return $this; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Widget/FormTabs.php b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Widget/FormTabs.php index b11db4365fa2d253ebf571ea4495200274fc74d6..b104c3230510c08d70f30d1d17d49be50cebd18d 100755 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Widget/FormTabs.php +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Widget/FormTabs.php @@ -7,6 +7,7 @@ namespace Magento\Backend\Test\Block\Widget; use Magento\Mtf\Block\BlockFactory; +use Magento\Mtf\Block\Form; use Magento\Mtf\Block\Mapper; use Magento\Mtf\Client\Locator; use Magento\Mtf\Client\ElementInterface; @@ -87,8 +88,7 @@ class FormTabs extends Form foreach ($tabs as $tabName => $tabFields) { $tab = $this->getTab($tabName); $this->openTab($tabName); - $tab->fillFormTab(array_merge($tabFields, $this->unassignedFields), $context); - $this->updateUnassignedFields($tab); + $tab->fillFormTab($tabFields, $context); } if (!empty($this->unassignedFields)) { $this->fillMissedFields($tabs); @@ -97,34 +97,25 @@ class FormTabs extends Form return $this; } - /** - * Update array with fields which aren't assigned to any tab - * - * @param Tab $tab - */ - protected function updateUnassignedFields(Tab $tab) - { - $this->unassignedFields = array_diff_key( - $this->unassignedFields, - array_intersect_key($this->unassignedFields, $tab->setFields) - ); - } - /** * Fill fields which weren't found on filled tabs * - * @param array $tabs * @throws \Exception - * * @SuppressWarnings(PHPMD.UnusedLocalVariable) */ - protected function fillMissedFields(array $tabs) + protected function fillMissedFields() { - foreach (array_diff_key($this->tabs, $tabs) as $tabName => $tabData) { + foreach ($this->tabs as $tabName => $tabData) { $tab = $this->getTab($tabName); - if ($this->openTab($tabName)) { - $tab->fillFormTab($this->unassignedFields, $this->_rootElement); - $this->updateUnassignedFields($tab); + if ($this->openTab($tabName) && $this->isTabVisible($tabName)) { + $mapping = $tab->dataMapping($this->unassignedFields); + foreach ($mapping as $fieldName => $data) { + $element = $tab->_rootElement->find($data['selector'], $data['strategy'], $data['input']); + if ($element->isVisible()) { + $element->setValue($data['value']); + unset($this->unassignedFields[$fieldName]); + } + } if (empty($this->unassignedFields)) { break; } diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/GlobalSearchEntityTest.php b/dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/GlobalSearchEntityTest.php new file mode 100644 index 0000000000000000000000000000000000000000..9624a9398b6ac7c7bb2f25f47b49bfde089978f5 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/GlobalSearchEntityTest.php @@ -0,0 +1,65 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Backend\Test\TestCase; + +use Magento\Backend\Test\Fixture\GlobalSearch; +use Magento\Backend\Test\Page\Adminhtml\Dashboard; +use Magento\Mtf\TestCase\Injectable; + +/** + * Preconditions: + * 1. Create customer + * 2. Create two simple products + * 3. Create order with one of created simple product + * + * Steps: + * 1. Login to backend + * 2. Click on Search button on the top of page + * 3. Fill in data according dataSet + * 4. Perform assertions + * + * @group Search_Core_(MX) + * @ZephyrId MAGETWO-28457 + */ +class GlobalSearchEntityTest extends Injectable +{ + /* tags */ + const MVP = 'no'; + const DOMAIN = 'MX'; + /* end tags */ + + /** + * Backend Dashboard page. + * + * @var Dashboard + */ + protected $dashboard; + + /** + * Preparing pages for test. + * + * @param Dashboard $dashboard + * @return void + */ + public function __inject(Dashboard $dashboard) + { + $this->dashboard = $dashboard; + } + + /** + * Run Global Search Entity Test. + * + * @param GlobalSearch $search + * @return void + */ + public function test(GlobalSearch $search) + { + //Steps: + $this->dashboard->open(); + $this->dashboard->getAdminPanelHeader()->search($search->getQuery()); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/GlobalSearchEntityTest.xml b/dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/GlobalSearchEntityTest.xml new file mode 100644 index 0000000000000000000000000000000000000000..7adcf2b0241bad21f32708ea1416b7a9afcf5128 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/GlobalSearchEntityTest.xml @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + --> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> + <testCase name="Magento\Backend\Test\TestCase\GlobalSearchEntityTest"> + <variation name="GlobalSearchEntityTestVariation2"> + <data name="description" xsi:type="string">search with 2 sign return no results</data> + <data name="search/data/query" xsi:type="string">:)</data> + <constraint name="Magento\Backend\Test\Constraint\AssertGlobalSearchNoRecordsFound" /> + </variation> + <variation name="GlobalSearchEntityTestVariation3"> + <data name="description" xsi:type="string">search product by sku</data> + <data name="search/data/query" xsi:type="string">orderInjectable::default::product::sku</data> + <constraint name="Magento\Backend\Test\Constraint\AssertGlobalSearchProductName" /> + </variation> + <variation name="GlobalSearchEntityTestVariation4"> + <data name="description" xsi:type="string">search existed customer</data> + <data name="search/data/query" xsi:type="string">customer::johndoe_unique::lastname</data> + <constraint name="Magento\Backend\Test\Constraint\AssertGlobalSearchCustomerName" /> + </variation> + <variation name="GlobalSearchEntityTestVariation5"> + <data name="description" xsi:type="string">search order (by order id)</data> + <data name="search/data/query" xsi:type="string">orderInjectable::default::id</data> + <constraint name="Magento\Backend\Test\Constraint\AssertGlobalSearchOrderId" /> + </variation> + </testCase> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/NavigateMenuTest.php b/dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/NavigateMenuTest.php index b8d486de23c5b4006f491a3f1fad1532a2a0f928..2e4509a1e66eab3cb43acfd0a9f0407c7bf50ffc 100644 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/NavigateMenuTest.php +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/NavigateMenuTest.php @@ -13,7 +13,7 @@ use Magento\Backend\Test\Page\Adminhtml\Dashboard; * Steps: * 1. Log in to backend. * 2. Navigate throught menu to the page. - * 6. Perform asserts. + * 3. Perform asserts. * * @ZephyrId MAGETWO-34874 */ diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertProductCustomOptionsOnBundleProductPage.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertProductCustomOptionsOnBundleProductPage.php index 308ebbe82565e481275b3940ca1f3bece6a11cae..dcb74539acd16a4e77972e99f68f331d328bfc1b 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertProductCustomOptionsOnBundleProductPage.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertProductCustomOptionsOnBundleProductPage.php @@ -9,8 +9,7 @@ namespace Magento\Bundle\Test\Constraint; use Magento\Catalog\Test\Constraint\AssertProductCustomOptionsOnProductPage; /** - * Class AssertProductCustomOptionsOnBundleProductPage - * Assertion that commodity options are displayed correctly on bundle product page + * Assertion that commodity options are displayed correctly on bundle product page. */ class AssertProductCustomOptionsOnBundleProductPage extends AssertProductCustomOptionsOnProductPage { diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertTierPriceOnBundleProductPage.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertTierPriceOnBundleProductPage.php index 3c62ea1c4eac77055ad478c6b28de567657631cf..156e24f75aa75a93d7ca1fb19c39fd69c5888508 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertTierPriceOnBundleProductPage.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertTierPriceOnBundleProductPage.php @@ -32,7 +32,7 @@ class AssertTierPriceOnBundleProductPage extends AssertProductTierPriceOnProduct * * @var int */ - protected $priceFormat = 4; + protected $priceFormat = 0; /** * Assertion that tier prices are displayed correctly diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/Price.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/Price.php index a30b316e1e8901d96241ba11f3a7547a5f4b184e..c4f0aee1ebebec8092b22ef6e821825495669879 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/Price.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/Price.php @@ -139,13 +139,13 @@ class Price implements FixtureInterface 'price_to' => '120.00', ], 'fixed-115' => [ - 'price_from' => '115.00', - 'price_to' => '120.00', + 'price_from' => '317.00', + 'price_to' => '362.00', 'cart_price' => '317.00', ], - 'fixed-159' => [ - 'price_from' => '115.00', - 'price_to' => '120.00', + 'fixed-110' => [ + 'price_from' => '159.00', + 'price_to' => '164.00', 'cart_price' => '159.00', ], 'fixed-756' => [ diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Page/Product/CatalogProductView.xml b/dev/tests/functional/tests/app/Magento/Bundle/Test/Page/Product/CatalogProductView.xml index 2fddc12693d45cf68779b2f75cabcb6b492b47cc..597a6d7f735a93b8a301a9aaff642a95606c0af0 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Page/Product/CatalogProductView.xml +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Page/Product/CatalogProductView.xml @@ -6,10 +6,10 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/pages.xsd"> - <page name="CatalogProductView" area="Product" mca="catalog/product/view"> - <block name="viewBlock"> - <render name="bundle" class="Magento\Bundle\Test\Block\Catalog\Product\View"/> - </block> - <block name="bundleViewBlock" class="Magento\Bundle\Test\Block\Catalog\Product\View" locator="#maincontent" strategy="css selector"/> - </page> + <page name="CatalogProductView" area="Product" mca="catalog/product/view"> + <block name="viewBlock"> + <render name="bundle" class="Magento\Bundle\Test\Block\Catalog\Product\View" /> + </block> + <block name="bundleViewBlock" class="Magento\Bundle\Test\Block\Catalog\Product\View" locator="#maincontent" strategy="css selector" /> + </page> </config> diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest.xml b/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest.xml index 51d270f4d41e0230b4b54570806b8faa5e0080f3..ad5b9bfa0c055caf84c363a3dcc9067689628cc6 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest.xml @@ -228,7 +228,6 @@ <constraint name="Magento\Bundle\Test\Constraint\AssertBundlePriceType" /> </variation> <variation name="CreateBundleProductEntityTestVariation10"> - <data name="tag" xsi:type="string">to_maintain:yes</data> <data name="description" xsi:type="string">Create dynamic bundle</data> <data name="product/data/url_key" xsi:type="string">bundle-product-%isolation%</data> <data name="product/data/name" xsi:type="string">Bundle Dynamic %isolation%</data> @@ -272,7 +271,7 @@ <data name="product/data/sku" xsi:type="string">sku_bundle_fixed_%isolation%</data> <data name="product/data/price_type" xsi:type="string">Fixed</data> <data name="product/data/price/value" xsi:type="string">110</data> - <data name="product/data/price/preset" xsi:type="string">fixed-159</data> + <data name="product/data/price/preset" xsi:type="string">fixed-110</data> <data name="product/data/bundle_selections/preset" xsi:type="string">second</data> <data name="product/data/bundle_selections/products" xsi:type="string">catalogProductSimple::product_100_dollar,catalogProductSimple::product_40_dollar</data> <data name="product/data/checkout_data/preset" xsi:type="string">with_custom_options_2</data> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/Set/Main/EditForm.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/Set/Main/EditForm.xml index 887e1983789462f31d40ec9c2846931bb225abd8..ab116cdecc2f5118629b781c8985557529e882a4 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/Set/Main/EditForm.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/Set/Main/EditForm.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<mapping strict="0"> +<mapping strict="1"> <fields> <attribute_set_name /> </fields> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Action/Attribute.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Action/Attribute.php index 39e76e2c98eec4d2d018e8048116199a27c683b7..bd1b633deedd32b670b10b1adf4faae4c2a87e58 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Action/Attribute.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Action/Attribute.php @@ -7,7 +7,7 @@ namespace Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Action; use Magento\Mtf\Fixture\FixtureInterface; -use Magento\Backend\Test\Block\Widget\Form; +use Magento\Mtf\Block\Form; use Magento\Mtf\Client\Element\SimpleElement; /** @@ -25,6 +25,7 @@ class Attribute extends Form public function fill(FixtureInterface $fixture, SimpleElement $element = null) { $data = $fixture->getData(); + $fields = []; foreach ($data as $name => $dataValue) { $fields['toggle_' . $name] = 'Yes'; $fields[$name] = $dataValue; diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/NewCategoryIds.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/NewCategoryIds.php index c1baad740ef47f6564c703afddebd6d11d772b35..5c44c611d8da52a7080edabd5699d5b5c0582af2 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/NewCategoryIds.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/NewCategoryIds.php @@ -7,7 +7,7 @@ namespace Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Tab\ProductDetails; use Magento\Catalog\Test\Fixture\Category; -use Magento\Backend\Test\Block\Widget\Form; +use Magento\Mtf\Block\Form; /** * Create new category. diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInGrid.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInGrid.php index edc00d8db75fe91c060c124232eadf815fc4c115..bb1e7cc32bbd8dbecc5bdfe2e8764e3c71a071ae 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInGrid.php @@ -11,7 +11,6 @@ use Magento\Mtf\Constraint\AbstractConstraint; use Magento\Mtf\Fixture\FixtureInterface; /** - * Class AssertProductInGrid * Assert that product is present in products grid. */ class AssertProductInGrid extends AbstractConstraint @@ -63,7 +62,7 @@ class AssertProductInGrid extends AbstractConstraint } /** - * Get product type + * Get product type. * * @return string */ diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductAttribute.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductAttribute.xml index 1e99a0752d4e407a6dfac02c519cf83d9f6ded54..1a38dd8158cd63cd9553ba8cde4daaa7e3c76eed 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductAttribute.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductAttribute.xml @@ -111,13 +111,13 @@ <field name="is_wysiwyg_enabled" is_required=""> <default_value xsi:type="number">0</default_value> </field> - <field name="is_used_for_promo_rules" is_required=""> + <field name="is_used_for_promo_rules" is_required="" group="frontend-properties"> <default_value xsi:type="number">0</default_value> </field> <field name="search_weight" is_required=""> <default_value xsi:type="string">1</default_value> </field> - <field name="options" is_required="" source="Magento\Catalog\Test\Fixture\CatalogProductAttribute\Options"> + <field name="options" is_required="" group="properties" source="Magento\Catalog\Test\Fixture\CatalogProductAttribute\Options"> <default_value xsi:type="null"/> </field> <field name="default_value_text" group="advanced-properties"/> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductVirtual.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductVirtual.xml index cc82e98b336dbdd13b1088b90762f29d081f212f..2e2903a0cf35267fb62eb27cec89bee8c831baef 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductVirtual.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductVirtual.xml @@ -36,6 +36,23 @@ </field> </dataset> + <dataset name="required_fields"> + <field name="url_key" xsi:type="string">virtual-product%isolation%</field> + <field name="name" xsi:type="string">Virtual product %isolation%</field> + <field name="sku" xsi:type="string">sku_virtual_product_%isolation%</field> + <field name="is_virtual" xsi:type="string">Yes</field> + <field name="price" xsi:type="array"> + <item name="value" xsi:type="string">10</item> + <item name="preset" xsi:type="string">-</item> + </field> + <field name="tax_class_id" xsi:type="array"> + <item name="dataSet" xsi:type="string">taxable_goods</item> + </field> + <field name="website_ids" xsi:type="array"> + <item name="0" xsi:type="string">Main Website</item> + </field> + </dataset> + <dataset name="required_fields_with_category"> <field name="url_key" xsi:type="string">virtual-product%isolation%</field> <field name="name" xsi:type="string">Virtual product %isolation%</field> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.xml index e84f0409dada6c372eead7ef608a6adb8544f588..364854e6870bbf6a8b9aa15989b7ccececcb7cbc 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.xml @@ -257,7 +257,6 @@ <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" /> </variation> <variation name="CreateSimpleProductEntityTestVariation15"> - <data name="tag" xsi:type="string">to_maintain:yes</data> <data name="description" xsi:type="string">Create product with tax class and group price</data> <data name="product/data/url_key" xsi:type="string">simple-product-%isolation%</data> <data name="product/data/name" xsi:type="string">Simple Product %isolation%</data> @@ -317,7 +316,6 @@ <constraint name="Magento\Catalog\Test\Constraint\AssertProductTierPriceOnProductPage" /> </variation> <variation name="CreateSimpleProductEntityTestVariation18"> - <data name="issue" xsi:type="string">Bug: MAGETWO-35342</data> <data name="description" xsi:type="string">Create product wit suite of custom options</data> <data name="product/data/url_key" xsi:type="string">simple-product-%isolation%</data> <data name="product/data/name" xsi:type="string">Simple Product %isolation%</data> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnCreationTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnCreationTest.php index 6c297ef596e1f08f89d4d4f578e4945d1a67caa9..1cdff9dbf0ed156e55ea0d5bbc657f7628f7e02d 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnCreationTest.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnCreationTest.php @@ -30,7 +30,6 @@ class ProductTypeSwitchingOnCreationTest extends Injectable /* tags */ const MVP = 'yes'; const DOMAIN = 'MX'; - const TO_MAINTAIN = 'yes'; /* end tags */ /** diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnCreationTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnCreationTest.xml index af77d4f6fd3d4ea47bad0a0bb3cf512ada4ab3f1..d4850eed96207c39e7d3a43265eab36300c2bcf9 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnCreationTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnCreationTest.xml @@ -27,13 +27,13 @@ </variation> <variation name="ProductTypeSwitchingOnCreationTestVariation3"> <data name="createProduct" xsi:type="string">configurable</data> - <data name="product" xsi:type="string">catalogProductSimple::default</data> + <data name="product" xsi:type="string">catalogProductSimple::product_without_category</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> </variation> <variation name="ProductTypeSwitchingOnCreationTestVariation4"> <data name="createProduct" xsi:type="string">configurable</data> - <data name="product" xsi:type="string">catalogProductVirtual::default</data> + <data name="product" xsi:type="string">catalogProductVirtual::required_fields</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> </variation> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnUpdateTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnUpdateTest.xml index d477c119f14ec5c992f4f9285a47c94bac67effc..8d1fc4b9e09c4fe2d44ffc29021fa079d9a88191 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnUpdateTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnUpdateTest.xml @@ -8,7 +8,6 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Catalog\Test\TestCase\Product\ProductTypeSwitchingOnUpdateTest"> <variation name="ProductTypeSwitchingOnUpdateTestVariation1"> - <data name="tag" xsi:type="string">stable:no</data> <data name="productOrigin" xsi:type="string">catalogProductSimple::default</data> <data name="product" xsi:type="string">configurableProduct::default</data> <data name="actionName" xsi:type="string">-</data> @@ -28,17 +27,15 @@ <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> </variation> <variation name="ProductTypeSwitchingOnUpdateTestVariation3"> - <data name="tag" xsi:type="string">stable:no</data> <data name="productOrigin" xsi:type="string">configurableProduct::default</data> - <data name="product" xsi:type="string">catalogProductSimple::default</data> + <data name="product" xsi:type="string">catalogProductSimple::product_without_category</data> <data name="actionName" xsi:type="string">deleteAttributes</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> </variation> <variation name="ProductTypeSwitchingOnUpdateTestVariation4"> - <data name="tag" xsi:type="string">stable:no</data> <data name="productOrigin" xsi:type="string">configurableProduct::default</data> - <data name="product" xsi:type="string">catalogProductVirtual::default</data> + <data name="product" xsi:type="string">catalogProductVirtual::required_fields</data> <data name="actionName" xsi:type="string">deleteAttributes</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> @@ -51,7 +48,6 @@ <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> </variation> <variation name="ProductTypeSwitchingOnUpdateTestVariation6"> - <data name="tag" xsi:type="string">stable:no</data> <data name="productOrigin" xsi:type="string">catalogProductVirtual::default</data> <data name="product" xsi:type="string">configurableProduct::not_virtual_for_type_switching</data> <data name="actionName" xsi:type="string">-</data> @@ -82,7 +78,6 @@ <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> </variation> <variation name="ProductTypeSwitchingOnUpdateTestVariation9"> - <data name="tag" xsi:type="string">stable:no</data> <data name="productOrigin" xsi:type="string">downloadableProduct::default</data> <data name="product" xsi:type="string">configurableProduct::not_virtual_for_type_switching</data> <data name="actionName" xsi:type="string">-</data> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.xml index 73e20318e00350a5fc21cc5089a833cdc7469cd1..4dde51eae09a370f540fa8e3b2e9970d40c19dc6 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.xml @@ -70,7 +70,6 @@ <constraint name="Magento\Catalog\Test\Constraint\AssertProductVisibleInCategory" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSearchableBySku" /> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" /> </variation> <variation name="UpdateSimpleProductEntityTestVariation5"> <data name="description" xsi:type="string">Update stock to Out of Stock</data> @@ -104,7 +103,6 @@ <constraint name="Magento\Catalog\Test\Constraint\AssertProductIsNotDisplayingOnFrontend" /> </variation> <variation name="UpdateSimpleProductEntityTestVariation7"> - <data name="tag" xsi:type="string">stable:no</data> <data name="description" xsi:type="string">Update category</data> <data name="initialProduct/dataSet" xsi:type="string">product_with_category</data> <data name="product/data/category_ids/presets" xsi:type="string">default</data> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateVirtualProductEntityTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateVirtualProductEntityTest.xml index 0346cc1467f5ee7cf386c0d0f304c5bef9625a62..d6607d67fd40b773f4af4c01f0f6dad154b31237 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateVirtualProductEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateVirtualProductEntityTest.xml @@ -15,11 +15,8 @@ <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">999</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> <data name="product/data/category_ids/presets" xsi:type="string">default_subcategory</data> - <data name="product/data/group_price/preset" xsi:type="string">-</data> - <data name="product/data/special_price" xsi:type="string">-</data> <data name="product/data/tier_price/preset" xsi:type="string">MAGETWO-23002</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> - <data name="product/data/custom_options/preset" xsi:type="string">-</data> <data name="product/data/visibility" xsi:type="string">Catalog</data> <data name="product/data/url_key" xsi:type="string">virtual-product-%isolation%</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> @@ -38,18 +35,13 @@ <data name="product/data/tax_class_id/dataSet" xsi:type="string">taxable_goods</data> <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">999</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> - <data name="product/data/category_ids/presets" xsi:type="string">-</data> - <data name="product/data/group_price/preset" xsi:type="string">-</data> <data name="product/data/special_price" xsi:type="string">45</data> - <data name="product/data/tier_price/preset" xsi:type="string">-</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> - <data name="product/data/custom_options/preset" xsi:type="string">-</data> <data name="product/data/visibility" xsi:type="string">Catalog, Search</data> <data name="product/data/url_key" xsi:type="string">virtual-product-%isolation%</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductForm" /> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductVisibleInCategory" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCategory" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" /> @@ -64,17 +56,13 @@ <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">999</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> <data name="product/data/category_ids/presets" xsi:type="string">default_subcategory</data> - <data name="product/data/group_price/preset" xsi:type="string">-</data> - <data name="product/data/special_price" xsi:type="string">-</data> <data name="product/data/tier_price/preset" xsi:type="string">MAGETWO-23002</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">Out of Stock</data> - <data name="product/data/custom_options/preset" xsi:type="string">-</data> <data name="product/data/visibility" xsi:type="string">Catalog, Search</data> <data name="product/data/url_key" xsi:type="string">virtual-product-%isolation%</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductForm" /> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductVisibleInCategory" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductOutOfStock" /> @@ -86,14 +74,8 @@ <data name="product/data/sku" xsi:type="string">virtual_sku_%isolation%</data> <data name="product/data/price/value" xsi:type="string">99.99</data> <data name="product/data/tax_class_id/dataSet" xsi:type="string">taxable_goods</data> - <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">-</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> - <data name="product/data/category_ids/presets" xsi:type="string">-</data> - <data name="product/data/group_price/preset" xsi:type="string">-</data> - <data name="product/data/special_price" xsi:type="string">-</data> - <data name="product/data/tier_price/preset" xsi:type="string">-</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">Out of Stock</data> - <data name="product/data/custom_options/preset" xsi:type="string">-</data> <data name="product/data/visibility" xsi:type="string">Search</data> <data name="product/data/url_key" xsi:type="string">virtual-product-%isolation%</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> @@ -108,14 +90,8 @@ <data name="product/data/sku" xsi:type="string">virtual_sku_%isolation%</data> <data name="product/data/price/value" xsi:type="string">5.00</data> <data name="product/data/tax_class_id/dataSet" xsi:type="string">None</data> - <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">-</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> - <data name="product/data/category_ids/presets" xsi:type="string">-</data> - <data name="product/data/group_price/preset" xsi:type="string">-</data> - <data name="product/data/special_price" xsi:type="string">-</data> - <data name="product/data/tier_price/preset" xsi:type="string">-</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">Out of Stock</data> - <data name="product/data/custom_options/preset" xsi:type="string">-</data> <data name="product/data/visibility" xsi:type="string">Catalog</data> <data name="product/data/url_key" xsi:type="string">virtual-product-%isolation%</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> @@ -134,10 +110,8 @@ <data name="product/data/is_virtual" xsi:type="string">Yes</data> <data name="product/data/category_ids/presets" xsi:type="string">default_subcategory</data> <data name="product/data/group_price/preset" xsi:type="string">MAGETWO-23055</data> - <data name="product/data/special_price" xsi:type="string">-</data> <data name="product/data/tier_price/preset" xsi:type="string">MAGETWO-23002</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> - <data name="product/data/custom_options/preset" xsi:type="string">-</data> <data name="product/data/visibility" xsi:type="string">Catalog, Search</data> <data name="product/data/url_key" xsi:type="string">virtual-product-%isolation%</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> @@ -154,14 +128,10 @@ <data name="product/data/sku" xsi:type="string">virtual_sku_%isolation%</data> <data name="product/data/price/value" xsi:type="string">99.99</data> <data name="product/data/tax_class_id/dataSet" xsi:type="string">None</data> - <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">-</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> <data name="product/data/category_ids/presets" xsi:type="string">default_subcategory</data> - <data name="product/data/group_price/preset" xsi:type="string">-</data> <data name="product/data/special_price" xsi:type="string">45</data> - <data name="product/data/tier_price/preset" xsi:type="string">-</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">Out of Stock</data> - <data name="product/data/custom_options/preset" xsi:type="string">-</data> <data name="product/data/visibility" xsi:type="string">Catalog, Search</data> <data name="product/data/url_key" xsi:type="string">virtual-product-%isolation%</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> @@ -176,14 +146,9 @@ <data name="product/data/sku" xsi:type="string">virtual_sku_%isolation%</data> <data name="product/data/price/value" xsi:type="string">5.00</data> <data name="product/data/tax_class_id/dataSet" xsi:type="string">taxable_goods</data> - <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">-</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> - <data name="product/data/category_ids/presets" xsi:type="string">-</data> <data name="product/data/group_price/preset" xsi:type="string">MAGETWO-23055</data> - <data name="product/data/special_price" xsi:type="string">-</data> - <data name="product/data/tier_price/preset" xsi:type="string">-</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">Out of Stock</data> - <data name="product/data/custom_options/preset" xsi:type="string">-</data> <data name="product/data/visibility" xsi:type="string">Search</data> <data name="product/data/url_key" xsi:type="string">virtual-product-%isolation%</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> @@ -201,9 +166,6 @@ <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">999</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> <data name="product/data/category_ids/presets" xsi:type="string">default_subcategory</data> - <data name="product/data/group_price/preset" xsi:type="string">-</data> - <data name="product/data/special_price" xsi:type="string">-</data> - <data name="product/data/tier_price/preset" xsi:type="string">-</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> <data name="product/data/custom_options/preset" xsi:type="string">options-suite</data> <data name="product/data/visibility" xsi:type="string">Search</data> @@ -221,14 +183,9 @@ <data name="product/data/sku" xsi:type="string">virtual_sku_%isolation%</data> <data name="product/data/price/value" xsi:type="string">99.99</data> <data name="product/data/tax_class_id/dataSet" xsi:type="string">taxable_goods</data> - <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">-</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> - <data name="product/data/category_ids/presets" xsi:type="string">-</data> <data name="product/data/group_price/preset" xsi:type="string">MAGETWO-23055</data> - <data name="product/data/special_price" xsi:type="string">-</data> - <data name="product/data/tier_price/preset" xsi:type="string">-</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">Out of Stock</data> - <data name="product/data/custom_options/preset" xsi:type="string">-</data> <data name="product/data/visibility" xsi:type="string">Catalog, Search</data> <data name="product/data/url_key" xsi:type="string">virtual-product-%isolation%</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> @@ -247,19 +204,15 @@ <data name="product/data/is_virtual" xsi:type="string">Yes</data> <data name="product/data/category_ids/presets" xsi:type="string">default_subcategory</data> <data name="product/data/group_price/preset" xsi:type="string">MAGETWO-23055</data> - <data name="product/data/special_price" xsi:type="string">-</data> <data name="product/data/tier_price/preset" xsi:type="string">MAGETWO-23002</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> - <data name="product/data/custom_options/preset" xsi:type="string">-</data> <data name="product/data/visibility" xsi:type="string">Catalog</data> <data name="product/data/url_key" xsi:type="string">virtual-product-%isolation%</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductForm" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" /> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductVisibleInCategory" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSpecialPriceOnProductPage" /> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductGroupedPriceOnProductPage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductTierPriceOnProductPage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCategory" /> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateAttributeSetEntityTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateAttributeSetEntityTest.xml index 93ba98c55dd97d03970e3d0ea2d951f3886c634b..320e99b58a4df53b9a155bad31d53748404b84d5 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateAttributeSetEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateAttributeSetEntityTest.xml @@ -6,14 +6,14 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Magento\Catalog\Test\TestCase\ProductAttribute\CreateAttributeSetEntityTest"> - <variation name="CreateAttributeSetEntityTestVariation1"> - <data name="attributeSet/data/attribute_set_name" xsi:type="string">ProductTemplate%isolation%</data> - <data name="attributeSet/data/skeleton_set/dataSet" xsi:type="string">default</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateSuccessSaveMessage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateForm"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateInGrid"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateOnProductForm"/> - </variation> - </testCase> + <testCase name="Magento\Catalog\Test\TestCase\ProductAttribute\CreateAttributeSetEntityTest"> + <variation name="CreateAttributeSetEntityTestVariation1"> + <data name="attributeSet/data/attribute_set_name" xsi:type="string">ProductTemplate%isolation%</data> + <data name="attributeSet/data/skeleton_set/dataSet" xsi:type="string">default</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateSuccessSaveMessage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateForm" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateInGrid" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateOnProductForm" /> + </variation> + </testCase> </config> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateAttributeSetTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateAttributeSetTest.xml index f569a5dbbd81d73b74ad961f2d3941e5f78b86f8..7597b2416ba022c4ba0a68073835d2af87313ada 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateAttributeSetTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateAttributeSetTest.xml @@ -6,17 +6,17 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Magento\Catalog\Test\TestCase\ProductAttribute\UpdateAttributeSetTest"> - <variation name="UpdateAttributeSetTestVariation1"> - <data name="attributeSet/data/attribute_set_name" xsi:type="string">ProductTemplateEdit1%isolation%</data> - <data name="attributeSet/data/group" xsi:type="string">Custom-group%isolation%</data> - <data name="attributeSetOriginal/dataSet" xsi:type="string">custom_attribute_set</data> - <data name="productAttributeOriginal/dataSet" xsi:type="string">attribute_type_text_field</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateSuccessSaveMessage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateForm"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateInGrid"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateOnProductForm"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateGroupOnProductForm"/> - </variation> - </testCase> + <testCase name="Magento\Catalog\Test\TestCase\ProductAttribute\UpdateAttributeSetTest"> + <variation name="UpdateAttributeSetTestVariation1"> + <data name="attributeSet/data/attribute_set_name" xsi:type="string">ProductTemplateEdit1%isolation%</data> + <data name="attributeSet/data/group" xsi:type="string">Custom-group%isolation%</data> + <data name="attributeSetOriginal/dataSet" xsi:type="string">custom_attribute_set</data> + <data name="productAttributeOriginal/dataSet" xsi:type="string">attribute_type_text_field</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateSuccessSaveMessage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateForm" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateInGrid" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateOnProductForm" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateGroupOnProductForm" /> + </variation> + </testCase> </config> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateProductAttributeEntityTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateProductAttributeEntityTest.xml index de42ea1eca4ef4ad387c7315f103b0cb0aa75ff0..0e74dfb542a73f312a319c9aef11e02d330176da 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateProductAttributeEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateProductAttributeEntityTest.xml @@ -6,58 +6,48 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Magento\Catalog\Test\TestCase\ProductAttribute\UpdateProductAttributeEntityTest"> - <variation name="UpdateProductAttributeEntityTestVariation1"> - <data name="productTemplate/dataSet" xsi:type="string">custom_attribute_set</data> - <data name="productAttributeOriginal/dataSet" xsi:type="string">attribute_type_text_field</data> - <data name="attribute/data/frontend_label" xsi:type="string">Text_Field_%isolation%</data> - <data name="attribute/data/frontend_input" xsi:type="string">-</data> - <data name="attribute/data/options/preset" xsi:type="string">-</data> - <data name="attribute/data/is_required" xsi:type="string">Yes</data> - <data name="attribute/data/attribute_code" xsi:type="string">-</data> - <data name="attribute/data/is_global" xsi:type="string">Global</data> - <data name="attribute/data/default_value_text" xsi:type="string">attribute_edited%isolation%</data> - <data name="attribute/data/is_unique" xsi:type="string">Yes</data> - <data name="attribute/data/manage_frontend_label" xsi:type="string">-</data> - <data name="attribute/data/is_searchable" xsi:type="string">Yes</data> - <data name="attribute/data/is_visible_in_advanced_search" xsi:type="string">Yes</data> - <data name="attribute/data/is_comparable" xsi:type="string">Yes</data> - <data name="attribute/data/is_filterable" xsi:type="string">-</data> - <data name="attribute/data/is_filterable_in_search" xsi:type="string">-</data> - <data name="attribute/data/is_used_for_promo_rules" xsi:type="string">Yes</data> - <data name="attribute/data/is_html_allowed_on_front" xsi:type="string">Yes</data> - <data name="attribute/data/is_visible_on_front" xsi:type="string">Yes</data> - <data name="attribute/data/used_in_product_listing" xsi:type="string">Yes</data> - <data name="attribute/data/used_for_sort_by" xsi:type="string">Yes</data> - <data name="isRequired" xsi:type="string">Yes</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeSaveMessage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertAddedProductAttributeOnProductForm"/> - </variation> - <variation name="UpdateProductAttributeEntityTestVariation2"> - <data name="productTemplate/dataSet" xsi:type="string">custom_attribute_set</data> - <data name="productAttributeOriginal/dataSet" xsi:type="string">attribute_type_dropdown</data> - <data name="attribute/data/frontend_label" xsi:type="string">Dropdown_%isolation%</data> - <data name="attribute/data/frontend_input" xsi:type="string">-</data> - <data name="attribute/data/options/preset" xsi:type="string">default</data> - <data name="attribute/data/is_required" xsi:type="string">Yes</data> - <data name="attribute/data/attribute_code" xsi:type="string">-</data> - <data name="attribute/data/is_global" xsi:type="string">Global</data> - <data name="attribute/data/default_value_text" xsi:type="string">-</data> - <data name="attribute/data/is_unique" xsi:type="string">Yes</data> - <data name="attribute/data/manage_frontend_label" xsi:type="string">-</data> - <data name="attribute/data/is_searchable" xsi:type="string">Yes</data> - <data name="attribute/data/is_visible_in_advanced_search" xsi:type="string">Yes</data> - <data name="attribute/data/is_comparable" xsi:type="string">Yes</data> - <data name="attribute/data/is_filterable" xsi:type="string">Filterable (with results)</data> - <data name="attribute/data/is_filterable_in_search" xsi:type="string">Yes</data> - <data name="attribute/data/is_used_for_promo_rules" xsi:type="string">No</data> - <data name="attribute/data/is_html_allowed_on_front" xsi:type="string">Yes</data> - <data name="attribute/data/is_visible_on_front" xsi:type="string">Yes</data> - <data name="attribute/data/used_in_product_listing" xsi:type="string">Yes</data> - <data name="attribute/data/used_for_sort_by" xsi:type="string">Yes</data> - <data name="isRequired" xsi:type="string">Yes</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeSaveMessage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertAddedProductAttributeOnProductForm"/> - </variation> - </testCase> + <testCase name="Magento\Catalog\Test\TestCase\ProductAttribute\UpdateProductAttributeEntityTest"> + <variation name="UpdateProductAttributeEntityTestVariation1"> + <data name="productTemplate/dataSet" xsi:type="string">custom_attribute_set</data> + <data name="productAttributeOriginal/dataSet" xsi:type="string">attribute_type_text_field</data> + <data name="attribute/data/frontend_label" xsi:type="string">Text_Field_%isolation%</data> + <data name="attribute/data/is_required" xsi:type="string">Yes</data> + <data name="attribute/data/is_global" xsi:type="string">Global</data> + <data name="attribute/data/default_value_text" xsi:type="string">attribute_edited%isolation%</data> + <data name="attribute/data/is_unique" xsi:type="string">Yes</data> + <data name="attribute/data/is_searchable" xsi:type="string">Yes</data> + <data name="attribute/data/is_visible_in_advanced_search" xsi:type="string">Yes</data> + <data name="attribute/data/is_comparable" xsi:type="string">Yes</data> + <data name="attribute/data/is_used_for_promo_rules" xsi:type="string">Yes</data> + <data name="attribute/data/is_html_allowed_on_front" xsi:type="string">Yes</data> + <data name="attribute/data/is_visible_on_front" xsi:type="string">Yes</data> + <data name="attribute/data/used_in_product_listing" xsi:type="string">Yes</data> + <data name="attribute/data/used_for_sort_by" xsi:type="string">Yes</data> + <data name="isRequired" xsi:type="string">Yes</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeSaveMessage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertAddedProductAttributeOnProductForm" /> + </variation> + <variation name="UpdateProductAttributeEntityTestVariation2"> + <data name="productTemplate/dataSet" xsi:type="string">custom_attribute_set</data> + <data name="productAttributeOriginal/dataSet" xsi:type="string">attribute_type_dropdown</data> + <data name="attribute/data/frontend_label" xsi:type="string">Dropdown_%isolation%</data> + <data name="attribute/data/options/preset" xsi:type="string">default</data> + <data name="attribute/data/is_required" xsi:type="string">Yes</data> + <data name="attribute/data/is_global" xsi:type="string">Global</data> + <data name="attribute/data/is_unique" xsi:type="string">Yes</data> + <data name="attribute/data/is_searchable" xsi:type="string">Yes</data> + <data name="attribute/data/is_visible_in_advanced_search" xsi:type="string">Yes</data> + <data name="attribute/data/is_comparable" xsi:type="string">Yes</data> + <data name="attribute/data/is_filterable" xsi:type="string">Filterable (with results)</data> + <data name="attribute/data/is_filterable_in_search" xsi:type="string">Yes</data> + <data name="attribute/data/is_used_for_promo_rules" xsi:type="string">No</data> + <data name="attribute/data/is_html_allowed_on_front" xsi:type="string">Yes</data> + <data name="attribute/data/is_visible_on_front" xsi:type="string">Yes</data> + <data name="attribute/data/used_in_product_listing" xsi:type="string">Yes</data> + <data name="attribute/data/used_for_sort_by" xsi:type="string">Yes</data> + <data name="isRequired" xsi:type="string">Yes</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeSaveMessage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertAddedProductAttributeOnProductForm" /> + </variation> + </testCase> </config> diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Block/Adminhtml/Edit/SearchTermForm.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Block/Adminhtml/Edit/SearchTermForm.php index c3c576a8b7d4cff2100653d3aa4a62b1d7912130..25ca938dde09070eefb4cc191d65d1a75e5d1f79 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Block/Adminhtml/Edit/SearchTermForm.php +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Block/Adminhtml/Edit/SearchTermForm.php @@ -6,11 +6,10 @@ namespace Magento\CatalogSearch\Test\Block\Adminhtml\Edit; -use Magento\Backend\Test\Block\Widget\Form as WidgetForm; +use Magento\Mtf\Block\Form as WidgetForm; /** - * Class Form - * Form for search term + * Form for search term. */ class SearchTermForm extends WidgetForm { diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/Shipping.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/Shipping.php index 5581bb47ea913a86cb7ba2a4bfaaddffdfe69bb8..c52774c67d3d912b1dd8813e9aacd7a61d89dd57 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/Shipping.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/Shipping.php @@ -11,55 +11,61 @@ use Magento\Mtf\Block\Form; use Magento\Mtf\Client\Locator; /** - * Class Shipping - * Cart shipping block + * Cart shipping block. */ class Shipping extends Form { /** - * Form wrapper selector + * Form wrapper selector. * * @var string */ protected $formWrapper = '.content'; /** - * Open shipping form selector + * Open shipping form selector. * * @var string */ protected $openForm = '.title'; /** - * Get quote selector + * Get quote selector. * * @var string */ protected $getQuote = '.action.quote'; /** - * Update total selector + * Update total selector. * * @var string */ protected $updateTotalSelector = '.action.update'; /** - * Selector to access the shipping carrier method + * Selector to access the shipping carrier method. * * @var string */ protected $shippingMethod = '//span[text()="%s"]/following::*//*[contains(text(), "%s")]'; /** - * From with shipping available shipping methods + * From with shipping available shipping methods. * * @var string */ protected $shippingMethodForm = '#co-shipping-method-form'; /** - * Open estimate shipping and tax form + * Fields that are used in estimation shipping form. + * + * @var array + */ + protected $estimationFields = ['country_id', 'region_id', 'region', 'postcode']; + + /** + * Open estimate shipping and tax form. * * @return void */ @@ -71,7 +77,7 @@ class Shipping extends Form } /** - * Click Get quote button + * Click Get quote button. * * @return void */ @@ -81,7 +87,7 @@ class Shipping extends Form } /** - * Select shipping method + * Select shipping method. * * @param array $shipping * @return void @@ -97,7 +103,7 @@ class Shipping extends Form } /** - * Fill shipping and tax form + * Fill shipping and tax form. * * @param Address $address * @return void @@ -105,12 +111,14 @@ class Shipping extends Form public function fillEstimateShippingAndTax(Address $address) { $this->openEstimateShippingAndTax(); - $this->fill($address); + $data = $address->getData(); + $mapping = $this->dataMapping(array_intersect_key($data, array_flip($this->estimationFields))); + $this->_fill($mapping, $this->_rootElement); $this->clickGetQuote(); } /** - * Determines if the specified shipping carrier/method is visible on the cart + * Determines if the specified shipping carrier/method is visible on the cart. * * @param $carrier * @param $method diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Billing.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Billing.php index f4df8ae791b970291e26684656e2199df91d1445..dcc945eaafd750c6d4fcb282c791c3f611e0e8a1 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Billing.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Billing.php @@ -48,8 +48,6 @@ class Billing extends Form $isShippingAddress = false ) { if ($billingAddress) { - //@TODO: MAGETWO-34756 - sleep(5); $this->fill($billingAddress); } if ($isShippingAddress) { diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Block/Adminhtml/Page/Grid.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Block/Adminhtml/Page/Grid.php index 4188aef15cd0565a483f3a08e31fdaf7156cd429..53402d17d2a4654409dd5a2b7d6937ad7c58422f 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/Block/Adminhtml/Page/Grid.php +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Block/Adminhtml/Page/Grid.php @@ -6,8 +6,8 @@ namespace Magento\Cms\Test\Block\Adminhtml\Page; -use Magento\Ui\Test\Block\Adminhtml\DataGrid; use Magento\Mtf\Client\Locator; +use Magento\Ui\Test\Block\Adminhtml\DataGrid; /** * Backend Data Grid for managing "CMS Page" entities. @@ -66,8 +66,8 @@ class Grid extends DataGrid * * @var string */ - protected $previewCmsPage = '.action-menu-item'; - + protected $previewCmsPage = ".//a[contains(@class, 'action-menu-item') and text() = '%s']"; + /** * Search item and open it on Frontend. * @@ -77,10 +77,12 @@ class Grid extends DataGrid */ public function searchAndPreview(array $filter) { + $itemName = 'Preview'; $this->search($filter); $rowItem = $this->_rootElement->find($this->rowItem); if ($rowItem->isVisible()) { - $rowItem->find($this->previewCmsPage)->click(); + $rowItem->find('.action-select')->click(); + $rowItem->find(sprintf($this->previewCmsPage, $itemName), Locator::SELECTOR_XPATH)->click(); } else { throw new \Exception('Searched item was not found.'); } diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsBlockEntityTest.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsBlockEntityTest.xml index 2e1583ed1df208668de87b8fc5a3e62edd4b4628..a6fb5bb04526031f8a9e828ea496e769bde0590b 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsBlockEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsBlockEntityTest.xml @@ -18,7 +18,6 @@ <constraint name="Magento\Cms\Test\Constraint\AssertCmsBlockOnCategoryPage" /> </variation> <variation name="CreateCmsBlockEntityTestVariation2"> - <data name="issue" xsi:type="string">Bug: MAGETWO-35059</data> <data name="cmsBlock/data/title" xsi:type="string">block_%isolation%</data> <data name="cmsBlock/data/identifier" xsi:type="string">identifier_%isolation%</data> <data name="cmsBlock/data/stores/dataSet/option_0" xsi:type="string">default</data> diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.php b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.php index 60e0ea23b8526546d7ef2dca4f1d92a7c870c99b..7c1cddceb98ec3c10a9706921d161ae55629fec8 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.php @@ -9,6 +9,7 @@ namespace Magento\Cms\Test\TestCase; use Magento\Cms\Test\Fixture\CmsPage as CmsPageFixture; use Magento\Cms\Test\Page\Adminhtml\CmsPageIndex; use Magento\Cms\Test\Page\Adminhtml\CmsPageNew; +use Magento\Mtf\Fixture\FixtureFactory; use Magento\Mtf\TestCase\Injectable; /** @@ -29,7 +30,6 @@ class CreateCmsPageEntityTest extends Injectable const MVP = 'yes'; const DOMAIN = 'PS'; const TEST_TYPE = 'acceptance_test'; - const TO_MAINTAIN = 'yes'; /* end tags */ /** @@ -46,33 +46,46 @@ class CreateCmsPageEntityTest extends Injectable */ protected $cmsPageNew; + /** + * Fixture factory. + * + * @var FixtureFactory + */ + protected $fixtureFactory; + /** * Inject pages. * * @param CmsPageIndex $cmsIndex * @param CmsPageNew $cmsPageNew + * @param FixtureFactory $fixtureFactory * @return void */ - public function __inject(CmsPageIndex $cmsIndex, CmsPageNew $cmsPageNew) + public function __inject(CmsPageIndex $cmsIndex, CmsPageNew $cmsPageNew, FixtureFactory $fixtureFactory) { $this->cmsIndex = $cmsIndex; $this->cmsPageNew = $cmsPageNew; + $this->fixtureFactory = $fixtureFactory; } /** * Creating Cms page. * - * @param CmsPageFixture $cms - * @return void + * @param array $data + * @param string $fixtureType + * @return array */ - public function test(CmsPageFixture $cms) + public function test(array $data, $fixtureType) { // Steps + $cms = $this->fixtureFactory->createByCode($fixtureType, ['data' => $data]); $this->cmsIndex->open(); $this->cmsIndex->getPageActionsBlock()->addNew(); //TODO: remove cms page new refresh after resolve issue with static js files publication (MAGETWO-37898) $this->cmsPageNew->open(); $this->cmsPageNew->getPageForm()->fill($cms); $this->cmsPageNew->getPageMainActions()->save(); + + return ['cms' => $cms]; } } diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.xml index 21c9773ef8a4518f1ebdd6c466585dd4d2749fd2..a549ca390d66817d3c7a2c64590aaa833bd1ed8a 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.xml @@ -9,10 +9,11 @@ <testCase name="Magento\Cms\Test\TestCase\CreateCmsPageEntityTest"> <variation name="CreateCmsPageEntityTestVariation1"> <data name="description" xsi:type="string">MAGETWO-12399: Create CMS Content Page</data> - <data name="cms/data/title" xsi:type="string">NewCmsPage%isolation%</data> - <data name="cms/data/identifier" xsi:type="string">identifier-%isolation%</data> - <data name="cms/data/store_id" xsi:type="string">All Store Views</data> - <data name="cms/data/content/content" xsi:type="string">cms_page_text_content%isolation%</data> + <data name="fixtureType" xsi:type="string">cmsPage</data> + <data name="data/title" xsi:type="string">NewCmsPage%isolation%</data> + <data name="data/identifier" xsi:type="string">identifier-%isolation%</data> + <data name="data/store_id" xsi:type="string">All Store Views</data> + <data name="data/content/content" xsi:type="string">cms_page_text_content%isolation%</data> <data name="tag" xsi:type="string">test_type:acceptance_test</data> <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageSuccessSaveMessage" /> <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageInGrid" /> @@ -20,20 +21,21 @@ </variation> <variation name="CreateCmsPageEntityTestVariation2"> <data name="description" xsi:type="string">Create page for default store view</data> - <data name="cms/data/title" xsi:type="string">NewCmsPage%isolation%</data> - <data name="cms/data/store_id" xsi:type="string">Main Website/Main Website Store/Default Store View</data> - <data name="cms/data/content/content" xsi:type="string">cms_page_text_content%isolation%</data> + <data name="fixtureType" xsi:type="string">cmsPage</data> + <data name="data/title" xsi:type="string">NewCmsPage%isolation%</data> + <data name="data/store_id" xsi:type="string">Main Website/Main Website Store/Default Store View</data> + <data name="data/content/content" xsi:type="string">cms_page_text_content%isolation%</data> <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageSuccessSaveMessage" /> <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageForm" /> </variation> <variation name="CreateCmsPageEntityTestVariation3"> - <data name="issue" xsi:type="string">Bug: MAGETWO-34858</data> <data name="description" xsi:type="string">Create page with widget and system variable</data> - <data name="cms/data/title" xsi:type="string">NewCmsPage%isolation%</data> - <data name="cms/data/store_id" xsi:type="string">Main Website/Main Website Store/Default Store View</data> - <data name="cms/data/content/content" xsi:type="string">cms_page_text_content%isolation%</data> - <data name="cms/data/content/widget/preset" xsi:type="string">default</data> - <data name="cms/data/content/variable" xsi:type="string">General Contact Name</data> + <data name="fixtureType" xsi:type="string">cmsPage</data> + <data name="data/title" xsi:type="string">NewCmsPage%isolation%</data> + <data name="data/store_id" xsi:type="string">Main Website/Main Website Store/Default Store View</data> + <data name="data/content/content" xsi:type="string">cms_page_text_content%isolation%</data> + <data name="data/content/widget/preset" xsi:type="string">default</data> + <data name="data/content/variable" xsi:type="string">General Contact Name</data> <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageSuccessSaveMessage" /> <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageForm" /> <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageInGrid" /> @@ -41,10 +43,11 @@ </variation> <variation name="CreateCmsPageEntityTestVariation4"> <data name="description" xsi:type="string">Create disabled page</data> - <data name="cms/data/title" xsi:type="string">NewCmsPage%isolation%</data> - <data name="cms/data/store_id" xsi:type="string">Main Website/Main Website Store/Default Store View</data> - <data name="cms/data/is_active" xsi:type="string">Disabled</data> - <data name="cms/data/content/content" xsi:type="string">cms_page_text_content%isolation%</data> + <data name="fixtureType" xsi:type="string">cmsPage</data> + <data name="data/title" xsi:type="string">NewCmsPage%isolation%</data> + <data name="data/store_id" xsi:type="string">Main Website/Main Website Store/Default Store View</data> + <data name="data/is_active" xsi:type="string">Disabled</data> + <data name="data/content/content" xsi:type="string">cms_page_text_content%isolation%</data> <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageSuccessSaveMessage" /> <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageForm" /> <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageInGrid" /> diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageRewriteEntityTest.php b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageRewriteEntityTest.php index 5023d9a37f2449be13b0c1153842e92014fa779c..5a0511def48fa2e7ac955637e7132367330113b4 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageRewriteEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageRewriteEntityTest.php @@ -75,7 +75,7 @@ class CreateCmsPageRewriteEntityTest extends Injectable //Steps $this->urlRewriteIndex->open(); $this->urlRewriteIndex->getPageActionsBlock()->addNew(); - $this->urlRewriteEdit->getFormBlock()->fill($urlRewrite); + $this->urlRewriteEdit->getUrlRewriteTypeSelectorBlock()->selectType($urlRewrite->getEntityType()); $cmsPage = $urlRewrite->getDataFieldConfig('target_path')['source']->getEntity(); $filter = ['title' => $cmsPage->getTitle()]; $this->urlRewriteEdit->getCmsGridBlock()->searchAndOpen($filter); diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsBlockEntityTest.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsBlockEntityTest.xml index 472e5a6558643e5ba71f676aa4811e555ff98515..048ff19fc06e9c2126be6cf5113afdaaa5349c9a 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsBlockEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsBlockEntityTest.xml @@ -18,7 +18,6 @@ <constraint name="Magento\Cms\Test\Constraint\AssertCmsBlockOnCategoryPage" /> </variation> <variation name="UpdateCmsBlockEntityTestVariation2"> - <data name="issue" xsi:type="string">Bug: MAGETWO-35059</data> <data name="cmsBlock/data/title" xsi:type="string">block_updated_%isolation%</data> <data name="cmsBlock/data/identifier" xsi:type="string">identifier_updated_%isolation%</data> <data name="cmsBlock/data/stores/dataSet/option_0" xsi:type="string">default</data> diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageEntityTest.php b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageEntityTest.php index 8da0baf1779dbb8f1509e4e74ad68bf8fe31d3ea..4c8f8d1cf29e792b75501b2d16471d83671cb0cc 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageEntityTest.php @@ -32,7 +32,6 @@ class UpdateCmsPageEntityTest extends Injectable /* tags */ const MVP = 'yes'; const DOMAIN = 'PS'; - const STABLE = 'no'; /* end tags */ /** diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/AffectedAttributeSet.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/AffectedAttributeSet.php index 1385164d592ac0608f057730e41b2897938ae55f..c838565a3d1ade69fe36b7cecf324a8bcd7e5402 100755 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/AffectedAttributeSet.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/AffectedAttributeSet.php @@ -10,7 +10,7 @@ use Magento\Mtf\Client\Element; use Magento\Mtf\Client\Locator; use Magento\Mtf\Fixture\FixtureInterface; use Magento\Mtf\Client\Element\SimpleElement; -use Magento\Backend\Test\Block\Widget\Form as ParentForm; +use Magento\Mtf\Block\Form as ParentForm; /** * Class AffectedAttributeSet diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config/Attribute.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config/Attribute.php index 9008800f6dd2ed58aec9821449f7fbd8ac12cd7f..17dc4b9d01f3141652064cfa61f058c34df4b68c 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config/Attribute.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config/Attribute.php @@ -6,7 +6,7 @@ namespace Magento\ConfigurableProduct\Test\Block\Adminhtml\Product\Edit\Tab\Super\Config; -use Magento\Backend\Test\Block\Widget\Form; +use Magento\Mtf\Block\Form; use Magento\ConfigurableProduct\Test\Block\Adminhtml\Product\Edit\Tab\Super\Config\Attribute\AttributeSelector; use Magento\Mtf\Client\Element\SimpleElement; use Magento\Mtf\Client\Locator; @@ -247,7 +247,12 @@ class Attribute extends Form $attributeBlock->find($this->addOption)->click(); } $mapping = $this->dataMapping($option); - $this->_fill($mapping, $optionContainer); + foreach ($mapping as $field) { + $element = $this->getElement($optionContainer, $field); + if ($element->isVisible() && !$element->isDisabled()) { + $element->setValue($field['value']); + } + } } } diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config/Attribute/AttributeSelector.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config/Attribute/AttributeSelector.php index d3c32d608a143ce63212eef08da97c7df4372a93..4d2bf2cb8268168557df928f63a3cb0b8cde12c8 100755 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config/Attribute/AttributeSelector.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config/Attribute/AttributeSelector.php @@ -21,14 +21,16 @@ class AttributeSelector extends SuggestElement */ public function waitResult() { - $browser = $this; - $selector = $this->searchResult; - $browser->waitUntil( - function () use ($browser, $selector) { - $element = $browser->find($selector); - return $element->isVisible() ? true : null; - } - ); + try { + $this->waitUntil( + function () { + return $this->find($this->searchResult)->isVisible() ? true : null; + } + ); + } catch (\Exception $e) { + // In parallel run on windows change the focus is lost on element + // that causes disappearing of result suggest list. + } } /** diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config/Matrix.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config/Matrix.php index 11db5ed304636b2e2f25019e3c7b08bc5d8ac1f5..8ecdc5aa867ac14b09de37a8dfc480144d468b6f 100755 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config/Matrix.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config/Matrix.php @@ -8,7 +8,7 @@ namespace Magento\ConfigurableProduct\Test\Block\Adminhtml\Product\Edit\Tab\Supe use Magento\Mtf\Client\Locator; use Magento\Backend\Test\Block\Template; -use Magento\Backend\Test\Block\Widget\Form; +use Magento\Mtf\Block\Form; use Magento\Mtf\Client\Element\SimpleElement; /** diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/ProductForm.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/ProductForm.php index 1fbc66894cebacdfb377b9a2edc64a5e04fa17a1..6b79d3f4378eb68c03306271d9f951fae10259cd 100755 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/ProductForm.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/ProductForm.php @@ -34,6 +34,7 @@ class ProductForm extends \Magento\Catalog\Test\Block\Adminhtml\Product\ProductF } $this->showAdvancedSettings(); + $this->getTab('variations')->showContent(); return $this->fillTabs($tabs, $element); } } diff --git a/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/Block/Adminhtml/System/Currency/Rate/CurrencyRateForm.xml b/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/Block/Adminhtml/System/Currency/Rate/CurrencyRateForm.xml index 4ffc8f05740d4454c14ded3bdc171699a7d93c1c..333fd02a273cdf57938df7df7fa4e9e801d26537 100644 --- a/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/Block/Adminhtml/System/Currency/Rate/CurrencyRateForm.xml +++ b/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/Block/Adminhtml/System/Currency/Rate/CurrencyRateForm.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<mapping strict="0"> +<mapping strict="1"> <wrapper>rate</wrapper> <fields> <rate> diff --git a/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/Block/Adminhtml/System/CurrencySymbolForm.php b/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/Block/Adminhtml/System/CurrencySymbolForm.php index 2f758e545f4821b7f8fc3fc271881099d2c70d82..33e1e795ca940f4dc40ade7b565ba87969a0c54f 100644 --- a/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/Block/Adminhtml/System/CurrencySymbolForm.php +++ b/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/Block/Adminhtml/System/CurrencySymbolForm.php @@ -34,6 +34,10 @@ class CurrencySymbolForm extends Form public function fill(FixtureInterface $fixture, SimpleElement $element = null) { $element = $this->_rootElement->find(sprintf($this->currencyRow, $fixture->getCode()), Locator::SELECTOR_XPATH); - return parent::fill($fixture, $element); + $data = $fixture->getData(); + unset($data['code']); + $mapping = $this->dataMapping($data); + $this->_fill($mapping, $element); + return $this; } } diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/Group/Edit/Form.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/Group/Edit/Form.php index b262872d048e724c5c3fc5570cb79e82b6030db4..e840b736e06357961ff3446ab37e661e27d93e58 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/Group/Edit/Form.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/Group/Edit/Form.php @@ -6,15 +6,10 @@ namespace Magento\Customer\Test\Block\Adminhtml\Group\Edit; -use Magento\Backend\Test\Block\Widget\Form as AbstractForm; - /** - * Class Form - * Customer group edit form - * - * @package Magento\Customer\Test\Block\Adminhtml\Group\Edit + * Customer group edit form. */ -class Form extends AbstractForm +class Form extends \Magento\Mtf\Block\Form { // } diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Curl/CreateCustomer.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Curl/CreateCustomer.php deleted file mode 100644 index 744387049f2bc348cc2ea1ad106c6d472e3c885b..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Curl/CreateCustomer.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\Customer\Test\Handler\Curl; - -use Magento\Mtf\Fixture\FixtureInterface; -use Magento\Mtf\Handler\Curl; -use Magento\Mtf\Util\Protocol\CurlInterface; -use Magento\Mtf\Util\Protocol\CurlTransport; - -/** - * Class CreateCustomer. - * Curl handler for creating customer through registration page. - * - */ -class CreateCustomer extends Curl -{ - /** - * Post request for creating customer - * - * @param FixtureInterface $fixture [optional] - * @return mixed|string - */ - public function persist(FixtureInterface $fixture = null) - { - $data = $fixture->getData('fields'); - $fields = []; - foreach ($data as $key => $field) { - $fields[$key] = $field['value']; - } - $url = $_ENV['app_frontend_url'] . 'customer/account/createpost/?nocookie=true'; - $curl = new CurlTransport(); - $curl->write(CurlInterface::POST, $url, '1.0', [], $fields); - $response = $curl->read(); - $curl->close(); - - return $response; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Curl/CreateCustomerBackend.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Curl/CreateCustomerBackend.php deleted file mode 100644 index cad3c992efa4681f8bf0851d50fa211c22aad7cc..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Curl/CreateCustomerBackend.php +++ /dev/null @@ -1,75 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\Customer\Test\Handler\Curl; - -use Magento\Mtf\Fixture\FixtureInterface; -use Magento\Mtf\Handler\Curl; -use Magento\Mtf\Util\Protocol\CurlInterface; -use Magento\Mtf\Util\Protocol\CurlTransport; -use Magento\Mtf\Util\Protocol\CurlTransport\BackendDecorator; - -/** - * Curl handler for creating customer in admin - * - */ -class CreateCustomerBackend extends Curl -{ - /** - * Prepare POST data for creating customer request - * - * @param FixtureInterface $fixture - * @return array - */ - protected function _prepareData(FixtureInterface $fixture) - { - $data = $fixture->getData('fields'); - foreach ($data as $key => $values) { - $value = $this->_getValue($values); - if (null === $value) { - continue; - } - $data[$key] = $value; - } - - $curlData['account'] = $data; - return $curlData; - } - - /** - * Retrieve field value or return null if value does not exist - * - * @param array $values - * @return null|mixed - */ - protected function _getValue($values) - { - if (!isset($values['value'])) { - return null; - } - return isset($values['input_value']) ? $values['input_value'] : $values['value']; - } - - /** - * Post request for creating customer in backend - * - * @param FixtureInterface $fixture [optional] - * @return mixed|string - */ - public function persist(FixtureInterface $fixture = null) - { - $params = $this->_prepareData($fixture); - - $url = $_ENV['app_backend_url'] . 'customer/index/save/active_tab/account'; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->addOption(CURLOPT_HEADER, 1); - $curl->write(CurlInterface::POST, $url, '1.0', [], $params); - $response = $curl->read(); - $curl->close(); - - return $response; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Curl/SaveCustomerWithAddress.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Curl/SaveCustomerWithAddress.php deleted file mode 100644 index 43456cb34eec54dc87dd5f795753e44e06856fd7..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Curl/SaveCustomerWithAddress.php +++ /dev/null @@ -1,147 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\Customer\Test\Handler\Curl; - -use Magento\Mtf\Fixture\FixtureInterface; -use Magento\Mtf\Handler\Curl; -use Magento\Mtf\Util\Protocol\CurlInterface; -use Magento\Mtf\Util\Protocol\CurlTransport; - -/** - * Curl handler for saving customer address in admin - * - */ -class SaveCustomerWithAddress extends Curl -{ - /** - * Url for saving data - * - * @var string - */ - protected $saveUrl = '/customer/address/formPost/?nocookie=true'; - - /** - * Url for saving customer - * - * @var string - */ - protected $saveCustomer = 'customer/account/createpost/?nocookie=true'; - - /** - * Url of new address form - * - * @var string - */ - protected $addressNew = '/customer/address/new/?nocookie=true'; - - /** - * Form key - * - * @var string - */ - protected $formKey; - - /** - * Prepare POST data for creating customer request - * - * @param array $data - * @return array - */ - protected function prepareData($data) - { - $curlData = []; - foreach ($data as $key => $values) { - $value = $this->getValue($values); - if (null === $value) { - continue; - } - $curlData[$key] = $value; - } - $curlData['success_url'] = ''; - $curlData['error_url'] = ''; - $curlData['default_billing'] = 1; - $curlData['default_shipping'] = 1; - - return $curlData; - } - - /** - * Retrieve field value or return null if value does not exist - * - * @param array $values - * @return null|mixed - */ - protected function getValue($values) - { - if (!isset($values['value'])) { - return null; - } - return isset($values['input_value']) ? $values['input_value'] : $values['value']; - } - - /** - * Execute handler - * - * @param FixtureInterface $fixture - * @return mixed - */ - public function persist(FixtureInterface $fixture = null) - { - /** @var \Magento\Customer\Test\Fixture\Customer $fixture */ - $address = $fixture->getDefaultBilling(); - $fields = $this->prepareData($address->getData('fields')); - $url = $_ENV['app_frontend_url'] . $this->saveUrl; - $curl = $this->saveCustomer($fixture); - $fields['form_key'] = $this->formKey; - $curl->write(CurlInterface::POST, $url, '1.0', [], $fields); - $response = $curl->read(); - $curl->close(); - - return $response; - } - - /** - * Get from key from response - * - * @param string $response - * @return string - */ - protected function getFromKey($response) - { - preg_match('/input name="form_key" type="hidden" value="(\w+)"/', $response, $matches); - $formKey = ''; - if (!empty($matches[1])) { - $formKey = $matches[1]; - } - return $formKey; - } - - /** - * Save new customer and get form key - * - * @param \Magento\Customer\Test\Fixture\Customer $fixture - * @return CurlTransport - */ - protected function saveCustomer(\Magento\Customer\Test\Fixture\Customer $fixture) - { - $data = $fixture->getData('fields'); - $fields = []; - foreach ($data as $key => $field) { - $fields[$key] = $field['value']; - } - $url = $_ENV['app_frontend_url'] . $this->saveCustomer; - $curl = new CurlTransport(); - $curl->write(CurlInterface::POST, $url, '1.0', [], $fields); - $curl->read(); - $urlForm = $_ENV['app_frontend_url'] . $this->addressNew; - $curl->write(CurlInterface::GET, $urlForm, '1.0', []); - $response = $curl->read(); - $this->formKey = $this->getFromKey($response); - - return $curl; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Customer/Curl.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Customer/Curl.php index a13c263aeab7fe4db7e475dc11ee6f668fbfe4a8..2d8f5faf09f8860b6d20b3e5a08bdc2ca5b21c0f 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Customer/Curl.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Customer/Curl.php @@ -195,23 +195,27 @@ class Curl extends AbstractCurl implements CustomerInterface */ protected function prepareAddressData(array $curlData) { + $address = []; foreach (array_keys($curlData['address']) as $key) { - $curlData['address'][$key]['_deleted'] = ''; - $curlData['address'][$key]['region'] = ''; - if (!is_array($curlData['address'][$key]['street'])) { - $street = $curlData['address'][$key]['street']; - $curlData['address'][$key]['street'] = []; - $curlData['address'][$key]['street'][] = $street; + $addressKey = 'new_' . $key; + $address[$addressKey] = $curlData['address'][$key]; + $address[$addressKey]['_deleted'] = ''; + $address[$addressKey]['region'] = ''; + if (!is_array($address[$addressKey]['street'])) { + $street = $address[$addressKey]['street']; + $address[$addressKey]['street'] = []; + $address[$addressKey]['street'][] = $street; } - if (isset($curlData['address'][$key]['default_billing'])) { - $value = $curlData['address'][$key]['default_billing'] === 'Yes' ? 'true' : 'false'; - $curlData['address'][$key]['default_billing'] = $value; + if (isset($address[$addressKey]['default_billing'])) { + $value = $address[$addressKey]['default_billing'] === 'Yes' ? 'true' : 'false'; + $address[$addressKey]['default_billing'] = $value; } - if (isset($curlData['address'][$key]['default_shipping'])) { - $value = $curlData['address'][$key]['default_shipping'] === 'Yes' ? 'true' : 'false'; - $curlData['address'][$key]['default_shipping'] = $value; + if (isset($address[$addressKey]['default_shipping'])) { + $value = $address[$addressKey]['default_shipping'] === 'Yes' ? 'true' : 'false'; + $address[$addressKey]['default_shipping'] = $value; } } + $curlData['address'] = $address; return $curlData; } diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Ui/CreateAddress.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Ui/CreateAddress.php deleted file mode 100644 index b2e9bdd33d69766478fad90cc5c20634f96f45f6..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Ui/CreateAddress.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\Customer\Test\Handler\Ui; - -use Magento\Mtf\Factory\Factory; -use Magento\Mtf\Fixture\FixtureInterface; - -/** - * UI handler for creating customer address. - */ -class CreateAddress extends \Magento\Mtf\Handler\Ui -{ - /** - * Execute handler - * - * @param FixtureInterface $fixture [optional] - * @return mixed - */ - public function persist(FixtureInterface $fixture = null) - { - /** @var \Magento\Customer\Test\Fixture\Address $fixture */ - // Pages - $loginPage = Factory::getPageFactory()->getCustomerAccountLogin(); - $addressPage = Factory::getPageFactory()->getCustomerAddressEdit(); - - $loginPage->open(); - if ($loginPage->getLoginBlock()->isVisible()) { - $loginPage->getLoginBlock()->login($fixture->getCustomer()); - } - - $addressPage->open(); - $addressPage->getEditForm()->editCustomerAddress($fixture); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Webapi/CreateCustomer.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Webapi/CreateCustomer.php deleted file mode 100644 index af06e68b03ef85b14d92d27f4044803de10e059b..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Webapi/CreateCustomer.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\Customer\Test\Handler\Webapi; - -use Magento\Mtf\Fixture\FixtureInterface; -use Magento\Mtf\Handler\Webapi; -use Magento\Mtf\Util\Protocol\SoapTransport; - -/** - * Class CreateCustomer - * - */ -class CreateCustomer extends Webapi -{ - /** - * Create customer through request - * - * @param FixtureInterface $fixture [optional] - * @return mixed - */ - public function persist(FixtureInterface $fixture = null) - { - $configuration = $this->_configuration->get('handler/0/webapi/0/value'); - - $soap = new SoapTransport($configuration['soap']); - return $soap->call('customerCustomerList', $fixture->getData()); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Address.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Address.php index 6012db8cdd17d501e64154dfe8892b8c14dcc2f3..ab84bfc693502818ea324506b9ff465771960798 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Address.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Address.php @@ -25,8 +25,8 @@ class Address extends AbstractRepository 'data' => $defaultData, ]; - $this->_data['address_US_1'] = $this->_getUS1(); - $this->_data['address_US_2'] = $this->_getUS2(); + $this->_data['US_address_1'] = $this->_getUS1(); + $this->_data['US_address_2'] = $this->_getUS2(); $this->_data['address_UK'] = $this->getAddressUK(); $this->_data['address_UK_2'] = $this->getAddressUK2(); $this->_data['address_UK_with_VAT'] = $this->getAddressUKWithVAT($this->_data['address_UK']); diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Address.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Address.xml index e379604530bcdc5cbafede7c11370a74e5639b94..b39490b24c48af4d2b10c1ac7e45fdc7d4a367d0 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Address.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Address.xml @@ -37,21 +37,6 @@ <field name="default_shipping" xsi:type="string">No</field> </dataset> - <dataset name="US_NY_address_billing"> - <field name="firstname" xsi:type="string">John</field> - <field name="lastname" xsi:type="string">Doe</field> - <field name="email" xsi:type="string">John.Doe%isolation%@example.com</field> - <field name="company" xsi:type="string">Magento %isolation%</field> - <field name="street" xsi:type="string">6262 Fifth Avenue</field> - <field name="city" xsi:type="string">New York</field> - <field name="region_id" xsi:type="string">New York</field> - <field name="postcode" xsi:type="string">90230</field> - <field name="country_id" xsi:type="string">United States</field> - <field name="telephone" xsi:type="string">555-55-555-55</field> - <field name="default_billing" xsi:type="string">No</field> - <field name="default_shipping" xsi:type="string">No</field> - </dataset> - <dataset name="US_address_default_shipping"> <field name="firstname" xsi:type="string">John</field> <field name="lastname" xsi:type="string">Doe</field> @@ -67,43 +52,42 @@ <field name="default_shipping" xsi:type="string">No</field> </dataset> - <dataset name="default_US_address"> + <dataset name="US_address_1"> + <field name="firstname" xsi:type="string">John</field> + <field name="lastname" xsi:type="string">Doe</field> <field name="company" xsi:type="string">Magento %isolation%</field> - <field name="street" xsi:type="string">6161 West Centinela Avenue</field> + <field name="email" xsi:type="string">John.Doe%isolation%@example.com</field> <field name="city" xsi:type="string">Culver City</field> - <field name="region_id" xsi:type="string">California</field> + <field name="street" xsi:type="string">6161 West Centinela Avenue</field> <field name="postcode" xsi:type="string">90230</field> <field name="country_id" xsi:type="string">United States</field> + <field name="region_id" xsi:type="string">California</field> <field name="telephone" xsi:type="string">555-55-555-55</field> - <field name="default_billing" xsi:type="string">Yes</field> - <field name="default_shipping" xsi:type="string">Yes</field> </dataset> - <dataset name="US_address_without_email"> + <dataset name="US_address_1_without_email"> <field name="firstname" xsi:type="string">John</field> <field name="lastname" xsi:type="string">Doe</field> <field name="company" xsi:type="string">Magento %isolation%</field> - <field name="street" xsi:type="string">6161 West Centinela Avenue</field> <field name="city" xsi:type="string">Culver City</field> - <field name="region_id" xsi:type="string">California</field> + <field name="street" xsi:type="string">6161 West Centinela Avenue</field> <field name="postcode" xsi:type="string">90230</field> <field name="country_id" xsi:type="string">United States</field> + <field name="region_id" xsi:type="string">California</field> <field name="telephone" xsi:type="string">555-55-555-55</field> </dataset> - <dataset name="US_address_NY"> - <field name="firstname" xsi:type="string">John</field> - <field name="lastname" xsi:type="string">Doe</field> - <field name="email" xsi:type="string">John.Doe%isolation%@example.com</field> + <dataset name="US_address_2"> + <field name="firstname" xsi:type="string">Billy</field> + <field name="lastname" xsi:type="string">Holiday</field> <field name="company" xsi:type="string">Magento %isolation%</field> - <field name="street" xsi:type="string">3222 Cliffside Drive</field> - <field name="city" xsi:type="string">Binghamton</field> - <field name="region_id" xsi:type="string">New York</field> - <field name="postcode" xsi:type="string">13901</field> + <field name="email" xsi:type="string">b.holliday@example.net</field> + <field name="city" xsi:type="string">New York</field> + <field name="street" xsi:type="string">727 5th Ave</field> + <field name="postcode" xsi:type="string">10022</field> <field name="country_id" xsi:type="string">United States</field> - <field name="telephone" xsi:type="string">607-481-7802</field> - <field name="default_billing" xsi:type="string">Yes</field> - <field name="default_shipping" xsi:type="string">Yes</field> + <field name="region_id" xsi:type="string">New York</field> + <field name="telephone" xsi:type="string">777-77-77-77</field> </dataset> <dataset name="US_address_TX"> @@ -121,21 +105,37 @@ <field name="default_shipping" xsi:type="string">Yes</field> </dataset> - <dataset name="customer_US"> + <dataset name="US_address_NY"> <field name="firstname" xsi:type="string">John</field> <field name="lastname" xsi:type="string">Doe</field> - <field name="email" xsi:type="string">JohnDoe_%isolation%@example.com</field> + <field name="email" xsi:type="string">John.Doe%isolation%@example.com</field> <field name="company" xsi:type="string">Magento %isolation%</field> - <field name="city" xsi:type="string">Culver City</field> - <field name="street" xsi:type="string">6161 West Centinela Avenue</field> + <field name="street" xsi:type="string">3222 Cliffside Drive</field> + <field name="city" xsi:type="string">Binghamton</field> + <field name="region_id" xsi:type="string">New York</field> + <field name="postcode" xsi:type="string">13901</field> + <field name="country_id" xsi:type="string">United States</field> + <field name="telephone" xsi:type="string">607-481-7802</field> + <field name="default_billing" xsi:type="string">Yes</field> + <field name="default_shipping" xsi:type="string">Yes</field> + </dataset> + + <dataset name="US_address_NY_default_no"> + <field name="firstname" xsi:type="string">John</field> + <field name="lastname" xsi:type="string">Doe</field> + <field name="email" xsi:type="string">John.Doe%isolation%@example.com</field> + <field name="company" xsi:type="string">Magento %isolation%</field> + <field name="street" xsi:type="string">6262 Fifth Avenue</field> + <field name="city" xsi:type="string">New York</field> + <field name="region_id" xsi:type="string">New York</field> <field name="postcode" xsi:type="string">90230</field> <field name="country_id" xsi:type="string">United States</field> - <field name="region_id" xsi:type="string">California</field> <field name="telephone" xsi:type="string">555-55-555-55</field> - <field name="fax" xsi:type="string">555-55-555-55</field> + <field name="default_billing" xsi:type="string">No</field> + <field name="default_shipping" xsi:type="string">No</field> </dataset> - <dataset name="customer_UK"> + <dataset name="UK_address_default_billing"> <field name="firstname" xsi:type="string">Jane</field> <field name="lastname" xsi:type="string">Doe</field> <field name="email" xsi:type="string">JaneDoe_%isolation%@example.com</field> @@ -147,9 +147,11 @@ <field name="region" xsi:type="string">London</field> <field name="telephone" xsi:type="string">444-44-444-44</field> <field name="fax" xsi:type="string">444-44-444-44</field> + <field name="default_billing" xsi:type="string">Yes</field> + <field name="default_shipping" xsi:type="string">Yes</field> </dataset> - <dataset name="address_UK_default_billing_address"> + <dataset name="UK_address"> <field name="firstname" xsi:type="string">Jane</field> <field name="lastname" xsi:type="string">Doe</field> <field name="email" xsi:type="string">JaneDoe_%isolation%@example.com</field> @@ -161,61 +163,9 @@ <field name="region" xsi:type="string">London</field> <field name="telephone" xsi:type="string">444-44-444-44</field> <field name="fax" xsi:type="string">444-44-444-44</field> - <field name="default_billing" xsi:type="string">Yes</field> - <field name="default_shipping" xsi:type="string">Yes</field> - </dataset> - - <dataset name="address_US_1"> - <field name="firstname" xsi:type="string">John</field> - <field name="lastname" xsi:type="string">Doe</field> - <field name="company" xsi:type="string">Magento %isolation%</field> - <field name="email" xsi:type="string">John.Doe%isolation%@example.com</field> - <field name="city" xsi:type="string">Culver City</field> - <field name="street" xsi:type="string">6161 West Centinela Avenue</field> - <field name="postcode" xsi:type="string">90230</field> - <field name="country_id" xsi:type="string">United States</field> - <field name="region_id" xsi:type="string">California</field> - <field name="telephone" xsi:type="string">555-55-555-55</field> - </dataset> - - <dataset name="address_US_2"> - <field name="firstname" xsi:type="string">Billy</field> - <field name="lastname" xsi:type="string">Holiday</field> - <field name="company" xsi:type="string">Magento %isolation%</field> - <field name="email" xsi:type="string">b.holliday@example.net</field> - <field name="city" xsi:type="string">New York</field> - <field name="street" xsi:type="string">727 5th Ave</field> - <field name="postcode" xsi:type="string">10022</field> - <field name="country_id" xsi:type="string">United States</field> - <field name="region_id" xsi:type="string">New York</field> - <field name="telephone" xsi:type="string">777-77-77-77</field> - </dataset> - - <dataset name="address_data_US_1"> - <field name="firstname" xsi:type="string">John</field> - <field name="lastname" xsi:type="string">Doe</field> - <field name="company" xsi:type="string">Magento %isolation%</field> - <field name="city" xsi:type="string">Culver City</field> - <field name="street" xsi:type="string">6161 West Centinela Avenue</field> - <field name="postcode" xsi:type="string">90230</field> - <field name="country_id" xsi:type="string">United States</field> - <field name="region_id" xsi:type="string">California</field> - <field name="telephone" xsi:type="string">555-55-555-55</field> - </dataset> - - <dataset name="address_DE"> - <field name="firstname" xsi:type="string">Jan</field> - <field name="lastname" xsi:type="string">Jansen</field> - <field name="company" xsi:type="string">Magento %isolation%</field> - <field name="city" xsi:type="string">Berlin</field> - <field name="street" xsi:type="string">Augsburger Strabe 41</field> - <field name="postcode" xsi:type="string">10789</field> - <field name="country_id" xsi:type="string">Germany</field> - <field name="region_id" xsi:type="string">Berlin</field> - <field name="telephone" xsi:type="string">333-33-333-33</field> </dataset> - <dataset name="address_UK"> + <dataset name="UK_address_without_email"> <field name="firstname" xsi:type="string">Jane</field> <field name="lastname" xsi:type="string">Doe</field> <field name="company" xsi:type="string">Magento %isolation%</field> @@ -223,23 +173,12 @@ <field name="street" xsi:type="string">172, Westminster Bridge Rd</field> <field name="postcode" xsi:type="string">SE1 7RW</field> <field name="country_id" xsi:type="string">United Kingdom</field> - <field name="region_id" xsi:type="string">London</field> - <field name="telephone" xsi:type="string">444-44-444-44</field> - </dataset> - - <dataset name="address_UK_2"> - <field name="firstname" xsi:type="string">Jane</field> - <field name="lastname" xsi:type="string">Doe</field> - <field name="company" xsi:type="string">Magento %isolation%</field> - <field name="city" xsi:type="string">Manchester</field> - <field name="street" xsi:type="string">42 King Street West</field> - <field name="postcode" xsi:type="string">M3 2WY</field> - <field name="country_id" xsi:type="string">United Kingdom</field> - <field name="region_id" xsi:type="string">Manchester</field> + <field name="region" xsi:type="string">London</field> <field name="telephone" xsi:type="string">444-44-444-44</field> + <field name="fax" xsi:type="string">444-44-444-44</field> </dataset> - <dataset name="address_UK_with_VAT"> + <dataset name="UK_address_with_VAT"> <field name="firstname" xsi:type="string">Jane</field> <field name="lastname" xsi:type="string">Doe</field> <field name="company" xsi:type="string">Magento %isolation%</field> @@ -253,5 +192,17 @@ <field name="default_billing" xsi:type="string">Yes</field> <field name="default_shipping" xsi:type="string">Yes</field> </dataset> + + <dataset name="DE_address"> + <field name="firstname" xsi:type="string">Jan</field> + <field name="lastname" xsi:type="string">Jansen</field> + <field name="company" xsi:type="string">Magento %isolation%</field> + <field name="city" xsi:type="string">Berlin</field> + <field name="street" xsi:type="string">Augsburger Strabe 41</field> + <field name="postcode" xsi:type="string">10789</field> + <field name="country_id" xsi:type="string">Germany</field> + <field name="region_id" xsi:type="string">Berlin</field> + <field name="telephone" xsi:type="string">333-33-333-33</field> + </dataset> </repository> </config> diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Customer.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Customer.xml index a3eb0e57b62a60790483e504a2f020e7252744b0..2dc95ab415c6d8bebb759f0726e17366ed87a627 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Customer.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Customer.xml @@ -76,22 +76,6 @@ </field> </dataset> - <dataset name="customer_US"> - <field name="firstname" xsi:type="string">John</field> - <field name="lastname" xsi:type="string">Doe</field> - <field name="email" xsi:type="string">JohnDoe_%isolation%@example.com</field> - <field name="password" xsi:type="string">123123q</field> - <field name="password_confirmation" xsi:type="string">123123q</field> - </dataset> - - <dataset name="customer_UK"> - <field name="firstname" xsi:type="string">Jane</field> - <field name="lastname" xsi:type="string">Doe</field> - <field name="email" xsi:type="string">JaneDoe_%isolation%@example.com</field> - <field name="password" xsi:type="string">123123q</field> - <field name="password_confirmation" xsi:type="string">123123q</field> - </dataset> - <dataset name="johndoe_unique"> <field name="firstname" xsi:type="string">John</field> <field name="lastname" xsi:type="string">Doe%isolation%</field> @@ -144,7 +128,7 @@ <field name="password" xsi:type="string">123123q</field> <field name="password_confirmation" xsi:type="string">123123q</field> <field name="address" xsi:type="array"> - <item name="presets" xsi:type="string">address_US_1</item> + <item name="presets" xsi:type="string">US_address_1</item> </field> </dataset> @@ -158,29 +142,18 @@ <field name="password" xsi:type="string">123123q</field> <field name="password_confirmation" xsi:type="string">123123q</field> <field name="address" xsi:type="array"> - <item name="presets" xsi:type="string">address_US_1</item> + <item name="presets" xsi:type="string">US_address_1</item> </field> </dataset> - <dataset name="customer_US_1"> - <field name="firstname" xsi:type="string">John</field> - <field name="lastname" xsi:type="string">Doe%isolation%</field> - <field name="email" xsi:type="string">John.Doe%isolation%@example.com</field> - <field name="password" xsi:type="string">123123q</field> - <field name="password_confirmation" xsi:type="string">123123q</field> - <field name="address" xsi:type="array"> - <item name="presets" xsi:type="string">address_US_1</item> - </field> - </dataset> - - <dataset name="customer_UK_1"> + <dataset name="customer_US"> <field name="firstname" xsi:type="string">John</field> <field name="lastname" xsi:type="string">Doe%isolation%</field> <field name="email" xsi:type="string">John.Doe%isolation%@example.com</field> <field name="password" xsi:type="string">123123q</field> <field name="password_confirmation" xsi:type="string">123123q</field> <field name="address" xsi:type="array"> - <item name="presets" xsi:type="string">address_UK</item> + <item name="presets" xsi:type="string">US_address_1</item> </field> </dataset> @@ -191,7 +164,7 @@ <field name="password" xsi:type="string">123123q</field> <field name="password_confirmation" xsi:type="string">123123q</field> <field name="address" xsi:type="array"> - <item name="presets" xsi:type="string">address_UK_default_billing_address</item> + <item name="presets" xsi:type="string">UK_address_default_billing</item> </field> </dataset> @@ -202,7 +175,7 @@ <field name="password" xsi:type="string">123123q</field> <field name="password_confirmation" xsi:type="string">123123q</field> <field name="address" xsi:type="array"> - <item name="presets" xsi:type="string">address_UK_with_VAT</item> + <item name="presets" xsi:type="string">UK_address_with_VAT</item> </field> </dataset> </repository> diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateExistingCustomerFrontendEntity.php b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateExistingCustomerFrontendEntity.php index 80e7a2eef28ff3be93e1ba8068f640151f00676e..010ed24047c38808b955e7645fccfbcccf858f6e 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateExistingCustomerFrontendEntity.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateExistingCustomerFrontendEntity.php @@ -13,11 +13,9 @@ use Magento\Customer\Test\Page\CustomerAccountLogout; use Magento\Mtf\TestCase\Injectable; /** - * Test Creation for CreateExistingCustomerFrontendEntity - * - * Test Flow: * Preconditions: - * 1.Customer is created + * 1.Customer is created. + * * Steps: * 1. Go to frontend. * 2. Click Register link. @@ -36,14 +34,14 @@ class CreateExistingCustomerFrontendEntity extends Injectable /* end tags */ /** - * Page CustomerAccountCreate + * Page CustomerAccountCreate. * * @var CustomerAccountCreate */ protected $customerAccountCreate; /** - * Page CustomerAccountLogout + * Page CustomerAccountLogout. * * @var CustomerAccountLogout */ @@ -57,51 +55,48 @@ class CreateExistingCustomerFrontendEntity extends Injectable protected $cmsIndex; /** - * Injection data + * Inject pages. * * @param CustomerAccountCreate $customerAccountCreate * @param CustomerAccountLogout $customerAccountLogout * @param CmsIndex $cmsIndex - * @param Customer $customer * @return array */ public function __inject( CustomerAccountCreate $customerAccountCreate, CustomerAccountLogout $customerAccountLogout, - CmsIndex $cmsIndex, - Customer $customer + CmsIndex $cmsIndex ) { $this->customerAccountLogout = $customerAccountLogout; $this->customerAccountCreate = $customerAccountCreate; $this->cmsIndex = $cmsIndex; - //Precondition - $customer->persist(); - return [ - 'customer' => $customer, - ]; } /** - * Create Existing Customer account on frontend + * Create Existing Customer account on frontend. * * @param Customer $customer * @return void */ public function testCreateExistingCustomer(Customer $customer) { - //Steps + // Precondition + $existingCustomer = clone $customer; + $customer->persist(); + + // Steps $this->cmsIndex->open(); $this->cmsIndex->getLinksBlock()->openLink('Register'); - $this->customerAccountCreate->getRegisterForm()->registerCustomer($customer); + $this->customerAccountCreate->getRegisterForm()->registerCustomer($existingCustomer); } /** - * Logout customer from frontend account + * Logout customer from frontend account. * * @return void */ public function tearDown() { - $this->customerAccountLogout->open(); + $this->objectManager->create('Magento\Customer\Test\TestStep\LogoutCustomerOnFrontendStep')->run(); } } diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateExistingCustomerFrontendEntity.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateExistingCustomerFrontendEntity.xml index 7c8b8ff68e45d059212dd8b1403f175a098f7b02..3fbdcf50f62d855f3aba5c3566609a72e0b34c8e 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateExistingCustomerFrontendEntity.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateExistingCustomerFrontendEntity.xml @@ -6,9 +6,14 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Magento\Customer\Test\TestCase\CreateExistingCustomerFrontendEntity"> - <variation name="CreateExistingCustomerFrontendEntityVariation1"> - <constraint name="Magento\Customer\Test\Constraint\AssertCustomerFailRegisterMessage"/> - </variation> - </testCase> + <testCase name="Magento\Customer\Test\TestCase\CreateExistingCustomerFrontendEntity"> + <variation name="CreateExistingCustomerFrontendEntityVariation1"> + <data name="customer/data/firstname" xsi:type="string">john</data> + <data name="customer/data/lastname" xsi:type="string">doe</data> + <data name="customer/data/email" xsi:type="string">johndoe%isolation%@example.com</data> + <data name="customer/data/password" xsi:type="string">123123q</data> + <data name="customer/data/password_confirmation" xsi:type="string">123123q</data> + <constraint name="Magento\Customer\Test\Constraint\AssertCustomerFailRegisterMessage" /> + </variation> + </testCase> </config> diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/DeleteCustomerAddressTest.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/DeleteCustomerAddressTest.xml index f998fde69cd1802f9eb05e63c6ae26622301b614..d4c96eef41e1caf37de7b2357dbfba0dec7e7350 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/DeleteCustomerAddressTest.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/DeleteCustomerAddressTest.xml @@ -9,7 +9,7 @@ <testCase name="Magento\Customer\Test\TestCase\DeleteCustomerAddressTest"> <variation name="DeleteCustomerAddressTestVariation1"> <data name="customer/dataSet" xsi:type="string">default</data> - <data name="customer/data/address/presets" xsi:type="string">US_address_default_billing,US_NY_address_billing</data> + <data name="customer/data/address/presets" xsi:type="string">US_address_default_billing,US_address_NY_default_no</data> <constraint name="Magento\Customer\Test\Constraint\AssertAddressDeletedFrontend"/> <constraint name="Magento\Customer\Test\Constraint\AssertAddressDeletedBackend"/> </variation> diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ForgotPasswordOnFrontendTest.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ForgotPasswordOnFrontendTest.xml index 28a5aa51e2f9bfb87966e81d9f6e77129c2f070a..42e10059a897b80bc35e7c0bccffb34f56469c75 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ForgotPasswordOnFrontendTest.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ForgotPasswordOnFrontendTest.xml @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Customer\Test\TestCase\ForgotPasswordOnFrontendTest"> <variation name="ForgotPasswordOnFrontendTestVariation1"> - <data name="customer/dataSet" xsi:type="string">customer_US_1</data> + <data name="customer/dataSet" xsi:type="string">customer_US</data> <constraint name="Magento\Customer\Test\Constraint\AssertCustomerForgotPasswordSuccessMessage" /> </variation> </testCase> diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerFrontendEntityTest.php b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerFrontendEntityTest.php index 2892af943fdd10dde6a8f51e40fa4580fe885047..63308bbea50d1103e598c31a2d40558952ce77d6 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerFrontendEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerFrontendEntityTest.php @@ -135,14 +135,4 @@ class UpdateCustomerFrontendEntityTest extends Injectable $this->customerAddressEdit->getEditForm()->fill($address); $this->customerAddressEdit->getEditForm()->saveAddress(); } - - /** - * Customer logout from account - * - * @return void - */ - public function tearDown() - { - $this->objectManager->create('Magento\Customer\Test\TestStep\LogoutCustomerOnFrontendStep')->run(); - } } diff --git a/dev/tests/functional/tests/app/Magento/Directory/Test/TestCase/CreateCurrencyRateTest.php b/dev/tests/functional/tests/app/Magento/Directory/Test/TestCase/CreateCurrencyRateTest.php index 04aa6c4ca73d61e4ef01e61ac9929d9a225d2b59..22b8d54518de92625349f1aa55fdf5cc7044695b 100644 --- a/dev/tests/functional/tests/app/Magento/Directory/Test/TestCase/CreateCurrencyRateTest.php +++ b/dev/tests/functional/tests/app/Magento/Directory/Test/TestCase/CreateCurrencyRateTest.php @@ -25,7 +25,7 @@ use Magento\CurrencySymbol\Test\Page\Adminhtml\SystemCurrencyIndex; * 5. Perform assertions. * * @group Localization_(PS) - * @ZephyrId MAGETWO-12427, MAGETWO-36824 + * @ZephyrId MAGETWO-36824 */ class CreateCurrencyRateTest extends Injectable { diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/UpdateDownloadableProductEntityTest.xml b/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/UpdateDownloadableProductEntityTest.xml index 69a8cb56138fc5d25a46a3eb72ac00e5dd66be17..10ba00e4d5db1f8c1791e7c96b82c0ddde64d343 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/UpdateDownloadableProductEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/UpdateDownloadableProductEntityTest.xml @@ -114,7 +114,6 @@ <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">10</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> - <data name="product/data/weight" xsi:type="string">10</data> <data name="product/data/special_price" xsi:type="string">40</data> <data name="isRequired" xsi:type="string">No</data> <data name="product/data/url_key" xsi:type="string">downloadableproduct-%isolation%</data> diff --git a/dev/tests/functional/tests/app/Magento/Fedex/Test/TestCase/OnePageCheckoutTest.xml b/dev/tests/functional/tests/app/Magento/Fedex/Test/TestCase/OnePageCheckoutTest.xml index 2c81ac17aeccd868843f2979155eaebd647408d8..add7f2519646396f0697621f74646ce4986d46bb 100644 --- a/dev/tests/functional/tests/app/Magento/Fedex/Test/TestCase/OnePageCheckoutTest.xml +++ b/dev/tests/functional/tests/app/Magento/Fedex/Test/TestCase/OnePageCheckoutTest.xml @@ -11,9 +11,9 @@ <data name="description" xsi:type="string">Checkout as guest using FedEx with US shipping origin and UK customer</data> <data name="products" xsi:type="string">catalogProductSimple::default, configurableProduct::default, bundleProduct::bundle_fixed_product</data> <data name="checkoutMethod" xsi:type="string">guest</data> - <data name="customer/dataSet" xsi:type="string">customer_UK</data> - <data name="address/dataSet" xsi:type="string">customer_UK</data> - <data name="billingAddress/dataSet" xsi:type="string">customer_UK</data> + <data name="customer/dataSet" xsi:type="string">default</data> + <data name="address/dataSet" xsi:type="string">UK_address</data> + <data name="billingAddress/dataSet" xsi:type="string">UK_address</data> <data name="shipping/shipping_service" xsi:type="string">Federal Express</data> <data name="shipping/shipping_method" xsi:type="string">International Economy</data> <data name="cart/data/shipping_method" xsi:type="string">International Economy</data> diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.xml b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.xml index 18f90c0f3157a1fc6295e3647311913f2fcf3f84..b6433e7ad8ed1e3a5d3715920b9e4f7cc85f4e47 100644 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.xml +++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.xml @@ -9,8 +9,8 @@ <testCase name="Magento\GiftMessage\Test\TestCase\CheckoutWithGiftMessagesTest"> <variation name="CheckoutWithGiftMessagesTestVariation1"> <data name="products" xsi:type="string">catalogProductSimple::default, catalogProductVirtual::default</data> - <data name="customer/dataSet" xsi:type="string">customer_US</data> - <data name="billingAddress/dataSet" xsi:type="string">customer_US</data> + <data name="customer/dataSet" xsi:type="string">default</data> + <data name="billingAddress/dataSet" xsi:type="string">US_address_1</data> <data name="checkoutMethod" xsi:type="string">login</data> <data name="shipping/shipping_service" xsi:type="string">Flat Rate</data> <data name="shipping/shipping_method" xsi:type="string">Fixed</data> @@ -26,8 +26,8 @@ </variation> <variation name="CheckoutWithGiftMessagesTestVariation2"> <data name="products" xsi:type="string">catalogProductSimple::default, catalogProductVirtual::default</data> - <data name="customer/dataSet" xsi:type="string">customer_US</data> - <data name="billingAddress/dataSet" xsi:type="string">customer_US</data> + <data name="customer/dataSet" xsi:type="string">default</data> + <data name="billingAddress/dataSet" xsi:type="string">US_address_1</data> <data name="checkoutMethod" xsi:type="string">login</data> <data name="shipping/shipping_service" xsi:type="string">Flat Rate</data> <data name="shipping/shipping_method" xsi:type="string">Fixed</data> diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Block/Adminhtml/Product/Grouped/AssociatedProducts.php b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Block/Adminhtml/Product/Grouped/AssociatedProducts.php index d888fa31e8ef27194c3dfd21d829fb82223b2e1c..618e06a6391659476bd7fcf648193767afae8302 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Block/Adminhtml/Product/Grouped/AssociatedProducts.php +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Block/Adminhtml/Product/Grouped/AssociatedProducts.php @@ -29,7 +29,7 @@ class AssociatedProducts extends Tab * * @var string */ - protected $productSearchGrid = "./ancestor::body//div[div[contains(@data-role,'add-product-dialog')]]"; + protected $productSearchGrid = './/*[@data-role="modal"][.//*[@data-role="add-product-dialog"]]'; /** * Associated products list block @@ -54,7 +54,7 @@ class AssociatedProducts extends Tab { return $this->blockFactory->create( 'Magento\GroupedProduct\Test\Block\Adminhtml\Product\Grouped\AssociatedProducts\Search\Grid', - ['element' => $this->_rootElement->find($this->productSearchGrid, Locator::SELECTOR_XPATH)] + ['element' => $this->browser->find($this->productSearchGrid, Locator::SELECTOR_XPATH)] ); } diff --git a/dev/tests/functional/tests/app/Magento/ImportExport/Test/Fixture/ImportExport.xml b/dev/tests/functional/tests/app/Magento/ImportExport/Test/Fixture/ImportExport.xml index 01f5463b5f052fac98c49d795f3ac38e4979139f..ac1253f96a0c0d1486389a3bf354b1842e4df1ac 100644 --- a/dev/tests/functional/tests/app/Magento/ImportExport/Test/Fixture/ImportExport.xml +++ b/dev/tests/functional/tests/app/Magento/ImportExport/Test/Fixture/ImportExport.xml @@ -6,22 +6,22 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="importExport" module="Magento_ImportExport" type="flat" entity_type="importexport_importdata" class="Magento\ImportExport\Test\Fixture\ImportExport"> - <dataset name="default"> - <field name="entity" xsi:type="string">Products</field> - <field name="behavior" xsi:type="string">CSV</field> - </dataset> - <field name="id" is_required="1"> - <default_value xsi:type="null"/> - </field> - <field name="entity" is_required=""> - <default_value xsi:type="string">Products</default_value> - </field> - <field name="behavior" is_required=""> - <default_value xsi:type="string">CSV</default_value> - </field> - <field name="data_export" is_required=""> - <default_value xsi:type="null"/> - </field> - </fixture> + <fixture name="importExport" module="Magento_ImportExport" type="flat" entity_type="importexport_importdata" class="Magento\ImportExport\Test\Fixture\ImportExport"> + <dataset name="default"> + <field name="entity" xsi:type="string">Products</field> + <field name="behavior" xsi:type="string">CSV</field> + </dataset> + <field name="id" is_required="1"> + <default_value xsi:type="null" /> + </field> + <field name="entity" is_required=""> + <default_value xsi:type="string">Products</default_value> + </field> + <field name="file_format" is_required=""> + <default_value xsi:type="string">CSV</default_value> + </field> + <field name="data_export" is_required=""> + <default_value xsi:type="null" /> + </field> + </fixture> </config> diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Block/CreateAdmin.xml b/dev/tests/functional/tests/app/Magento/Install/Test/Block/CreateAdmin.xml index 3f1616de3dbd0340573923778b6036b34776df03..b21f140454da51bf0b7428fd6d515c84b52534b6 100644 --- a/dev/tests/functional/tests/app/Magento/Install/Test/Block/CreateAdmin.xml +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Block/CreateAdmin.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<mapping strict="0"> +<mapping strict="1"> <fields> <username> <selector>[name='adminUsername']</selector> diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Block/CustomizeStore.php b/dev/tests/functional/tests/app/Magento/Install/Test/Block/CustomizeStore.php index e9e81483fa4943a59bb69b5f31ca0bb2552d954e..efe02fa2148c8c0108b0324d6790ab31df0c78c2 100644 --- a/dev/tests/functional/tests/app/Magento/Install/Test/Block/CustomizeStore.php +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Block/CustomizeStore.php @@ -24,11 +24,11 @@ class CustomizeStore extends Form protected $next = "[ng-click*='checkModuleConstraints']"; /** - * First field selector + * Module configuration section. * * @var string */ - protected $firstField = '[ng-model*="language"]'; + protected $moduleConfiguration = '.customize-your-store-advanced'; /** * Click on 'Next' button. @@ -49,7 +49,17 @@ class CustomizeStore extends Form */ public function fill(FixtureInterface $fixture, SimpleElement $element = null) { - $this->waitForElementVisible($this->firstField); - return parent::fill($fixture, $element); + $this->waitForElementVisible($this->moduleConfiguration); + $data = $fixture->getData(); + $storeData = []; + foreach ($data as $key => $value) { + if (strpos($key, 'store') === 0) { + $storeData[$key] = $value; + } + } + $mapping = $this->dataMapping($storeData); + $this->_fill($mapping, $element); + + return $this; } } diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Block/CustomizeStore.xml b/dev/tests/functional/tests/app/Magento/Install/Test/Block/CustomizeStore.xml index 24eaf10fa6a1ae9b5c06b4b06d41736b6e36f93d..8c99894d4e76836ccdd88c30f6498f6fbaba0c00 100644 --- a/dev/tests/functional/tests/app/Magento/Install/Test/Block/CustomizeStore.xml +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Block/CustomizeStore.xml @@ -7,13 +7,13 @@ --> <mapping strict="0"> <fields> - <currency> - <selector>[ng-model*='currency']</selector> + <storeCurrency> + <selector>#storeCurrency</selector> <input>select</input> - </currency> - <language> - <selector>[ng-model*='language']</selector> + </storeCurrency> + <storeLanguage> + <selector>#storeLanguage</selector> <input>select</input> - </language> + </storeLanguage> </fields> </mapping> diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Block/Database.php b/dev/tests/functional/tests/app/Magento/Install/Test/Block/Database.php index e1efe0955d55b1affbec3bd5ecce0045617dad7a..b532f1d1070a6439e06709987196760716415b75 100644 --- a/dev/tests/functional/tests/app/Magento/Install/Test/Block/Database.php +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Block/Database.php @@ -8,6 +8,8 @@ namespace Magento\Install\Test\Block; use Magento\Mtf\Block\Form; use Magento\Mtf\Client\Locator; +use Magento\Mtf\Fixture\FixtureInterface; +use Magento\Mtf\Client\Element\SimpleElement; /** * Database form. @@ -28,6 +30,28 @@ class Database extends Form */ protected $next = "[ng-click*='testConnection']"; + /** + * Fill database form. + * + * @param FixtureInterface $fixture + * @param SimpleElement|null $element + * @return $this + */ + public function fill(FixtureInterface $fixture, SimpleElement $element = null) + { + $data = $fixture->getData(); + $dbData = []; + foreach ($data as $key => $value) { + if (strpos($key, 'db') === 0) { + $dbData[$key] = $value; + } + } + $mapping = $this->dataMapping($dbData); + $this->_fill($mapping, $element); + + return $this; + } + /** * Get 'Test connection successful.' message. * diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Block/WebConfiguration.php b/dev/tests/functional/tests/app/Magento/Install/Test/Block/WebConfiguration.php index 654dd1ffc8fe3ad117cf1db3a7bb24ee7da00594..64a90917c4c0245490565f507e3def561752cd70 100644 --- a/dev/tests/functional/tests/app/Magento/Install/Test/Block/WebConfiguration.php +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Block/WebConfiguration.php @@ -7,6 +7,8 @@ namespace Magento\Install\Test\Block; use Magento\Mtf\Block\Form; +use Magento\Mtf\Fixture\FixtureInterface; +use Magento\Mtf\Client\Element\SimpleElement; /** * Web configuration block. @@ -27,6 +29,28 @@ class WebConfiguration extends Form */ protected $advancedOptions = "[ng-click*='advanced']"; + /** + * Fill web configuration form. + * + * @param FixtureInterface $fixture + * @param SimpleElement|null $element + * @return $this + */ + public function fill(FixtureInterface $fixture, SimpleElement $element = null) + { + $data = $fixture->getData(); + $webConfiguration = []; + foreach ($data as $key => $value) { + if (strpos($key, 'db') !== 0 && strpos($key, 'store') !== 0) { + $webConfiguration[$key] = $value; + } + } + $mapping = $this->dataMapping($webConfiguration); + $this->_fill($mapping, $element); + + return $this; + } + /** * Click on 'Next' button. * diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Block/WebConfiguration.xml b/dev/tests/functional/tests/app/Magento/Install/Test/Block/WebConfiguration.xml index f88d760c4c9cbd9a7c8d3b81bdb73f12338a9b79..a4b04f205eebf5c1305bda785977155d6449f569 100644 --- a/dev/tests/functional/tests/app/Magento/Install/Test/Block/WebConfiguration.xml +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Block/WebConfiguration.xml @@ -7,7 +7,9 @@ --> <mapping strict="0"> <fields> - <web /> + <baseUrl> + <selector>[name="base_url"]</selector> + </baseUrl> <admin /> <keyOwn> <selector>[value="user"]</selector> diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertSuccessInstall.php b/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertSuccessInstall.php index 07ce519b594d395e17adffc2cc6af1ab0f0f2ffb..dec19f621eda153301cce67d640609aa1bc406d2 100644 --- a/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertSuccessInstall.php +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertSuccessInstall.php @@ -24,7 +24,7 @@ class AssertSuccessInstall extends AbstractConstraint protected $adminFieldsList = [ ['pageData' => 'username', 'fixture' => 'username'], ['pageData' => 'e-mail', 'fixture' => 'email'], - ['pageData' => 'your_store_address', 'fixture' => 'web'], + ['pageData' => 'your_store_address', 'fixture' => 'baseUrl'], ['pageData' => 'magento_admin_address', 'fixture' => 'admin'] ]; @@ -57,8 +57,8 @@ class AssertSuccessInstall extends AbstractConstraint $allData[$key] = isset($value['value']) ? $value['value'] : $value; } - $allData['web'] = (isset($allData['https']) ? $allData['https'] : $allData['web']); - $allData['admin'] = $allData['web'] . $allData['admin'] . '/'; + $allData['baseUrl'] = (isset($allData['https']) ? $allData['https'] : $allData['baseUrl']); + $allData['admin'] = $allData['baseUrl'] . $allData['admin'] . '/'; foreach ($this->adminFieldsList as $field) { \PHPUnit_Framework_Assert::assertEquals( diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Fixture/Install.xml b/dev/tests/functional/tests/app/Magento/Install/Test/Fixture/Install.xml index d846de8f0bd45b0ed71068f8146e171994d682f6..2d83153459204f88755791b178917c92d4c01c79 100644 --- a/dev/tests/functional/tests/app/Magento/Install/Test/Fixture/Install.xml +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Fixture/Install.xml @@ -6,25 +6,25 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="install" module="Magento_Install" type="virtual" entity_type="install" repository_class="Magento\Install\Test\Repository\Install" handler_interface="Magento\Install\Test\Handler\Install\InstallInterface" class="Magento\Install\Test\Fixture\Install"> - <field name="dbHost"/> - <field name="dbUser"/> - <field name="dbPassword"/> - <field name="dbName"/> - <field name="web"/> - <field name="admin"/> - <field name="adminUsername"/> - <field name="adminEmail"/> - <field name="adminPassword"/> - <field name="adminConfirm"/> - <field name="apacheRewrites"/> - <field name="dbTablePrefix"/> - <field name="keyOwn"/> - <field name="httpsAdmin"/> - <field name="https"/> - <field name="httpsFront"/> - <field name="keyValue"/> - <field name="language"/> - <field name="currency"/> - </fixture> + <fixture name="install" module="Magento_Install" type="virtual" entity_type="install" repository_class="Magento\Install\Test\Repository\Install" handler_interface="Magento\Install\Test\Handler\Install\InstallInterface" class="Magento\Install\Test\Fixture\Install"> + <field name="dbHost" /> + <field name="dbUser" /> + <field name="dbPassword" /> + <field name="dbName" /> + <field name="dbTablePrefix" /> + <field name="baseUrl" /> + <field name="admin" /> + <field name="adminUsername" /> + <field name="adminEmail" /> + <field name="adminPassword" /> + <field name="adminConfirm" /> + <field name="apacheRewrites" /> + <field name="keyOwn" /> + <field name="httpsAdmin" /> + <field name="https" /> + <field name="httpsFront" /> + <field name="keyValue" /> + <field name="storeLanguage" /> + <field name="storeCurrency" /> + </fixture> </config> diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/TestCase/InstallTest.php b/dev/tests/functional/tests/app/Magento/Install/Test/TestCase/InstallTest.php index fbfb262f1206d798a750dcfede4c913b96eed3c5..ccf21709a84ab2f1d5f59eaf62cb5444a49df765 100644 --- a/dev/tests/functional/tests/app/Magento/Install/Test/TestCase/InstallTest.php +++ b/dev/tests/functional/tests/app/Magento/Install/Test/TestCase/InstallTest.php @@ -12,17 +12,13 @@ use Magento\Install\Test\Fixture\Install as InstallConfig; use Magento\User\Test\Fixture\User; use Magento\Mtf\Fixture\FixtureFactory; use Magento\Mtf\TestCase\Injectable; -use Magento\Mtf\Config\DataInterface; use Magento\Install\Test\Constraint\AssertAgreementTextPresent; use Magento\Install\Test\Constraint\AssertSuccessfulReadinessCheck; -use Magento\Mtf\ObjectManagerFactory; /** * PLEASE ADD NECESSARY INFO BEFORE RUNNING TEST TO * ../dev/tests/functional/config/config.xml * - * Test Flow: - * * Preconditions: * 1. Uninstall Magento. * @@ -67,20 +63,20 @@ class InstallTest extends Injectable */ public function __prepare() { - $config = ObjectManagerFactory::getObjectManager()->get('Magento\Mtf\Config\DataInterface'); + $config = $this->objectManager->get('Magento\Mtf\Config\DataInterface'); // Prepare config data $configData['dbHost'] = $config->get('install/0/host/0'); $configData['dbUser'] = $config->get('install/0/user/0'); $configData['dbPassword'] = $config->get('install/0/password/0'); $configData['dbName'] = $config->get('install/0/dbName/0'); - $configData['web'] = $config->get('install/0/baseUrl/0'); + $configData['baseUrl'] = $config->get('install/0/baseUrl/0'); $configData['admin'] = $config->get('install/0/backendName/0'); return ['configData' => $configData]; } /** - * Injection data. + * Uninstall Magento. * * @param CmsIndex $homePage * @param Install $installPage @@ -99,24 +95,24 @@ class InstallTest extends Injectable * Install Magento via web interface. * * @param User $user - * @param array $install * @param array $configData * @param FixtureFactory $fixtureFactory * @param AssertAgreementTextPresent $assertLicense * @param AssertSuccessfulReadinessCheck $assertReadiness + * @param array $install [optional] * @return array */ public function test( User $user, - array $install, array $configData, FixtureFactory $fixtureFactory, AssertAgreementTextPresent $assertLicense, - AssertSuccessfulReadinessCheck $assertReadiness + AssertSuccessfulReadinessCheck $assertReadiness, + array $install = [] ) { $dataConfig = array_merge($install, $configData); - if ($dataConfig['httpsFront'] != "-") { - $dataConfig['https'] = str_replace('http', 'https', $dataConfig['web']); + if (isset($dataConfig['httpsFront'])) { + $dataConfig['https'] = str_replace('http', 'https', $dataConfig['baseUrl']); } /** @var InstallConfig $installConfig */ $installConfig = $fixtureFactory->create('Magento\Install\Test\Fixture\Install', ['data' => $dataConfig]); diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/TestCase/InstallTest.xml b/dev/tests/functional/tests/app/Magento/Install/Test/TestCase/InstallTest.xml index a527c8538f6140ecff520b4f49e72bf3731d49ca..ff6ba2d1f1d7c44aa00109c83150752118a34b5b 100644 --- a/dev/tests/functional/tests/app/Magento/Install/Test/TestCase/InstallTest.xml +++ b/dev/tests/functional/tests/app/Magento/Install/Test/TestCase/InstallTest.xml @@ -6,113 +6,59 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Magento\Install\Test\TestCase\InstallTest"> - <variation name="InstallTestVariation1"> - <data name="user/dataSet" xsi:type="string">default</data> - <data name="install/dbTablePrefix" xsi:type="string">-</data> - <data name="install/admin" xsi:type="string">-</data> - <data name="install/httpsFront" xsi:type="string">-</data> - <data name="install/httpsAdmin" xsi:type="string">-</data> - <data name="install/apacheRewrites" xsi:type="string">-</data> - <data name="install/keyOwn" xsi:type="string">-</data> - <data name="install/keyValue" xsi:type="string">-</data> - <data name="install/language" xsi:type="string">-</data> - <data name="install/currency" xsi:type="string">-</data> - <data name="currencySymbol" xsi:type="string">-</data> - <data name="languageTemplate" xsi:type="string">-</data> - <data name="description" xsi:type="string">install with default values</data> - <constraint name="Magento\Install\Test\Constraint\AssertSuccessInstall"/> - <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogin"/> - </variation> - <variation name="InstallTestVariation2"> - <data name="user/dataSet" xsi:type="string">default</data> - <data name="install/dbTablePrefix" xsi:type="string">-</data> - <data name="install/admin" xsi:type="string">custom</data> - <data name="install/httpsFront" xsi:type="string">-</data> - <data name="install/httpsAdmin" xsi:type="string">-</data> - <data name="install/apacheRewrites" xsi:type="string">-</data> - <data name="install/keyOwn" xsi:type="string">-</data> - <data name="install/keyValue" xsi:type="string">-</data> - <data name="install/language" xsi:type="string">-</data> - <data name="install/currency" xsi:type="string">-</data> - <data name="currencySymbol" xsi:type="string">-</data> - <data name="languageTemplate" xsi:type="string">-</data> - <data name="description" xsi:type="string">install with custom admin path</data> - <constraint name="Magento\Install\Test\Constraint\AssertSuccessInstall"/> - <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogin"/> - </variation> - <variation name="InstallTestVariation3"> - <data name="user/dataSet" xsi:type="string">default</data> - <data name="install/dbTablePrefix" xsi:type="string">-</data> - <data name="install/admin" xsi:type="string">-</data> - <data name="install/httpsFront" xsi:type="string">-</data> - <data name="install/httpsAdmin" xsi:type="string">-</data> - <data name="install/apacheRewrites" xsi:type="string">-</data> - <data name="install/keyOwn" xsi:type="string">Yes</data> - <data name="install/keyValue" xsi:type="string">123123qa</data> - <data name="install/language" xsi:type="string">German (Germany)</data> - <data name="install/currency" xsi:type="string">Euro (EUR)</data> - <data name="currencySymbol" xsi:type="string">€</data> - <data name="languageTemplate" xsi:type="string">Suchbegriffe</data> - <data name="description" xsi:type="string">install with custom encryption key and changed currency and locale</data> - <constraint name="Magento\Install\Test\Constraint\AssertSuccessInstall"/> - <constraint name="Magento\Install\Test\Constraint\AssertKeyCreated"/> - <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogin"/> - <constraint name="Magento\Install\Test\Constraint\AssertCurrencySelected"/> - <constraint name="Magento\Install\Test\Constraint\AssertLanguageSelected"/> - </variation> - <variation name="InstallTestVariation4"> - <data name="user/dataSet" xsi:type="string">default</data> - <data name="install/dbTablePrefix" xsi:type="string">prefix1_</data> - <data name="install/admin" xsi:type="string">-</data> - <data name="install/httpsFront" xsi:type="string">-</data> - <data name="install/httpsAdmin" xsi:type="string">-</data> - <data name="install/apacheRewrites" xsi:type="string">-</data> - <data name="install/keyOwn" xsi:type="string">-</data> - <data name="install/keyValue" xsi:type="string">-</data> - <data name="install/language" xsi:type="string">Chinese (China)</data> - <data name="install/currency" xsi:type="string">-</data> - <data name="currencySymbol" xsi:type="string">-</data> - <data name="languageTemplate" xsi:type="string">-</data> - <data name="description" xsi:type="string">install with table prefix</data> - <constraint name="Magento\Install\Test\Constraint\AssertSuccessInstall"/> - <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogin"/> - </variation> - <variation name="InstallTestVariation5"> - <data name="user/dataSet" xsi:type="string">default</data> - <data name="install/dbTablePrefix" xsi:type="string">-</data> - <data name="install/admin" xsi:type="string">-</data> - <data name="install/httpsFront" xsi:type="string">-</data> - <data name="install/httpsAdmin" xsi:type="string">-</data> - <data name="install/apacheRewrites" xsi:type="string">Yes</data> - <data name="install/keyOwn" xsi:type="string">-</data> - <data name="install/keyValue" xsi:type="string">-</data> - <data name="install/language" xsi:type="string">-</data> - <data name="install/currency" xsi:type="string">-</data> - <data name="currencySymbol" xsi:type="string">-</data> - <data name="languageTemplate" xsi:type="string">-</data> - <data name="description" xsi:type="string">install with enabled url rewrites</data> - <constraint name="Magento\Install\Test\Constraint\AssertSuccessInstall"/> - <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogin"/> - <constraint name="Magento\Install\Test\Constraint\AssertRewritesEnabled"/> - </variation> - <variation name="InstallTestVariation6"> - <data name="user/dataSet" xsi:type="string">default</data> - <data name="install/dbTablePrefix" xsi:type="string">-</data> - <data name="install/admin" xsi:type="string">-</data> - <data name="install/httpsFront" xsi:type="string">Yes</data> - <data name="install/httpsAdmin" xsi:type="string">Yes</data> - <data name="install/apacheRewrites" xsi:type="string">-</data> - <data name="install/keyOwn" xsi:type="string">-</data> - <data name="install/keyValue" xsi:type="string">-</data> - <data name="install/language" xsi:type="string">-</data> - <data name="install/currency" xsi:type="string">-</data> - <data name="currencySymbol" xsi:type="string">-</data> - <data name="languageTemplate" xsi:type="string">-</data> - <data name="description" xsi:type="string">install with enabled secure urls</data> - <constraint name="Magento\Install\Test\Constraint\AssertSuccessInstall"/> - <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogin"/> - <constraint name="Magento\Install\Test\Constraint\AssertSecureUrlEnabled"/> - </variation> - </testCase> + <testCase name="Magento\Install\Test\TestCase\InstallTest"> + <variation name="InstallTestVariation1"> + <data name="description" xsi:type="string">Install with default values.</data> + <data name="user/dataSet" xsi:type="string">default</data> + <constraint name="Magento\Install\Test\Constraint\AssertSuccessInstall" /> + <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogin" /> + </variation> + <variation name="InstallTestVariation2"> + <data name="description" xsi:type="string">Install with custom admin path.</data> + <data name="user/dataSet" xsi:type="string">default</data> + <data name="install/admin" xsi:type="string">custom</data> + <constraint name="Magento\Install\Test\Constraint\AssertSuccessInstall" /> + <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogin" /> + </variation> + <variation name="InstallTestVariation3"> + <data name="description" xsi:type="string">Install with custom encryption key and changed currency and locale.</data> + <data name="user/dataSet" xsi:type="string">default</data> + <data name="install/keyOwn" xsi:type="string">Yes</data> + <data name="install/keyValue" xsi:type="string">123123qa</data> + <data name="install/storeLanguage" xsi:type="string">German (Germany)</data> + <data name="install/storeCurrency" xsi:type="string">Euro (EUR)</data> + <data name="currencySymbol" xsi:type="string">€</data> + <data name="languageTemplate" xsi:type="string">Suchbegriffe</data> + <constraint name="Magento\Install\Test\Constraint\AssertSuccessInstall" /> + <constraint name="Magento\Install\Test\Constraint\AssertKeyCreated" /> + <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogin" /> + <constraint name="Magento\Install\Test\Constraint\AssertCurrencySelected" /> + <constraint name="Magento\Install\Test\Constraint\AssertLanguageSelected" /> + </variation> + <variation name="InstallTestVariation4"> + <data name="description" xsi:type="string">Install with table prefix.</data> + <data name="user/dataSet" xsi:type="string">default</data> + <data name="install/dbTablePrefix" xsi:type="string">prefix1_</data> + <data name="install/storeLanguage" xsi:type="string">Chinese (China)</data> + <constraint name="Magento\Install\Test\Constraint\AssertSuccessInstall" /> + <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogin" /> + </variation> + <variation name="InstallTestVariation5"> + <data name="description" xsi:type="string">Install with enabled url rewrites.</data> + <data name="user/dataSet" xsi:type="string">default</data> + <data name="install/apacheRewrites" xsi:type="string">Yes</data> + <constraint name="Magento\Install\Test\Constraint\AssertSuccessInstall" /> + <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogin" /> + <constraint name="Magento\Install\Test\Constraint\AssertRewritesEnabled" /> + </variation> + <variation name="InstallTestVariation6"> + <data name="description" xsi:type="string">Install with enabled secure urls.</data> + <data name="user/dataSet" xsi:type="string">default</data> + <data name="install/httpsFront" xsi:type="string">Yes</data> + <data name="install/httpsAdmin" xsi:type="string">Yes</data> + <constraint name="Magento\Install\Test\Constraint\AssertSuccessInstall" /> + <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogin" /> + <constraint name="Magento\Install\Test\Constraint\AssertSecureUrlEnabled" /> + </variation> + </testCase> </config> diff --git a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Page/Adminhtml/TemplateEdit.xml b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Page/Adminhtml/TemplateEdit.xml index c17dbfb6ada9f96177f87d9d17223643041df640..56ee9f7302d96e787e64d4e0cf408d768f65cfab 100644 --- a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Page/Adminhtml/TemplateEdit.xml +++ b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Page/Adminhtml/TemplateEdit.xml @@ -6,9 +6,9 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/pages.xsd"> - <page name="TemplateEdit" area="Adminhtml" mca="newsletter/template/edit" module="Magento_Newsletter"> - <block name="formPageActions" class="Magento\Newsletter\Test\Block\Adminhtml\Template\FormPageActions" locator=".page-main-actions" strategy="css selector"/> - <block name="editForm" class="Magento\Backend\Test\Block\Widget\Form" locator="[id='page:main-container']" strategy="css selector"/> - <block name="messagesBlock" class="Magento\Backend\Test\Block\Messages" locator="#messages" strategy="css selector"/> - </page> + <page name="TemplateEdit" area="Adminhtml" mca="newsletter/template/edit" module="Magento_Newsletter"> + <block name="formPageActions" class="Magento\Newsletter\Test\Block\Adminhtml\Template\FormPageActions" locator=".page-main-actions" strategy="css selector" /> + <block name="editForm" class="Magento\Mtf\Block\Form" locator="[id='page:main-container']" strategy="css selector" /> + <block name="messagesBlock" class="Magento\Backend\Test\Block\Messages" locator="#messages" strategy="css selector" /> + </page> </config> diff --git a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Page/Adminhtml/TemplateNewIndex.xml b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Page/Adminhtml/TemplateNewIndex.xml index 968920909e50d99c93a0f21dcc54c7f645a07ddf..b2744b0902e2c80329f8a345cbf953555ca6554c 100644 --- a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Page/Adminhtml/TemplateNewIndex.xml +++ b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Page/Adminhtml/TemplateNewIndex.xml @@ -6,9 +6,9 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/pages.xsd"> - <page name="TemplateNewIndex" area="Adminhtml" mca="newsletter/template/new/index" module="Magento_Newsletter"> - <block name="formPageActions" class="Magento\Newsletter\Test\Block\Adminhtml\Template\FormPageActions" locator=".page-main-actions" strategy="css selector"/> - <block name="editForm" class="Magento\Backend\Test\Block\Widget\Form" locator="[id='page:main-container']" strategy="css selector"/> - <block name="messagesBlock" class="Magento\Backend\Test\Block\Messages" locator="#messages" strategy="css selector"/> - </page> + <page name="TemplateNewIndex" area="Adminhtml" mca="newsletter/template/new/index" module="Magento_Newsletter"> + <block name="formPageActions" class="Magento\Newsletter\Test\Block\Adminhtml\Template\FormPageActions" locator=".page-main-actions" strategy="css selector" /> + <block name="editForm" class="Magento\Mtf\Block\Form" locator="[id='page:main-container']" strategy="css selector" /> + <block name="messagesBlock" class="Magento\Backend\Test\Block\Messages" locator="#messages" strategy="css selector" /> + </page> </config> diff --git a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Page/Adminhtml/TemplateQueue.xml b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Page/Adminhtml/TemplateQueue.xml index 8e17bfc6814b8ab37822b55279cb9dbffaaba742..c4840bceae2123bf11213311c8756b1707b48ba7 100644 --- a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Page/Adminhtml/TemplateQueue.xml +++ b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Page/Adminhtml/TemplateQueue.xml @@ -6,9 +6,9 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/pages.xsd"> - <page name="TemplateQueue" area="Adminhtml" mca="newsletter/queue/edit" module="Magento_Newsletter"> - <block name="formPageActions" class="Magento\Newsletter\Test\Block\Adminhtml\Template\FormPageActions" locator=".page-main-actions" strategy="css selector"/> - <block name="editForm" class="Magento\Backend\Test\Block\Widget\Form" locator="#queue_edit_form" strategy="css selector"/> - <block name="messagesBlock" class="Magento\Backend\Test\Block\Messages" locator="#messages" strategy="css selector"/> - </page> + <page name="TemplateQueue" area="Adminhtml" mca="newsletter/queue/edit" module="Magento_Newsletter"> + <block name="formPageActions" class="Magento\Newsletter\Test\Block\Adminhtml\Template\FormPageActions" locator=".page-main-actions" strategy="css selector" /> + <block name="editForm" class="Magento\Mtf\Block\Form" locator="#queue_edit_form" strategy="css selector" /> + <block name="messagesBlock" class="Magento\Backend\Test\Block\Messages" locator="#messages" strategy="css selector" /> + </page> </config> diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/CustomerReviewReportEntityTest.xml b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/CustomerReviewReportEntityTest.xml index e996602cc41fc49ed5c141addcfd07d71325b91f..26430b8ea9c7233e8734019c057493a2435bbbf3 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/CustomerReviewReportEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/CustomerReviewReportEntityTest.xml @@ -6,36 +6,38 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Magento\Reports\Test\TestCase\CustomerReviewReportEntityTest"> - <variation name="CustomerReviewReportEntityTestVariation1"> - <data name="customerLogin" xsi:type="string">Yes</data> - <data name="product/dataSet" xsi:type="string">default</data> - <data name="review/data/nickname" xsi:type="string">name_upd_%isolation%</data> - <data name="review/data/title" xsi:type="string">title_upd_%isolation%</data> - <data name="review/data/detail" xsi:type="string">review_upd_%isolation%</data> - <data name="reviewsCount" xsi:type="string">1</data> - <constraint name="Magento\Reports\Test\Constraint\AssertProductReviewsQtyByCustomer"/> - <constraint name="Magento\Reports\Test\Constraint\AssertProductReportByCustomerInGrid"/> - </variation> - <variation name="CustomerReviewReportEntityTestVariation2"> - <data name="customerLogin" xsi:type="string">Yes</data> - <data name="product/dataSet" xsi:type="string">default</data> - <data name="review/data/nickname" xsi:type="string">name_upd_%isolation%</data> - <data name="review/data/title" xsi:type="string">title_upd_%isolation%</data> - <data name="review/data/detail" xsi:type="string">review_upd_%isolation%</data> - <data name="reviewsCount" xsi:type="string">2</data> - <constraint name="Magento\Reports\Test\Constraint\AssertProductReviewsQtyByCustomer"/> - <constraint name="Magento\Reports\Test\Constraint\AssertProductReportByCustomerInGrid"/> - </variation> - <variation name="CustomerReviewReportEntityTestVariation3"> - <data name="customerLogin" xsi:type="string">No</data> - <data name="product/dataSet" xsi:type="string">default</data> - <data name="review/data/nickname" xsi:type="string">name_upd_%isolation%</data> - <data name="review/data/title" xsi:type="string">title_upd_%isolation%</data> - <data name="review/data/detail" xsi:type="string">review_upd_%isolation%</data> - <data name="reviewsCount" xsi:type="string">2</data> - <constraint name="Magento\Reports\Test\Constraint\AssertProductReviewsQtyByCustomer"/> - <constraint name="Magento\Reports\Test\Constraint\AssertProductReportByCustomerNotInGrid"/> - </variation> - </testCase> + <testCase name="Magento\Reports\Test\TestCase\CustomerReviewReportEntityTest"> + <variation name="CustomerReviewReportEntityTestVariation1"> + <data name="customerLogin" xsi:type="string">Yes</data> + <data name="product/dataSet" xsi:type="string">default</data> + <data name="review/data/type" xsi:type="string">Customer</data> + <data name="review/data/nickname" xsi:type="string">name_upd_%isolation%</data> + <data name="review/data/title" xsi:type="string">title_upd_%isolation%</data> + <data name="review/data/detail" xsi:type="string">review_upd_%isolation%</data> + <data name="reviewsCount" xsi:type="string">1</data> + <constraint name="Magento\Reports\Test\Constraint\AssertProductReviewsQtyByCustomer" /> + <constraint name="Magento\Reports\Test\Constraint\AssertProductReportByCustomerInGrid" /> + </variation> + <variation name="CustomerReviewReportEntityTestVariation2"> + <data name="customerLogin" xsi:type="string">Yes</data> + <data name="product/dataSet" xsi:type="string">default</data> + <data name="review/data/type" xsi:type="string">Customer</data> + <data name="review/data/nickname" xsi:type="string">name_upd_%isolation%</data> + <data name="review/data/title" xsi:type="string">title_upd_%isolation%</data> + <data name="review/data/detail" xsi:type="string">review_upd_%isolation%</data> + <data name="reviewsCount" xsi:type="string">2</data> + <constraint name="Magento\Reports\Test\Constraint\AssertProductReviewsQtyByCustomer" /> + <constraint name="Magento\Reports\Test\Constraint\AssertProductReportByCustomerInGrid" /> + </variation> + <variation name="CustomerReviewReportEntityTestVariation3"> + <data name="customerLogin" xsi:type="string">No</data> + <data name="product/dataSet" xsi:type="string">default</data> + <data name="review/data/nickname" xsi:type="string">name_upd_%isolation%</data> + <data name="review/data/title" xsi:type="string">title_upd_%isolation%</data> + <data name="review/data/detail" xsi:type="string">review_upd_%isolation%</data> + <data name="reviewsCount" xsi:type="string">2</data> + <constraint name="Magento\Reports\Test\Constraint\AssertProductReviewsQtyByCustomer" /> + <constraint name="Magento\Reports\Test\Constraint\AssertProductReportByCustomerNotInGrid" /> + </variation> + </testCase> </config> diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/ReviewForm.php b/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/ReviewForm.php index a9499d608da3f1844151c1b9c81a70f4dcbf9c9a..c3ad0a3ef2d2f631d160e7da69b7de4629296d9f 100755 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/ReviewForm.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/ReviewForm.php @@ -6,38 +6,58 @@ namespace Magento\Review\Test\Block\Adminhtml; -use Magento\Backend\Test\Block\Widget\Form; +use Magento\Mtf\Block\Form; use Magento\Mtf\Client\Locator; +use Magento\Mtf\Fixture\FixtureInterface; +use Magento\Mtf\Client\Element\SimpleElement; /** - * Class Edit - * Review edit form + * Review edit form. */ class ReviewForm extends Form { /** - * Posted by field + * Posted by field. * * @var string */ protected $customer = '#customer'; /** - * Rating status + * Rating status. * * @var string */ protected $status = '[name=status_id]'; /** - * 'Save Review' button + * 'Save Review' button. * * @var string */ protected $saveButton = '[data-ui-id$=save-button-button]'; /** - * Get data from 'Posted By' field + * Fill the review form. + * + * @param FixtureInterface $fixture + * @param SimpleElement|null $element + * @return $this + */ + public function fill(FixtureInterface $fixture, SimpleElement $element = null) + { + $data = $fixture->getData(); + if (isset($data['entity_id'])) { + unset($data['entity_id']); + } + $mapping = $this->dataMapping($data); + $this->_fill($mapping, $element); + + return $this; + } + + /** + * Get data from 'Posted By' field. * * @return string */ @@ -47,7 +67,7 @@ class ReviewForm extends Form } /** - * Get data from Status field + * Get data from Status field. * * @return string */ @@ -57,7 +77,7 @@ class ReviewForm extends Form } /** - * Set approve review + * Set approve review. * * @return void */ diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewForm.php b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewForm.php index eb6cb92c40c0f270b3fab671135d6f00bcc364a2..edf5cb90995549c5ddd0537fbf335002d8304fc3 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewForm.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewForm.php @@ -48,8 +48,8 @@ class AssertProductReviewForm extends AbstractAssertForm $fixtureData = $review->getData(); $formData = $reviewEdit->getReviewForm()->getData(); - if (isset($fixtureData['customer'])) { - $formData['customer'] = $reviewEdit->getReviewForm()->getPostedBy(); + if (isset($fixtureData['type'])) { + $formData['type'] = $reviewEdit->getReviewForm()->getPostedBy(); } $error = $this->verifyData($fixtureData, $formData); diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewInGrid.php b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewInGrid.php index b448f3ac837a261457216b46465dc4ce9e719ec6..93e28f758b9eb2408328058ca50d4d93a585b18d 100755 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewInGrid.php @@ -12,13 +12,12 @@ use Magento\Mtf\Constraint\AbstractConstraint; use Magento\Mtf\Fixture\FixtureInterface; /** - * Class AssertProductReviewInGrid - * Check that review is displayed in grid + * Check that review is displayed in grid. */ class AssertProductReviewInGrid extends AbstractConstraint { /** - * Filter params + * Filter params. * * @var array */ @@ -35,10 +34,10 @@ class AssertProductReviewInGrid extends AbstractConstraint ]; /** - * Assert that review is displayed in grid + * Assert that review is displayed in grid. * * @param ReviewIndex $reviewIndex - * @param Review $review , + * @param Review $review * @param FixtureInterface $product * @param string $gridStatus * @return void @@ -61,7 +60,7 @@ class AssertProductReviewInGrid extends AbstractConstraint } /** - * Prepare filter for assert + * Prepare filter for assert. * * @param FixtureInterface $product * @param array $review @@ -89,6 +88,9 @@ class AssertProductReviewInGrid extends AbstractConstraint case 'status_id': $value = $gridStatus != '' ? $gridStatus : (isset($review[$param]) ? $review[$param] : null); break; + case 'type': + $value = isset($review[$param]) ? $review[$param] : 'Administrator'; + break; default: $value = isset($review[$param]) ? $review[$param] : null; break; @@ -101,7 +103,7 @@ class AssertProductReviewInGrid extends AbstractConstraint } /** - * Text success exist review in grid on product reviews tab + * Text success exist review in grid on product reviews tab. * * @return string */ diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductReviewBackendEntityTest.xml b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductReviewBackendEntityTest.xml index bf97a39b60e0ab692798889c9c0d22d36a1fbd27..ee97d7bb2149563e0583afbb7328d09cf1189a3b 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductReviewBackendEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductReviewBackendEntityTest.xml @@ -6,48 +6,45 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Magento\Review\Test\TestCase\CreateProductReviewBackendEntityTest"> - <variation name="CreateProductReviewBackendEntityTestVariation1"> - <data name="review/data/type" xsi:type="string">Administrator</data> - <data name="review/data/entity_id/dataSet" xsi:type="string">catalogProductSimple::default</data> - <data name="review/data/status_id" xsi:type="string">Approved</data> - <data name="review/data/select_stores/0" xsi:type="string">Main Website/Main Website Store/Default Store View</data> - <data name="review/data/ratings/rating_0/dataSet" xsi:type="string">visibleOnDefaultWebsite</data> - <data name="review/data/ratings/rating_0/rating" xsi:type="string">3</data> - <data name="review/data/nickname" xsi:type="string">John</data> - <data name="review/data/title" xsi:type="string">title %isolation%</data> - <data name="review/data/detail" xsi:type="string">review detail %isolation%</data> - <constraint name="Magento\Review\Test\Constraint\AssertProductReviewBackendSuccessSaveMessage"/> - <constraint name="Magento\Review\Test\Constraint\AssertProductReviewInGrid"/> - <constraint name="Magento\Review\Test\Constraint\AssertProductRatingInProductPage"/> - </variation> - <variation name="CreateProductReviewBackendEntityTestVariation2"> - <data name="review/data/type" xsi:type="string">Administrator</data> - <data name="review/data/entity_id/dataSet" xsi:type="string">catalogProductSimple::default</data> - <data name="review/data/status_id" xsi:type="string">Pending</data> - <data name="review/data/select_stores/0" xsi:type="string">Main Website/Main Website Store/Default Store View</data> - <data name="review/data/ratings/rating_0/dataSet" xsi:type="string">visibleOnDefaultWebsite</data> - <data name="review/data/ratings/rating_0/rating" xsi:type="string">4</data> - <data name="review/data/nickname" xsi:type="string">Britney</data> - <data name="review/data/title" xsi:type="string">title %isolation%</data> - <data name="review/data/detail" xsi:type="string">review detail %isolation%</data> - <constraint name="Magento\Review\Test\Constraint\AssertProductReviewBackendSuccessSaveMessage"/> - <constraint name="Magento\Review\Test\Constraint\AssertProductReviewInGrid"/> - <constraint name="Magento\Review\Test\Constraint\AssertProductRatingInProductPage"/> - </variation> - <variation name="CreateProductReviewBackendEntityTestVariation3"> - <data name="review/data/type" xsi:type="string">Administrator</data> - <data name="review/data/entity_id/dataSet" xsi:type="string">catalogProductSimple::default</data> - <data name="review/data/status_id" xsi:type="string">Not Approved</data> - <data name="review/data/select_stores/0" xsi:type="string">Main Website/Main Website Store/Default Store View</data> - <data name="review/data/ratings/rating_0/dataSet" xsi:type="string">visibleOnDefaultWebsite</data> - <data name="review/data/ratings/rating_0/rating" xsi:type="string">5</data> - <data name="review/data/nickname" xsi:type="string">Michael</data> - <data name="review/data/title" xsi:type="string">title %isolation%</data> - <data name="review/data/detail" xsi:type="string">review detail %isolation%</data> - <constraint name="Magento\Review\Test\Constraint\AssertProductReviewBackendSuccessSaveMessage"/> - <constraint name="Magento\Review\Test\Constraint\AssertProductReviewInGrid"/> - <constraint name="Magento\Review\Test\Constraint\AssertProductRatingInProductPage"/> - </variation> - </testCase> + <testCase name="Magento\Review\Test\TestCase\CreateProductReviewBackendEntityTest"> + <variation name="CreateProductReviewBackendEntityTestVariation1"> + <data name="review/data/entity_id/dataSet" xsi:type="string">catalogProductSimple::default</data> + <data name="review/data/status_id" xsi:type="string">Approved</data> + <data name="review/data/select_stores/0" xsi:type="string">Main Website/Main Website Store/Default Store View</data> + <data name="review/data/ratings/rating_0/dataSet" xsi:type="string">visibleOnDefaultWebsite</data> + <data name="review/data/ratings/rating_0/rating" xsi:type="string">3</data> + <data name="review/data/nickname" xsi:type="string">John</data> + <data name="review/data/title" xsi:type="string">title %isolation%</data> + <data name="review/data/detail" xsi:type="string">review detail %isolation%</data> + <constraint name="Magento\Review\Test\Constraint\AssertProductReviewBackendSuccessSaveMessage" /> + <constraint name="Magento\Review\Test\Constraint\AssertProductReviewInGrid" /> + <constraint name="Magento\Review\Test\Constraint\AssertProductRatingInProductPage" /> + </variation> + <variation name="CreateProductReviewBackendEntityTestVariation2"> + <data name="review/data/entity_id/dataSet" xsi:type="string">catalogProductSimple::default</data> + <data name="review/data/status_id" xsi:type="string">Pending</data> + <data name="review/data/select_stores/0" xsi:type="string">Main Website/Main Website Store/Default Store View</data> + <data name="review/data/ratings/rating_0/dataSet" xsi:type="string">visibleOnDefaultWebsite</data> + <data name="review/data/ratings/rating_0/rating" xsi:type="string">4</data> + <data name="review/data/nickname" xsi:type="string">Britney</data> + <data name="review/data/title" xsi:type="string">title %isolation%</data> + <data name="review/data/detail" xsi:type="string">review detail %isolation%</data> + <constraint name="Magento\Review\Test\Constraint\AssertProductReviewBackendSuccessSaveMessage" /> + <constraint name="Magento\Review\Test\Constraint\AssertProductReviewInGrid" /> + <constraint name="Magento\Review\Test\Constraint\AssertProductRatingInProductPage" /> + </variation> + <variation name="CreateProductReviewBackendEntityTestVariation3"> + <data name="review/data/entity_id/dataSet" xsi:type="string">catalogProductSimple::default</data> + <data name="review/data/status_id" xsi:type="string">Not Approved</data> + <data name="review/data/select_stores/0" xsi:type="string">Main Website/Main Website Store/Default Store View</data> + <data name="review/data/ratings/rating_0/dataSet" xsi:type="string">visibleOnDefaultWebsite</data> + <data name="review/data/ratings/rating_0/rating" xsi:type="string">5</data> + <data name="review/data/nickname" xsi:type="string">Michael</data> + <data name="review/data/title" xsi:type="string">title %isolation%</data> + <data name="review/data/detail" xsi:type="string">review detail %isolation%</data> + <constraint name="Magento\Review\Test\Constraint\AssertProductReviewBackendSuccessSaveMessage" /> + <constraint name="Magento\Review\Test\Constraint\AssertProductReviewInGrid" /> + <constraint name="Magento\Review\Test\Constraint\AssertProductRatingInProductPage" /> + </variation> + </testCase> </config> diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductReviewFrontendEntityTest.xml b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductReviewFrontendEntityTest.xml index 747044f00e030859b162598332c766a74b5c283c..ee9096bce936c26452574d0d8362293f90933c68 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductReviewFrontendEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductReviewFrontendEntityTest.xml @@ -6,37 +6,35 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Magento\Review\Test\TestCase\CreateProductReviewFrontendEntityTest"> - <variation name="CreateProductReviewFrontendEntityTestVariation1"> - <data name="description" xsi:type="string">Create product review with rating</data> - <data name="review/data/customer" xsi:type="string">-</data> - <data name="review/data/nickname" xsi:type="string">name_%isolation%</data> - <data name="review/data/title" xsi:type="string">title_%isolation%</data> - <data name="review/data/detail" xsi:type="string">review_%isolation%</data> - <data name="review/data/ratings/1/dataSet" xsi:type="string">visibleOnDefaultWebsite</data> - <data name="review/data/ratings/1/rating" xsi:type="string">4</data> - <data name="review/data/entity_id/dataSet" xsi:type="string">catalogProductSimple::default</data> - <constraint name="Magento\Review\Test\Constraint\AssertReviewCreationSuccessMessage"/> - <constraint name="Magento\Review\Test\Constraint\AssertProductReviewInGrid"/> - <constraint name="Magento\Review\Test\Constraint\AssertProductRatingOnReviewPage"/> - <constraint name="Magento\Review\Test\Constraint\AssertProductRatingInProductPage"/> - </variation> - <variation name="CreateProductReviewFrontendEntityTestVariation2"> - <data name="description" xsi:type="string">MAGETWO-12403 - Add Product Review from Customer's Prospective</data> - <data name="review/data/customer" xsi:type="string">Guest</data> - <data name="review/data/nickname" xsi:type="string">name_%isolation%</data> - <data name="review/data/title" xsi:type="string">title_%isolation%</data> - <data name="review/data/detail" xsi:type="string">review_%isolation%</data> - <data name="review/data/ratings/1/dataSet" xsi:type="string">-</data> - <data name="review/data/ratings/1/rating" xsi:type="string">-</data> - <data name="review/data/entity_id/dataSet" xsi:type="string">catalogProductSimple::default</data> - <data name="tag" xsi:type="string">test_type:acceptance_test</data> - <constraint name="Magento\Review\Test\Constraint\AssertReviewCreationSuccessMessage"/> - <constraint name="Magento\Review\Test\Constraint\AssertProductReviewIsAbsentOnProductPage"/> - <constraint name="Magento\Review\Test\Constraint\AssertProductReviewForm"/> - <constraint name="Magento\Review\Test\Constraint\AssertSetApprovedProductReview"/> - <constraint name="Magento\Review\Test\Constraint\AssertReviewLinksIsPresentOnProductPage"/> - <constraint name="Magento\Review\Test\Constraint\AssertProductReviewOnProductPage"/> - </variation> - </testCase> + <testCase name="Magento\Review\Test\TestCase\CreateProductReviewFrontendEntityTest"> + <variation name="CreateProductReviewFrontendEntityTestVariation1"> + <data name="description" xsi:type="string">Create product review with rating</data> + <data name="review/data/type" xsi:type="string">Guest</data> + <data name="review/data/nickname" xsi:type="string">name_%isolation%</data> + <data name="review/data/title" xsi:type="string">title_%isolation%</data> + <data name="review/data/detail" xsi:type="string">review_%isolation%</data> + <data name="review/data/ratings/1/dataSet" xsi:type="string">visibleOnDefaultWebsite</data> + <data name="review/data/ratings/1/rating" xsi:type="string">4</data> + <data name="review/data/entity_id/dataSet" xsi:type="string">catalogProductSimple::default</data> + <constraint name="Magento\Review\Test\Constraint\AssertReviewCreationSuccessMessage" /> + <constraint name="Magento\Review\Test\Constraint\AssertProductReviewInGrid" /> + <constraint name="Magento\Review\Test\Constraint\AssertProductRatingOnReviewPage" /> + <constraint name="Magento\Review\Test\Constraint\AssertProductRatingInProductPage" /> + </variation> + <variation name="CreateProductReviewFrontendEntityTestVariation2"> + <data name="description" xsi:type="string">MAGETWO-12403 - Add Product Review from Customer's Prospective</data> + <data name="review/data/type" xsi:type="string">Guest</data> + <data name="review/data/nickname" xsi:type="string">name_%isolation%</data> + <data name="review/data/title" xsi:type="string">title_%isolation%</data> + <data name="review/data/detail" xsi:type="string">review_%isolation%</data> + <data name="review/data/entity_id/dataSet" xsi:type="string">catalogProductSimple::default</data> + <data name="tag" xsi:type="string">test_type:acceptance_test</data> + <constraint name="Magento\Review\Test\Constraint\AssertReviewCreationSuccessMessage" /> + <constraint name="Magento\Review\Test\Constraint\AssertProductReviewIsAbsentOnProductPage" /> + <constraint name="Magento\Review\Test\Constraint\AssertProductReviewForm" /> + <constraint name="Magento\Review\Test\Constraint\AssertSetApprovedProductReview" /> + <constraint name="Magento\Review\Test\Constraint\AssertReviewLinksIsPresentOnProductPage" /> + <constraint name="Magento\Review\Test\Constraint\AssertProductReviewOnProductPage" /> + </variation> + </testCase> </config> diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Billing/Address.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Billing/Address.xml index 369d359cf8a55a41421c7228d0b91c6a924e7ac6..2439e6aeac763956de84b836bf817642a915135b 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Billing/Address.xml +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Billing/Address.xml @@ -23,8 +23,5 @@ </region_id> <postcode /> <telephone /> - <save_in_address_book> - <input>checkbox</input> - </save_in_address_book> </fields> </mapping> diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Coupons.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Coupons.php index 0a350725839b9e8833b90dda8003c051b0c7293c..14ec5f4336b64d6429c6c04caa8bf5501666ac09 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Coupons.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Coupons.php @@ -6,7 +6,7 @@ namespace Magento\Sales\Test\Block\Adminhtml\Order\Create; -use Magento\Backend\Test\Block\Widget\Form; +use Magento\Mtf\Block\Form; use Magento\SalesRule\Test\Fixture\SalesRule; use Magento\Mtf\Client\Locator; diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Form/Account.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Form/Account.xml index 768fef18f37797e49cb835efa48e80e45b746f6a..ece7a7be14cf2e6234031368e4bb83310b869e49 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Form/Account.xml +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Form/Account.xml @@ -5,12 +5,12 @@ * See COPYING.txt for license details. */ --> -<mapping strict="0"> +<mapping strict="1"> <wrapper>order[account]</wrapper> <fields> - <group> + <group_id> <input>select</input>> - </group> + </group_id> <email /> </fields> </mapping> diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Items/ItemProduct.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Items/ItemProduct.php index 03ec6f8187c16a1a697a93f64e6a8d861a0130fe..efcf05d2a42144b7ed72c3b2e0a9b0fd5243d911 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Items/ItemProduct.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Items/ItemProduct.php @@ -8,6 +8,8 @@ namespace Magento\Sales\Test\Block\Adminhtml\Order\Create\Items; use Magento\Mtf\Block\Form; use Magento\Mtf\Client\Locator; +use Magento\Mtf\Fixture\FixtureInterface; +use Magento\Mtf\Client\Element\SimpleElement; /** * Class ItemProduct @@ -76,6 +78,28 @@ class ItemProduct extends Form return $result; } + /** + * Fill the root form. + * + * @param FixtureInterface $fixture + * @param SimpleElement|null $element + * @return $this + */ + public function fill(FixtureInterface $fixture, SimpleElement $element = null) + { + $data = $fixture->getData(); + if (isset($data['cartItem'])) { + unset($data['cartItem']); + } + if (isset($data['options'])) { + unset($data['options']); + } + $mapping = $this->dataMapping($data); + $this->_fill($mapping, $element); + + return $this; + } + /** * Click Configure button. * diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderStatusEdit.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderStatusEdit.xml index c1d712de6a2d0f33e4545ce3a3983a101dd96e11..298289698a18295d355e73f5f66f515e040b2620 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderStatusEdit.xml +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderStatusEdit.xml @@ -6,9 +6,9 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/pages.xsd"> - <page name="OrderStatusEdit" area="Adminhtml" mca="sales/order_status/edit" module="Magento_Sales"> - <block name="formPageActions" class="Magento\Backend\Test\Block\FormPageActions" locator=".page-main-actions" strategy="css selector"/> - <block name="orderStatusForm" class="Magento\Backend\Test\Block\Widget\Form" locator="#edit_form" strategy="css selector"/> - <block name="messagesBlock" class="Magento\Backend\Test\Block\Messages" locator="#messages" strategy="css selector"/> - </page> + <page name="OrderStatusEdit" area="Adminhtml" mca="sales/order_status/edit" module="Magento_Sales"> + <block name="formPageActions" class="Magento\Backend\Test\Block\FormPageActions" locator=".page-main-actions" strategy="css selector" /> + <block name="orderStatusForm" class="Magento\Mtf\Block\Form" locator="#edit_form" strategy="css selector" /> + <block name="messagesBlock" class="Magento\Backend\Test\Block\Messages" locator="#messages" strategy="css selector" /> + </page> </config> diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderStatusNew.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderStatusNew.xml index 856880560d3ed1eaa69d6746666788ce166ce286..0457f3a4b1899a46bd3b850b7c6349733cd3d515 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderStatusNew.xml +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderStatusNew.xml @@ -6,9 +6,9 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/pages.xsd"> - <page name="OrderStatusNew" area="Adminhtml" mca="sales/order_status/new" module="Magento_Sales"> - <block name="formPageActions" class="Magento\Backend\Test\Block\FormPageActions" locator=".page-main-actions" strategy="css selector"/> - <block name="orderStatusForm" class="Magento\Backend\Test\Block\Widget\Form" locator="#edit_form" strategy="css selector"/> - <block name="messagesBlock" class="Magento\Backend\Test\Block\Messages" locator="#messages" strategy="css selector"/> - </page> + <page name="OrderStatusNew" area="Adminhtml" mca="sales/order_status/new" module="Magento_Sales"> + <block name="formPageActions" class="Magento\Backend\Test\Block\FormPageActions" locator=".page-main-actions" strategy="css selector" /> + <block name="orderStatusForm" class="Magento\Mtf\Block\Form" locator="#edit_form" strategy="css selector" /> + <block name="messagesBlock" class="Magento\Backend\Test\Block\Messages" locator="#messages" strategy="css selector" /> + </page> </config> diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateOrderBackendTest.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateOrderBackendTest.xml index 6371ae09b9981d48b42be0a1e9fd1c54897e91cd..ce5a4f0d95671ebaf4caf9ff4a8984b6c0853b57 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateOrderBackendTest.xml +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateOrderBackendTest.xml @@ -10,8 +10,8 @@ <variation name="CreateOrderBackendTestVariation1"> <data name="description" xsi:type="string">Create order with simple product for registered US customer using Fixed shipping method and Cash on Delivery payment method</data> <data name="products" xsi:type="string">catalogProductSimple::default</data> - <data name="customer/dataSet" xsi:type="string">customer_US</data> - <data name="billingAddress/dataSet" xsi:type="string">customer_US</data> + <data name="customer/dataSet" xsi:type="string">default</data> + <data name="billingAddress/dataSet" xsi:type="string">US_address_1_without_email</data> <data name="saveAddress" xsi:type="string">No</data> <data name="shipping/shipping_service" xsi:type="string">Flat Rate</data> <data name="shipping/shipping_method" xsi:type="string">Fixed</data> @@ -31,8 +31,8 @@ <variation name="CreateOrderBackendTestVariation2"> <data name="description" xsi:type="string">Create order with virtual product for registered UK customer using Check/Money Order payment method</data> <data name="products" xsi:type="string">catalogProductVirtual::default</data> - <data name="customer/dataSet" xsi:type="string">customer_UK</data> - <data name="billingAddress/dataSet" xsi:type="string">customer_UK</data> + <data name="customer/dataSet" xsi:type="string">default</data> + <data name="billingAddress/dataSet" xsi:type="string">UK_address_without_email</data> <data name="prices" xsi:type="array"> <item name="grandTotal" xsi:type="string">10.00</item> </data> @@ -49,8 +49,8 @@ <variation name="CreateOrderBackendTestVariation3"> <data name="description" xsi:type="string">Create order with simple product for registered US customer using Fixed shipping method and Bank Transfer payment method</data> <data name="products" xsi:type="string">catalogProductSimple::default</data> - <data name="customer/dataSet" xsi:type="string">customer_US</data> - <data name="billingAddress/dataSet" xsi:type="string">customer_US</data> + <data name="customer/dataSet" xsi:type="string">default</data> + <data name="billingAddress/dataSet" xsi:type="string">US_address_1_without_email</data> <data name="saveAddress" xsi:type="string">No</data> <data name="shipping/shipping_service" xsi:type="string">Flat Rate</data> <data name="shipping/shipping_method" xsi:type="string">Fixed</data> @@ -71,8 +71,8 @@ <data name="tag" xsi:type="string">to_maintain:yes</data> <data name="description" xsi:type="string">Create order with virtual product for registered UK customer using Bank Transfer payment method</data> <data name="products" xsi:type="string">catalogProductVirtual::default</data> - <data name="customer/dataSet" xsi:type="string">customer_UK</data> - <data name="billingAddress/dataSet" xsi:type="string">customer_UK</data> + <data name="customer/dataSet" xsi:type="string">default</data> + <data name="billingAddress/dataSet" xsi:type="string">UK_address_without_email</data> <data name="saveAddress" xsi:type="string">No</data> <data name="prices" xsi:type="array"> <item name="grandTotal" xsi:type="string">10.00</item> @@ -91,9 +91,9 @@ <data name="tag" xsi:type="string">to_maintain:yes</data> <data name="description" xsi:type="string">Create order with simple product for registered US customer using Fixed shipping method and Purchase Order payment method</data> <data name="products" xsi:type="string">catalogProductSimple::default</data> - <data name="customer/dataSet" xsi:type="string">customer_US</data> + <data name="customer/dataSet" xsi:type="string">default</data> <data name="saveAddress" xsi:type="string">No</data> - <data name="billingAddress/dataSet" xsi:type="string">customer_US</data> + <data name="billingAddress/dataSet" xsi:type="string">US_address_1_without_email</data> <data name="shipping/shipping_service" xsi:type="string">Flat Rate</data> <data name="shipping/shipping_method" xsi:type="string">Fixed</data> <data name="prices" xsi:type="array"> @@ -114,10 +114,10 @@ <data name="description" xsi:type="string">MAGETWO-12395 - Create Offline Order for Registered Customer in Admin</data> <data name="products" xsi:type="string">catalogProductSimple::simple_10_dollar, configurableProduct::with_one_option</data> <data name="taxRule" xsi:type="string">us_ca_ny_rule</data> - <data name="customer/dataSet" xsi:type="string">customer_US</data> + <data name="customer/dataSet" xsi:type="string">default</data> <data name="saveAddress" xsi:type="string">No</data> <data name="checkoutMethod" xsi:type="string">login</data> - <data name="billingAddress/dataSet" xsi:type="string">customer_US</data> + <data name="billingAddress/dataSet" xsi:type="string">US_address_1_without_email</data> <data name="shipping/shipping_service" xsi:type="string">Flat Rate</data> <data name="shipping/shipping_method" xsi:type="string">Fixed</data> <data name="prices" xsi:type="array"> @@ -132,10 +132,10 @@ <data name="description" xsi:type="string">MAGETWO-12520 - Create Order for New Customer in Admin with Offline Payment Method</data> <data name="products" xsi:type="string">catalogProductSimple::simple_10_dollar, configurableProduct::with_one_option</data> <data name="taxRule" xsi:type="string">us_ca_ny_rule</data> - <data name="customer/dataSet" xsi:type="string">customer_US</data> + <data name="customer/dataSet" xsi:type="string">default</data> <data name="saveAddress" xsi:type="string">Yes</data> <data name="checkoutMethod" xsi:type="string">register</data> - <data name="billingAddress/dataSet" xsi:type="string">customer_US</data> + <data name="billingAddress/dataSet" xsi:type="string">US_address_1_without_email</data> <data name="shipping/shipping_service" xsi:type="string">Flat Rate</data> <data name="shipping/shipping_method" xsi:type="string">Fixed</data> <data name="prices" xsi:type="array"> diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/ReorderOrderEntityTest.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/ReorderOrderEntityTest.xml index 200b45de0adb16a93d2c5343434e3038d064973d..20b862a735ee7e9977599fd0c8f82598384d6637 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/ReorderOrderEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/ReorderOrderEntityTest.xml @@ -11,8 +11,8 @@ <data name="description" xsi:type="string">Reorder placed order (update products, billing address).</data> <data name="order/dataSet" xsi:type="string">two_simple_product</data> <data name="salesRule" xsi:type="string">active_sales_rule_with_fixed_price_discount_coupon</data> - <data name="customer/dataSet" xsi:type="string">customer_US</data> - <data name="billingAddress/dataSet" xsi:type="string">customer_US</data> + <data name="customer/dataSet" xsi:type="string">default</data> + <data name="billingAddress/dataSet" xsi:type="string">US_address_1</data> <data name="shipping/shipping_service" xsi:type="string">Flat Rate</data> <data name="shipping/shipping_method" xsi:type="string">Fixed</data> <data name="prices" xsi:type="array"> diff --git a/dev/tests/functional/tests/app/Magento/Shipping/Test/Block/Adminhtml/Form.xml b/dev/tests/functional/tests/app/Magento/Shipping/Test/Block/Adminhtml/Form.xml index 7e75ac518b8e7a2e66c38e5d9798c220d281e39f..bacb199390c0d3982e726b71db8c8adc51e9e9bd 100644 --- a/dev/tests/functional/tests/app/Magento/Shipping/Test/Block/Adminhtml/Form.xml +++ b/dev/tests/functional/tests/app/Magento/Shipping/Test/Block/Adminhtml/Form.xml @@ -6,7 +6,7 @@ */ --> <mapping strict="0"> - <wrapper>creditmemo</wrapper> + <wrapper>shipment</wrapper> <fields> <comment_text /> <shipping_amount /> diff --git a/dev/tests/functional/tests/app/Magento/Sitemap/Test/Page/Adminhtml/SitemapNew.xml b/dev/tests/functional/tests/app/Magento/Sitemap/Test/Page/Adminhtml/SitemapNew.xml index 4f33714bfae86e6ab15c88cb3b5c500ad429e4ad..6852866408294adf0b9516a3013a41855534e24e 100644 --- a/dev/tests/functional/tests/app/Magento/Sitemap/Test/Page/Adminhtml/SitemapNew.xml +++ b/dev/tests/functional/tests/app/Magento/Sitemap/Test/Page/Adminhtml/SitemapNew.xml @@ -6,8 +6,8 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/pages.xsd"> - <page name="SitemapNew" area="Adminhtml" mca="sitemap/new/index" module="Magento_Sitemap"> - <block name="sitemapForm" class="Magento\Backend\Test\Block\Widget\Form" locator="#add_sitemap_form" strategy="css selector"/> - <block name="sitemapPageActions" class="Magento\Sitemap\Test\Block\Adminhtml\SitemapPageActions" locator=".page-main-actions" strategy="css selector"/> - </page> + <page name="SitemapNew" area="Adminhtml" mca="sitemap/new/index" module="Magento_Sitemap"> + <block name="sitemapForm" class="Magento\Mtf\Block\Form" locator="#add_sitemap_form" strategy="css selector" /> + <block name="sitemapPageActions" class="Magento\Sitemap\Test\Block\Adminhtml\SitemapPageActions" locator=".page-main-actions" strategy="css selector" /> + </page> </config> diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateForm.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateForm.php index 970bede06def9787026240f7fd543488d39ed4a7..43e431fbbea44d9a0d3f6964961747b69f1cb104 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateForm.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateForm.php @@ -31,10 +31,7 @@ class AssertTaxRateForm extends AbstractConstraint TaxRate $taxRate, TaxRate $initialTaxRate = null ) { - $data = ($initialTaxRate !== null) - ? array_merge($initialTaxRate->getData(), $taxRate->getData()) - : $taxRate->getData(); - $data = $this->prepareData($data); + $data = $this->prepareData($taxRate, $initialTaxRate); $filter = [ 'code' => $data['code'], ]; @@ -53,11 +50,20 @@ class AssertTaxRateForm extends AbstractConstraint /** * Preparing data for verification * - * @param array $data + * @param TaxRate $taxRate + * @param TaxRate $initialTaxRate * @return array */ - protected function prepareData(array $data) + protected function prepareData(TaxRate $taxRate, TaxRate $initialTaxRate = null) { + if ($initialTaxRate !== null) { + $data = array_merge($initialTaxRate->getData(), $taxRate->getData()); + if ($taxRate->hasData('tax_country_id') && !$taxRate->hasData('tax_region_id')) { + unset($data['tax_region_id']); + } + } else { + $data = $taxRate->getData(); + } if ($data['zip_is_range'] === 'Yes') { unset($data['tax_postcode']); } else { diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/ApplyTaxBasedOnVatIdTest.xml b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/ApplyTaxBasedOnVatIdTest.xml index ae3c83014c7f0169da523f9e15c065671c69f167..d5407ecf878f38d62433a282d67c5b7e2f7f942a 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/ApplyTaxBasedOnVatIdTest.xml +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/ApplyTaxBasedOnVatIdTest.xml @@ -11,11 +11,11 @@ <data name="description" xsi:type="string">MAGETWO-13436: Automatic Apply Tax Based on VAT ID.</data> <data name="vatConfig/dataSet" xsi:type="string">enable_VAT_on_frontend</data> <data name="configData" xsi:type="string">default_tax_configuration, flatrate, checkmo, store_information_DE_with_VAT, enable_VAT_on_frontend</data> - <data name="customer/dataSet" xsi:type="string">address_UK_with_VAT</data> + <data name="customer/dataSet" xsi:type="string">customer_UK_address_with_VAT</data> <data name="order/dataSet" xsi:type="string">default</data> <data name="order/data/entity_id/products" xsi:type="string">catalogProductSimple::product_10_dollar</data> <data name="order/data/customer_id/dataSet" xsi:type="string">customer_UK_address_with_VAT</data> - <data name="order/data/billing_address_id/dataSet" xsi:type="string">address_UK_with_VAT</data> + <data name="order/data/billing_address_id/dataSet" xsi:type="string">UK_address_with_VAT</data> <data name="taxRule/dataSet" xsi:type="string">retailer_uk_full_tax_rule</data> <data name="customerGroup" xsi:type="string">valid_intra_union_group</data> <data name="cart/data/subtotal" xsi:type="string">10</data> diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/CreateTaxRateEntityTest.xml b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/CreateTaxRateEntityTest.xml index bee3fb886b6f598dd767fe1706a967247ea05736..9602d171bf546587b59734b79042e4b42d6618fc 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/CreateTaxRateEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/CreateTaxRateEntityTest.xml @@ -14,7 +14,6 @@ <data name="taxRate/data/zip_to" xsi:type="string">-</data> <data name="taxRate/data/tax_postcode" xsi:type="string">*</data> <data name="taxRate/data/tax_country_id" xsi:type="string">Australia</data> - <data name="taxRate/data/tax_region_id" xsi:type="string">*</data> <data name="taxRate/data/rate" xsi:type="string">20</data> <constraint name="Magento\Tax\Test\Constraint\AssertTaxRateSuccessSaveMessage" /> <constraint name="Magento\Tax\Test\Constraint\AssertTaxRateInGrid" /> @@ -55,7 +54,6 @@ <data name="taxRate/data/zip_to" xsi:type="string">7800935</data> <data name="taxRate/data/tax_postcode" xsi:type="string">-</data> <data name="taxRate/data/tax_country_id" xsi:type="string">United Kingdom</data> - <data name="taxRate/data/tax_region_id" xsi:type="string">*</data> <data name="taxRate/data/rate" xsi:type="string">7.75</data> <constraint name="Magento\Tax\Test\Constraint\AssertTaxRateSuccessSaveMessage" /> <constraint name="Magento\Tax\Test\Constraint\AssertTaxRateForm" /> diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/UpdateTaxRateEntityTest.xml b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/UpdateTaxRateEntityTest.xml index 5f3a3e5fba76bad0aa9afb2fa85624cddb1e4beb..c8205ff306c4f0a543f0ab0cea2d619a6df8004a 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/UpdateTaxRateEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/UpdateTaxRateEntityTest.xml @@ -11,8 +11,6 @@ <data name="initialTaxRate/dataSet" xsi:type="string">default</data> <data name="taxRate/data/code" xsi:type="string">TaxIdentifier%isolation%</data> <data name="taxRate/data/zip_is_range" xsi:type="string">No</data> - <data name="taxRate/data/zip_from" xsi:type="string">-</data> - <data name="taxRate/data/zip_to" xsi:type="string">-</data> <data name="taxRate/data/tax_postcode" xsi:type="string">90001</data> <data name="taxRate/data/tax_country_id" xsi:type="string">United States</data> <data name="taxRate/data/tax_region_id" xsi:type="string">California</data> @@ -27,7 +25,6 @@ <data name="taxRate/data/zip_is_range" xsi:type="string">Yes</data> <data name="taxRate/data/zip_from" xsi:type="string">90001</data> <data name="taxRate/data/zip_to" xsi:type="string">96162</data> - <data name="taxRate/data/tax_postcode" xsi:type="string">-</data> <data name="taxRate/data/tax_country_id" xsi:type="string">United States</data> <data name="taxRate/data/tax_region_id" xsi:type="string">California</data> <data name="taxRate/data/rate" xsi:type="string">15.05</data> @@ -39,11 +36,8 @@ <data name="initialTaxRate/dataSet" xsi:type="string">default</data> <data name="taxRate/data/code" xsi:type="string">TaxIdentifier%isolation%</data> <data name="taxRate/data/zip_is_range" xsi:type="string">No</data> - <data name="taxRate/data/zip_from" xsi:type="string">-</data> - <data name="taxRate/data/zip_to" xsi:type="string">-</data> <data name="taxRate/data/tax_postcode" xsi:type="string">*</data> <data name="taxRate/data/tax_country_id" xsi:type="string">United Kingdom</data> - <data name="taxRate/data/tax_region_id" xsi:type="string">*</data> <data name="taxRate/data/rate" xsi:type="string">777</data> <constraint name="Magento\Tax\Test\Constraint\AssertTaxRateSuccessSaveMessage" /> <constraint name="Magento\Tax\Test\Constraint\AssertTaxRateInGrid" /> @@ -53,8 +47,6 @@ <data name="initialTaxRate/dataSet" xsi:type="string">withZipRange</data> <data name="taxRate/data/code" xsi:type="string">TaxIdentifier%isolation%</data> <data name="taxRate/data/zip_is_range" xsi:type="string">No</data> - <data name="taxRate/data/zip_from" xsi:type="string">-</data> - <data name="taxRate/data/zip_to" xsi:type="string">-</data> <data name="taxRate/data/tax_postcode" xsi:type="string">180</data> <data name="taxRate/data/tax_country_id" xsi:type="string">Canada</data> <data name="taxRate/data/tax_region_id" xsi:type="string">*</data> @@ -69,9 +61,7 @@ <data name="taxRate/data/zip_is_range" xsi:type="string">Yes</data> <data name="taxRate/data/zip_from" xsi:type="string">1</data> <data name="taxRate/data/zip_to" xsi:type="string">7800935</data> - <data name="taxRate/data/tax_postcode" xsi:type="string">-</data> <data name="taxRate/data/tax_country_id" xsi:type="string">United Kingdom</data> - <data name="taxRate/data/tax_region_id" xsi:type="string">*</data> <data name="taxRate/data/rate" xsi:type="string">12.99</data> <constraint name="Magento\Tax\Test\Constraint\AssertTaxRateSuccessSaveMessage" /> <constraint name="Magento\Tax\Test\Constraint\AssertTaxRateForm" /> @@ -80,8 +70,6 @@ <data name="initialTaxRate/dataSet" xsi:type="string">withZipRange</data> <data name="taxRate/data/code" xsi:type="string">TaxIdentifier%isolation%</data> <data name="taxRate/data/zip_is_range" xsi:type="string">No</data> - <data name="taxRate/data/zip_from" xsi:type="string">-</data> - <data name="taxRate/data/zip_to" xsi:type="string">-</data> <data name="taxRate/data/tax_postcode" xsi:type="string">*</data> <data name="taxRate/data/tax_country_id" xsi:type="string">France</data> <data name="taxRate/data/tax_region_id" xsi:type="string">Val-d'Oise</data> diff --git a/dev/tests/functional/tests/app/Magento/Ups/Test/TestCase/OnePageCheckoutTest.xml b/dev/tests/functional/tests/app/Magento/Ups/Test/TestCase/OnePageCheckoutTest.xml index 850c839e08fd3a5e50591d5c9912922b4467803e..fcb92ddb6be2a91c3c689bd686687517c4c6ef16 100644 --- a/dev/tests/functional/tests/app/Magento/Ups/Test/TestCase/OnePageCheckoutTest.xml +++ b/dev/tests/functional/tests/app/Magento/Ups/Test/TestCase/OnePageCheckoutTest.xml @@ -11,8 +11,8 @@ <data name="description" xsi:type="string">MAGETWO-12848 – Use UPS Online Shipping Carrier on Checkout as a Registered Customer</data> <data name="products" xsi:type="string">catalogProductSimple::default, configurableProduct::default, bundleProduct::bundle_fixed_product</data> <data name="checkoutMethod" xsi:type="string">login</data> - <data name="customer/dataSet" xsi:type="string">customer_US</data> - <data name="billingAddress/dataSet" xsi:type="string">customer_US</data> + <data name="customer/dataSet" xsi:type="string">default</data> + <data name="billingAddress/dataSet" xsi:type="string">US_address_1</data> <data name="shipping/shipping_service" xsi:type="string">United Parcel Service</data> <data name="shipping/shipping_method" xsi:type="string">UPS Ground</data> <data name="cart/data/shipping_method" xsi:type="string">UPS Ground</data> @@ -27,9 +27,9 @@ <data name="description" xsi:type="string">Checkout as guest using UPS with US shipping origin and UK customer</data> <data name="products" xsi:type="string">catalogProductSimple::default, configurableProduct::default, bundleProduct::bundle_fixed_product</data> <data name="checkoutMethod" xsi:type="string">guest</data> - <data name="customer/dataSet" xsi:type="string">customer_UK</data> - <data name="address/dataSet" xsi:type="string">customer_UK</data> - <data name="billingAddress/dataSet" xsi:type="string">customer_UK</data> + <data name="customer/dataSet" xsi:type="string">default</data> + <data name="address/dataSet" xsi:type="string">UK_address</data> + <data name="billingAddress/dataSet" xsi:type="string">UK_address</data> <data name="shipping/shipping_service" xsi:type="string">United Parcel Service</data> <data name="shipping/shipping_method" xsi:type="string">UPS Worldwide Expedited</data> <data name="cart/data/shipping_method" xsi:type="string">UPS Worldwide Expedited</data> diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Block/Adminhtml/Catalog/Edit/UrlRewriteForm.php b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Block/Adminhtml/Catalog/Edit/UrlRewriteForm.php index 373c6c4cabd7c90d4920667f958868594b4b3946..5fb3fc21d02d69cd99399f7af6741da752448522 100644 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Block/Adminhtml/Catalog/Edit/UrlRewriteForm.php +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Block/Adminhtml/Catalog/Edit/UrlRewriteForm.php @@ -6,7 +6,7 @@ namespace Magento\UrlRewrite\Test\Block\Adminhtml\Catalog\Edit; -use Magento\Backend\Test\Block\Widget\Form; +use Magento\Mtf\Block\Form; use Magento\Mtf\Client\Element\SimpleElement; use Magento\Mtf\Client\Element; use Magento\Mtf\Fixture\FixtureInterface; @@ -16,6 +16,42 @@ use Magento\Mtf\Fixture\FixtureInterface; */ class UrlRewriteForm extends Form { + /** + * Prepare data for url rewrite fixture. + * + * @param FixtureInterface $fixture + * @return array + */ + protected function prepareData(FixtureInterface $fixture) + { + $data = $fixture->getData(); + if (empty($data['entity_type']) && empty($this->getData()['target_path']) && !isset($data['target_path'])) { + $entity = $fixture->getDataFieldConfig('target_path')['source']->getEntity(); + $data['target_path'] = $entity->hasData('identifier') + ? $entity->getIdentifier() + : $entity->getUrlKey() . '.html'; + } + return $data; + } + + /** + * Fill visible fields on the form. + * + * @param array $data + * @param SimpleElement $context + * @retun void + */ + protected function fillFields(array $data, SimpleElement $context) + { + $mapping = $this->dataMapping($data); + foreach ($mapping as $field) { + $element = $this->getElement($context, $field); + if ($element->isVisible() && !$element->isDisabled()) { + $element->setValue($field['value']); + } + } + } + /** * Fill the root form. * @@ -29,13 +65,8 @@ class UrlRewriteForm extends Form SimpleElement $element = null, array $replace = [] ) { - $data = $fixture->getData(); - if (empty($data['entity_type']) && empty($this->getData()['target_path']) && !isset($data['target_path'])) { - $entity = $fixture->getDataFieldConfig('target_path')['source']->getEntity(); - $data['target_path'] = $entity->hasData('identifier') - ? $entity->getIdentifier() - : $entity->getUrlKey() . '.html'; - } + $context = ($element === null) ? $this->_rootElement : $element; + $data = $this->prepareData($fixture); foreach ($replace as $key => $value) { if (isset($data[$key])) { @@ -43,8 +74,7 @@ class UrlRewriteForm extends Form } } - $mapping = $this->dataMapping($data); - $this->_fill($mapping, $element); + $this->fillFields($data, $context); return $this; } diff --git a/dev/tests/functional/tests/app/Magento/Usps/Test/TestCase/OnePageCheckoutTest.xml b/dev/tests/functional/tests/app/Magento/Usps/Test/TestCase/OnePageCheckoutTest.xml index db8db09e418ca18c1adee18b65fbc9391a1a303e..25c488a697e577f4589ef24fd679ae5e52ed3f89 100644 --- a/dev/tests/functional/tests/app/Magento/Usps/Test/TestCase/OnePageCheckoutTest.xml +++ b/dev/tests/functional/tests/app/Magento/Usps/Test/TestCase/OnePageCheckoutTest.xml @@ -11,8 +11,8 @@ <data name="description" xsi:type="string">MAGETWO-12444 – Use USPS Online Shipping Carrier on Checkout as a Registered Customer</data> <data name="products" xsi:type="string">catalogProductSimple::default, configurableProduct::default, bundleProduct::bundle_fixed_product</data> <data name="checkoutMethod" xsi:type="string">login</data> - <data name="customer/dataSet" xsi:type="string">customer_US</data> - <data name="billingAddress/dataSet" xsi:type="string">customer_US</data> + <data name="customer/dataSet" xsi:type="string">default</data> + <data name="billingAddress/dataSet" xsi:type="string">US_address_1</data> <data name="shipping/shipping_service" xsi:type="string">United States Postal Service</data> <data name="shipping/shipping_method" xsi:type="string">Priority Mail 1-Day</data> <data name="cart/data/shipping_method" xsi:type="string">Priority Mail 1-Day</data> @@ -27,9 +27,9 @@ <data name="description" xsi:type="string">Checkout as guest using USPS with US shipping origin and UK customer</data> <data name="products" xsi:type="string">catalogProductSimple::default, configurableProduct::default, bundleProduct::bundle_fixed_product</data> <data name="checkoutMethod" xsi:type="string">guest</data> - <data name="customer/dataSet" xsi:type="string">customer_UK</data> - <data name="address/dataSet" xsi:type="string">customer_UK</data> - <data name="billingAddress/dataSet" xsi:type="string">customer_UK</data> + <data name="customer/dataSet" xsi:type="string">default</data> + <data name="address/dataSet" xsi:type="string">UK_address</data> + <data name="billingAddress/dataSet" xsi:type="string">UK_address</data> <data name="shipping/shipping_service" xsi:type="string">United States Postal Service</data> <data name="shipping/shipping_method" xsi:type="string">Priority Mail International</data> <data name="cart/data/shipping_method" xsi:type="string">Priority Mail International</data> diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AbstractWishlistTest.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AbstractWishlistTest.php index 736d2e0e8136600a99ebc424ef73e57fbfdb2a00..b3102c9d7f960e4205fd633bfb10c18008fd10f5 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AbstractWishlistTest.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AbstractWishlistTest.php @@ -119,11 +119,9 @@ abstract class AbstractWishlistTest extends Injectable */ protected function addToWishlist(array $products, $configure = false) { - $addProductsToWishlistStep = $this->objectManager->create( + $this->objectManager->create( 'Magento\Wishlist\Test\TestStep\AddProductsToWishlistStep', ['products' => $products, 'configure' => $configure] - ); - - $addProductsToWishlistStep->run(); + )->run(); } } diff --git a/dev/tests/functional/utils/generate/constraint.php b/dev/tests/functional/utils/generate/constraint.php deleted file mode 100644 index 5dfd019f6c17046591a153cb136e0245dac581a3..0000000000000000000000000000000000000000 --- a/dev/tests/functional/utils/generate/constraint.php +++ /dev/null @@ -1,9 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -require_once dirname(__DIR__) . '/' . 'bootstrap.php'; - -$objectManager->create('Magento\Mtf\Util\Generate\Constraint')->launch(); -\Magento\Mtf\Util\Generate\GenerateResult::displayResults(); diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/grid/columns/actions.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/grid/columns/actions.test.js new file mode 100644 index 0000000000000000000000000000000000000000..331dbef78d040a791fd30f9f58efa2e5153164b8 --- /dev/null +++ b/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/grid/columns/actions.test.js @@ -0,0 +1,100 @@ +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +define([ + 'underscore', + 'Magento_Ui/js/grid/columns/actions' +], function (_, Actions) { + 'use strict'; + + describe('ui/js/grid/columns/actions', function () { + var model, + action; + + beforeEach(function () { + model = new Actions({ + index: 'actions', + name: 'listing_action', + indexField: 'id', + dataScope: '', + rows: [{ + identifier: 'row' + }] + }); + action = { + index: 'delete', + hidden: true, + rowIndex: 0, + callback: function() { + return true; + } + }; + }); + + it('Check addAction function', function () { + expect(model.addAction('delete', action)).toBe(model); + }); + + it('Check getAction function', function () { + var someAction = _.clone(action); + + someAction.index = 'edit'; + model.addAction('edit', someAction); + expect(model.getAction(0, 'edit')).toEqual(someAction); + }); + + it('Check getVisibleActions function', function () { + var someAction = _.clone(action); + + someAction.hidden = false; + someAction.index= 'view'; + model.addAction('delete', action); + model.addAction('view', someAction); + expect(model.getVisibleActions('0')).toEqual([someAction]); + }); + + it('Check updateActions function', function () { + expect(model.updateActions()).toEqual(model); + }); + + it('Check applyAction function', function () { + model.addAction('delete', action); + expect(model.applyAction('delete', 0)).toEqual(model); + }); + + it('Check isSingle and isMultiple function', function () { + var someAction = _.clone(action); + + action.hidden = false; + model.addAction('delete', action); + expect(model.isSingle(0)).toBeTruthy(); + someAction.hidden = false; + someAction.index = 'edit'; + model.addAction('edit', someAction); + expect(model.isSingle(0)).toBeFalsy(); + expect(model.isMultiple(0)).toBeTruthy(); + }); + + it('Check isActionVisible function', function () { + expect(model.isActionVisible(action)).toBeFalsy(); + action.hidden = false; + expect(model.isActionVisible(action)).toBeTruthy(); + }); + + it('Check toggleList function', function () { + model.toggleList(0); + expect(model.opened()).toEqual(0); + model.toggleList(0); + expect(model.opened()).toBeFalsy(); + }); + + it('Check closeList function', function () { + model.toggleList(0); + expect(model.opened()).toEqual(0); + model.closeList(0); + expect(model.opened()).toBeFalsy(); + }); + }); +}); \ No newline at end of file diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/dialog/dialog.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/modal/modal.test.js similarity index 60% rename from dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/dialog/dialog.test.js rename to dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/modal/modal.test.js index be1e6dfa867088f6174526b3d41c6fade7276b8a..b5e2837467bebad4e5e15bea402121a1be7e96ae 100644 --- a/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/dialog/dialog.test.js +++ b/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/modal/modal.test.js @@ -5,23 +5,23 @@ define([ 'jquery', - 'Magento_Ui/js/dialog/dialog' + 'Magento_Ui/js/modal/modal' ], function ($) { 'use strict'; - describe('ui/js/dialog/dialog', function () { + describe('ui/js/modal/modal', function () { var element = $('<div>some element</div>'), - dialog = element.dialog({}).data('mage-dialog'); + modal = element.modal({}).data('mage-modal'); - it('Check for dialog definition', function () { - expect(dialog).toBeDefined(); + it('Check for modal definition', function () { + expect(modal).toBeDefined(); }); it('Show/hide function check', function () { expect(element.trigger('openDialog')).toBe(element); expect(element.trigger('closeDialog')).toBe(element); }); it('Check for transition support', function () { - expect(dialog.whichTransitionEvent()).toBe('webkitTransitionEnd'); + expect(modal.whichTransitionEvent()).toBe('webkitTransitionEnd'); }); }); }); \ No newline at end of file diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/ClassesTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/ClassesTest.php index b190aee7f88acc5bd18af6e1f986472dd6c35627..9bc08c21c00f0379c39d9061b6da22eacb7488d5 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/ClassesTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/ClassesTest.php @@ -7,6 +7,8 @@ */ namespace Magento\Test\Integrity; +use Magento\Framework\App\Utility\Classes; + class ClassesTest extends \PHPUnit_Framework_TestCase { /** @@ -31,7 +33,7 @@ class ClassesTest extends \PHPUnit_Framework_TestCase */ function ($file) { $contents = file_get_contents($file); - $classes = \Magento\Framework\App\Utility\Classes::getAllMatches( + $classes = Classes::getAllMatches( $contents, '/ # ::getResourceModel ::getBlockSingleton ::getModel ::getSingleton @@ -57,7 +59,7 @@ class ClassesTest extends \PHPUnit_Framework_TestCase ); // without modifier "i". Starting from capital letter is a significant characteristic of a class name - \Magento\Framework\App\Utility\Classes::getAllMatches( + Classes::getAllMatches( $contents, '/(?:\-> | parent\:\:)(?:_init | setType)\(\s* \'([A-Z][a-z\d][A-Za-z\d\\\\]+)\'(?:,\s*\'([A-Z][a-z\d][A-Za-z\d\\\\]+)\') @@ -82,7 +84,7 @@ class ClassesTest extends \PHPUnit_Framework_TestCase protected function _collectResourceHelpersPhp($contents, &$classes) { $regex = '/(?:\:\:|\->)getResourceHelper\(\s*\'([a-z\d\\\\]+)\'\s*\)/ix'; - $matches = \Magento\Framework\App\Utility\Classes::getAllMatches($contents, $regex); + $matches = Classes::getAllMatches($contents, $regex); foreach ($matches as $moduleName) { $classes[] = "{$moduleName}\\Model\\Resource\\Helper\\Mysql4"; } @@ -96,7 +98,7 @@ class ClassesTest extends \PHPUnit_Framework_TestCase * @param string $path */ function ($path) { - $classes = \Magento\Framework\App\Utility\Classes::collectClassesInConfig(simplexml_load_file($path)); + $classes = Classes::collectClassesInConfig(simplexml_load_file($path)); $this->_assertClassesExist($classes, $path); }, \Magento\Framework\App\Utility\Files::init()->getMainConfigFiles() @@ -113,26 +115,26 @@ class ClassesTest extends \PHPUnit_Framework_TestCase function ($path) { $xml = simplexml_load_file($path); - $classes = \Magento\Framework\App\Utility\Classes::getXmlNodeValues( + $classes = Classes::getXmlNodeValues( $xml, '/layout//*[contains(text(), "\\\\Block\\\\") or contains(text(), "\\\\Model\\\\") or contains(text(), "\\\\Helper\\\\")]' ); - foreach (\Magento\Framework\App\Utility\Classes::getXmlAttributeValues( + foreach (Classes::getXmlAttributeValues( $xml, '/layout//@helper', 'helper' ) as $class) { - $classes[] = \Magento\Framework\App\Utility\Classes::getCallbackClass($class); + $classes[] = Classes::getCallbackClass($class); } - foreach (\Magento\Framework\App\Utility\Classes::getXmlAttributeValues( + foreach (Classes::getXmlAttributeValues( $xml, '/layout//@module', 'module' ) as $module) { $classes[] = str_replace('_', '\\', "{$module}_Helper_Data"); } - $classes = array_merge($classes, \Magento\Framework\App\Utility\Classes::collectLayoutClasses($xml)); + $classes = array_merge($classes, Classes::collectLayoutClasses($xml)); $this->_assertClassesExist(array_unique($classes), $path); }, @@ -159,7 +161,7 @@ class ClassesTest extends \PHPUnit_Framework_TestCase $badUsages = []; foreach ($classes as $class) { try { - if (strrchr($class, '\\') == false) { + if (strrchr($class, '\\') === false and !Classes::isVirtual($class)) { $badUsages[] = $class; continue; } else { @@ -168,9 +170,9 @@ class ClassesTest extends \PHPUnit_Framework_TestCase self::$_existingClasses[$class] ) || \Magento\Framework\App\Utility\Files::init()->classFileExists( $class - ) || \Magento\Framework\App\Utility\Classes::isVirtual( + ) || Classes::isVirtual( $class - ) || \Magento\Framework\App\Utility\Classes::isAutogenerated( + ) || Classes::isAutogenerated( $class ) ); diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/ConfigTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/ConfigTest.php index 58d662260d8271730806151c01eba88e356a7b0a..6b439124a3238ac31ad21fa1e2b341c3c0be460a 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/ConfigTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/ConfigTest.php @@ -5,6 +5,8 @@ */ namespace Magento\Test\Integrity; +use Magento\Framework\App\Utility\Classes; + class ConfigTest extends \PHPUnit_Framework_TestCase { public function testPaymentMethods() @@ -19,12 +21,14 @@ class ConfigTest extends \PHPUnit_Framework_TestCase $nodes = $config->xpath('/config/default/payment/*/model') ?: []; $formalModuleName = str_replace('_', '\\', $moduleName); foreach ($nodes as $node) { - $this->assertStringStartsWith( - $formalModuleName . '\Model\\', - (string)$node, - "'{$node}' payment method is declared in '{$configFile}' module, " . - "but doesn't belong to '{$moduleName}' module" - ); + if (!Classes::isVirtual((string)$node)) { + $this->assertStringStartsWith( + $formalModuleName . '\Model\\', + (string)$node, + "'{$node}' payment method is declared in '{$configFile}' module, " . + "but doesn't belong to '{$moduleName}' module" + ); + } } }, $this->paymentMethodsDataProvider() diff --git a/lib/internal/Magento/Framework/AppInterface.php b/lib/internal/Magento/Framework/AppInterface.php index b0b03dfcb471f368da7964d27b52ab16cae7f171..fb61d6803b3681c56a7af5ad3a29cc8468484e27 100644 --- a/lib/internal/Magento/Framework/AppInterface.php +++ b/lib/internal/Magento/Framework/AppInterface.php @@ -17,7 +17,7 @@ interface AppInterface /** * Magento version */ - const VERSION = '0.74.0-beta13'; + const VERSION = '0.74.0-beta14'; /** * Launch application diff --git a/lib/internal/Magento/Framework/Intl/DateTimeFactory.php b/lib/internal/Magento/Framework/Intl/DateTimeFactory.php new file mode 100644 index 0000000000000000000000000000000000000000..089dc90170965d0a32eb46bd9196001ccebd997a --- /dev/null +++ b/lib/internal/Magento/Framework/Intl/DateTimeFactory.php @@ -0,0 +1,25 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Framework\Intl; + +/** + * Class DateTimeFactory + * @package Magento\Framework + */ +class DateTimeFactory +{ + /** + * Factory method for \DateTime + * + * @param string $time + * @param \DateTimeZone $timezone + * @return \DateTime + */ + public function create($time = 'now', \DateTimeZone $timezone = null) + { + return new \DateTime($time, $timezone); + } +} diff --git a/lib/internal/Magento/Framework/Intl/README.md b/lib/internal/Magento/Framework/Intl/README.md new file mode 100644 index 0000000000000000000000000000000000000000..7257506ebe47cde86a94a0166e8599fbdd2b39dc --- /dev/null +++ b/lib/internal/Magento/Framework/Intl/README.md @@ -0,0 +1,3 @@ +# Intl + +**Intl** provides an access to Intl extension library wrappers. diff --git a/lib/internal/Magento/Framework/ObjectManager/TMap.php b/lib/internal/Magento/Framework/ObjectManager/TMap.php index 759ed739d624497ce65ee5e2678b4d9cbe3c99a0..b15b87ed467203a7b5c9be009408e5fdbfe219da 100644 --- a/lib/internal/Magento/Framework/ObjectManager/TMap.php +++ b/lib/internal/Magento/Framework/ObjectManager/TMap.php @@ -44,24 +44,16 @@ class TMap implements \IteratorAggregate, \Countable, \ArrayAccess */ private $configInterface; - /** - * @var ClassReaderInterface - */ - private $classReaderInterface; - - /** * @param string $type * @param ObjectManagerInterface $objectManager * @param ConfigInterface $configInterface - * @param ClassReaderInterface $classReaderInterface * @param array $array */ public function __construct( $type, ObjectManagerInterface $objectManager, ConfigInterface $configInterface, - ClassReaderInterface $classReaderInterface, array $array = [] ) { if (!class_exists($this->type) && !interface_exists($type)) { @@ -72,7 +64,6 @@ class TMap implements \IteratorAggregate, \Countable, \ArrayAccess $this->objectManager = $objectManager; $this->configInterface = $configInterface; - $this->classReaderInterface = $classReaderInterface; array_walk( $array, @@ -99,7 +90,12 @@ class TMap implements \IteratorAggregate, \Countable, \ArrayAccess $this->configInterface->getPreference($instanceName) ); - if (!in_array($this->type, $this->classReaderInterface->getParents($realType), true)) { + if ( + !in_array( + $this->type, + array_unique(array_merge(class_parents($realType), class_implements($realType))), + true + )) { $this->throwTypeException($realType, $index); } } diff --git a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/TMapTest.php b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/TMapTest.php index 6ce188335d8c6aa1f9e8dba25addacfb2d116847..4e599bd2356dbe77f1e748733e3496822c59376c 100644 --- a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/TMapTest.php +++ b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/TMapTest.php @@ -22,11 +22,6 @@ class TMapTest extends \PHPUnit_Framework_TestCase */ private $omConfig; - /** - * @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Framework\Code\Reader\ClassReaderInterface - */ - private $cReader; - public function setUp() { $this->om = $this->getMockBuilder('Magento\Framework\ObjectManagerInterface') @@ -34,9 +29,6 @@ class TMapTest extends \PHPUnit_Framework_TestCase $this->omConfig = $this->getMockBuilder('Magento\Framework\ObjectManager\ConfigInterface') ->getMockForAbstractClass(); - - $this->cReader = $this->getMockBuilder('Magento\Framework\Code\Reader\ClassReaderInterface') - ->getMockForAbstractClass(); } public function testConstructor() @@ -154,19 +146,10 @@ class TMapTest extends \PHPUnit_Framework_TestCase ] ); - $this->cReader->expects(static::exactly($exactlyCalls)) - ->method('getParents') - ->willReturnMap( - [ - ['TClass', ['TInterface']] - ] - ); - return new TMap( 'TInterface', $this->om, $this->omConfig, - $this->cReader, $testClasses ); } diff --git a/lib/internal/Magento/Framework/View/Element/Template.php b/lib/internal/Magento/Framework/View/Element/Template.php index a7f4b683343f87bdda4c73305a248ea92b6d81c6..8e1c8e4cb27946799946680b342aff3ae78949df 100644 --- a/lib/internal/Magento/Framework/View/Element/Template.php +++ b/lib/internal/Magento/Framework/View/Element/Template.php @@ -7,7 +7,6 @@ namespace Magento\Framework\View\Element; use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\Filesystem; -use Magento\Framework\View\Template\Html\Minifier; /** * Base html block diff --git a/lib/internal/Magento/Framework/composer.json b/lib/internal/Magento/Framework/composer.json index 1307d01001635ca7553aabcd9dcd94884d01801c..29ca6222b30be7c45122ac19c9f1c48c04c408fc 100644 --- a/lib/internal/Magento/Framework/composer.json +++ b/lib/internal/Magento/Framework/composer.json @@ -2,7 +2,7 @@ "name": "magento/framework", "description": "N/A", "type": "magento2-library", - "version": "0.74.0-beta13", + "version": "0.74.0-beta14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/lib/web/css/source/components/_modals.less b/lib/web/css/source/components/_modals.less index c7776d6684e7e5880247625d2032f0cd4b33fc02..df5c973eef2de55b58b941178d1acf677ee0a219 100644 --- a/lib/web/css/source/components/_modals.less +++ b/lib/web/css/source/components/_modals.less @@ -28,6 +28,8 @@ @modal-slide-header__padding-vertical: 2.1rem; +@modal-popup-confirm__width: 50rem; + // // Utilities // --------------------------------------------- @@ -181,6 +183,16 @@ padding-top: @modal-popup__padding; padding-bottom: @modal-popup__padding; } + &.confirm { + .modal-inner-wrap { + margin-left: -(@modal-popup-confirm__width/2); + left: 50%; + width: @modal-popup-confirm__width; + } + .modal-footer { + text-align: right; + } + } } // diff --git a/lib/web/css/source/lib/_navigation.less b/lib/web/css/source/lib/_navigation.less index 6bc9cb68b243392a50bf5026f8bc510146a1f71a..a0af0e4ebd85069255dd6e8c5d13c82206552855 100644 --- a/lib/web/css/source/lib/_navigation.less +++ b/lib/web/css/source/lib/_navigation.less @@ -329,7 +329,6 @@ margin: 0 !important; position: absolute; left: 0; - top: 100%; z-index: 1; .css(background, @_submenu-background-color); .css(border, @_submenu-border-width @_submenu-border-style @_submenu-border-color); @@ -370,6 +369,10 @@ top: 0 !important; left: 100% !important; } + .submenu-reverse{ + left: auto !important; + right: 100%; + } } &.more { position: relative; diff --git a/lib/web/mage/backend/suggest.js b/lib/web/mage/backend/suggest.js index dfb3ef72d8c4d8424c949ea44dfba20b3a8f01be..f4efd12693997985cdc08232778491db37a74848 100644 --- a/lib/web/mage/backend/suggest.js +++ b/lib/web/mage/backend/suggest.js @@ -178,16 +178,47 @@ _bind: function () { this._on($.extend({ keydown: function (event) { - var keyCode = $.ui.keyCode; + var keyCode = $.ui.keyCode, + suggestList, + hasSuggestedItems, + hasSelectedItems, + selectedItem; + switch (event.keyCode) { case keyCode.PAGE_UP: - case keyCode.PAGE_DOWN: case keyCode.UP: + if (!event.shiftKey) { + event.preventDefault(); + this._proxyEvents(event); + } + + suggestList = event.currentTarget.parentNode.getElementsByTagName('ul')[0]; + hasSuggestedItems = event.currentTarget.parentNode.getElementsByTagName('ul')[0].children.length >= 0; + if (hasSuggestedItems) { + selectedItem = $(suggestList.getElementsByClassName('_active')[0]).removeClass('_active').prev().addClass('_active'); + event.currentTarget.value = selectedItem.find("a").text(); + } + + break; + case keyCode.PAGE_DOWN: case keyCode.DOWN: if (!event.shiftKey) { event.preventDefault(); this._proxyEvents(event); } + + suggestList = event.currentTarget.parentNode.getElementsByTagName('ul')[0]; + hasSuggestedItems = event.currentTarget.parentNode.getElementsByTagName('ul')[0].children.length >= 0; + if(hasSuggestedItems){ + hasSelectedItems = suggestList.getElementsByClassName('_active').length === 0; + if(hasSelectedItems) { + selectedItem = $(suggestList.children[0]).addClass('_active'); + event.currentTarget.value = selectedItem.find("a").text(); + }else { + selectedItem = $(suggestList.getElementsByClassName('_active')[0]).removeClass('_active').next().addClass('_active'); + event.currentTarget.value = selectedItem.find("a").text(); + } + } break; case keyCode.TAB: if (this.isDropdownShown()) { @@ -197,6 +228,7 @@ break; case keyCode.ENTER: case keyCode.NUMPAD_ENTER: + if (this.isDropdownShown() && this._focused) { this._proxyEvents(event); event.preventDefault(); diff --git a/lib/web/mage/menu.js b/lib/web/mage/menu.js index 94055ff0a1ddbda398323f9d8e31a9060ac7bfd3..925ae9df33791441a2e54ed6457753a62cba0751 100644 --- a/lib/web/mage/menu.js +++ b/lib/web/mage/menu.js @@ -8,7 +8,7 @@ define([ "jquery/ui", "jquery/jquery.mobile.custom", "mage/translate" -], function($, mediaCheck){ +], function ($, mediaCheck) { 'use strict'; /** @@ -20,22 +20,30 @@ define([ expanded: false, delay: 300 }, + _create: function () { + var self = this; - _init: function() { + this._super(); + $(window).on('resize', function () { + self.element.find('.submenu-reverse').removeClass('submenu-reverse'); + }); + }, + + _init: function () { this._super(); this.delay = this.options.delay; - if(this.options.expanded === true) { + if (this.options.expanded === true) { this.isExpanded(); } - if(this.options.responsive === true){ + if (this.options.responsive === true) { mediaCheck({ media: '(max-width: 640px)', - entry: $.proxy(function() { + entry: $.proxy(function () { this._toggleMobileMode(); }, this), - exit: $.proxy(function() { + exit: $.proxy(function () { this._toggleDesktopMode(); }, this) }); @@ -44,7 +52,7 @@ define([ this._assignControls()._listen(); }, - _assignControls: function() { + _assignControls: function () { this.controls = { toggleBtn: $('[data-action="toggle-nav"]'), swipeArea: $('.nav-sections') @@ -53,125 +61,125 @@ define([ return this; }, - _listen: function() { + _listen: function () { var controls = this.controls; var toggle = this.toggle; - this._on(controls.toggleBtn, { 'click' : toggle }); - this._on(controls.swipeArea, { 'swipeleft': toggle }); + this._on(controls.toggleBtn, {'click': toggle}); + this._on(controls.swipeArea, {'swipeleft': toggle}); }, - toggle: function() { + toggle: function () { if ($('html').hasClass('nav-open')) { $('html').removeClass('nav-open'); - setTimeout(function() { + setTimeout(function () { $('html').removeClass('nav-before-open'); - },300); + }, 300); } else { $('html').addClass('nav-before-open'); - setTimeout(function() { + setTimeout(function () { $('html').addClass('nav-open'); - },42); + }, 42); } }, //Add class for expanded option - isExpanded: function() { - var subMenus = this.element.find( this.options.menus ), + isExpanded: function () { + var subMenus = this.element.find(this.options.menus), expandedMenus = subMenus.find('ul'); expandedMenus.addClass('expanded'); }, - _activate: function( event ) { + _activate: function (event) { window.location.href = this.active.find('> a').attr('href'); this.collapseAll(event); }, - _keydown: function(event) { + _keydown: function (event) { var match, prev, character, skip, regex, - preventDefault = true; + preventDefault = true; - function escape( value ) { - return value.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" ); + function escape(value) { + return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&"); } - if(this.active.closest('ul').attr('aria-expanded') != 'true') { + if (this.active.closest('ul').attr('aria-expanded') != 'true') { - switch ( event.keyCode ) { + switch (event.keyCode) { case $.ui.keyCode.PAGE_UP: - this.previousPage( event ); + this.previousPage(event); break; case $.ui.keyCode.PAGE_DOWN: - this.nextPage( event ); + this.nextPage(event); break; case $.ui.keyCode.HOME: - this._move( "first", "first", event ); + this._move("first", "first", event); break; case $.ui.keyCode.END: - this._move( "last", "last", event ); + this._move("last", "last", event); break; case $.ui.keyCode.UP: - this.previous( event ); + this.previous(event); break; case $.ui.keyCode.DOWN: - if ( this.active && !this.active.is( ".ui-state-disabled" ) ) { - this.expand( event ); + if (this.active && !this.active.is(".ui-state-disabled")) { + this.expand(event); } break; case $.ui.keyCode.LEFT: - this.previous( event ); + this.previous(event); break; case $.ui.keyCode.RIGHT: - this.next( event ); + this.next(event); break; case $.ui.keyCode.ENTER: case $.ui.keyCode.SPACE: - this._activate( event ); + this._activate(event); break; case $.ui.keyCode.ESCAPE: - this.collapse( event ); + this.collapse(event); break; default: preventDefault = false; prev = this.previousFilter || ""; - character = String.fromCharCode( event.keyCode ); + character = String.fromCharCode(event.keyCode); skip = false; - clearTimeout( this.filterTimer ); + clearTimeout(this.filterTimer); - if ( character === prev ) { + if (character === prev) { skip = true; } else { character = prev + character; } - regex = new RegExp( "^" + escape( character ), "i" ); - match = this.activeMenu.children( ".ui-menu-item" ).filter(function() { - return regex.test( $( this ).children( "a" ).text() ); + regex = new RegExp("^" + escape(character), "i"); + match = this.activeMenu.children(".ui-menu-item").filter(function () { + return regex.test($(this).children("a").text()); }); - match = skip && match.index( this.active.next() ) !== -1 ? - this.active.nextAll( ".ui-menu-item" ) : + match = skip && match.index(this.active.next()) !== -1 ? + this.active.nextAll(".ui-menu-item") : match; // If no matches on the current filter, reset to the last character pressed // to move down the menu to the first item that starts with that character - if ( !match.length ) { - character = String.fromCharCode( event.keyCode ); - regex = new RegExp( "^" + escape( character ), "i" ); - match = this.activeMenu.children( ".ui-menu-item" ).filter(function() { - return regex.test( $( this ).children( "a" ).text() ); + if (!match.length) { + character = String.fromCharCode(event.keyCode); + regex = new RegExp("^" + escape(character), "i"); + match = this.activeMenu.children(".ui-menu-item").filter(function () { + return regex.test($(this).children("a").text()); }); } - if ( match.length ) { - this.focus( event, match ); - if ( match.length > 1 ) { + if (match.length) { + this.focus(event, match); + if (match.length > 1) { this.previousFilter = character; - this.filterTimer = this._delay(function() { + this.filterTimer = this._delay(function () { delete this.previousFilter; - }, 1000 ); + }, 1000); } else { delete this.previousFilter; } @@ -180,65 +188,65 @@ define([ } } } else { - switch ( event.keyCode ) { + switch (event.keyCode) { case $.ui.keyCode.DOWN: - this.next( event ); + this.next(event); break; case $.ui.keyCode.UP: - this.previous( event ); + this.previous(event); break; case $.ui.keyCode.RIGHT: - if ( this.active && !this.active.is( ".ui-state-disabled" ) ) { - this.expand( event ); + if (this.active && !this.active.is(".ui-state-disabled")) { + this.expand(event); } break; case $.ui.keyCode.ENTER: case $.ui.keyCode.SPACE: - this._activate( event ); + this._activate(event); break; case $.ui.keyCode.LEFT: case $.ui.keyCode.ESCAPE: - this.collapse( event ); + this.collapse(event); break; default: preventDefault = false; prev = this.previousFilter || ""; - character = String.fromCharCode( event.keyCode ); + character = String.fromCharCode(event.keyCode); skip = false; - clearTimeout( this.filterTimer ); + clearTimeout(this.filterTimer); - if ( character === prev ) { + if (character === prev) { skip = true; } else { character = prev + character; } - regex = new RegExp( "^" + escape( character ), "i" ); - match = this.activeMenu.children( ".ui-menu-item" ).filter(function() { - return regex.test( $( this ).children( "a" ).text() ); + regex = new RegExp("^" + escape(character), "i"); + match = this.activeMenu.children(".ui-menu-item").filter(function () { + return regex.test($(this).children("a").text()); }); - match = skip && match.index( this.active.next() ) !== -1 ? - this.active.nextAll( ".ui-menu-item" ) : + match = skip && match.index(this.active.next()) !== -1 ? + this.active.nextAll(".ui-menu-item") : match; // If no matches on the current filter, reset to the last character pressed // to move down the menu to the first item that starts with that character - if ( !match.length ) { - character = String.fromCharCode( event.keyCode ); - regex = new RegExp( "^" + escape( character ), "i" ); - match = this.activeMenu.children( ".ui-menu-item" ).filter(function() { - return regex.test( $( this ).children( "a" ).text() ); + if (!match.length) { + character = String.fromCharCode(event.keyCode); + regex = new RegExp("^" + escape(character), "i"); + match = this.activeMenu.children(".ui-menu-item").filter(function () { + return regex.test($(this).children("a").text()); }); } - if ( match.length ) { - this.focus( event, match ); - if ( match.length > 1 ) { + if (match.length) { + this.focus(event, match); + if (match.length > 1) { this.previousFilter = character; - this.filterTimer = this._delay(function() { + this.filterTimer = this._delay(function () { delete this.previousFilter; - }, 1000 ); + }, 1000); } else { delete this.previousFilter; } @@ -248,27 +256,27 @@ define([ } } - if ( preventDefault ) { + if (preventDefault) { event.preventDefault(); } }, - _toggleMobileMode: function() { + _toggleMobileMode: function () { $(this.element).off('mouseenter mouseleave'); this._on({ - "click .ui-menu-item:has(a)": function( event ) { + "click .ui-menu-item:has(a)": function (event) { event.preventDefault(); - var target = $( event.target ).closest( ".ui-menu-item" ); - - if ( !target.hasClass('level-top') || !target.has( ".ui-menu" ).length ) { + var target = $(event.target).closest(".ui-menu-item"); + + if (!target.hasClass('level-top') || !target.has(".ui-menu").length) { window.location.href = target.find('> a').attr('href'); } } }); var subMenus = this.element.find('.level-top'); - $.each(subMenus, $.proxy(function(index, item) { + $.each(subMenus, $.proxy(function (index, item) { var category = $(item).find('> a span').not('.ui-menu-icon').text(), categoryUrl = $(item).find('> a').attr('href'), menu = $(item).find('> .ui-menu'); @@ -281,58 +289,79 @@ define([ .addClass('ui-menu-item all-category') .html(this.categoryLink); - if(menu.find('.all-category').length === 0) { + if (menu.find('.all-category').length === 0) { menu.prepend(this.categoryParent); } }, this)); }, - _toggleDesktopMode: function() { + _toggleDesktopMode: function () { this._on({ // Prevent focus from sticking to links inside menu after clicking // them (focus should always stay on UL during navigation). - "mousedown .ui-menu-item > a": function( event ) { + "mousedown .ui-menu-item > a": function (event) { event.preventDefault(); }, - "click .ui-state-disabled > a": function( event ) { + "click .ui-state-disabled > a": function (event) { event.preventDefault(); }, - "click .ui-menu-item:has(a)": function( event ) { - var target = $( event.target ).closest( ".ui-menu-item" ); - if ( !this.mouseHandled && target.not( ".ui-state-disabled" ).length ) { - this.select( event ); + "click .ui-menu-item:has(a)": function (event) { + var target = $(event.target).closest(".ui-menu-item"); + if (!this.mouseHandled && target.not(".ui-state-disabled").length) { + this.select(event); // Only set the mouseHandled flag if the event will bubble, see #9469. - if ( !event.isPropagationStopped() ) { + if (!event.isPropagationStopped()) { this.mouseHandled = true; } // Open submenu on click - if ( target.has( ".ui-menu" ).length ) { - this.expand( event ); - } else if ( !this.element.is( ":focus" ) && $( this.document[ 0 ].activeElement ).closest( ".ui-menu" ).length ) { + if (target.has(".ui-menu").length) { + this.expand(event); + } else if (!this.element.is(":focus") && $(this.document[0].activeElement).closest(".ui-menu").length) { // Redirect focus to the menu - this.element.trigger( "focus", [ true ] ); + this.element.trigger("focus", [true]); // If the active item is on the top level, let it stay active. // Otherwise, blur the active item since it is no longer visible. - if ( this.active && this.active.parents( ".ui-menu" ).length === 1 ) { - clearTimeout( this.timer ); + if (this.active && this.active.parents(".ui-menu").length === 1) { + clearTimeout(this.timer); } } } }, - "mouseenter .ui-menu-item": function( event ) { - var target = $( event.currentTarget ); + "mouseenter .ui-menu-item": function (event) { + var target = $(event.currentTarget), + ulElement, + ulElementWidth, + width, + targetPageX, + rightBound; + + if (target.has('ul')) { + ulElement = target.find('ul'); + ulElementWidth = target.find('ul').outerWidth(true); + width = target.outerWidth() * 2; + targetPageX = target.offset().left; + rightBound = $(window).width(); + + if ((ulElementWidth + width + targetPageX) > rightBound) { + ulElement.addClass('submenu-reverse'); + } + if ((targetPageX - ulElementWidth) < 0) { + ulElement.removeClass('submenu-reverse'); + } + } + // Remove ui-state-active class from siblings of the newly focused menu item // to avoid a jump caused by adjacent elements both having a class with a border - target.siblings().children( ".ui-state-active" ).removeClass( "ui-state-active" ); - this.focus( event, target ); + target.siblings().children(".ui-state-active").removeClass("ui-state-active"); + this.focus(event, target); }, - "mouseleave": function( event ){ - this.collapseAll( event, true ); + "mouseleave": function (event) { + this.collapseAll(event, true); }, "mouseleave .ui-menu": "collapseAll" }); @@ -349,11 +378,14 @@ define([ }, 300); } }, - _delay: function(handler, delay) { - handler.apply(this, arguments); - - return setTimeout(function() {}, delay || 0); + var instance = this, + handlerProxy = function () { + return (typeof handler === "string" ? instance[handler] : handler) + .apply(instance, arguments); + }; + + return setTimeout(handlerProxy, delay || 0); } }); @@ -368,7 +400,7 @@ define([ breakpoint: 768 }, - _init: function() { + _init: function () { this._super(); var that = this, @@ -383,24 +415,24 @@ define([ this.setMaxItems(); //check responsive option - if(responsive == "onResize") { - $(window).on('resize', function() { - if($(window).width() > that.options.breakpoint) { - that._responsive(); - $('[responsive=more]').show(); + if (responsive == "onResize") { + $(window).on('resize', function () { + if ($(window).width() > that.options.breakpoint) { + that._responsive(); + $('[responsive=more]').show(); } else { that.element.children().show(); $('[responsive=more]').hide(); } }); - } else if(responsive == "onReload") { + } else if (responsive == "onReload") { this._responsive(); } }, - setupMoreMenu: function() { + setupMoreMenu: function () { var moreListItems = this.element.children().clone(), - moreLink = $('<a>'+ this.options.moreText +'</a>'); + moreLink = $('<a>' + this.options.moreText + '</a>'); moreListItems.hide(); @@ -418,15 +450,15 @@ define([ .attr('responsive', 'more') .append(this.moreListContainer) .menu({ - position : { - my : "right top", - at : "right bottom" + position: { + my: "right top", + at: "right bottom" } }) .insertAfter(this.element); }, - _responsive: function() { + _responsive: function () { var container = $(this.options.container), containerSize = container.width(), width = 0, @@ -434,7 +466,7 @@ define([ more = $('.ui-menu-more > li > ul > li a'); - items = items.map(function() { + items = items.map(function () { var item = {}; item.item = $(this); @@ -442,36 +474,36 @@ define([ return item; }); - $.each(items, function(index, item){ + $.each(items, function (index, item) { var itemText = items[index].item - .find('a:first') - .text(); + .find('a:first') + .text(); width += parseInt(items[index].itemSize, null); - if(width < containerSize) { + if (width < containerSize) { items[index].item.show(); - more.each(function() { - var text = $(this).text(); - if(text === itemText){ - $(this).parent().hide(); - } - }); - } else if(width > containerSize) { + more.each(function () { + var text = $(this).text(); + if (text === itemText) { + $(this).parent().hide(); + } + }); + } else if (width > containerSize) { items[index].item.hide(); - more.each(function() { - var text = $(this).text(); - if(text === itemText){ - $(this).parent().show(); - } - }); + more.each(function () { + var text = $(this).text(); + if (text === itemText) { + $(this).parent().show(); + } + }); } }); }, - setMaxItems: function() { + setMaxItems: function () { var items = this.element.children('li'), itemsCount = items.length, maxItems = this.options.maxItems, @@ -480,23 +512,23 @@ define([ overflowItems.hide(); - overflowItems.each(function(){ + overflowItems.each(function () { var itemText = $(this).find('a:first').text(); $(this).hide(); - $('.ui-menu-more > li > ul > li a').each(function() { - var text = $(this).text(); - if(text === itemText){ - $(this).parent().show(); - } - }); + $('.ui-menu-more > li > ul > li a').each(function () { + var text = $(this).text(); + if (text === itemText) { + $(this).parent().show(); + } + }); }); } }); - + return { - menu: $.mage.menu, + menu: $.mage.menu, navigation: $.mage.navigation }; }); diff --git a/lib/web/mage/utils/arrays.js b/lib/web/mage/utils/arrays.js index 54fb9a6189a8df0335808a989c5be5b859643ed8..d931fc1c7118a76ac5fe4f3b2dbc9cf4df9756a7 100644 --- a/lib/web/mage/utils/arrays.js +++ b/lib/web/mage/utils/arrays.js @@ -8,6 +8,25 @@ define([ ], function (_, utils) { 'use strict'; + /** + * Defines index of an item in a specified container. + * + * @param {*} item - Item whose index should be defined. + * @param {Array} container - Container upon which to perform search. + * @returns {Number} + */ + function getIndex(item, container) { + var index = container.indexOf(item); + + if (~index) { + return index; + } + + return _.findIndex(container, function (value) { + return value && value.name === item; + }); + } + return { /** * Facade method to remove/add value from/to array @@ -62,21 +81,6 @@ define([ return this; }, - /** - * Extends an incoming array with a specified ammount of undefined values - * starting from a specified position. - * - * @param {Array} container - Array to be extended. - * @param {Number} size - Ammount of values to be added. - * @param {Number} [offset=0] - Position at which to start inserting values. - * @returns {Array} Modified array. - */ - reserve: function (container, size, offset) { - container.splice(offset || 0, 0, new Array(size)); - - return _.flatten(container); - }, - /** * Compares multiple arrays without tracking order of their elements. * @@ -93,7 +97,64 @@ define([ }); }, - formatOffset: function(elems, offset) { + /** + * Inserts specified item into container at specified position. + * + * @param {*} item - Item to be inserted into container. + * @param {Array} container - Container of items. + * @param {*} [position=-1] - Position at which item should be inserted. + * Position can represent: + * - specific index in container + * - item which might already be present in container + * - structure with one of these properties: after, before + * @returns {Boolean|*} + * - true if element has changed its' position + * - false if nothing has changed + * - inserted value if it wasn't present in container + */ + insert: function (item, container, position) { + var currentIndex = getIndex(item, container), + newIndex, + target; + + if (typeof position === 'undefined') { + position = -1; + } else if (typeof position === 'string') { + position = isNaN(+position) ? position : +position; + } + + newIndex = position; + + if (~currentIndex) { + target = container.splice(currentIndex, 1)[0]; + + if (typeof item === 'string') { + item = target; + } + } + + if (typeof position !== 'number') { + target = position.after || position.before || position; + + newIndex = getIndex(target, container); + + if (~newIndex && (position.after || newIndex >= currentIndex)) { + newIndex++; + } + } + + if (newIndex < 0) { + newIndex += container.length + 1; + } + + container[newIndex] ? + container.splice(newIndex, 0, item) : + container[newIndex] = item; + + return !~currentIndex ? item : currentIndex !== newIndex; + }, + + formatOffset: function (elems, offset) { if (utils.isEmpty(offset)) { offset = -1; } diff --git a/lib/web/mage/utils/objects.js b/lib/web/mage/utils/objects.js index 7cd4924e492a39ee5609bb7e25c9bdef887c2ebb..4aa5d7216c6f3b4c4496071da48516e7d029e78b 100644 --- a/lib/web/mage/utils/objects.js +++ b/lib/web/mage/utils/objects.js @@ -207,7 +207,12 @@ define([ return result; }, - extend: function (target) { + /** + * Performs deep extend of specified objects. + * + * @returns {Object|Array} Extended object. + */ + extend: function () { var args = _.toArray(arguments); args.unshift(true); @@ -215,15 +220,36 @@ define([ return $.extend.apply($, args); }, + /** + * Performs a deep clone of a specified object. + * + * @param {(Object|Array)} data - Data that should be copied. + * @returns {Object|Array} Cloned object. + */ copy: function (data) { - return this.extend({}, data); + var result = data, + isArray = Array.isArray(data), + placeholder; + + if (this.isObject(data) || isArray) { + placeholder = isArray ? [] : {}; + result = this.extend(placeholder, data); + } + + return result; }, - isObject: function (data) { + /** + * Checks if provided value is a plain object. + * + * @param {*} value - Value to be checked. + * @returns {Boolean} + */ + isObject: function (value) { var objProto = Object.prototype; - return typeof data == 'object' ? - objProto.toString.call(data) === '[object Object]' : + return typeof value == 'object' ? + objProto.toString.call(value) === '[object Object]' : false; } }; diff --git a/lib/web/mage/utils/strings.js b/lib/web/mage/utils/strings.js index 185951886aaf3271e84cfc4d79d16016aec1d5ef..914ca72c1bdf63a6525eca1fc2c2c7372e60ade3 100644 --- a/lib/web/mage/utils/strings.js +++ b/lib/web/mage/utils/strings.js @@ -7,7 +7,29 @@ define([ ], function (_) { 'use strict'; + var jsonRe = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/; + return { + /** + * Attempts to convert string to one of the primitive values, + * or to parse it as a valid json object. + * + * @param {String} str - String to be processed. + * @returns {*} + */ + castString: function (str) { + try { + str = str === 'true' ? true : + str === 'false' ? false : + str === 'null' ? null : + +str + '' === str ? +str : + jsonRe.test(str) ? JSON.parse(str) : + str; + } catch (e) {} + + return str; + }, + /** * Splits string by separator if it's possible, * otherwise returns the incoming value. @@ -62,6 +84,13 @@ define([ return value === '' || _.isUndefined(value) || _.isNull(value); }, + /** + * Adds 'prefix' to the 'part' value if it was provided. + * + * @param {String} prefix + * @param {String} part + * @returns {String} + */ fullPath: function (prefix, part) { return prefix ? prefix + '.' + part : part; } diff --git a/lib/web/mage/utils/template.js b/lib/web/mage/utils/template.js index a2b8cd462f6669405c84a39a89785cec54cb472b..d76f0e890f665582b06071a7ab1253717eb3656a 100644 --- a/lib/web/mage/utils/template.js +++ b/lib/web/mage/utils/template.js @@ -4,8 +4,9 @@ */ define([ 'underscore', - 'mage/utils/objects' -], function (_, utils) { + 'mage/utils/objects', + 'mage/utils/strings' +], function (_, utils, stringUtils) { 'use strict'; var tmplSettings = _.templateSettings, @@ -28,6 +29,7 @@ define([ })(); if (hasStringTmpls) { + /*eslint-disable no-unused-vars, no-eval*/ /** * Evaluates template string using ES6 templates. * @@ -38,6 +40,7 @@ define([ template = function (tmpl, $) { return eval('`' + tmpl + '`'); }; + /*eslint-enable no-unused-vars, no-eval*/ } else { /** * Fallback function used when ES6 templates are not supported. @@ -52,7 +55,9 @@ define([ tmplSettings.interpolate = interpolate; - tmpl = _.template(tmpl, {variable: '$'})(data); + tmpl = _.template(tmpl, { + variable: '$' + })(data); tmplSettings.interpolate = cached; @@ -63,7 +68,7 @@ define([ /** * Checks if provided value contains template syntax. * - * @param {*} value - Value to be check. + * @param {*} value - Value to be checked. * @returns {Boolean} */ function isTemplate(value) { @@ -76,9 +81,12 @@ define([ * * @param {String} tmpl - Template string. * @param {Object} data - Data object used in a template. - * @returns {String} Compiled template. + * @param {Boolean} [castString=false] - Flag that indicates whether template + * should be casted after evaluation to a value of another type or + * that it should be leaved as a string. + * @returns {*} Compiled template. */ - function render(tmpl, data) { + function render(tmpl, data, castString) { var last = tmpl; data = Object.create(data); @@ -93,7 +101,9 @@ define([ last = tmpl; } - return tmpl; + return castString ? + stringUtils.castString(tmpl) : + tmpl; } return { @@ -102,7 +112,10 @@ define([ * * @param {Object|String} tmpl * @param {Object} [data] - Data object to match with template. - * @returns {Object|String} + * @param {Boolean} [castString=false] - Flag that indicates whether template + * should be casted after evaluation to a value of another type or + * that it should be leaved as a string. + * @returns {*} * * @example Template defined as a string. * var source = { foo: 'Random Stuff', bar: 'Some' }; @@ -114,6 +127,8 @@ define([ * var tmpl = { * key: {'${ $.$data.bar }': '${ $.$data.foo }'}, * foo: 'bar', + * x1: 2, x2: 5, + * delta: '${ $.x2 - $.x1 }', * baz: 'Upper ${ $.foo.toUpperCase() }' * }; * @@ -121,19 +136,25 @@ define([ * => { * key: {'Some': 'Random Stuff'}, * foo: 'bar', + * x1: 2, x2: 5, + * delta: 3, * baz: 'Upper BAR' * }; */ - template: function (tmpl, data) { + template: function (tmpl, data, castString) { + var iterate; + if (typeof tmpl === 'string') { - return render(tmpl, data); + return render(tmpl, data, castString); } - tmpl = utils.extend({}, tmpl); - + tmpl = utils.copy(tmpl); tmpl.$data = data || {}; - _.each(tmpl, function iterate(value, key, list) { + /** + * Template iterator function. + */ + iterate = function (value, key, list) { if (key === '$data') { return; } @@ -146,11 +167,13 @@ define([ } if (isTemplate(value)) { - list[key] = render(value, tmpl); - } else if (_.isObject(value)) { + list[key] = render(value, tmpl, castString); + } else if (utils.isObject(value) || Array.isArray(value)) { _.each(value, iterate); } - }); + }; + + _.each(tmpl, iterate); delete tmpl.$data;