From a4fd0c9c6dbf1aa3af1f8127d718732221286687 Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 28 Jun 2021 11:52:57 -0700 Subject: [PATCH 1/3] Fixed #9745 - added searchable, sortable notes field to status labels Signed-off-by: snipe --- app/Http/Controllers/Api/StatuslabelsController.php | 2 +- resources/views/statuslabels/index.blade.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Api/StatuslabelsController.php b/app/Http/Controllers/Api/StatuslabelsController.php index 0e5b6cb53..774fb7001 100644 --- a/app/Http/Controllers/Api/StatuslabelsController.php +++ b/app/Http/Controllers/Api/StatuslabelsController.php @@ -22,7 +22,7 @@ class StatuslabelsController extends Controller public function index(Request $request) { $this->authorize('view', Statuslabel::class); - $allowed_columns = ['id','name','created_at', 'assets_count','color','default_label']; + $allowed_columns = ['id','name','created_at', 'assets_count','color', 'notes','default_label']; $statuslabels = Statuslabel::withCount('assets as assets_count'); diff --git a/resources/views/statuslabels/index.blade.php b/resources/views/statuslabels/index.blade.php index 39c7ce2a1..f69f69cd0 100755 --- a/resources/views/statuslabels/index.blade.php +++ b/resources/views/statuslabels/index.blade.php @@ -53,6 +53,7 @@ {{ trans('admin/statuslabels/table.color') }} {{ trans('admin/statuslabels/table.show_in_nav') }} {{ trans('admin/statuslabels/table.default_label') }} + {{ trans('general.notes') }} {{ trans('table.actions') }} From 19413a63da4743eba189530396cc36c59f756704 Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 28 Jun 2021 11:53:17 -0700 Subject: [PATCH 2/3] Make notes field searchable on status labels Signed-off-by: snipe --- app/Models/Statuslabel.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Models/Statuslabel.php b/app/Models/Statuslabel.php index cd4672b84..fc252af71 100755 --- a/app/Models/Statuslabel.php +++ b/app/Models/Statuslabel.php @@ -41,7 +41,7 @@ class Statuslabel extends SnipeModel * * @var array */ - protected $searchableAttributes = ['name']; + protected $searchableAttributes = ['name', 'notes']; /** * The relations and their attributes that should be included when searching the model. From 30297e479e8f9b66cfb337822915bc5a9ff1bfbd Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 28 Jun 2021 13:08:32 -0700 Subject: [PATCH 3/3] Hide notes field by default Signed-off-by: snipe --- resources/views/statuslabels/index.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/statuslabels/index.blade.php b/resources/views/statuslabels/index.blade.php index f69f69cd0..1590ac3b5 100755 --- a/resources/views/statuslabels/index.blade.php +++ b/resources/views/statuslabels/index.blade.php @@ -53,7 +53,7 @@ {{ trans('admin/statuslabels/table.color') }} {{ trans('admin/statuslabels/table.show_in_nav') }} {{ trans('admin/statuslabels/table.default_label') }} - {{ trans('general.notes') }} + {{ trans('general.notes') }} {{ trans('table.actions') }}