Merge branch 'main' of https://git.probindo.com/Probindo/database-pertani-web
This commit is contained in:
@@ -61,6 +61,8 @@ class KolomBasisDataController extends Controller
|
||||
'relasi_kolom_id' => ['nullable', 'string'],
|
||||
'relasi_kolom_label' => ['nullable', 'string'],
|
||||
'enum_opsi' => ['nullable', 'json'],
|
||||
'is_active' => ['nullable', 'boolean'],
|
||||
'is_browse' => ['nullable', 'boolean'],
|
||||
]);
|
||||
|
||||
if (!empty($validated['enum_opsi'])) {
|
||||
@@ -139,6 +141,8 @@ class KolomBasisDataController extends Controller
|
||||
'relasi_kolom_id' => ['nullable', 'string'],
|
||||
'relasi_kolom_label' => ['nullable', 'string'],
|
||||
'enum_opsi' => ['nullable', 'json'],
|
||||
'is_active' => ['nullable', 'boolean'],
|
||||
'is_browse' => ['nullable', 'boolean'],
|
||||
]);
|
||||
|
||||
$kolom->update([...$validated,
|
||||
|
||||
@@ -44,7 +44,10 @@ class ValueBasisDataController extends Controller
|
||||
if (!$tabel) {
|
||||
abort(404, 'Data tabel tidak ditemukan.');
|
||||
}
|
||||
$kolom = KolomBasisData::where('tabel_id', $tabelId)->get();
|
||||
$kolom = KolomBasisData::where('tabel_id', $tabelId)
|
||||
->where('is_active', true)
|
||||
->where('is_browse', true)
|
||||
->get();
|
||||
if ($kolom->isEmpty()) {
|
||||
abort(404, 'Data kolom tidak ditemukan untuk tabel ini.');
|
||||
}
|
||||
@@ -162,7 +165,8 @@ class ValueBasisDataController extends Controller
|
||||
if (!$tabel) {
|
||||
abort(404, 'Data tabel tidak ditemukan.');
|
||||
}
|
||||
$kolom = KolomBasisData::where('tabel_id', $tabelId)->get();
|
||||
$kolom = KolomBasisData::where('tabel_id', $tabelId)
|
||||
->where('is_active', true)->get();
|
||||
if ($kolom->isEmpty()) {
|
||||
abort(404, 'Data kolom tidak ditemukan untuk tabel ini.');
|
||||
}
|
||||
@@ -210,7 +214,8 @@ class ValueBasisDataController extends Controller
|
||||
if (!$tabel) {
|
||||
abort(404, 'Data tabel tidak ditemukan.');
|
||||
}
|
||||
$kolom = KolomBasisData::where('tabel_id', $tabelId)->get();
|
||||
$kolom = KolomBasisData::where('tabel_id', $tabelId)
|
||||
->where('is_active', true)->get();
|
||||
if ($kolom->isEmpty()) {
|
||||
abort(404, 'Data kolom tidak ditemukan untuk tabel ini.');
|
||||
}
|
||||
@@ -278,7 +283,8 @@ class ValueBasisDataController extends Controller
|
||||
if (!$tabel) {
|
||||
abort(404, 'Data tabel tidak ditemukan.');
|
||||
}
|
||||
$kolom = KolomBasisData::where('tabel_id', $tabelId)->get();
|
||||
$kolom = KolomBasisData::where('tabel_id', $tabelId)
|
||||
->where('is_active', true)->get();
|
||||
if ($kolom->isEmpty()) {
|
||||
abort(404, 'Data kolom tidak ditemukan untuk tabel ini.');
|
||||
}
|
||||
@@ -334,7 +340,8 @@ class ValueBasisDataController extends Controller
|
||||
if (!$tabel) {
|
||||
abort(404, 'Data tabel tidak ditemukan.');
|
||||
}
|
||||
$kolom = KolomBasisData::where('tabel_id', $tabelId)->get();
|
||||
$kolom = KolomBasisData::where('tabel_id', $tabelId)
|
||||
->where('is_active', true)->get();
|
||||
if ($kolom->isEmpty()) {
|
||||
abort(404, 'Data kolom tidak ditemukan untuk tabel ini.');
|
||||
}
|
||||
@@ -396,7 +403,8 @@ class ValueBasisDataController extends Controller
|
||||
if (!$tabel) {
|
||||
abort(404, 'Data tabel tidak ditemukan.');
|
||||
}
|
||||
$kolom = KolomBasisData::where('tabel_id', $tabelId)->get();
|
||||
$kolom = KolomBasisData::where('tabel_id', $tabelId)
|
||||
->where('is_active', true)->get();
|
||||
if ($kolom->isEmpty()) {
|
||||
abort(404, 'Data kolom tidak ditemukan untuk tabel ini.');
|
||||
}
|
||||
|
||||
@@ -26,6 +26,8 @@ class KolomBasisData extends Model
|
||||
'relasi_kolom_id',
|
||||
'relasi_kolom_label',
|
||||
'enum_opsi',
|
||||
'is_active',
|
||||
'is_browse',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('ekosistem_basis_data_kolom', function (Blueprint $table) {
|
||||
$table->boolean('is_active')->default('true');
|
||||
$table->boolean('is_browse')->default('false');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
}
|
||||
};
|
||||
@@ -59,6 +59,28 @@
|
||||
<label class="form-label" for="add-kolom-validasi">Validasi<span class="text-danger">*</span></label>
|
||||
<textarea class="form-control" id="add-kolom-validasi" name="validasi" value="1" placeholder="Cth: required"></textarea>
|
||||
</div>
|
||||
<div class="mb-6 form-control-validation">
|
||||
<label class="switch">
|
||||
<input type="hidden" name="is_active" value="0"/>
|
||||
<input type="checkbox" class="switch-input" name="is_active" checked value="1"/>
|
||||
<span class="switch-toggle-slider">
|
||||
<span class="switch-on"></span>
|
||||
<span class="switch-off"></span>
|
||||
</span>
|
||||
<span class="switch-label">Aktif</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="mb-6 form-control-validation">
|
||||
<label class="switch">
|
||||
<input type="hidden" name="is_browse" value="0"/>
|
||||
<input type="checkbox" class="switch-input" name="is_browse" value="1"/>
|
||||
<span class="switch-toggle-slider">
|
||||
<span class="switch-on"></span>
|
||||
<span class="switch-off"></span>
|
||||
</span>
|
||||
<span class="switch-label">Tampil di Halaman Daftar/List</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-success me-3 data-submit">Simpan</button>
|
||||
<button type="reset" class="btn btn-label-danger" data-bs-dismiss="offcanvas">Batal</button>
|
||||
|
||||
@@ -56,6 +56,28 @@
|
||||
<label class="form-label" for="update-kolom-validasi">Validasi<span class="text-danger">*</span></label>
|
||||
<textarea class="form-control" id="update-kolom-validasi" name="validasi" value="1" placeholder="Cth: required"></textarea>
|
||||
</div>
|
||||
<div class="mb-6 form-control-validation">
|
||||
<label class="switch">
|
||||
<input type="hidden" name="is_active" value="0" />
|
||||
<input type="checkbox" class="switch-input" name="is_active" checked value="1" id="update-kolom-is_active"/>
|
||||
<span class="switch-toggle-slider">
|
||||
<span class="switch-on"></span>
|
||||
<span class="switch-off"></span>
|
||||
</span>
|
||||
<span class="switch-label">Aktif</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="mb-6 form-control-validation">
|
||||
<label class="switch">
|
||||
<input type="hidden" name="is_browse" value="0"/>
|
||||
<input type="checkbox" class="switch-input" name="is_browse" value="1" id="update-kolom-is_browse"/>
|
||||
<span class="switch-toggle-slider">
|
||||
<span class="switch-on"></span>
|
||||
<span class="switch-off"></span>
|
||||
</span>
|
||||
<span class="switch-label">Tampil di Halaman Daftar/List</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-success me-3 data-submit">Simpan</button>
|
||||
<button type="reset" class="btn btn-label-danger" data-bs-dismiss="offcanvas">Batal</button>
|
||||
@@ -107,6 +129,8 @@
|
||||
$('#relasi-form-kolom-update').hide();
|
||||
$('#relasi-form-kolom-label-update').hide();
|
||||
}
|
||||
$('#update-kolom-is_active').prop('checked', res.data.is_active === 1 || res.data.is_active === true);
|
||||
$('#update-kolom-is_browse').prop('checked', res.data.is_browse === 1 || res.data.is_browse === true);
|
||||
offcanvasUpdate.show();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user