From 6288651176f9e048e0d01f11a22e8d0c8492ef36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cihan=20=C5=9Eent=C3=BCrk?= <53110792+CihanSenturk@users.noreply.github.com> Date: Wed, 18 Oct 2023 16:47:56 +0300 Subject: [PATCH 1/2] fixed disabled dashboard delete issue --- app/Jobs/Common/DeleteDashboard.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Jobs/Common/DeleteDashboard.php b/app/Jobs/Common/DeleteDashboard.php index 729582b7c..3e4b81f23 100644 --- a/app/Jobs/Common/DeleteDashboard.php +++ b/app/Jobs/Common/DeleteDashboard.php @@ -32,7 +32,7 @@ class DeleteDashboard extends Job implements ShouldDelete { // Can't delete last dashboard for any shared user foreach ($this->model->users as $user) { - if ($user->dashboards()->enabled()->count() > 1) { + if (! $this->model->enabled || $user->dashboards()->enabled()->count() > 1) { continue; } From 69649adad8bf1bccdee6d5757d2bd1b38b279d3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cihan=20=C5=9Eent=C3=BCrk?= <53110792+CihanSenturk@users.noreply.github.com> Date: Wed, 18 Oct 2023 16:49:06 +0300 Subject: [PATCH 2/2] fixed dashboard enabled issue --- app/BulkActions/Common/Dashboards.php | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/app/BulkActions/Common/Dashboards.php b/app/BulkActions/Common/Dashboards.php index fbb288022..e0644d058 100644 --- a/app/BulkActions/Common/Dashboards.php +++ b/app/BulkActions/Common/Dashboards.php @@ -39,19 +39,6 @@ class Dashboards extends BulkAction ], ]; - public function enable($request) - { - $dashboards = $this->getSelectedRecords($request); - - foreach ($dashboards as $dashboard) { - try { - $this->dispatch(new UpdateDashboard($dashboard, $request->merge(['enabled' => 1]))); - } catch (\Exception $e) { - flash($e->getMessage())->error()->important(); - } - } - } - public function disable($request) { $dashboards = $this->getSelectedRecords($request);