🔧 refactor(inspeksi): gunakan updateOrCreate & perbaikan kode
- Ganti `Inspeksi::create()` → `updateOrCreate()` di PenilaiController (2x) & SurveyorController (1x) dengan kondisi upsert (permohonan_id + dokument_id)
- Tambah logging di SaveFormInspesksiService.php (`Log::info`) untuk debugging & validasi action kosong
- Perbaiki error handling dengan pesan lebih informatif `'Gagal menyimpan data : '.$e->getMessage()`
- Refaktor parsing action memakai array_map & array_filter agar lebih efisien
- Rapikan kode: hapus baris kosong tidak perlu & improve readability
- Perbaiki urutan class CSS di beberapa Blade view (rap-penilai, penilai/index, surveyor/inspeksi)
- Perbaiki XSS di rap-penilai.blade.php dengan `{!! json_encode($dokumen->address ?? '') !!}`
- Tingkatkan integritas database: cegah duplikasi data inspeksi via updateOrCreate()
- Tambah keamanan & maintainability: logging, validasi input, perbaikan format, serta pembersihan kode lama
This commit is contained in:
@@ -5,12 +5,12 @@
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="grid gap-5 mx-auto w-full lg:gap-7.5">
|
||||
|
||||
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10"
|
||||
<div class="min-w-full border card border-agi-100 card-grid" data-datatable="false" data-datatable-page-size="10"
|
||||
data-datatable-state-save="false" id="penilai-table" data-api-url="{{ route('penilai.dataForTables') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<div class="flex-wrap py-5 card-header bg-agi-50">
|
||||
<h3 class="card-title">
|
||||
Penilai
|
||||
</h3>
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm"
|
||||
<table class="table text-sm font-medium text-gray-700 align-middle table-auto table-border"
|
||||
data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -82,13 +82,13 @@
|
||||
</table>
|
||||
</div>
|
||||
<div
|
||||
class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
class="flex-col gap-3 justify-center font-medium text-gray-600 card-footer md:justify-between md:flex-row text-2sm">
|
||||
<div class="flex gap-2 items-center">
|
||||
Show
|
||||
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per
|
||||
<select class="w-16 select select-sm" data-datatable-size="true" name="perpage"> </select> per
|
||||
page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<div class="flex gap-4 items-center">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
@@ -228,7 +228,7 @@
|
||||
status: {
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
return `<span class="badge badge-sm badge-default uppercase flex justify-center">${data.status.replace(/-/g, ' ')}</span>`;
|
||||
return `<span class="flex justify-center uppercase badge badge-sm badge-default">${data.status.replace(/-/g, ' ')}</span>`;
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
@@ -237,14 +237,15 @@
|
||||
if (data.status === 'survey-completed' || data.status === 'proses-laporan' || data
|
||||
.status === 'paparan' || data.status === 'proses-paparan' || data.status ===
|
||||
'paparan' || data.status == 'revisi-laporan' || data.status === 'done' || data
|
||||
.status === 'revisi-paparan' || data.status === 'unfreeze-sla' || data.status === 'reject-freeze') {
|
||||
.status === 'revisi-paparan' || data.status === 'unfreeze-sla' || data.status ===
|
||||
'reject-freeze') {
|
||||
return `
|
||||
<div class="flex flex-nowrap justify-center gap-1.5">
|
||||
<div class="flex flex-nowrap gap-1.5 justify-center">
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-info" href="penilai/${data.id}/show">
|
||||
<i class="ki-outline ki-eye"></i>
|
||||
</a>
|
||||
<button type="button"
|
||||
class="btn btn-sm btn-icon btn-clear btn-warning"
|
||||
class="btn btn-sm btn-icon btn-clear btn-warning"
|
||||
onclick="surveyorFreeze('${data.id}', '${data.nomor_registrasi}', '${data.debiture?.name}')"
|
||||
title="Freeze SLA">
|
||||
<i class="ki-filled ki-arrow-circle-right"></i>
|
||||
@@ -257,13 +258,13 @@
|
||||
<i class="ki-filled ki-watch"></i>
|
||||
</a>
|
||||
</div>`;
|
||||
}else if(data.status === 'freeze'){
|
||||
return ` <div class="flex flex-nowrap justify-center gap-1.5">
|
||||
} else if (data.status === 'freeze') {
|
||||
return ` <div class="flex flex-nowrap gap-1.5 justify-center">
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-info" href="penilai/${data.id}/show">
|
||||
<i class="ki-outline ki-eye"></i>
|
||||
</a>
|
||||
</div>`
|
||||
} else{
|
||||
} else {
|
||||
return `<div class="flex flex-nowrap justify-center">
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-success" onclick="showLoadingSwal('Masih Menunggu proses ...')">
|
||||
<i class="ki-filled ki-watch"></i>
|
||||
|
||||
Reference in New Issue
Block a user