Skip to content

Commit

Permalink
Merge pull request #84 from magento-firedrakes/MAGETWO-53988
Browse files Browse the repository at this point in the history
[Firedrakes] Bugfixes
  • Loading branch information
Oleksii Korshenko committed Jun 8, 2016
2 parents 54f4cb7 + 84874ad commit 151726a
Show file tree
Hide file tree
Showing 13 changed files with 57 additions and 10 deletions.
2 changes: 0 additions & 2 deletions app/code/Magento/Checkout/Controller/Index/Index.php
Expand Up @@ -34,8 +34,6 @@ public function execute()

$this->_customerSession->regenerateId();
$this->_objectManager->get('Magento\Checkout\Model\Session')->setCartWasUpdated(false);
$currentUrl = $this->_url->getUrl('*/*/*', ['_secure' => true]);
$this->_objectManager->get('Magento\Customer\Model\Session')->setBeforeAuthUrl($currentUrl);
$this->getOnepage()->initCheckout();
$resultPage = $this->resultPageFactory->create();
$resultPage->getConfig()->getTitle()->set(__('Checkout'));
Expand Down
1 change: 0 additions & 1 deletion app/code/Magento/Sales/Model/Order/AddressRepository.php
Expand Up @@ -91,7 +91,6 @@ public function getList(\Magento\Framework\Api\SearchCriteria $searchCriteria)
$searchResult->addFieldToFilter($filter->getField(), [$condition => $filter->getValue()]);
}
}

$searchResult->setCurPage($searchCriteria->getCurrentPage());
$searchResult->setPageSize($searchCriteria->getPageSize());

Expand Down
Expand Up @@ -99,6 +99,7 @@ public function getList(\Magento\Framework\Api\SearchCriteria $searchCriteria)
$searchResult->addFieldToFilter($filter->getField(), [$condition => $filter->getValue()]);
}
}
$searchResult->setSearchCriteria($searchCriteria);
$searchResult->setCurPage($searchCriteria->getCurrentPage());
$searchResult->setPageSize($searchCriteria->getPageSize());
return $searchResult;
Expand Down
1 change: 1 addition & 0 deletions app/code/Magento/Sales/Model/Order/InvoiceRepository.php
Expand Up @@ -95,6 +95,7 @@ public function getList(\Magento\Framework\Api\SearchCriteria $searchCriteria)
$collection->addFieldToFilter($filter->getField(), [$condition => $filter->getValue()]);
}
}
$collection->setSearchCriteria($searchCriteria);
$collection->setCurPage($searchCriteria->getCurrentPage());
$collection->setPageSize($searchCriteria->getPageSize());
return $collection;
Expand Down
Expand Up @@ -193,6 +193,7 @@ public function getList(\Magento\Framework\Api\SearchCriteria $searchCriteria)
$collection->addFieldToFilter($filter->getField(), [$condition => $filter->getValue()]);
}
}
$collection->setSearchCriteria($searchCriteria);
$collection->setCurPage($searchCriteria->getCurrentPage());
$collection->setPageSize($searchCriteria->getPageSize());
$collection->addPaymentInformation(['method']);
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Sales/Model/Order/ShipmentRepository.php
Expand Up @@ -91,7 +91,7 @@ public function getList(\Magento\Framework\Api\SearchCriteria $searchCriteria)
$searchResult->addFieldToFilter($filter->getField(), [$condition => $filter->getValue()]);
}
}

$searchResult->setSearchCriteria($searchCriteria);
$searchResult->setCurPage($searchCriteria->getCurrentPage());
$searchResult->setPageSize($searchCriteria->getPageSize());

