Skip to content
This repository was archived by the owner on May 20, 2019. It is now read-only.

Commit d73e84f

Browse files
authored
Merge pull request #1 from magento/2.2-develop
Latest Pull 2.2
2 parents 08b8956 + fbb7fad commit d73e84f

File tree

234 files changed

+4081
-726
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

234 files changed

+4081
-726
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
name: Bug report
3+
about: Technical issue with the Magento 2 core components
4+
5+
---
6+
7+
<!---
8+
Please review our guidelines before adding a new issue: https://github.com/magento/magento2/wiki/Issue-reporting-guidelines
9+
-->
10+
11+
### Preconditions
12+
<!---
13+
Provide the exact Magento version (example: 2.2.5) and any important information on the environment where bug is reproducible.
14+
-->
15+
1.
16+
2.
17+
18+
### Steps to reproduce
19+
<!---
20+
Important: Provide a set of clear steps to reproduce this bug. We can not provide support without clear instructions on how to reproduce.
21+
-->
22+
1.
23+
2.
24+
25+
### Expected result
26+
<!--- Tell us what do you expect to happen. -->
27+
1. [Screenshots, logs or description]
28+
2.
29+
30+
### Actual result
31+
<!--- Tell us what happened instead. Include error messages and issues. -->
32+
1. [Screenshots, logs or description]
33+
2.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
name: Developer experience issue
3+
about: Issues related to customization, extensibility, modularity
4+
5+
---
6+
7+
<!---
8+
Please review our guidelines before adding a new issue: https://github.com/magento/magento2/wiki/Issue-reporting-guidelines
9+
-->
10+
11+
### Summary
12+
<!--- Describe the issue you are experiencing. Include general information, error messages, environments, and so on. -->
13+
14+
### Examples
15+
<!--- Provide code examples or a patch with a test (recommended) to clearly indicate the problem. -->
16+
17+
### Proposed solution
18+
<!--- Suggest your potential solutions for this issue. -->
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
name: Feature request
3+
about: Please consider reporting directly to https://github.com/magento/community-features
4+
5+
---
6+
7+
<!---
8+
Important: This repository is intended only for Magento 2 Technical Issues. Enter Feature Requests at https://github.com/magento/community-features. Project stakeholders monitor and manage requests. Feature requests entered using this form may be moved to the forum.
9+
-->
10+
11+
### Description
12+
<!--- Describe the feature you would like to add. -->
13+
14+
### Expected behavior
15+
<!--- What is the expected behavior of this feature? How is it going to work? -->
16+
17+
### Benefits
18+
<!--- How do you think this feature would improve Magento? -->
19+
20+
### Additional information
21+
<!--- What other information can you provide about the desired feature? -->

app/bootstrap.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@
3131
// Sets default autoload mappings, may be overridden in Bootstrap::create
3232
\Magento\Framework\App\Bootstrap::populateAutoloader(BP, []);
3333

34-
require_once BP . '/app/functions.php';
35-
3634
/* Custom umask value may be provided in optional mage_umask file in root */
3735
$umaskFile = BP . '/magento_umask';
3836
$mask = file_exists($umaskFile) ? octdec(file_get_contents($umaskFile)) : 002;

app/code/Magento/AdminNotification/etc/adminhtml/menu.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd">
99
<menu>
10-
<add id="Magento_AdminNotification::system_adminnotification" title="Notifications" translate="title" module="Magento_AdminNotification" sortOrder="10" parent="Magento_Backend::system_other_settings" action="adminhtml/notification" resource="Magento_AdminNotification::adminnotification"/>
10+
<add id="Magento_AdminNotification::system_adminnotification" title="Notifications" translate="title" module="Magento_AdminNotification" sortOrder="10" parent="Magento_Backend::system_other_settings" action="adminhtml/notification" resource="Magento_AdminNotification::adminnotification"/>
1111
</menu>
1212
</config>

app/code/Magento/Backend/Block/Media/Uploader.php

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento\Backend\Block\Media;
79

810
use Magento\Framework\App\ObjectManager;
911
use Magento\Framework\Serialize\Serializer\Json;
12+
use Magento\Framework\Image\Adapter\ConfigInterface;
1013

1114
/**
1215
* Adminhtml media library uploader
@@ -35,20 +38,29 @@ class Uploader extends \Magento\Backend\Block\Widget
3538
*/
3639
private $jsonEncoder;
3740

41+
/**
42+
* @var ConfigInterface
43+
*/
44+
private $imageConfig;
45+
3846
/**
3947
* @param \Magento\Backend\Block\Template\Context $context
4048
* @param \Magento\Framework\File\Size $fileSize
4149
* @param array $data
4250
* @param Json $jsonEncoder
51+
* @param ConfigInterface $imageConfig
4352
*/
4453
public function __construct(
4554
\Magento\Backend\Block\Template\Context $context,
4655
\Magento\Framework\File\Size $fileSize,
4756
array $data = [],
48-
Json $jsonEncoder = null
57+
Json $jsonEncoder = null,
58+
ConfigInterface $imageConfig = null
4959
) {
5060
$this->_fileSizeService = $fileSize;
5161
$this->jsonEncoder = $jsonEncoder ?: ObjectManager::getInstance()->get(Json::class);
62+
$this->imageConfig = $imageConfig ?: ObjectManager::getInstance()->get(ConfigInterface::class);
63+
5264
parent::__construct($context, $data);
5365
}
5466

@@ -90,6 +102,26 @@ public function getFileSizeService()
90102
return $this->_fileSizeService;
91103
}
92104

105+
/**
106+
* Get Image Upload Maximum Width Config
107+
*
108+
* @return int
109+
*/
110+
public function getImageUploadMaxWidth()
111+
{
112+
return $this->imageConfig->getMaxWidth();
113+
}
114+
115+
/**
116+
* Get Image Upload Maximum Height Config
117+
*
118+
* @return int
119+
*/
120+
public function getImageUploadMaxHeight()
121+
{
122+
return $this->imageConfig->getMaxHeight();
123+
}
124+
93125
/**
94126
* Prepares layout and set element renderer
95127
*

app/code/Magento/Backend/etc/adminhtml/system.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,19 @@
319319
</depends>
320320
</field>
321321
</group>
322+
<group id="upload_configuration" translate="label" type="text" sortOrder="1000" showInDefault="1" showInWebsite="1" showInStore="1">
323+
<label>Images Upload Configuration</label>
324+
<field id="max_width" translate="label comment" type="text" sortOrder="100" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
325+
<label>Maximum Width</label>
326+
<validate>validate-greater-than-zero validate-number required-entry</validate>
327+
<comment>Maximum allowed width for uploaded image.</comment>
328+
</field>
329+
<field id="max_height" translate="label comment" type="text" sortOrder="200" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
330+
<label>Maximum Height</label>
331+
<validate>validate-greater-than-zero validate-number required-entry</validate>
332+
<comment>Maximum allowed height for uploaded image.</comment>
333+
</field>
334+
</group>
322335
</section>
323336
<section id="admin" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="0" showInStore="0">
324337
<label>Admin</label>

app/code/Magento/Backend/etc/config.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
<dashboard>
2929
<enable_charts>1</enable_charts>
3030
</dashboard>
31+
<upload_configuration>
32+
<max_width>1920</max_width>
33+
<max_height>1200</max_height>
34+
</upload_configuration>
3135
</system>
3236
<general>
3337
<validator_data>

app/code/Magento/Backend/view/adminhtml/templates/media/uploader.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
data-mage-init='{
1414
"Magento_Backend/js/media-uploader" : {
1515
"maxFileSize": <?= /* @escapeNotVerified */ $block->getFileSizeService()->getMaxFileSize() ?>,
16-
"maxWidth":<?= /* @escapeNotVerified */ \Magento\Framework\File\Uploader::MAX_IMAGE_WIDTH ?> ,
17-
"maxHeight": <?= /* @escapeNotVerified */ \Magento\Framework\File\Uploader::MAX_IMAGE_HEIGHT ?>
16+
"maxWidth":<?= /* @escapeNotVerified */ $block->getImageUploadMaxWidth() ?> ,
17+
"maxHeight": <?= /* @escapeNotVerified */ $block->getImageUploadMaxHeight() ?>
1818
}
1919
}'
2020
>

