feat(penilai): tambahkan kolom dan fungsionalitas status
- Menambahkan kolom 'Status' pada tabel di halaman index penilai. - Mengimplementasikan render untuk menampilkan status dengan format badge. - Mengubah urutan default query menjadi berdasarkan 'updated_at' jika tidak ada parameter sort yang diberikan.
This commit is contained in:
@@ -389,6 +389,8 @@ class PenilaiController extends Controller
|
||||
$order = $request->get('sortOrder');
|
||||
$column = $request->get('sortField');
|
||||
$query->orderBy($column, $order);
|
||||
} else {
|
||||
$query->orderBy('updated_at','DESC');
|
||||
}
|
||||
|
||||
// Get the total count of records
|
||||
|
||||
@@ -68,6 +68,10 @@
|
||||
<span class="sort"> <span class="sort-label"> Due Date SLA </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="status">
|
||||
<span class="sort"> <span class="sort-label"> Status</span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -178,6 +182,12 @@
|
||||
return `${formatDate(new Date(data.created_at))}`;
|
||||
},
|
||||
},
|
||||
status: {
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
return `<span class="badge badge-sm badge-default uppercase flex justify-center">${data.status.replace(/-/g, ' ')}</span>`;
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
title: 'Action',
|
||||
render: (item, data) => {
|
||||
|
||||
Reference in New Issue
Block a user