Merge branch 'fix/daily-checklist' into 'development'

[FIX/FE] Daily Checklist

See merge request mbugroup/lti-web-client!459
This commit is contained in:
Rivaldi A N S
2026-05-04 07:20:16 +00:00
6 changed files with 47 additions and 18 deletions
@@ -89,7 +89,10 @@ export function Dashboard() {
options: kandangOptions,
loadMore: loadMoreKandang,
isLoadingMore: isLoadingMoreKandang,
} = useSelect(DailyChecklistKandangApi.basePath, 'id', 'name');
} = useSelect(DailyChecklistKandangApi.basePath, 'id', 'name', 'search', {
order_by: 'asc',
sort_by: 'name',
});
const handleKandangScroll = (e: React.UIEvent<HTMLDivElement>) => {
const target = e.target as HTMLDivElement;
@@ -110,7 +110,10 @@ export function ListDailyChecklistContent() {
options: kandangOptions,
isLoadingMore: isLoadingMoreKandang,
loadMore: loadMoreKandang,
} = useSelect(DailyChecklistKandangApi.basePath, 'id', 'name');
} = useSelect(DailyChecklistKandangApi.basePath, 'id', 'name', 'search', {
order_by: 'asc',
sort_by: 'name',
});
const checklistList = isResponseSuccess(checklistListRes)
? checklistListRes.data || []
@@ -96,7 +96,10 @@ export function MasterEmployeeContent() {
options: kandangOptions,
loadMore: loadMoreKandang,
isLoadingMore: isLoadingMoreKandang,
} = useSelect(DailyChecklistKandangApi.basePath, 'id', 'name');
} = useSelect(DailyChecklistKandangApi.basePath, 'id', 'name', 'search', {
order_by: 'asc',
sort_by: 'name',
});
const handleKandangScroll = (e: React.UIEvent<HTMLDivElement>) => {
const target = e.target as HTMLDivElement;
@@ -368,7 +368,9 @@ export function MasterKandangContent() {
name='search'
placeholder='Cari kandang...'
value={tableFilterState.search}
onChange={(e) => updateFilter('search', e.target.value)}
onChange={(e) =>
updateFilter('search', e.target.value, true)
}
className={{
wrapper: 'w-full sm:w-[280px] border-gray-200',
inputWrapper: 'px-3 py-2 h-fit rounded-md',
@@ -383,7 +385,11 @@ export function MasterKandangContent() {
<Select
value={tableFilterState.location_id}
onValueChange={(value) =>
updateFilter('location_id', value === 'all' ? '' : value)
updateFilter(
'location_id',
value === 'all' ? '' : value,
true
)
}
>
<SelectTrigger className='w-[180px] border-gray-200'>
@@ -137,6 +137,8 @@ export function DailyChecklistReportsContent() {
} = useSelect(DailyChecklistKandangApi.basePath, 'id', 'name', 'search', {
area_id: tableFilterState.area_id,
location_id: tableFilterState.location_id,
order_by: 'asc',
sort_by: 'name',
});
const handleKandangScroll = (e: React.UIEvent<HTMLDivElement>) => {
@@ -159,17 +161,24 @@ export function DailyChecklistReportsContent() {
}
);
const { options: employeeOptions } = useSelect(
EmployeeApi.basePath,
'id',
'name',
'search',
{
page: '1',
limit: '500',
kandang_id: tableFilterState.kandang_id,
const {
options: employeeOptions,
loadMore: loadMoreEmployee,
isLoadingMore: isLoadingMoreEmployee,
} = useSelect(EmployeeApi.basePath, 'id', 'name', 'search', {
order_by: 'asc',
sort_by: 'name',
kandang_id: tableFilterState.kandang_id,
});
const handleEmployeeScroll = (e: React.UIEvent<HTMLDivElement>) => {
const target = e.target as HTMLDivElement;
if (target.scrollHeight - target.scrollTop <= target.clientHeight + 10) {
if (!isLoadingMoreEmployee) {
loadMoreEmployee();
}
}
);
};
const currentMonthMaxDay = new Date(
Number(tableFilterState.tahun),
@@ -493,7 +502,7 @@ export function DailyChecklistReportsContent() {
>
<SelectValue placeholder='Semua ABK' />
</SelectTrigger>
<SelectContent>
<SelectContent onScroll={handleEmployeeScroll}>
<SelectItem value='ALL'>Semua ABK</SelectItem>
{employeeOptions.map((employee) => (
<SelectItem
@@ -503,6 +512,11 @@ export function DailyChecklistReportsContent() {
{employee.label}
</SelectItem>
))}
{isLoadingMoreEmployee && (
<div className='flex justify-center p-2'>
<Loader2 className='h-4 w-4 animate-spin text-gray-500' />
</div>
)}
</SelectContent>
</Select>
</div>
+2 -2
View File
@@ -5,7 +5,7 @@ import { RequestOptions } from '@/services/http/base';
import { redirectToSSO } from '@/lib/auth-helper';
const BASE_URL = process.env.NEXT_PUBLIC_API_BASE_URL ?? '';
const axiosClient = axios.create({ baseURL: BASE_URL, timeout: 30_000 });
const axiosClient = axios.create({ baseURL: BASE_URL, timeout: 60_000 });
axiosClient.interceptors.response.use(
(response) => response,
@@ -38,7 +38,7 @@ export async function httpClient<T, B = unknown>(
method: opts.method ?? 'GET',
params: opts.query,
data: opts.body,
timeout: opts.timeoutMs ?? 30_000,
timeout: opts.timeoutMs ?? 60_000,
withCredentials: isCookieAuth && !isBearerAuth,
responseType: opts.responseType,
headers: {