mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2026-05-28 04:34:08 -04:00
MoveNodeForm: Instruct JS to refresh the target container
instead of letting JS refresh it on its own
This commit is contained in:
parent
926ac14bd9
commit
8b2bac4e85
3 changed files with 14 additions and 11 deletions
|
|
@ -263,7 +263,14 @@ class ProcessController extends Controller
|
|||
->setSimulation(Simulation::fromSession($this->session()))
|
||||
->handleRequest();
|
||||
} elseif ($action === 'move') {
|
||||
$successUrl = $this->url()->without(['action', 'movenode']);
|
||||
if ($this->params->get('mode') === 'tree') {
|
||||
// If the user moves a node from a subtree, the `node` param exists
|
||||
$successUrl->getParams()->remove('node');
|
||||
}
|
||||
|
||||
$form = $this->loadForm('MoveNode')
|
||||
->setSuccessUrl($successUrl)
|
||||
->setProcess($bp)
|
||||
->setParentNode($node)
|
||||
->setSession($this->session())
|
||||
|
|
|
|||
|
|
@ -171,7 +171,11 @@ class MoveNodeForm extends QuickForm
|
|||
$this->notifySuccess($this->getSuccessMessage($this->translate('Node order updated')));
|
||||
|
||||
$response = $this->getRequest()->getResponse()
|
||||
->setHeader('X-Icinga-Container', 'ignore');
|
||||
->setHeader('X-Icinga-Container', 'ignore')
|
||||
->setHeader('X-Icinga-Extra-Updates', implode(';', [
|
||||
$this->getRequest()->getHeader('X-Icinga-Container'),
|
||||
$this->getSuccessUrl()->getAbsoluteUrl()
|
||||
]));
|
||||
|
||||
Session::getSession()->write();
|
||||
$response->sendResponse();
|
||||
|
|
|
|||
|
|
@ -122,11 +122,7 @@
|
|||
].join('&');
|
||||
|
||||
var $container = $source.closest('.container');
|
||||
var req = icinga.loader.loadUrl(actionUrl, $container, data, 'POST');
|
||||
req.always(function() {
|
||||
icinga.loader.loadUrl(
|
||||
$container.data('icingaUrl'), $container, undefined, undefined, undefined, true);
|
||||
});
|
||||
icinga.loader.loadUrl(actionUrl, $container, data, 'POST');
|
||||
}
|
||||
},
|
||||
|
||||
|
|
@ -159,11 +155,7 @@
|
|||
].join('&');
|
||||
|
||||
var $container = $target.closest('.container');
|
||||
var req = icinga.loader.loadUrl(actionUrl, $container, data, 'POST');
|
||||
req.always(function() {
|
||||
icinga.loader.loadUrl(
|
||||
$container.data('icingaUrl'), $container, undefined, undefined, undefined, true);
|
||||
});
|
||||
icinga.loader.loadUrl(actionUrl, $container, data, 'POST');
|
||||
event.stopPropagation();
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue