Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 catatan_rilis.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Di rilis ini, versi 2601.0.0 berisi penambahan dan perbaikan yang diminta penggu
8. [#907](https://github.com/OpenSID/OpenKab/issues/907) Penambahan fitur expor excel pada data presisi pendidikan.
9. [#906](https://github.com/OpenSID/OpenKab/issues/906) Penambahan expor excel pada data presisi pangan.
10. [#916](https://github.com/OpenSID/OpenKab/issues/916) Penambahan expor excel pada data presisi ketenagakerjaan.
11. [#908](https://github.com/OpenSID/OpenKab/issues/908) Penambahan expor excel pada data presisi seni budaya.

#### Perbaikan BUG

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,17 @@
<div class="card card-outline card-primary">
<div class="card-header">
<div class="row">
<div class="col-sm-2">
<select id="filter-tahun" class="form-control form-control-sm">
@php
$currentYear = date('Y');
$startYear = 2020;
@endphp
@for($year = $currentYear; $year >= $startYear; $year--)
<option value="{{ $year }}" {{ $year == $currentYear ? 'selected' : '' }}>{{ $year }}</option>
@endfor
</select>
</div>
<div class="col-sm-3">
<button id="cetak" type="button" class="btn btn-primary btn-sm" data-url="">
<i class="fa fa-print"></i> Cetak
</button>
<x-filter-tahun />
<div class="col-auto">
<x-print-button :print-url="url('data-presisi/seni-budaya/cetak')" table-id="table-seni-budaya" :filter="[]" />
</div>
<x-excel-download-button :download-url="config('app.databaseGabunganUrl') . '/api/v1/data-presisi/seni-budaya/rtm/download'" table-id="table-seni-budaya" filename="data_presisi_seni-budaya" />

</div>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-striped" id="table-kesehatan">
<table class="table table-striped" id="table-seni-budaya">
<thead>
<tr>
<th>Aksi</th>
Expand Down Expand Up @@ -80,7 +70,7 @@
url.searchParams.set("kode_kecamatan", "{{ session('kecamatan.kode_kecamatan') ?? '' }}");
url.searchParams.set("kode_desa", "{{ session('desa.id') ?? '' }}");

var dtks = $('#table-kesehatan').DataTable({
var dtks = $('#table-seni-budaya').DataTable({
processing: true,
serverSide: true,
autoWidth: false,
Expand Down Expand Up @@ -225,13 +215,6 @@ function format(data) {
data_grafik = [];
grafikPie();
});

$('#cetak').on('click', function() {
let baseUrl = "{{ route('data-pokok.data-presisi-seni-budaya.cetak') }}";
let params = dtks.ajax.params(); // Get DataTables params
let queryString = new URLSearchParams(params).toString(); // Convert params to query string
window.open(`${baseUrl}?${queryString}`, '_blank'); // Open the URL with appended query
});
});
</script>
@endsection
58 changes: 58 additions & 0 deletions tests/Feature/DataPresisiSeniBudayaExcelDownloadTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?php

namespace Tests\Feature;

use Tests\BaseTestCase;

class DataPresisiSeniBudayaExcelDownloadTest extends BaseTestCase
{
/** @test */
public function test_excel_download_button_exists_in_seni_budaya_page()
{
$response = $this->get('/data-presisi/seni-budaya');

if ($response->status() !== 200) {
$this->markTestSkipped('Page /data-presisi/seni-budaya not accessible (status: ' . $response->status() . ')');
return;
}

$content = $response->getContent();

// Test komponen excel-download-button ada di halaman (setelah render menjadi button dengan data attributes)
$this->assertStringContainsString('data-download-url', $content);
$this->assertStringContainsString('table-seni-budaya', $content);
$this->assertStringContainsString('/api/v1/data-presisi/seni-budaya/rtm/download', $content);
}

/** @test */
public function test_seni_budaya_page_has_filter_tahun()
{
$response = $this->get('/data-presisi/seni-budaya');

if ($response->status() !== 200) {
$this->markTestSkipped('Page not accessible');
return;
}

$content = $response->getContent();

// Test filter-tahun ada di halaman
$this->assertStringContainsString('filter-tahun', $content);
}

/** @test */
public function test_seni_budaya_page_has_print_button()
{
$response = $this->get('/data-presisi/seni-budaya');

if ($response->status() !== 200) {
$this->markTestSkipped('Page not accessible');
return;
}

$content = $response->getContent();

// Test print button ada di halaman
$this->assertStringContainsString('data-presisi/seni-budaya/cetak', $content);
}
}