Don't render the initial modal view over again when autosubmitting the form

This commit is contained in:
Yonas Habteab 2022-04-14 13:47:41 +02:00
parent 737f1d459a
commit b39f6ad48e
2 changed files with 8 additions and 15 deletions

View File

@ -38,10 +38,6 @@ class DashletForm extends SetupNewDashboardForm
protected function assembleNextPageDashboardPart()
{
if (! $this->isUpdatingADashlet() && ! $this->getPopulatedValue('btn_next')) {
return;
}
$requestUrl = Url::fromRequest();
$homes = $this->dashboard->getEntryKeyTitleArr();
@ -127,7 +123,7 @@ class DashletForm extends SetupNewDashboardForm
protected function assemble()
{
if ($this->isUpdatingADashlet() || $this->getPopulatedValue('btn_next')) {
if ($this->isUpdatingADashlet() || $this->getPopulatedValue('btn_next') || $this->hasBeenSent()) {
$this->assembleNextPage();
if ($this->isUpdatingADashlet()) {

View File

@ -49,7 +49,7 @@ class SetupNewDashboardForm extends BaseDashboardForm
*/
protected function dumpArbitaryDashlets(bool $strict = true): void
{
$choosenDashlets = [];
$chosenDashlets = [];
foreach (self::$moduleDashlets as $module => $dashlets) {
/** @var Dashlet $dashlet */
foreach ($dashlets as $dashlet) {
@ -65,19 +65,19 @@ class SetupNewDashboardForm extends BaseDashboardForm
->setTitle($title);
}
$choosenDashlets[$module][$dashlet->getName()] = $dashlet;
$chosenDashlets[$module][$dashlet->getName()] = $dashlet;
}
}
if (isset($choosenDashlets[$module]) && ! $this->duplicateCustomDashlet) {
if (isset($chosenDashlets[$module]) && ! $this->duplicateCustomDashlet) {
$this->duplicateCustomDashlet = array_key_exists(
$this->getPopulatedValue('dashlet'),
$choosenDashlets[$module]
$chosenDashlets[$module]
);
}
}
self::$moduleDashlets = $choosenDashlets;
self::$moduleDashlets = $chosenDashlets;
}
/**
@ -97,11 +97,8 @@ class SetupNewDashboardForm extends BaseDashboardForm
*/
protected function assembleNextPage()
{
if (! $this->isUpdatingADashlet() && ! $this->getPopulatedValue('btn_next')) {
return;
}
$this->dumpArbitaryDashlets();
$strict = $this->isUpdatingADashlet() || $this->getPopulatedValue('btn_next') || ! $this->hasBeenSent();
$this->dumpArbitaryDashlets($strict);
$this->assembleNextPageDashboardPart();
$this->assembleNexPageDashletPart();
}