app/code/Magento/Backend/view/adminhtml/templates/widget/grid.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ $numColumns = sizeof($block->getColumns());
107107
<?= /* @escapeNotVerified */ __('of %1', '<span>' . $block->getCollection()->getLastPageNumber() . '</span>') ?>
108108
</label>
109109
<?php if ($_curPage < $_lastPage): ?>
110-
<button title="<?= /* @escapeNotVerified */ __('Next page') ?>"
110+
<button type="button" title="<?= /* @escapeNotVerified */ __('Next page') ?>"
111111
class="action-next"
112112
onclick="<?= /* @escapeNotVerified */ $block->getJsObjectName() ?>.setPage('<?= /* @escapeNotVerified */ ($_curPage + 1) ?>');return false;">
113113
<span><?= /* @escapeNotVerified */ __('Next page') ?></span>
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AdminOrderFillBraintreeCreditCardActionGroup">
11+
<arguments>
12+
<argument name="cardData" defaultValue="BraintreeCard"/>
13+
</arguments>
14+
<waitForLoadingMaskToDisappear stepKey="waitLoadingMaskDisappear"/>
15+
<conditionalClick selector="{{AdminOrderFormPaymentSection.braintreeCreditCardMethod}}" dependentSelector="{{AdminOrderFormPaymentSection.braintreeCreditCardMethod}}" visible="true" stepKey="chooseBraintreeCreditCard"/>
16+
<waitForLoadingMaskToDisappear stepKey="waitLoadingMask"/>
17+
<selectOption selector="{{AdminOrderFormPaymentSection.braintreeCcType}}" userInput="{{cardData.cc_type}}" stepKey="fillCc"/>
18+
<!--Fill card number-->
19+
<switchToIFrame selector="{{AdminOrderFormPaymentSection.braintreeCcFrame}}" stepKey="switchToCcIFrame"/>
20+
<fillField selector="{{AdminOrderFormPaymentSection.braintreeCardNumber}}" userInput="{{cardData.card_number}}" stepKey="fillCardNumber"/>
21+
<waitForPageLoad stepKey="waitForFillCardNumber" time="1"/>
22+
<switchToIFrame stepKey="switchToDefaultContext1"/>
23+
<!--Fill card expiration month-->
24+
<switchToIFrame selector="{{AdminOrderFormPaymentSection.braintreeCcExpMonthFrame}}" stepKey="switchToCcExpMonthIFrame"/>
25+
<fillField selector="{{AdminOrderFormPaymentSection.braintreeExpMonth}}" userInput="{{cardData.exp_month}}" stepKey="fillExpMonth"/>
26+
<waitForPageLoad stepKey="waitForFillCardExpMonth" time="1"/>
27+
<switchToIFrame stepKey="switchToDefaultContext2"/>
28+
<!--Fill card expiration year-->
29+
<switchToIFrame selector="{{AdminOrderFormPaymentSection.braintreeCcExpYear}}" stepKey="switchToCcExpYearIFrame"/>
30+
<fillField selector="{{AdminOrderFormPaymentSection.braintreeExpYear}}" userInput="{{cardData.exp_year}}" stepKey="fillExpYear"/>
31+
<waitForPageLoad stepKey="waitForFillCardExpYear" time="1"/>
32+
<switchToIFrame stepKey="switchToDefaultContext3"/>
33+
<!--Fill card CVV-->
34+
<switchToIFrame selector="{{AdminOrderFormPaymentSection.braintreeCvvFrame}}" stepKey="switchToCvvIFrame"/>
35+
<fillField selector="{{AdminOrderFormPaymentSection.braintreeCvv}}" userInput="{{cardData.cvv}}" stepKey="fillCvv"/>
36+
<waitForPageLoad stepKey="waitForFillCardCvv" time="1"/>
37+
<switchToIFrame stepKey="switchToDefaultContext4"/>
38+
</actionGroup>
39+
</actionGroups>

