Skip to content

Commit

Permalink
Merge pull request #377 from magento-fearless-kiwis/FearlessKiwis-MAG…
Browse files Browse the repository at this point in the history
…ETWO-37032-Port-Braintree

[FearlessKiwis] Port of M1 Braintree V1 code to M2
  • Loading branch information
Tang, Yu(ytang1) committed Jun 20, 2015
2 parents 8599357 + 6f723ff commit 4148723
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,12 @@ protected function _prepareToRender()
*/
protected function _prepareArrayRow(\Magento\Framework\Object $row)
{
$optionExtraAttr = [];
$optionExtraAttr['option_' . $this->_getGroupRenderer()->calcOptionHash($row->getData('customer_group_id'))] =
'selected="selected"';
$row->setData(
'option_extra_attr_' . $this->_getGroupRenderer()->calcOptionHash($row->getData('customer_group_id')),
'selected="selected"'
'option_extra_attrs',
$optionExtraAttr
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ $_colspan = $block->isAddAfter() ? 2 : 1;
templateValues = {
<?php foreach ($block->getColumns() as $columnName => $column): ?>
<?php echo $columnName ?>: '',
'option_extra_attrs': {},
<?php endforeach; ?>
_id: '_' + d.getTime() + '_' + d.getMilliseconds()
};
Expand Down
4 changes: 2 additions & 2 deletions app/code/Magento/Sales/Test/Unit/Model/Order/PaymentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,14 +182,14 @@ function ($value) {

$this->transactionFactory = $this->getMock(
'Magento\Sales\Model\Order\Payment\TransactionFactory',
[],
['create'],
[],
'',
false
);
$this->transactionCollectionFactory = $this->getMock(
'Magento\Sales\Model\Resource\Order\Payment\Transaction\CollectionFactory',
[],
['create'],
[],
'',
false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ protected function _optionToHtml($option, $selected = false)
{
$selectedHtml = $selected ? ' selected="selected"' : '';
if ($this->getIsRenderToJsTemplate() === true) {
$selectedHtml .= ' #{option_extra_attr_' . self::calcOptionHash($option['value']) . '}';
$selectedHtml .= ' <%= option_extra_attrs.option_' . self::calcOptionHash($option['value']) . ' %>';
}

$params = '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,9 @@ public function testGetHtmlJs()
$this->select->setValue($selectedValue);

$result = '<select name="testName" id="testId" class="testClass" title="testTitle" >'
. '<option value="testValue" #{option_extra_attr_4016862802} >testLabel</option>'
. '<option value="selectedValue" selected="selected" #{option_extra_attr_662265145} >selectedLabel</option>'
. '<option value="testValue" <%= option_extra_attrs.option_4016862802 %> >testLabel</option>'
. '<option value="selectedValue" selected="selected" <%= option_extra_attrs.option_662265145 %> >'
. 'selectedLabel</option>'
. '</select>';

$this->select->setIsRenderToJsTemplate(true);
Expand Down

0 comments on commit 4148723

Please sign in to comment.