Skip to content

Commit

Permalink
Merge pull request #14 from magento/2.2-develop
Browse files Browse the repository at this point in the history
Latest pull
  • Loading branch information
ronak2ram authored Aug 30, 2018
2 parents 964d4ef + 19bec6f commit 4150ad1
Show file tree
Hide file tree
Showing 167 changed files with 2,824 additions and 492 deletions.
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: Bug report
about: Technical issue with the Magento 2 core components

---

<!---
Please review our guidelines before adding a new issue: https://github.com/magento/magento2/wiki/Issue-reporting-guidelines
-->

### Preconditions
<!---
Provide the exact Magento version (example: 2.2.5) and any important information on the environment where bug is reproducible.
-->
1.
2.

### Steps to reproduce
<!---
Important: Provide a set of clear steps to reproduce this bug. We can not provide support without clear instructions on how to reproduce.
-->
1.
2.

### Expected result
<!--- Tell us what do you expect to happen. -->
1. [Screenshots, logs or description]
2.

### Actual result
<!--- Tell us what happened instead. Include error messages and issues. -->
1. [Screenshots, logs or description]
2.
18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE/developer-experience-issue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: Developer experience issue
about: Issues related to customization, extensibility, modularity

---

<!---
Please review our guidelines before adding a new issue: https://github.com/magento/magento2/wiki/Issue-reporting-guidelines
-->

### Summary
<!--- Describe the issue you are experiencing. Include general information, error messages, environments, and so on. -->

### Examples
<!--- Provide code examples or a patch with a test (recommended) to clearly indicate the problem. -->

### Proposed solution
<!--- Suggest your potential solutions for this issue. -->
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: Feature request
about: Please consider reporting directly to https://github.com/magento/community-features

---

<!---
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.
-->

### Description
<!--- Describe the feature you would like to add. -->

### Expected behavior
<!--- What is the expected behavior of this feature? How is it going to work? -->

### Benefits
<!--- How do you think this feature would improve Magento? -->

