Skip to content

Commit 533f126

Browse files
committed
Merge branch 'develop' of github.corp.magento.com:magento2/magento2ce into MAGETWO-47395
2 parents 90c8216 + e0ed4ba commit 533f126

File tree

50 files changed

+1266
-243
lines changed

Some content is hidden

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

50 files changed

+1266
-243
lines changed

app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Http/Client/TransactionSubmitForSettlementTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function testPlaceRequestWithException()
6969
}
7070

7171
/**
72-
* @covers \Magento\BraintreeTwo\Gateway\Http\Client\TransactionSubmitForSettlement::placeRequest
72+
* @covers \Magento\BraintreeTwo\Gateway\Http\Client\TransactionSubmitForSettlement::process
7373
*/
7474
public function testPlaceRequest()
7575
{

app/code/Magento/BraintreeTwo/view/adminhtml/layout/braintreetwo_report_index.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@
77
-->
88
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
99
<body>
10+
<referenceContainer name="page.main.actions">
11+
<block class="Magento\Backend\Block\Template" name="adminhtml.report.grid.braintreetwo.tooltip" template="Magento_BraintreeTwo::grid/tooltip.phtml">
12+
<arguments>
13+
<argument name="tooltip_content" xsi:type="string" translate="true">Apply filters in order to get results. Only first 100 records will be displayed in the grid, you will be able to download full version of the report in .csv format.</argument>
14+
</arguments>
15+
</block>
16+
</referenceContainer>
1017
<referenceContainer name="content">
1118
<uiComponent name="braintreetwo_report"/>
1219
</referenceContainer>

app/code/Magento/BraintreeTwo/view/adminhtml/templates/form/vault.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ $id = $block->escapeHtml($block->getData('id'));
2323
<img src="<?php echo $block->escapeUrl($icon['url']); ?>"
2424
width="<?php echo $block->escapeHtml($icon['width']); ?>"
2525
height="<?php echo $block->escapeHtml($icon['height']); ?>"
26-
>
26+
class="payment-icon" >
2727
<span><?php echo $block->escapeHtml(__('ending'));?></span>
2828
<span><?php echo $block->escapeHtml($details['maskedCC']); ?></span>
2929
(<span><?php echo $block->escapeHtml(__('expires'));?></span>:
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
/**
3+
* Copyright © 2016 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
/**
8+
* @var \Magento\Backend\Block\Template $block
9+
*/
10+
echo $block->escapeHtml($block->getData('tooltip_content'));

app/code/Magento/BraintreeTwo/view/frontend/web/js/view/payment/method-renderer/hosted-fields.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,12 @@ define([
112112
self.selectedCardType(null);
113113
}
114114

115-
if (!event.isValid) {
116-
return false;
117-
}
118-
119-
if (event.card) {
115+
if (event.target.fieldKey === 'number' && event.card) {
116+
if (event.isValid) {
117+
self.cardNumber = event.card;
118+
} else {
119+
self.cardNumber = null;
120+
}
120121
self.selectedCardType(
121122
validator.getMageCardType(event.card.type, self.getCcAvailableTypes())
122123
);

app/code/Magento/BraintreeTwo/view/frontend/web/js/view/payment/method-renderer/paypal.js

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ define([
99
'underscore',
1010
'Magento_Checkout/js/view/payment/default',
1111
'Magento_BraintreeTwo/js/view/payment/adapter',
12-
'Magento_Checkout/js/model/quote'
13-
], function ($, _, Component, Braintree, quote) {
12+
'Magento_Checkout/js/model/quote',
13+
'Magento_Checkout/js/model/full-screen-loader'
14+
], function ($, _, Component, Braintree, quote, fullScreenLoader) {
1415
'use strict';
1516

1617
var checkout;
@@ -35,6 +36,7 @@ define([
3536
*/
3637
onReady: function (integration) {
3738
checkout = integration;
39+
this.enableButton();
3840
},
3941

4042
/**
@@ -160,6 +162,7 @@ define([
160162
checkout.teardown(function () {
161163
checkout = null;
162164
});
165+
this.disableButton();
163166
this.clientConfig.paypal.amount = this.grandTotalAmount;
164167

165168
Braintree.setConfig(this.clientConfig);
@@ -267,6 +270,22 @@ define([
267270
getPaymentAcceptanceMarkSrc: function () {
268271

269272
return window.checkoutConfig.payment[this.getCode()].paymentAcceptanceMarkSrc;
273+
},
274+
275+
/**
276+
* Disable submit button
277+
*/
278+
disableButton: function () {
279+
fullScreenLoader.startLoader();
280+
$('[data-button="place"]').attr('disabled', 'disabled');
281+
},
282+
283+
/**
284+
* Enable submit button
285+
*/
286+
enableButton: function () {
287+
$('[data-button="place"]').removeAttr('disabled');
288+
fullScreenLoader.stopLoader();
270289
}
271290
});
272291
});

app/code/Magento/BraintreeTwo/view/frontend/web/template/payment/paypal.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
</div>
3030
<div class="actions-toolbar">
3131
<div class="primary">
32-
<button data-role="review-save"
32+
<button data-button="place" data-role="review-save"
3333
type="submit"
3434
data-bind="attr: {title: $t('Continue to PayPal')}, enable: (isActive()), click: payWithPayPal"
3535
class="action primary checkout"

app/code/Magento/CatalogRule/Model/CatalogRuleRepository.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Magento\Framework\Exception\NoSuchEntityException;
1010
use Magento\Framework\Exception\CouldNotDeleteException;
1111
use Magento\Framework\Exception\CouldNotSaveException;
12+
use \Magento\Framework\Exception\ValidatorException;
1213

1314
class CatalogRuleRepository implements \Magento\CatalogRule\Api\CatalogRuleRepositoryInterface
1415
{
@@ -51,7 +52,10 @@ public function save(Data\RuleInterface $rule)
5152
try {
5253
$this->ruleResource->save($rule);
5354
unset($this->rules[$rule->getId()]);
54-
} catch (\Exception $e) {
55+
} catch (ValidatorException $e) {
56+
throw new CouldNotSaveException(__($e->getMessage()));
57+
}
58+
catch (\Exception $e) {
5559
throw new CouldNotSaveException(__('Unable to save rule %1', $rule->getRuleId()));
5660
}
5761
return $rule;
@@ -63,7 +67,7 @@ public function save(Data\RuleInterface $rule)
6367
public function get($ruleId)
6468
{
6569
if (!isset($this->rules[$ruleId])) {
66-
/** @var \Magento\CatalogRule\Model\RuleFactory $rule */
70+
/** @var \Magento\CatalogRule\Model\Rule $rule */
6771
$rule = $this->ruleFactory->create();
6872

6973
/* TODO: change to resource model after entity manager will be fixed */
@@ -84,6 +88,8 @@ public function delete(Data\RuleInterface $rule)
8488
try {
8589
$this->ruleResource->delete($rule);
8690
unset($this->rules[$rule->getId()]);
91+
} catch (ValidatorException $e) {
92+
throw new CouldNotSaveException(__($e->getMessage()));
8793
} catch (\Exception $e) {
8894
throw new CouldNotDeleteException(__('Unable to remove rule %1', $rule->getRuleId()));
8995
}

app/code/Magento/CatalogRule/Model/ResourceModel/Rule.php

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -287,28 +287,31 @@ public function save(\Magento\Framework\Model\AbstractModel $object)
287287
}
288288

289289
/**
290-
* Delete the object
291-
*
292-
* @param \Magento\Framework\Model\AbstractModel $object
290+
* @param AbstractModel $object
293291
* @return $this
294292
* @throws \Exception
295293
*/
296-
public function delete(AbstractModel $object)
294+
public function delete(\Magento\Framework\Model\AbstractModel $object)
297295
{
296+
//TODO: add object relation processor support (MAGETWO-49297)
298297
$this->transactionManager->start($this->getConnection());
299298
try {
300299
$object->beforeDelete();
301300
$this->_beforeDelete($object);
302-
$this->entityManager->delete('Magento\CatalogRule\Api\Data\RuleInterface', $object);
301+
$this->entityManager->delete(
302+
'Magento\CatalogRule\Api\Data\RuleInterface',
303+
$object
304+
);
303305
$this->_afterDelete($object);
304306
$object->isDeleted(true);
305307
$object->afterDelete();
306308
$this->transactionManager->commit();
307309
$object->afterDeleteCommit();
308-
} catch (\Exception $exception) {
310+
} catch (\Exception $e) {
309311
$this->transactionManager->rollBack();
310-
throw $exception;
312+
throw $e;
311313
}
314+
312315
return $this;
313316
}
314317
}

app/code/Magento/Cms/Model/Wysiwyg/Config.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
*/
66
namespace Magento\Cms\Model\Wysiwyg;
77

8+
use Magento\Framework\Filesystem;
9+
use Magento\Framework\App\Filesystem\DirectoryList;
810
use Magento\Ui\Component\Wysiwyg\ConfigInterface;
911

1012
/**
@@ -91,6 +93,11 @@ class Config extends \Magento\Framework\DataObject implements ConfigInterface
9193
*/
9294
protected $_storeManager;
9395

96+
/**
97+
* @var Filesystem
98+
*/
99+
protected $filesystem;
100+
94101
/**
95102
* @param \Magento\Backend\Model\UrlInterface $backendUrl
96103
* @param \Magento\Framework\Event\ManagerInterface $eventManager
@@ -100,6 +107,7 @@ class Config extends \Magento\Framework\DataObject implements ConfigInterface
100107
* @param \Magento\Widget\Model\Widget\Config $widgetConfig
101108
* @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
102109
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
110+
* @param Filesystem $filesystem
103111
* @param array $windowSize
104112
* @param array $data
105113
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
@@ -113,6 +121,7 @@ public function __construct(
113121
\Magento\Widget\Model\Widget\Config $widgetConfig,
114122
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
115123
\Magento\Store\Model\StoreManagerInterface $storeManager,
124+
Filesystem $filesystem,
116125
array $windowSize = [],
117126
array $data = []
118127
) {
@@ -125,6 +134,7 @@ public function __construct(
125134
$this->_widgetConfig = $widgetConfig;
126135
$this->_windowSize = $windowSize;
127136
$this->_storeManager = $storeManager;
137+
$this->filesystem = $filesystem;
128138
parent::__construct($data);
129139
}
130140

@@ -157,6 +167,9 @@ public function getConfig($data = [])
157167
'add_widgets' => true,
158168
'no_display' => false,
159169
'encode_directives' => true,
170+
'baseStaticUrl' => $this->_assetRepo->getStaticViewFileContext()->getBaseUrl(),
171+
'baseStaticDefaultUrl' => str_replace('index.php/', '', $this->_backendUrl->getBaseUrl())
172+
. $this->filesystem->getUri(DirectoryList::STATIC_VIEW) . '/',
160173
'directives_url' => $this->_backendUrl->getUrl('cms/wysiwyg/directive'),
161174
'popup_css' => $this->_assetRepo->getUrl(
162175
'mage/adminhtml/wysiwyg/tiny_mce/themes/advanced/skins/default/dialog.css'

0 commit comments

Comments
 (0)