Skip to content

Commit a0c061e

Browse files
authored
ENGCOM-5801: Fix #21610 - No loading mask on sitemap, when click on Save #24482
2 parents 7192b1f + 2fee480 commit a0c061e

File tree

3 files changed

+47
-7
lines changed

3 files changed

+47
-7
lines changed

app/code/Magento/Sitemap/Controller/Adminhtml/Sitemap/Edit.php

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,30 @@
66

77
namespace Magento\Sitemap\Controller\Adminhtml\Sitemap;
88

9+
use Magento\Backend\App\Action\Context;
10+
use Magento\Backend\Block\Template;
11+
use Magento\Backend\Model\Session;
912
use Magento\Framework\App\Action\HttpGetActionInterface;
13+
use Magento\Framework\Registry;
14+
use Magento\Sitemap\Controller\Adminhtml\Sitemap;
1015

1116
/**
1217
* Controller class Edit. Responsible for rendering of a sitemap edit page
1318
*/
14-
class Edit extends \Magento\Sitemap\Controller\Adminhtml\Sitemap implements HttpGetActionInterface
19+
class Edit extends Sitemap implements HttpGetActionInterface
1520
{
1621
/**
1722
* Core registry
1823
*
19-
* @var \Magento\Framework\Registry
24+
* @var Registry
2025
*/
21-
protected $_coreRegistry = null;
26+
protected $_coreRegistry;
2227

2328
/**
24-
* @param \Magento\Backend\App\Action\Context $context
25-
* @param \Magento\Framework\Registry $coreRegistry
29+
* @param Context $context
30+
* @param Registry $coreRegistry
2631
*/
27-
public function __construct(\Magento\Backend\App\Action\Context $context, \Magento\Framework\Registry $coreRegistry)
32+
public function __construct(Context $context, Registry $coreRegistry)
2833
{
2934
$this->_coreRegistry = $coreRegistry;
3035
parent::__construct($context);
@@ -53,7 +58,7 @@ public function execute()
5358
}
5459

5560
// 3. Set entered data if was error when we do save
56-
$data = $this->_objectManager->get(\Magento\Backend\Model\Session::class)->getFormData(true);
61+
$data = $this->_objectManager->get(Session::class)->getFormData(true);
5762
if (!empty($data)) {
5863
$model->setData($data);
5964
}
@@ -67,6 +72,8 @@ public function execute()
6772
$id ? __('Edit Sitemap') : __('New Sitemap')
6873
)->_addContent(
6974
$this->_view->getLayout()->createBlock(\Magento\Sitemap\Block\Adminhtml\Edit::class)
75+
)->_addJs(
76+
$this->_view->getLayout()->createBlock(Template::class)->setTemplate('Magento_Sitemap::js.phtml')
7077
);
7178
$this->_view->getPage()->getConfig()->getTitle()->prepend(__('Site Map'));
7279
$this->_view->getPage()->getConfig()->getTitle()->prepend(
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
?>
7+
8+
<script type="text/x-magento-init">
9+
{
10+
"#edit_form": {
11+
"Magento_Sitemap/js/form-submit-loader" : {}
12+
}
13+
}
14+
</script>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* Copyright © Magento, Inc. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
6+
define([
7+
'jquery'
8+
], function ($) {
9+
'use strict';
10+
11+
return function (data, element) {
12+
13+
$(element).on('save', function () {
14+
if ($(this).valid()) {
15+
$('body').trigger('processStart');
16+
}
17+
});
18+
};
19+
});

0 commit comments

Comments
 (0)