Skip to content

Commit 2355151

Browse files
committed
Merge remote-tracking branch 'origin/MAGETWO-34653' into MAGETWO-34653
2 parents 1267a66 + aa272bd commit 2355151

File tree

3 files changed

+21
-8
lines changed

3 files changed

+21
-8
lines changed

app/code/Magento/Shipping/view/adminhtml/templates/create/form.phtml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,12 @@
5656
<script>
5757
require([
5858
"jquery",
59+
"Magento_Ui/js/lib/registry/registry",
5960
"mage/mage",
6061
"prototype"
61-
], function(jQuery){
62+
], function(jQuery, registry){
6263

63-
jQuery('body').one('packageInitialized', function(){
64+
registry.get('packaging', function(packaging){
6465
packaging.setConfirmPackagingCallback(function(){
6566
packaging.setParamsCreateLabelRequest($('edit_form').serialize(true));
6667
packaging.sendCreateLabelRequest();

app/code/Magento/Shipping/view/adminhtml/templates/order/packaging/popup.phtml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@ $girthEnabled = $block->isDisplayGirthValue() && $block->isGirthAllowed() ? 1 :
1616
<script>
1717
require([
1818
"jquery",
19+
"Magento_Ui/js/lib/registry/registry",
1920
"prototype",
2021
"Magento_Shipping/order/packaging"
21-
], function(jQuery){
22+
], function(jQuery, registry){
2223

2324
packaging = new Packaging(<?php echo $block->getConfigDataJson() ?>);
2425
packaging.changeContainerType($$('select[name=package_container]')[0]);
2526
packaging.checkSizeAndGirthParameter(
2627
$$('select[name=package_container]')[0],
2728
<?php echo $girthEnabled; ?>
2829
);
29-
30-
jQuery('body').trigger('packageInitialized');
30+
registry.set('packaging', packaging);
3131

3232
});
3333
</script>

dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertStoreCanBeLocalized.php

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Magento\Mtf\Constraint\AbstractConstraint;
1111
use Magento\Backend\Test\Page\Adminhtml\SystemConfig;
1212
use Magento\Cms\Test\Page\CmsIndex;
13+
use Magento\Backend\Test\Page\Adminhtml\AdminCache;
1314

1415
/**
1516
* Assert that store can be localized.
@@ -22,12 +23,18 @@ class AssertStoreCanBeLocalized extends AbstractConstraint
2223
* @param SystemConfig $systemConfig
2324
* @param Store $store
2425
* @param CmsIndex $cmsIndex
26+
* @param AdminCache $adminCache
2527
* @param string $locale
2628
* @param string $welcomeText
27-
* @return void
2829
*/
29-
public function processAssert(SystemConfig $systemConfig, Store $store, CmsIndex $cmsIndex, $locale, $welcomeText)
30-
{
30+
public function processAssert(
31+
SystemConfig $systemConfig,
32+
Store $store,
33+
CmsIndex $cmsIndex,
34+
AdminCache $adminCache,
35+
$locale,
36+
$welcomeText
37+
) {
3138
// Set locale options
3239
$systemConfig->open();
3340
$systemConfig->getPageActions()->selectStore($store->getGroupId() . "/" . $store->getName());
@@ -37,6 +44,11 @@ public function processAssert(SystemConfig $systemConfig, Store $store, CmsIndex
3744
$systemConfig->getPageActions()->save();
3845
$systemConfig->getMessagesBlock()->waitSuccessMessage();
3946

47+
// Flush cache
48+
$adminCache->open();
49+
$adminCache->getActionsBlock()->flushMagentoCache();
50+
$adminCache->getMessagesBlock()->waitSuccessMessage();
51+
4052
// Check presents income text on index page
4153
$cmsIndex->open();
4254
$cmsIndex->getStoreSwitcherBlock()->selectStoreView($store->getName());

0 commit comments

Comments
 (0)