feat(qma): add history timesheet unit support submenu in log aktifitas

This commit is contained in:
Ray1111-aa
2026-10-20 21:28:59 +07:00
parent 26e614c407
commit d4b919b54c
4 changed files with 34 additions and 9 deletions
+15 -3
View File
@@ -324,7 +324,7 @@
@if(auth()->user()->canAny(['qma.logs.view', 'qma.p2h.view'])) @if(auth()->user()->canAny(['qma.logs.view', 'qma.p2h.view']))
@php @php
$isActivityRoute = request()->routeIs('qma.activity.log') || request()->routeIs('qma.p2h.index') || request()->routeIs('qma.p2h.show'); $isActivityRoute = request()->routeIs('qma.activity.log') || request()->routeIs('qma.activity.support_timesheet') || request()->routeIs('qma.p2h.index') || request()->routeIs('qma.p2h.show');
@endphp @endphp
<!-- Dropdown Menu: Log Aktifitas --> <!-- Dropdown Menu: Log Aktifitas -->
<div> <div>
@@ -338,13 +338,18 @@
<i id="activityChevronDesktop" class="fa-solid fa-chevron-down text-[11px] transition-transform duration-200 {{ $isActivityRoute ? 'rotate-180 text-[#1b5e20]' : 'text-slate-400 group-hover:text-slate-600' }}"></i> <i id="activityChevronDesktop" class="fa-solid fa-chevron-down text-[11px] transition-transform duration-200 {{ $isActivityRoute ? 'rotate-180 text-[#1b5e20]' : 'text-slate-400 group-hover:text-slate-600' }}"></i>
</button> </button>
<!-- Submenu Dropdown: Timesheet LV & P2H Unit Support (Tanpa Icon) --> <!-- Submenu Dropdown: Timesheet LV, History Timesheet Unit Support & P2H Unit Support (Tanpa Icon) -->
<div id="activitySubmenuDesktop" class="{{ $isActivityRoute ? '' : 'hidden' }} mt-1 pl-7 pr-1 space-y-1"> <div id="activitySubmenuDesktop" class="{{ $isActivityRoute ? '' : 'hidden' }} mt-1 pl-7 pr-1 space-y-1">
@can('qma.logs.view') @can('qma.logs.view')
<a href="{{ route('qma.activity.log') }}" <a href="{{ route('qma.activity.log') }}"
class="block px-3.5 py-2 text-xs rounded-xl transition {{ request()->routeIs('qma.activity.log') ? 'bg-[#1b5e20] text-white font-bold shadow-sm' : 'text-slate-600 hover:text-slate-900 hover:bg-slate-100 font-medium' }}"> class="block px-3.5 py-2 text-xs rounded-xl transition {{ request()->routeIs('qma.activity.log') ? 'bg-[#1b5e20] text-white font-bold shadow-sm' : 'text-slate-600 hover:text-slate-900 hover:bg-slate-100 font-medium' }}">
<span>Timesheet LV</span> <span>Timesheet LV</span>
</a> </a>
<a href="{{ route('qma.activity.support_timesheet') }}"
class="block px-3.5 py-2 text-xs rounded-xl transition {{ request()->routeIs('qma.activity.support_timesheet') ? 'bg-[#1b5e20] text-white font-bold shadow-sm' : 'text-slate-600 hover:text-slate-900 hover:bg-slate-100 font-medium' }}">
<span>History Timesheet Unit Support</span>
</a>
@endcan @endcan
@can('qma.p2h.view') @can('qma.p2h.view')
@@ -654,7 +659,7 @@
@if(auth()->user()->canAny(['qma.logs.view', 'qma.p2h.view'])) @if(auth()->user()->canAny(['qma.logs.view', 'qma.p2h.view']))
@php @php
$isActivityRouteMob = request()->routeIs('qma.activity.log') || request()->routeIs('qma.p2h.index') || request()->routeIs('qma.p2h.show'); $isActivityRouteMob = request()->routeIs('qma.activity.log') || request()->routeIs('qma.activity.support_timesheet') || request()->routeIs('qma.p2h.index') || request()->routeIs('qma.p2h.show');
@endphp @endphp
<div> <div>
<button type="button" <button type="button"
@@ -673,6 +678,11 @@
class="block px-3.5 py-2 text-xs rounded-xl transition {{ request()->routeIs('qma.activity.log') ? 'bg-[#1b5e20] text-white font-bold shadow-sm' : 'text-slate-600 hover:text-slate-900 hover:bg-slate-100 font-medium' }}"> class="block px-3.5 py-2 text-xs rounded-xl transition {{ request()->routeIs('qma.activity.log') ? 'bg-[#1b5e20] text-white font-bold shadow-sm' : 'text-slate-600 hover:text-slate-900 hover:bg-slate-100 font-medium' }}">
<span>Timesheet LV</span> <span>Timesheet LV</span>
</a> </a>
<a href="{{ route('qma.activity.support_timesheet') }}"
class="block px-3.5 py-2 text-xs rounded-xl transition {{ request()->routeIs('qma.activity.support_timesheet') ? 'bg-[#1b5e20] text-white font-bold shadow-sm' : 'text-slate-600 hover:text-slate-900 hover:bg-slate-100 font-medium' }}">
<span>History Timesheet Unit Support</span>
</a>
@endcan @endcan
@can('qma.p2h.view') @can('qma.p2h.view')
@@ -828,6 +838,8 @@
Manajemen Unit Manajemen Unit
@elseif(request()->routeIs('qma.activity.log')) @elseif(request()->routeIs('qma.activity.log'))
Timesheet LV Timesheet LV
@elseif(request()->routeIs('qma.activity.support_timesheet'))
History Timesheet Unit Support
@elseif(request()->routeIs('qma.support_timesheet.*')) @elseif(request()->routeIs('qma.support_timesheet.*'))
Timesheet Unit Support Timesheet Unit Support
@elseif(request()->routeIs('qma.p2h.summary')) @elseif(request()->routeIs('qma.p2h.summary'))
@@ -1,6 +1,6 @@
@extends('layouts.app') @extends('layouts.app')
@section('title', 'Timesheet Unit Support - Admin QMA | PT Kerinci Merangin Hidro') @section('title', (request()->routeIs('qma.activity.support_timesheet') ? 'History Timesheet Unit Support' : 'Timesheet Unit Support') . ' - Admin QMA | PT Kerinci Merangin Hidro')
@section('content') @section('content')
<div class="w-full space-y-6"> <div class="w-full space-y-6">
@@ -14,11 +14,11 @@
</span> </span>
<span class="text-slate-300">&bull;</span> <span class="text-slate-300">&bull;</span>
<span class="text-xs font-semibold text-slate-500"> <span class="text-xs font-semibold text-slate-500">
Log Aktifitas {{ request()->routeIs('qma.activity.support_timesheet') ? 'Log Aktifitas' : 'Operasional Unit' }}
</span> </span>
</div> </div>
<h2 class="text-2xl sm:text-3xl font-extrabold text-slate-900 tracking-tight"> <h2 class="text-2xl sm:text-3xl font-extrabold text-slate-900 tracking-tight">
Timesheet Unit Support {{ request()->routeIs('qma.activity.support_timesheet') ? 'History Timesheet Unit Support' : 'Timesheet Unit Support' }}
</h2> </h2>
<p class="text-xs sm:text-sm text-slate-500 mt-0.5"> <p class="text-xs sm:text-sm text-slate-500 mt-0.5">
Pencatatan jam kerja (HM/KM), penugasan operator, utilisasi shift, serta pemakaian solar alat berat. Pencatatan jam kerja (HM/KM), penugasan operator, utilisasi shift, serta pemakaian solar alat berat.
@@ -127,7 +127,7 @@
<!-- Filter & Pencarian --> <!-- Filter & Pencarian -->
<div class="bg-white p-4 rounded-2xl border border-slate-200/80 shadow-xs space-y-3.5"> <div class="bg-white p-4 rounded-2xl border border-slate-200/80 shadow-xs space-y-3.5">
<form method="GET" action="{{ route('qma.support_timesheet.index') }}" class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-6 gap-2.5 items-center"> <form method="GET" action="{{ url()->current() }}" class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-6 gap-2.5 items-center">
<!-- Tanggal Mulai --> <!-- Tanggal Mulai -->
<div> <div>
@@ -194,7 +194,7 @@
</button> </button>
@if(request()->anyFilled(['start_date', 'end_date', 'vehicle_id', 'operator_id', 'shift', 'status', 'search'])) @if(request()->anyFilled(['start_date', 'end_date', 'vehicle_id', 'operator_id', 'shift', 'status', 'search']))
<a href="{{ route('qma.support_timesheet.index') }}" class="px-3 py-2 rounded-xl text-xs font-semibold text-rose-600 bg-rose-50 border border-rose-200 hover:bg-rose-100 transition whitespace-nowrap" title="Reset Semua Filter"> <a href="{{ url()->current() }}" class="px-3 py-2 rounded-xl text-xs font-semibold text-rose-600 bg-rose-50 border border-rose-200 hover:bg-rose-100 transition whitespace-nowrap" title="Reset Semua Filter">
<i class="fa-solid fa-rotate-left"></i> <i class="fa-solid fa-rotate-left"></i>
</a> </a>
@endif @endif
@@ -394,7 +394,7 @@
<p class="text-xs text-slate-400 mt-1">Gunakan tombol "Catat Timesheet" di atas untuk menambahkan laporan harian.</p> <p class="text-xs text-slate-400 mt-1">Gunakan tombol "Catat Timesheet" di atas untuk menambahkan laporan harian.</p>
@if(request()->anyFilled(['start_date', 'end_date', 'vehicle_id', 'shift', 'search'])) @if(request()->anyFilled(['start_date', 'end_date', 'vehicle_id', 'shift', 'search']))
<div class="mt-4"> <div class="mt-4">
<a href="{{ route('qma.support_timesheet.index') }}" class="inline-flex items-center space-x-1.5 px-3.5 py-2 rounded-xl text-xs font-semibold text-rose-600 bg-rose-50 border border-rose-200 hover:bg-rose-100 transition cursor-pointer"> <a href="{{ url()->current() }}" class="inline-flex items-center space-x-1.5 px-3.5 py-2 rounded-xl text-xs font-semibold text-rose-600 bg-rose-50 border border-rose-200 hover:bg-rose-100 transition cursor-pointer">
<i class="fa-solid fa-rotate-left text-[11px]"></i> <i class="fa-solid fa-rotate-left text-[11px]"></i>
<span>Reset Filter</span> <span>Reset Filter</span>
</a> </a>
+1
View File
@@ -86,6 +86,7 @@ Route::middleware('auth')->group(function () {
Route::post('/vehicles/{id}', [VehicleController::class, 'update'])->name('vehicles.update')->middleware('permission:qma.vehicles.edit'); Route::post('/vehicles/{id}', [VehicleController::class, 'update'])->name('vehicles.update')->middleware('permission:qma.vehicles.edit');
Route::delete('/vehicles/{id}', [VehicleController::class, 'destroy'])->name('vehicles.destroy')->middleware('permission:qma.vehicles.delete'); Route::delete('/vehicles/{id}', [VehicleController::class, 'destroy'])->name('vehicles.destroy')->middleware('permission:qma.vehicles.delete');
Route::get('/activity-log', [ActivityLogController::class, 'index'])->name('activity.log')->middleware('permission:qma.logs.view'); Route::get('/activity-log', [ActivityLogController::class, 'index'])->name('activity.log')->middleware('permission:qma.logs.view');
Route::get('/activity-log/support-timesheet', [SupportTimesheetController::class, 'index'])->name('activity.support_timesheet')->middleware('permission:qma.logs.view');
Route::post('/activity-log/{id}/correct-odometer', [ActivityLogController::class, 'correctOdometer'])->name('activity.correct_odometer')->middleware('permission:qma.logs.edit_odometer'); Route::post('/activity-log/{id}/correct-odometer', [ActivityLogController::class, 'correctOdometer'])->name('activity.correct_odometer')->middleware('permission:qma.logs.edit_odometer');
Route::get('/activity-log/export-excel', [ActivityLogController::class, 'exportExcel'])->name('activity.export_excel')->middleware('permission:qma.logs.view'); Route::get('/activity-log/export-excel', [ActivityLogController::class, 'exportExcel'])->name('activity.export_excel')->middleware('permission:qma.logs.view');
Route::get('/activity-log/export-pdf', [ActivityLogController::class, 'exportPdf'])->name('activity.export_pdf')->middleware('permission:qma.logs.view'); Route::get('/activity-log/export-pdf', [ActivityLogController::class, 'exportPdf'])->name('activity.export_pdf')->middleware('permission:qma.logs.view');
+12
View File
@@ -106,6 +106,18 @@ class QmaSupportTimesheetTest extends TestCase
$response->assertSee('Main Dam'); $response->assertSee('Main Dam');
} }
/**
* Admin QMA dapat mengakses riwayat timesheet melalui rute Log Aktifitas.
*/
public function test_qma_admin_can_view_support_timesheet_history_via_activity_log_route(): void
{
$response = $this->actingAs($this->qmaAdmin)
->get(route('qma.activity.support_timesheet'));
$response->assertStatus(200);
$response->assertSee('History Timesheet Unit Support');
}
/** /**
* Admin QMA dapat menyimpan timesheet baru, yang mengupdate meter unit dan posisi di Manajemen Unit. * Admin QMA dapat menyimpan timesheet baru, yang mengupdate meter unit dan posisi di Manajemen Unit.
*/ */