Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
62fe1ce
Perbaiki Tampilan Skema DataSpasial
vickyrolanda Nov 11, 2026
03cc0ae
perbaikan fungsi impor data sektoral dengan lokasi
vickyrolanda Nov 11, 2026
48bf677
list data import dan pembagian hak akses sektor
pandigresik Nov 16, 2026
07a81d5
Merge branch 'rilis-v2611.0.1' into 2510-import-data-list-pk
pandigresik Nov 16, 2026
00dfa39
Merge branch 'rilis-v2611.0.1' into 2510-import-data-list-pk
pandigresik Nov 16, 2026
f41e7fc
Merge branch 'rilis-dev' into 2510-import-data-list-pk
pandigresik Nov 16, 2026
fa0b81f
Halaman "Status Desa": nonaktifkan/aktifkan pengisian Data Spasial pe…
habibie11 Nov 17, 2026
3593329
[ci skip] memutahirkan catatan rilis
vickyrolanda Nov 23, 2026
e7953c9
Merge pull request #1322 from OpenSID/2510-import-data-list-pk
analisopendesa Nov 23, 2026
6f175a3
feat(user): tambahkan reset password pengguna dan batasan akses dasbo…
pandigresik Nov 23, 2026
e9a2468
biarkan beranda kosong
pandigresik Nov 23, 2026
947b07b
Merge branch 'rilis-dev' into status-desa-ds
habibie11 Nov 23, 2026
45914f0
refactor(menu): pindahkan item Dasbor ke menu group dengan gate can
pandigresik Nov 23, 2026
e096491
fix(menu): batasi menu Dasbor ke group administrator, kabupaten, dan …
pandigresik Nov 23, 2026
1fdf006
update catatan rilis
vickyrolanda Nov 23, 2026
ffe8e3f
Merge pull request #1325 from OpenSID/2511-user-password-reset
analisopendesa Nov 23, 2026
fa0a51c
nonaktifkan/aktifkan desa sekaligus
habibie11 Nov 23, 2026
fd65505
fix tombol
habibie11 Nov 23, 2026
a8781fa
Merge branch 'rilis-dev' into status-desa-ds
vickyrolanda Nov 23, 2026
5637155
update catatan rilis
vickyrolanda Nov 23, 2026
deaecc4
Merge pull request #1323 from OpenSID/status-desa-ds
analisopendesa Nov 23, 2026
ca6d9a5
Rilis v2611.0.2
pandigresik Nov 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ specs/
.specify/
storage/sso
.claude/
CLAUDE.md
4 changes: 2 additions & 2 deletions .specify/feature.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"feature_directory": "specs/2507-peta-gabungan-dashboard"
}
"feature_directory": "specs/009-import-data-list"
}
26 changes: 26 additions & 0 deletions app/Enums/Modul.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,20 @@ final class Modul extends Enum
];

const Menu = [
[
'text' => 'Dasbor',
'icon' => 'fa fa-home',
'permission' => 'dasbor',
'can' => 'dasbor-read',
'url' => 'dasbor',
],
[
'text' => 'Dasbor Demografi',
'icon' => 'fa fa-home',
'permission' => 'dasbor-demografi',
'can' => 'dasbor-demografi-read',
'url' => 'dasbor-demografi',
],
[
'text' => 'Profile Kependudukan',
'icon' => 'fa fa-users',
Expand Down Expand Up @@ -301,6 +315,12 @@ final class Modul extends Enum
'url' => 'dataspasial/impor',
'permission' => 'dataspasial-impor',
],
[
'icon' => 'far fa-fw fa-circle',
'text' => 'Daftar Data Hasil Impor',
'url' => 'dataspasial/impor/daftar',
'permission' => 'dataspasial-impor',
],
[
'icon' => 'far fa-fw fa-circle',
'text' => 'Monitoring',
Expand All @@ -313,6 +333,12 @@ final class Modul extends Enum
'url' => 'dataspasial/audit',
'permission' => 'dataspasial-audit',
],
[
'icon' => 'far fa-fw fa-circle',
'text' => 'Status Desa',
'url' => 'dataspasial/desa',
'permission' => 'dataspasial-desa',
],
],
],
[
Expand Down
2 changes: 1 addition & 1 deletion app/Helpers/general.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function csp_nonce()
*/
function openkab_versi()
{
return 'v2611.0.1';
return 'v2611.0.2';
}
}

