Skip to content

Commit 9ba7e7a

Browse files
authored
Merge pull request #9761 from snipe/features/9745_add_notes_to_statuslabels
Added #9745 - adds searchable, sortable notes to statuslabels index
2 parents 6521f16 + 30297e4 commit 9ba7e7a

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

app/Http/Controllers/Api/StatuslabelsController.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class StatuslabelsController extends Controller
2222
public function index(Request $request)
2323
{
2424
$this->authorize('view', Statuslabel::class);
25-
$allowed_columns = ['id','name','created_at', 'assets_count','color','default_label'];
25+
$allowed_columns = ['id','name','created_at', 'assets_count','color', 'notes','default_label'];
2626

2727
$statuslabels = Statuslabel::withCount('assets as assets_count');
2828

app/Models/Statuslabel.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class Statuslabel extends SnipeModel
4141
*
4242
* @var array
4343
*/
44-
protected $searchableAttributes = ['name'];
44+
protected $searchableAttributes = ['name', 'notes'];
4545

4646
/**
4747
* The relations and their attributes that should be included when searching the model.

resources/views/statuslabels/index.blade.php

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ class="table table-striped snipe-table"
5353
<th data-sortable="true" data-field="color" data-formatter="colorSqFormatter">{{ trans('admin/statuslabels/table.color') }}</th>
5454
<th class="text-center" data-sortable="true" data-field="show_in_nav" data-formatter="trueFalseFormatter">{{ trans('admin/statuslabels/table.show_in_nav') }}</th>
5555
<th class="text-center" data-sortable="true" data-field="default_label" data-formatter="trueFalseFormatter">{{ trans('admin/statuslabels/table.default_label') }}</th>
56+
<th data-sortable="true" data-field="notes" data-visible="false">{{ trans('general.notes') }}</th>
5657
<th data-formatter="statuslabelsActionsFormatter" data-searchable="false" data-sortable="false" data-field="actions">{{ trans('table.actions') }}</th>
5758
</tr>
5859
</thead>

0 commit comments

Comments
 (0)