[Superuser] Perbaikan Halaman Akses Superuser

This commit is contained in:
Ariyutta
2026-11-12 12:22:06 +07:00
parent 2b20537fdb
commit eaad95e8f2
45 changed files with 1062 additions and 110 deletions
@@ -38,6 +38,9 @@ class KurikulumController extends Controller
$programs = $this->overview->programs((int) $request->user()->getKey());
$prodi = $programs->keys()->all();
[$labelTahun, $labelJenjang, $labelProdi] = $page['filters'];
// Bawaan: tahun periode aktif prodi akun (seperti filter periode halaman lain); pilihan lain tetap bisa dipilih.
$years = $this->curriculum->years($prodi);
$defaultYear = $this->curriculum->defaultYear($prodi, $years);
return view('operator.satu.remote-list', [
'page' => $page,
@@ -47,7 +50,7 @@ class KurikulumController extends Controller
'url' => route('operator.kurikulum.data'),
'viewUrl' => route('operator.kurikulum.show', '__ID__'),
'filters' => [
['name' => 'tahun', 'label' => $labelTahun, 'options' => $this->curriculum->years($prodi)->all()],
['name' => 'tahun', 'label' => $labelTahun, 'options' => $years->all(), 'value' => $defaultYear],
['name' => 'jenjang', 'label' => $labelJenjang, 'options' => $this->curriculum->levels($prodi)->all()],
['name' => 'prodi', 'label' => $labelProdi, 'options' => $programs->all()],
],
@@ -166,7 +169,7 @@ class KurikulumController extends Controller
return view('operator.satu.kurikulum-detail', [
'page' => $page,
'crumbs' => ['Beranda' => route('operator.dashboard')] + array_fill_keys(Catalog::trail(self::SLUG), null) + [$page['title'] => route('operator.halaman', self::SLUG), 'Detail' => null],
'crumbs' => ['Beranda' => route(auth()->user()->role->dashboardRoute())] + array_fill_keys(Catalog::trail(self::SLUG), null) + [$page['title'] => route('operator.halaman', self::SLUG), 'Detail' => null],
'kurikulum' => $detail['kurikulum'],
'semesters' => $detail['semesters'],
'back' => route('operator.halaman', self::SLUG),
@@ -176,8 +179,14 @@ class KurikulumController extends Controller
/** @param list<int> $prodi */
private function search(Request $request, array $prodi): LengthAwarePaginator
{
// Tahun: tidak dikirim = bawaan (tahun periode aktif); dikirim kosong = dikosongkan pengguna (semua tahun).
$tahun = preg_match('/^\d{4}$/', (string) $request->string('tahun')) ? (string) $request->string('tahun') : null;
if (! $request->has('tahun')) {
$tahun = $this->curriculum->defaultYear($prodi, $this->curriculum->years($prodi));
}
return $this->curriculum->list($prodi, [
'tahun' => preg_match('/^\d{4}$/', (string) $request->string('tahun')) ? (string) $request->string('tahun') : null,
'tahun' => $tahun,
'jenjang' => preg_match('/^[A-Za-z0-9]{1,6}$/', (string) $request->string('jenjang')) ? (string) $request->string('jenjang') : null,
'prodi' => $request->filled('prodi') && in_array($request->integer('prodi'), $prodi, true) ? $request->integer('prodi') : null,
'q' => $this->query($request),