Expand Down
1 change: 1 addition & 0 deletions app/code/Magento/Translation/etc/di.xml
Expand Up @@ -58,6 +58,7 @@
<arguments>
<argument name="patterns" xsi:type="array">
<item name="i18n_translation" xsi:type="string"><![CDATA[~i18n\:\s*(["'])(.*?)(?<!\\)\1~]]></item>
<item name="translate_wrapping" xsi:type="string"><![CDATA[~translate\=("')([^\'].*?)\'\"~]]></item>
<item name="mage_translation_widget" xsi:type="string">~\$\.mage\.__\((?s)[^'"]*?(['"])(.+?)\1(?s).*?\)~</item>
<item name="mage_translation_static" xsi:type="string">~\$t\((?s)[^'"]*?(["'])(.+?)\1(?s).*?\)~</item>
</argument>
Expand Down
32 changes: 30 additions & 2 deletions app/code/Magento/Ui/view/base/web/js/dynamic-rows/dnd.js
Expand Up @@ -58,8 +58,12 @@ define([
recordsCache: [],
draggableElement: {},
draggableElementClass: '_dragged',
elemPositions: [],
listens: {
'${ $.recordsProvider }:elems': 'setCacheRecords'
},
modules: {
parentComponent: '${ $.recordsProvider }'
}
},

Expand Down Expand Up @@ -189,7 +193,9 @@ define([
pageY = isTouchDevice ? event.originalEvent.touches[0].pageY : event.pageY,
positionY = pageY - drEl.eventMousedownY;

drEl.depElement = this.getDepElement(drEl.instance, positionY);
drEl.depElement = this.getDepElement(drEl.instance, positionY, this.draggableElement.originRow);

drEl.instance.remove();

if (drEl.depElement) {
depElementCtx = this.getRecord(drEl.depElement.elem[0]);
Expand All @@ -210,7 +216,6 @@ define([
this.body.unbind('mouseup', this.mouseupHandler);
}

drEl.instance.remove();
this.draggableElement = {};
},

Expand All @@ -224,11 +229,34 @@ define([
setPosition: function (depElem, depElementCtx, dragData) {
var depElemPosition = ~~depElementCtx.position;

this.cacheElementsPosition();

if (dragData.depElement.insert === 'after') {
dragData.instanceCtx.position = depElemPosition + 1;
} else if (dragData.depElement.insert === 'before') {
dragData.instanceCtx.position = depElemPosition;
}

this.normalizePositions();
},

/**
* Saves elements position from current elements
*/
cacheElementsPosition: function () {
this.elemPositions = [];
this.parentComponent().elems.each(function (elem) {
this.elemPositions.push(elem.position);
}, this);
},

/**
* Normalize position, uses start elements position
*/
normalizePositions: function () {
this.parentComponent().elems.each(function (item, index) {
item.position = this.elemPositions[index];
}, this);
},

/**
Expand Down
Expand Up @@ -62,7 +62,8 @@ public function testCreditmemoList()
[
$filterBuilder
->setField('state')
->setValue(\Magento\Sales\Model\Order\Creditmemo::STATE_OPEN)
->setValue((string)\Magento\Sales\Model\Order\Creditmemo::STATE_OPEN)
->setConditionType('eq')
->create(),
]
);
Expand All @@ -85,5 +86,7 @@ public function testCreditmemoList()
// TODO Test fails, due to the inability of the framework API to handle data collection
$this->assertArrayHasKey('items', $result);
$this->assertCount(1, $result['items']);
$this->assertArrayHasKey('search_criteria', $result);
$this->assertEquals($searchData, $result['search_criteria']);
}
}
Expand Up @@ -47,7 +47,8 @@ public function testInvoiceList()
[
$filterBuilder
->setField('state')
->setValue(2)
->setValue((string)\Magento\Sales\Model\Order\Invoice::STATE_PAID)
->setConditionType('eq')
->create(),
]
);
Expand All @@ -70,5 +71,7 @@ public function testInvoiceList()
// TODO Test fails, due to the inability of the framework API to handle data collection
$this->assertArrayHasKey('items', $result);
$this->assertCount(1, $result['items']);
$this->assertArrayHasKey('search_criteria', $result);
$this->assertEquals($searchData, $result['search_criteria']);
}
}
Expand Up @@ -43,7 +43,15 @@ public function testShipmentList()
'Magento\Framework\Api\FilterBuilder'
);

$searchCriteriaBuilder->addFilters([$filterBuilder->setField('shipment_status')->setValue(1)->create()]);
$searchCriteriaBuilder->addFilters(
[
$filterBuilder
->setField('shipment_status')
->setValue((string)\Magento\Sales\Model\Order\Shipment::STATUS_NEW)
->setConditionType('eq')
->create()
]
);
$searchData = $searchCriteriaBuilder->create()->__toArray();

$requestData = ['searchCriteria' => $searchData];
Expand All @@ -63,5 +71,7 @@ public function testShipmentList()
// TODO Test fails, due to the inability of the framework API to handle data collection
$this->assertArrayHasKey('items', $result);
$this->assertCount(1, $result['items']);
$this->assertArrayHasKey('search_criteria', $result);
$this->assertEquals($searchData, $result['search_criteria']);
}
}
Expand Up @@ -141,6 +141,8 @@ public function testTransactionList($filters)
$expectedData = [$transactionData, $childTransactionData];

$this->assertEquals($expectedData, $result['items']);
$this->assertArrayHasKey('search_criteria', $result);
$this->assertEquals($searchData, $result['search_criteria']);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/internal/Magento/Framework/Url.php
Expand Up @@ -232,7 +232,7 @@ protected function _parseUrl($url)
'user' => 'setUser',
'pass' => 'setPassword',
'path' => 'setPath',
'query' => 'setQuery',
'query' => '_setQuery',
'fragment' => 'setFragment',
];

Expand Down

0 comments on commit 151726a

Please sign in to comment.