Expand Down
51 changes: 49 additions & 2 deletions app/Http/Controllers/DataSpasial/AuditDataSpasialController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
use App\Exports\AuditDataSpasialExport;
use App\Http\Requests\DataSpasial\AuditDataRequest;
use App\Services\AuditDataSpasialService;
use App\Services\CakupanPenggunaService;
use App\Services\ConfigApiService;
use App\Services\DataSpasialResult;
use App\Support\KodeWilayah;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Cache;
Expand All @@ -31,10 +33,19 @@ class AuditDataSpasialController extends DataSpasialController
public function __construct(
protected AuditDataSpasialService $audit,
protected ConfigApiService $configApi,
protected CakupanPenggunaService $cakupan,
) {
parent::__construct($this->audit->dataspasial);
}

/**
* Terapkan hak akses sektor & wilayah pengguna pada baris audit (issue #1320).
*/
private function terapkanAkses(Request $request): void
{
$this->audit->setFilterAkses($this->cakupan->filterBaris((int) $request->user()->id));
}

protected function pageTitle(): string
{
return 'Log Entri';
Expand All @@ -53,19 +64,48 @@ protected function fetch(Request $request): DataSpasialResult

public function index(Request $request): View
{
$uid = (int) $request->user()->id;
$sektorAkses = $this->cakupan->sektorAkses($uid);
$sektorList = array_values(array_filter(
$this->daftarSektorTersimpan(),
fn (array $s) => $sektorAkses === null || in_array($s['kode'], $sektorAkses, true),
));
$filterWilayah = $this->cakupan->filterBaris($uid, false);
$desaList = array_values(array_filter(
$this->daftarDesa(),
fn (array $d) => $filterWilayah === null || $filterWilayah($d),
));

// Filter dari URL (mis. ?kode_desa=5102102003) dipilihkan di dropdown; kecamatan diturunkan dari desa.
$kodeDesa = $this->kodeWilayahDariQuery($request, 'kode_desa');
$kodeKecamatan = $this->kodeWilayahDariQuery($request, 'kode_kecamatan') ?? KodeWilayah::kecamatan($kodeDesa);

return view($this->viewName(), [
'title' => $this->pageTitle(),
'result' => $this->fetch($request),
'sektorList' => $this->daftarSektorTersimpan(),
'desaList' => $this->daftarDesa(),
'sektorList' => $sektorList,
'desaList' => $desaList,
'kodeDesaTerpilih' => $kodeDesa ?? '',
'kodeKecamatanTerpilih' => $kodeKecamatan ?? '',
]);
}

/**
* Kode wilayah dari query string bila formatnya angka; selain itu null.
*/
private function kodeWilayahDariQuery(Request $request, string $kunci): ?string
{
$nilai = (string) $request->query($kunci, '');

return preg_match('/^[0-9]{4,10}$/', $nilai) === 1 ? $nilai : null;
}

/**
* Kartu ringkasan + tabel + meta (kontrak `meta.validation` saat 422).
*/
public function data(AuditDataRequest $request): JsonResponse
{
$this->terapkanAkses($request);
$built = $this->audit->buildHalaman($request->validated());

return response()->json([
Expand All @@ -83,6 +123,12 @@ public function detail(Request $request, string $id): JsonResponse
{
$detail = $this->audit->detail($id);

// Entri di luar hak akses diperlakukan seperti tidak ditemukan.
$filter = $this->cakupan->filterBaris((int) $request->user()->id);
if ($detail !== null && $filter !== null && ! $filter($detail)) {
$detail = null;
}

if ($detail === null) {
return response()->json([
'meta' => [
Expand All @@ -106,6 +152,7 @@ public function detail(Request $request, string $id): JsonResponse
*/
public function ekspor(AuditDataRequest $request): BinaryFileResponse|JsonResponse
{
$this->terapkanAkses($request);
$filter = $this->audit->filter($request->validated());
$hasil = $this->audit->barisEkspor($filter);

Expand Down
60 changes: 59 additions & 1 deletion app/Http/Controllers/DataSpasial/DasborDataSpasialController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace App\Http\Controllers\DataSpasial;

use App\Services\CakupanPenggunaService;
use App\Services\DasborDataSpasialService;
use App\Services\DataSpasialApiService;
use App\Services\DataSpasialResult;
Expand All @@ -15,7 +16,8 @@
class DasborDataSpasialController extends DataSpasialController
{
public function __construct(
protected DasborDataSpasialService $dasbor
protected DasborDataSpasialService $dasbor,
protected CakupanPenggunaService $cakupan,
) {
parent::__construct($this->dasbor?->dataspasial ?? app(DataSpasialApiService::class));
}
Expand Down Expand Up @@ -82,6 +84,13 @@ public function index(Request $request): View
], now()->addMinutes(30));
}

// Cache bersifat global; pembatasan sektor diterapkan per pengguna di sini (issue #1320).
$sektorAkses = $this->cakupan->sektorAkses((int) $request->user()->id);
if ($sektorAkses !== null) {
$sektorList = array_values(array_filter($sektorList, fn ($s) => in_array($s['kode'] ?? null, $sektorAkses, true)));
$indikatorBySektor = array_intersect_key($indikatorBySektor, array_flip($sektorAkses));
}

return view($this->viewName(), [
'title' => $this->pageTitle(),
'sektorList' => $sektorList,
Expand All @@ -91,6 +100,11 @@ public function index(Request $request): View

public function data(Request $request): JsonResponse
{
$request = $this->batasiSektor($request);
if ($request === null) {
return response()->json(['success' => false, 'message' => 'Anda tidak memiliki akses ke sektor ini.'], 403);
}

$built = $this->dasbor->buildDashboard($request->all());
$ringkasanResult = $this->dasbor->fetchRingkasan($request->only(['sektor', 'sektor_id', 'periode', 'kode_kabupaten', 'kode_kecamatan', 'kode_desa']));
$unavailable = $ringkasanResult->isUnavailable();
Expand Down Expand Up @@ -123,6 +137,45 @@ public function data(Request $request): JsonResponse
], 200);
}

/**
* Terapkan hak akses pengguna pada permintaan dasbor (issue #1320).
*
* Tanpa pembatasan, permintaan dibiarkan apa adanya.
* - Sektor dibatasi: sektor kosong diisi sektor pertama yang diizinkan; sektor di luar hak akses → null (403).
* - Wilayah dibatasi: filter kabupaten/kecamatan/desa dipaksa sesuai hak akses.
*
* @return Request|null null berarti ditolak (403).
*/
private function batasiSektor(Request $request): ?Request
{
$uid = (int) $request->user()->id;
$sektorAkses = $this->cakupan->sektorAkses($uid);
$wilayah = $this->cakupan->wilayahAkses($uid);

if ($sektorAkses !== null) {
$kode = (string) $request->input('sektor', '');
if ($kode === '' && $request->filled('sektor_id')) {
$kode = (string) ($this->cakupan->kodeSektorDariId((int) $request->input('sektor_id')) ?? '');
if ($kode === '') {
return null; // sektor_id tidak dikenali: tolak, jangan ganti diam-diam
}
}
if ($kode === '') {
$kode = $sektorAkses[0];
}
if (! in_array($kode, $sektorAkses, true)) {
return null;
}
$request->merge(['sektor' => $kode]);
}

if ($wilayah !== null) {
$request->merge($this->cakupan->filterDasbor($wilayah));
}

return $request;
}

/**
* Daftar sektor untuk dropdown filter (kosong bila API tidak tersedia).
*
Expand Down Expand Up @@ -153,6 +206,11 @@ private function daftarSektor(): array

public function ekspor(Request $request): mixed
{
$request = $this->batasiSektor($request);
if ($request === null) {
return response()->json(['success' => false, 'message' => 'Anda tidak memiliki akses ke sektor ini.'], 403);
}

$built = $this->dasbor->buildDashboard($request->all());
$rows = $built['tabel']['rows'] ?? [];
if ($rows === []) {
Expand Down
Loading
Loading