app/code/Magento/Braintree/Test/Mftf/Data/BraintreeData.xml

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,17 @@
4343
<requiredEntity type="merchant_id">DefaultMerchantId</requiredEntity>
4444
<requiredEntity type="public_key">DefaultPublicKey</requiredEntity>
4545
<requiredEntity type="private_key">DefaultPrivateKey</requiredEntity>
46+
<requiredEntity type="active">DefaultActive</requiredEntity>
47+
<requiredEntity type="merchant_account_id">DefaultMerchantAccountId</requiredEntity>
4648
</entity>
4749
<entity name="DefaultTitle" type="title">
4850
<data key="value"/>
4951
</entity>
5052
<entity name="DefaultPaymentAction" type="payment_action">
51-
<data key="value"/>
53+
<data key="value">authorize</data>
5254
</entity>
5355
<entity name="DefaultEnvironment" type="environment">
54-
<data key="value"/>
56+
<data key="value">sandbox</data>
5557
</entity>
5658
<entity name="DefaultMerchantId" type="merchant_id">
5759
<data key="value"/>
@@ -62,4 +64,54 @@
6264
<entity name="DefaultPrivateKey" type="private_key">
6365
<data key="value"/>
6466
</entity>
67+
<entity name="DefaultActive" type="active">
68+
<data key="value">0</data>
69+
</entity>
70+
<entity name="DefaultMerchantAccountId" type="merchant_account_id">
71+
<data key="value"/>
72+
</entity>
73+
74+
<entity name="SandboxBraintreeConfig" type="braintree_config_state">
75+
<requiredEntity type="title">EnabledTitle</requiredEntity>
76+
<requiredEntity type="payment_action">AuthorizePaymentAction</requiredEntity>
77+
<requiredEntity type="environment">SandboxEnvironment</requiredEntity>
78+
<requiredEntity type="merchant_id">EnabledMerchantId</requiredEntity>
79+
<requiredEntity type="public_key">EnabledPublicKey</requiredEntity>
80+
<requiredEntity type="private_key">EnabledPrivateKey</requiredEntity>
81+
<requiredEntity type="active">EnabledActive</requiredEntity>
82+
<requiredEntity type="merchant_account_id">EnabledMerchantAccountId</requiredEntity>
83+
</entity>
84+
<entity name="EnabledTitle" type="title">
85+
<data key="value">Credit Card (Braintree)</data>
86+
</entity>
87+
<entity name="AuthorizePaymentAction" type="payment_action">
88+
<data key="value">authorize</data>
89+
</entity>
90+
<entity name="SandboxEnvironment" type="environment">
91+
<data key="value">sandbox</data>
92+
</entity>
93+
<entity name="EnabledMerchantId" type="merchant_id">
94+
<data key="value">d4pdjhxgjfrsmzbf</data>
95+
</entity>
96+
<entity name="EnabledPublicKey" type="public_key">
97+
<data key="value">m7q4wmh43xrgyrst</data>
98+
</entity>
99+
<entity name="EnabledPrivateKey" type="private_key">
100+
<data key="value">67de364080b1b4e2492d7a3de413a572</data>
101+
</entity>
102+
<entity name="EnabledActive" type="active">
103+
<data key="value">1</data>
104+
</entity>
105+
<entity name="EnabledMerchantAccountId" type="merchant_account_id">
106+
<data key="value">Magneto</data>
107+
</entity>
108+
109+
<entity name="BraintreeCard" type="creditCard">
110+
<data key="cc_type">MasterCard</data>
111+
<data key="card_number">5105105105105100</data>
112+
<data key="exp_month">12</data>
113+
<data key="exp_year">20</data>
114+
<data key="cvv">113</data>
115+
</entity>
116+
65117
</entities>

app/code/Magento/Braintree/Test/Mftf/Metadata/braintree_config-meta.xml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88

99
<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataOperation.xsd">
11-
<operation name="CreateBraintreeConfigState" dataType="braintree_config_state" type="create" auth="adminFormKey" url="/admin/system_config/save/section/payment/" method="POST">
11+
<operation name="CreateBraintreeConfigState" dataType="braintree_config_state" type="create" auth="adminFormKey" url="/admin/system_config/save/section/payment/" successRegex="/messages-message-success/" method="POST">
12+
<contentType>application/x-www-form-urlencoded</contentType>
1213
<object key="groups" dataType="braintree_config_state">
1314
<object key="braintree_section" dataType="braintree_config_state">
1415
<object key="groups" dataType="braintree_config_state">
@@ -36,6 +37,18 @@
3637
</object>
3738
</object>
3839
</object>
40+
<object key="braintree_advanced" dataType="braintree_config_state">
41+
<object key="fields" dataType="braintree_config_state">
42+
<object key="merchant_account_id" dataType="merchant_account_id">
43+
<field key="value">string</field>
44+
</object>
45+
</object>
46+
</object>
47+
</object>
48+
<object key="fields" dataType="braintree_config_state">
49+
<object key="active" dataType="active">
50+
<field key="value">integer</field>
51+
</object>
3952
</object>
4053
</object>
4154
</object>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
11+
<section name="AdminOrderFormPaymentSection">
12+
<element name="braintreeCreditCardMethod" type="radio" selector="#p_method_braintree" timeout="10"/>
13+
<element name="braintreeCcType" type="select" selector="#braintree_cc_type"/>
14+
<element name="braintreeCardNumber" type="input" selector="#credit-card-number"/>
15+
<element name="braintreeExpMonth" type="input" selector="#expiration-month"/>
16+
<element name="braintreeExpYear" type="input" selector="#expiration-year"/>
17+
<element name="braintreeCvv" type="input" selector="#cvv"/>
18+
<element name="braintreeCcFrame" type="iframe" selector="braintree-hosted-field-number"/>
19+
<element name="braintreeCcExpMonthFrame" type="iframe" selector="braintree-hosted-field-expirationMonth"/>
20+
<element name="braintreeCcExpYear" type="iframe" selector="braintree-hosted-field-expirationYear"/>
21+
<element name="braintreeCvvFrame" type="iframe" selector="braintree-hosted-field-cvv"/>
22+
</section>
23+
</sections>

0 commit comments

Comments
 (0)