From 1c9068cfa99a0edab1d4521c0fbc5ffad9f85e86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Mon, 20 Jun 2022 16:17:38 +0300 Subject: [PATCH 1/3] Skip date column for SearchString --- app/View/Components/SearchString.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/View/Components/SearchString.php b/app/View/Components/SearchString.php index ae524cb70..394bf023e 100644 --- a/app/View/Components/SearchString.php +++ b/app/View/Components/SearchString.php @@ -18,6 +18,11 @@ class SearchString extends Component /** string */ public $model; + public $skip_columns = [ + 'created_at', + 'updated_at', + ]; + /** * Create a new component instance. * @@ -47,7 +52,12 @@ class SearchString extends Component foreach ($columns as $column => $options) { // This column skip for filter - if (!empty($options['searchable'])) { + if (! empty($options['searchable'])) { + continue; + } + + // This column skip for filter + if (in_array($column, $this->skip_columns)) { continue; } From 612e15fb995eb3cccb9d9a19d2773c102f2702a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Duli=C3=A7i?= Date: Mon, 20 Jun 2022 18:38:29 +0300 Subject: [PATCH 2/3] dont detach on soft-delete --- app/Jobs/Common/DeleteCompany.php | 2 -- app/Jobs/Common/DeleteDashboard.php | 2 -- 2 files changed, 4 deletions(-) diff --git a/app/Jobs/Common/DeleteCompany.php b/app/Jobs/Common/DeleteCompany.php index 2a3647ff7..c456b7aad 100644 --- a/app/Jobs/Common/DeleteCompany.php +++ b/app/Jobs/Common/DeleteCompany.php @@ -34,8 +34,6 @@ class DeleteCompany extends Job implements ShouldDelete 'recurring', 'reports', 'settings', 'taxes', 'transactions', 'transfers', 'widgets', ]); - $this->model->users()->detach(); - $this->model->delete(); }); diff --git a/app/Jobs/Common/DeleteDashboard.php b/app/Jobs/Common/DeleteDashboard.php index 67a5d42e5..729582b7c 100644 --- a/app/Jobs/Common/DeleteDashboard.php +++ b/app/Jobs/Common/DeleteDashboard.php @@ -19,8 +19,6 @@ class DeleteDashboard extends Job implements ShouldDelete \DB::transaction(function () { $this->deleteRelationships($this->model, ['widgets']); - $this->model->users()->detach(); - $this->model->delete(); }); From 21cf287998eaf2c7a1b15be090c04eae3ab7a502 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Mon, 20 Jun 2022 18:41:12 +0300 Subject: [PATCH 3/3] Fixed widget and report alias issue.. ( #32baajc ) --- app/Utilities/Reports.php | 2 +- app/Utilities/Widgets.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Utilities/Reports.php b/app/Utilities/Reports.php index 67b0f45fb..05a5dec1f 100644 --- a/app/Utilities/Reports.php +++ b/app/Utilities/Reports.php @@ -54,7 +54,7 @@ class Reports return false; } - if (($model->alias != 'core') && (new static)->moduleIsDisabled($model->alias)) { + if (! empty($model) && ($model->alias != 'core') && (new static)->moduleIsDisabled($model->alias)) { return false; } diff --git a/app/Utilities/Widgets.php b/app/Utilities/Widgets.php index b9a97a7e4..7d2ebc04b 100644 --- a/app/Utilities/Widgets.php +++ b/app/Utilities/Widgets.php @@ -65,7 +65,7 @@ class Widgets $model = Widget::where('dashboard_id', session('dashboard_id'))->where('class', $class_name)->first(); - if (($model->alias != 'core') && (new static)->moduleIsDisabled($model->alias)) { + if (! empty($model) && ($model->alias != 'core') && (new static)->moduleIsDisabled($model->alias)) { return false; }