mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-31 01:34:09 +02:00
DashboardsController: Perform a full reload when the drop action couldn't be performed successfully
This commit is contained in:
parent
b39f6ad48e
commit
d95c754f85
@ -298,6 +298,7 @@ class DashboardsController extends CompatController
|
||||
}
|
||||
}
|
||||
|
||||
$duplicatedError = false;
|
||||
foreach ($dashboards as $home => $value) {
|
||||
if (! $this->dashboard->hasEntry($home)) {
|
||||
Notification::error(sprintf(t('Dashboard home "%s" not found'), $home));
|
||||
@ -329,6 +330,8 @@ class DashboardsController extends CompatController
|
||||
$pane->getTitle(),
|
||||
$home->getTitle()
|
||||
));
|
||||
|
||||
$duplicatedError = true;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -359,6 +362,8 @@ class DashboardsController extends CompatController
|
||||
$dashlet,
|
||||
$pane->getTitle()
|
||||
));
|
||||
|
||||
$duplicatedError = true;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -374,6 +379,12 @@ class DashboardsController extends CompatController
|
||||
}
|
||||
}
|
||||
|
||||
if ($duplicatedError) {
|
||||
// Even though the drop action couldn't be performed successfully from our server, Sortable JS has
|
||||
// already dropped the draggable element though, so we need to redirect here to undo it.
|
||||
$this->redirectNow(Dashboard::BASE_ROUTE . '/settings');
|
||||
}
|
||||
|
||||
$this->createTabs();
|
||||
$this->dashboard->activate('dashboard_settings');
|
||||
$this->sendMultipartUpdate();
|
||||
@ -426,6 +437,8 @@ class DashboardsController extends CompatController
|
||||
));
|
||||
|
||||
$this->content->getAttributes()->add('class', 'dashboard-manager');
|
||||
$this->controls->getAttributes()->add('class', 'dashboard-manager-controls');
|
||||
|
||||
$this->addContent(new Settings($this->dashboard));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user