### Additional information
<!--- What other information can you provide about the desired feature? -->
10 changes: 7 additions & 3 deletions app/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,16 @@
&& isset($_SERVER['HTTP_ACCEPT'])
&& strpos($_SERVER['HTTP_ACCEPT'], 'text/html') !== false
) {
$profilerFlag = isset($_SERVER['MAGE_PROFILER']) && strlen($_SERVER['MAGE_PROFILER'])
$profilerConfig = isset($_SERVER['MAGE_PROFILER']) && strlen($_SERVER['MAGE_PROFILER'])
? $_SERVER['MAGE_PROFILER']
: trim(file_get_contents(BP . '/var/profiler.flag'));

\Magento\Framework\Profiler::applyConfig(
$profilerFlag,
if ($profilerConfig) {
$profilerConfig = json_decode($profilerConfig, true) ?: $profilerConfig;
}

Magento\Framework\Profiler::applyConfig(
$profilerConfig,
BP,
!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest'
);
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/AdminNotification/etc/adminhtml/menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd">
<menu>
<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"/>
<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"/>
</menu>
</config>
34 changes: 33 additions & 1 deletion app/code/Magento/Backend/Block/Media/Uploader.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\Backend\Block\Media;

use Magento\Framework\App\ObjectManager;
use Magento\Framework\Serialize\Serializer\Json;
use Magento\Framework\Image\Adapter\ConfigInterface;

/**
* Adminhtml media library uploader
Expand Down Expand Up @@ -35,20 +38,29 @@ class Uploader extends \Magento\Backend\Block\Widget
*/
private $jsonEncoder;

/**
* @var ConfigInterface
*/
private $imageConfig;

/**
* @param \Magento\Backend\Block\Template\Context $context
* @param \Magento\Framework\File\Size $fileSize
* @param array $data
* @param Json $jsonEncoder
* @param ConfigInterface $imageConfig
*/
public function __construct(
\Magento\Backend\Block\Template\Context $context,
\Magento\Framework\File\Size $fileSize,
array $data = [],
Json $jsonEncoder = null
Json $jsonEncoder = null,
ConfigInterface $imageConfig = null
) {
$this->_fileSizeService = $fileSize;
$this->jsonEncoder = $jsonEncoder ?: ObjectManager::getInstance()->get(Json::class);
$this->imageConfig = $imageConfig ?: ObjectManager::getInstance()->get(ConfigInterface::class);

parent::__construct($context, $data);
}

Expand Down Expand Up @@ -90,6 +102,26 @@ public function getFileSizeService()
return $this->_fileSizeService;
}

/**
* Get Image Upload Maximum Width Config
*
* @return int
*/
public function getImageUploadMaxWidth()
{
return $this->imageConfig->getMaxWidth();
}

/**
* Get Image Upload Maximum Height Config
*
* @return int
*/
public function getImageUploadMaxHeight()
{
return $this->imageConfig->getMaxHeight();
}

/**
* Prepares layout and set element renderer
*
Expand Down
13 changes: 13 additions & 0 deletions app/code/Magento/Backend/etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,19 @@
</depends>
</field>
</group>
<group id="upload_configuration" translate="label" type="text" sortOrder="1000" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Images Upload Configuration</label>
<field id="max_width" translate="label comment" type="text" sortOrder="100" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
<label>Maximum Width</label>
<validate>validate-greater-than-zero validate-number required-entry</validate>
<comment>Maximum allowed width for uploaded image.</comment>
</field>
<field id="max_height" translate="label comment" type="text" sortOrder="200" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
<label>Maximum Height</label>
<validate>validate-greater-than-zero validate-number required-entry</validate>
<comment>Maximum allowed height for uploaded image.</comment>
</field>
</group>
</section>
<section id="admin" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="0" showInStore="0">
<label>Admin</label>
Expand Down
4 changes: 4 additions & 0 deletions app/code/Magento/Backend/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
<dashboard>
<enable_charts>1</enable_charts>
</dashboard>
<upload_configuration>
<max_width>1920</max_width>
<max_height>1200</max_height>
</upload_configuration>
</system>
<general>
<validator_data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
data-mage-init='{
"Magento_Backend/js/media-uploader" : {
"maxFileSize": <?= /* @escapeNotVerified */ $block->getFileSizeService()->getMaxFileSize() ?>,
"maxWidth":<?= /* @escapeNotVerified */ \Magento\Framework\File\Uploader::MAX_IMAGE_WIDTH ?> ,
"maxHeight": <?= /* @escapeNotVerified */ \Magento\Framework\File\Uploader::MAX_IMAGE_HEIGHT ?>
"maxWidth":<?= /* @escapeNotVerified */ $block->getImageUploadMaxWidth() ?> ,
"maxHeight": <?= /* @escapeNotVerified */ $block->getImageUploadMaxHeight() ?>
}
}'
>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminOrderFillBraintreeCreditCardActionGroup">
<arguments>
<argument name="cardData" defaultValue="BraintreeCard"/>
</arguments>
<waitForLoadingMaskToDisappear stepKey="waitLoadingMaskDisappear"/>
<conditionalClick selector="{{AdminOrderFormPaymentSection.braintreeCreditCardMethod}}" dependentSelector="{{AdminOrderFormPaymentSection.braintreeCreditCardMethod}}" visible="true" stepKey="chooseBraintreeCreditCard"/>
<waitForLoadingMaskToDisappear stepKey="waitLoadingMask"/>
<selectOption selector="{{AdminOrderFormPaymentSection.braintreeCcType}}" userInput="{{cardData.cc_type}}" stepKey="fillCc"/>
<!--Fill card number-->
<switchToIFrame selector="{{AdminOrderFormPaymentSection.braintreeCcFrame}}" stepKey="switchToCcIFrame"/>
<fillField selector="{{AdminOrderFormPaymentSection.braintreeCardNumber}}" userInput="{{cardData.card_number}}" stepKey="fillCardNumber"/>
<waitForPageLoad stepKey="waitForFillCardNumber" time="1"/>
<switchToIFrame stepKey="switchToDefaultContext1"/>
<!--Fill card expiration month-->
<switchToIFrame selector="{{AdminOrderFormPaymentSection.braintreeCcExpMonthFrame}}" stepKey="switchToCcExpMonthIFrame"/>
<fillField selector="{{AdminOrderFormPaymentSection.braintreeExpMonth}}" userInput="{{cardData.exp_month}}" stepKey="fillExpMonth"/>
<waitForPageLoad stepKey="waitForFillCardExpMonth" time="1"/>
<switchToIFrame stepKey="switchToDefaultContext2"/>
<!--Fill card expiration year-->
<switchToIFrame selector="{{AdminOrderFormPaymentSection.braintreeCcExpYear}}" stepKey="switchToCcExpYearIFrame"/>
<fillField selector="{{AdminOrderFormPaymentSection.braintreeExpYear}}" userInput="{{cardData.exp_year}}" stepKey="fillExpYear"/>
<waitForPageLoad stepKey="waitForFillCardExpYear" time="1"/>
<switchToIFrame stepKey="switchToDefaultContext3"/>
<!--Fill card CVV-->
<switchToIFrame selector="{{AdminOrderFormPaymentSection.braintreeCvvFrame}}" stepKey="switchToCvvIFrame"/>
<fillField selector="{{AdminOrderFormPaymentSection.braintreeCvv}}" userInput="{{cardData.cvv}}" stepKey="fillCvv"/>
<waitForPageLoad stepKey="waitForFillCardCvv" time="1"/>
<switchToIFrame stepKey="switchToDefaultContext4"/>
</actionGroup>
</actionGroups>
56 changes: 54 additions & 2 deletions app/code/Magento/Braintree/Test/Mftf/Data/BraintreeData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,17 @@
<requiredEntity type="merchant_id">DefaultMerchantId</requiredEntity>
<requiredEntity type="public_key">DefaultPublicKey</requiredEntity>
<requiredEntity type="private_key">DefaultPrivateKey</requiredEntity>
<requiredEntity type="active">DefaultActive</requiredEntity>
<requiredEntity type="merchant_account_id">DefaultMerchantAccountId</requiredEntity>
</entity>
<entity name="DefaultTitle" type="title">
<data key="value"/>
</entity>
<entity name="DefaultPaymentAction" type="payment_action">
<data key="value"/>
<data key="value">authorize</data>
</entity>
<entity name="DefaultEnvironment" type="environment">
<data key="value"/>
<data key="value">sandbox</data>
</entity>
<entity name="DefaultMerchantId" type="merchant_id">
<data key="value"/>
Expand All @@ -62,4 +64,54 @@
<entity name="DefaultPrivateKey" type="private_key">
<data key="value"/>
</entity>
<entity name="DefaultActive" type="active">
<data key="value">0</data>
</entity>
<entity name="DefaultMerchantAccountId" type="merchant_account_id">
<data key="value"/>
</entity>

<entity name="SandboxBraintreeConfig" type="braintree_config_state">
<requiredEntity type="title">EnabledTitle</requiredEntity>
<requiredEntity type="payment_action">AuthorizePaymentAction</requiredEntity>
<requiredEntity type="environment">SandboxEnvironment</requiredEntity>
<requiredEntity type="merchant_id">EnabledMerchantId</requiredEntity>
<requiredEntity type="public_key">EnabledPublicKey</requiredEntity>
<requiredEntity type="private_key">EnabledPrivateKey</requiredEntity>
<requiredEntity type="active">EnabledActive</requiredEntity>
<requiredEntity type="merchant_account_id">EnabledMerchantAccountId</requiredEntity>
</entity>
<entity name="EnabledTitle" type="title">
<data key="value">Credit Card (Braintree)</data>
</entity>
<entity name="AuthorizePaymentAction" type="payment_action">
<data key="value">authorize</data>
</entity>
<entity name="SandboxEnvironment" type="environment">
<data key="value">sandbox</data>
</entity>
<entity name="EnabledMerchantId" type="merchant_id">
<data key="value">d4pdjhxgjfrsmzbf</data>
</entity>
<entity name="EnabledPublicKey" type="public_key">
<data key="value">m7q4wmh43xrgyrst</data>
</entity>
<entity name="EnabledPrivateKey" type="private_key">
<data key="value">67de364080b1b4e2492d7a3de413a572</data>
</entity>
<entity name="EnabledActive" type="active">
<data key="value">1</data>
</entity>
<entity name="EnabledMerchantAccountId" type="merchant_account_id">
<data key="value">Magneto</data>
</entity>

<entity name="BraintreeCard" type="creditCard">
<data key="cc_type">MasterCard</data>
<data key="card_number">5105105105105100</data>
<data key="exp_month">12</data>
<data key="exp_year">20</data>
<data key="cvv">113</data>
</entity>

</entities>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataOperation.xsd">
<operation name="CreateBraintreeConfigState" dataType="braintree_config_state" type="create" auth="adminFormKey" url="/admin/system_config/save/section/payment/" method="POST">
<operation name="CreateBraintreeConfigState" dataType="braintree_config_state" type="create" auth="adminFormKey" url="/admin/system_config/save/section/payment/" successRegex="/messages-message-success/" method="POST">
<contentType>application/x-www-form-urlencoded</contentType>
<object key="groups" dataType="braintree_config_state">
<object key="braintree_section" dataType="braintree_config_state">
<object key="groups" dataType="braintree_config_state">
Expand Down Expand Up @@ -36,6 +37,18 @@
</object>
</object>
</object>
<object key="braintree_advanced" dataType="braintree_config_state">
<object key="fields" dataType="braintree_config_state">
<object key="merchant_account_id" dataType="merchant_account_id">
<field key="value">string</field>
</object>
</object>
</object>
</object>
<object key="fields" dataType="braintree_config_state">
<object key="active" dataType="active">
<field key="value">integer</field>
</object>
</object>
</object>
</object>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
<section name="AdminOrderFormPaymentSection">
<element name="braintreeCreditCardMethod" type="radio" selector="#p_method_braintree" timeout="10"/>
<element name="braintreeCcType" type="select" selector="#braintree_cc_type"/>
<element name="braintreeCardNumber" type="input" selector="#credit-card-number"/>
<element name="braintreeExpMonth" type="input" selector="#expiration-month"/>
<element name="braintreeExpYear" type="input" selector="#expiration-year"/>
<element name="braintreeCvv" type="input" selector="#cvv"/>
<element name="braintreeCcFrame" type="iframe" selector="braintree-hosted-field-number"/>
<element name="braintreeCcExpMonthFrame" type="iframe" selector="braintree-hosted-field-expirationMonth"/>
<element name="braintreeCcExpYear" type="iframe" selector="braintree-hosted-field-expirationYear"/>
<element name="braintreeCvvFrame" type="iframe" selector="braintree-hosted-field-cvv"/>
</section>
</sections>
Loading

0 comments on commit 4150ad1

Please sign in to comment.