Commit 50a1812c authored by Rais Aryaguna's avatar Rais Aryaguna

fix error and warning esLint

parent 2f05b3b9
...@@ -115,13 +115,16 @@ export const paths = { ...@@ -115,13 +115,16 @@ export const paths = {
bulananUbah: (id: string) => `${ROOTS.PPH21}/bulanan/${id}/ubah`, bulananUbah: (id: string) => `${ROOTS.PPH21}/bulanan/${id}/ubah`,
bulananPengganti: (id: string) => `${ROOTS.PPH21}/bulanan/${id}/pengganti`, bulananPengganti: (id: string) => `${ROOTS.PPH21}/bulanan/${id}/pengganti`,
bupotFinal: `${ROOTS.PPH21}/bupot-final`, bupotFinal: `${ROOTS.PPH21}/bupot-final`,
detailsBupotFinal: (id: string) => `${ROOTS.PPH21}/bupot-final/${id}`, bupotFinalRekam: `${ROOTS.PPH21}/bupot-final/rekam`,
tahuan: `${ROOTS.PPH21}/tahunan`, bupotFinalEdit: (id: string, path:string) => `${ROOTS.PPH21}/bupot-final/${id}/${path}`,
detailstahuan: (id: string) => `${ROOTS.PPH21}/tahunan/${id}`, tahunan: `${ROOTS.PPH21}/tahunan`,
tahunanRekam: `${ROOTS.PPH21}/tahunan/rekam`,
bupotTahunanEdit: (id: string, path:string) => `${ROOTS.PPH21}/tahunan/${id}/${path}`,
tahunanA2: `${ROOTS.PPH21}/tahunan-a2`, tahunanA2: `${ROOTS.PPH21}/tahunan-a2`,
detailstahunanA2: (id: string) => `${ROOTS.PPH21}/tahunan-a2/${id}`, detailstahunanA2: (id: string) => `${ROOTS.PPH21}/tahunan-a2/${id}`,
bupot26: `${ROOTS.PPH21}/bupot-26`, bupot26: `${ROOTS.PPH21}/bupot-26`,
detailsbupot26: (id: string) => `${ROOTS.PPH21}/bupot-26/${id}`, bupot26Rekam: `${ROOTS.PPH21}/bupot-26/rekam`,
bupot26Edit: (id: string, path:string) => `${ROOTS.PPH21}/bupot-26/${id}/${path}`,
}, },
faktur: { faktur: {
root: ROOTS.FAKTUR, root: ROOTS.FAKTUR,
......
/* eslint-disable react-hooks/exhaustive-deps */
import { import {
ArticleTwoTone, ArticleTwoTone,
AutorenewTwoTone, AutorenewTwoTone,
...@@ -38,7 +39,7 @@ import ModalCetakPdf from '../components/dialog/ModalCetakPdf'; ...@@ -38,7 +39,7 @@ import ModalCetakPdf from '../components/dialog/ModalCetakPdf';
import ModalDelete from '../components/dialog/ModalDelete'; import ModalDelete from '../components/dialog/ModalDelete';
import ModalUpload from '../components/dialog/ModalUpload'; import ModalUpload from '../components/dialog/ModalUpload';
import StatusChip from '../components/StatusChip'; import StatusChip from '../components/StatusChip';
import { FG_STATUS_DN, KODE_OBJEK_PAJAK, KODE_OBJEK_PAJAK_TEXT } from '../constant'; import { FG_STATUS_DN } from '../constant';
import useAdvancedFilter from '../hooks/useAdvancedFilter'; import useAdvancedFilter from '../hooks/useAdvancedFilter';
import { useGetBupot26 } from '../hooks/useGetBupot26'; import { useGetBupot26 } from '../hooks/useGetBupot26';
import { usePaginationStore } from '../store/paginationStore'; import { usePaginationStore } from '../store/paginationStore';
...@@ -72,13 +73,6 @@ export type IColumnGrid = GridColDef & { ...@@ -72,13 +73,6 @@ export type IColumnGrid = GridColDef & {
valueOptions?: string[]; valueOptions?: string[];
}; };
const kodeObjekPajak = [
{
value: KODE_OBJEK_PAJAK.BUPOT_26,
label: `${KODE_OBJEK_PAJAK.BUPOT_26} : ${KODE_OBJEK_PAJAK_TEXT[KODE_OBJEK_PAJAK.BUPOT_26]}`,
},
];
export function Bupot26ListView() { export function Bupot26ListView() {
const apiRef = useGridApiRef(); const apiRef = useGridApiRef();
const navigate = useNavigate(); const navigate = useNavigate();
...@@ -105,7 +99,6 @@ export function Bupot26ListView() { ...@@ -105,7 +99,6 @@ export function Bupot26ListView() {
const dataSelectedRef = useRef<any[]>([]); const dataSelectedRef = useRef<any[]>([]);
const [selectionVersion, setSelectionVersion] = useState(0); const [selectionVersion, setSelectionVersion] = useState(0);
const [kodeObjekPajaks, setKodeObjekPajaks] = useState<[]>([]);
const [localPagination, setLocalPagination] = useState({ const [localPagination, setLocalPagination] = useState({
page: tables[tableKey]?.page ?? 0, page: tables[tableKey]?.page ?? 0,
pageSize: tables[tableKey]?.pageSize ?? 10, pageSize: tables[tableKey]?.pageSize ?? 10,
...@@ -158,7 +151,7 @@ export function Bupot26ListView() { ...@@ -158,7 +151,7 @@ export function Bupot26ListView() {
if (!isEqual(currentStore, filterModel.items)) { if (!isEqual(currentStore, filterModel.items)) {
setFilter(tableKey, { items: filterModel.items }); setFilter(tableKey, { items: filterModel.items });
} }
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [filterModel]); }, [filterModel]);
const params = useMemo(() => { const params = useMemo(() => {
...@@ -223,7 +216,7 @@ export function Bupot26ListView() { ...@@ -223,7 +216,7 @@ export function Bupot26ListView() {
// ---------- status options and columns (kept identical to your original) ---------- // ---------- status options and columns (kept identical to your original) ----------
type Status = 'draft' | 'normal' | 'cancelled' | 'amended'; type Status = 'draft' | 'normal' | 'cancelled' | 'amended';
type StatusOption = { value: Status; label: string }; type StatusOption = { value: Status; label: string };
// eslint-disable-next-line react-hooks/exhaustive-deps
const statusOptions: StatusOption[] = [ const statusOptions: StatusOption[] = [
{ value: 'draft', label: 'Draft' }, { value: 'draft', label: 'Draft' },
{ value: 'normal', label: 'Normal' }, { value: 'normal', label: 'Normal' },
...@@ -365,7 +358,7 @@ export function Bupot26ListView() { ...@@ -365,7 +358,7 @@ export function Bupot26ListView() {
canReplacement: count === 1 && dataSelected[0].fgStatus === FG_STATUS_DN.NORMAL_DONE, canReplacement: count === 1 && dataSelected[0].fgStatus === FG_STATUS_DN.NORMAL_DONE,
canCancel: hasSelection && allNormal, canCancel: hasSelection && allNormal,
}; };
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [selectionVersion]); }, [selectionVersion]);
// ✅ Handler tombol “Detail” // ✅ Handler tombol “Detail”
...@@ -379,10 +372,6 @@ export function Bupot26ListView() { ...@@ -379,10 +372,6 @@ export function Bupot26ListView() {
console.log('🧾 selectedRow:', selectedRow); console.log('🧾 selectedRow:', selectedRow);
console.log('🧩 Keys:', Object.keys(selectedRow)); console.log('🧩 Keys:', Object.keys(selectedRow));
const kode = selectedRow.kodeObjekPajak || selectedRow.kdObjPjk;
const detailKop = kodeObjekPajaks.find((item: any) => item.value === kode);
console.log(detailKop);
const mergedRow = { const mergedRow = {
...selectedRow, ...selectedRow,
// ...(detailKop // ...(detailKop
...@@ -454,7 +443,7 @@ export function Bupot26ListView() { ...@@ -454,7 +443,7 @@ export function Bupot26ListView() {
}, },
], ],
], ],
// eslint-disable-next-line react-hooks/exhaustive-deps
[validatedActions, refetch, handleEditData] [validatedActions, refetch, handleEditData]
); );
...@@ -485,7 +474,7 @@ export function Bupot26ListView() { ...@@ -485,7 +474,7 @@ export function Bupot26ListView() {
}, 100); }, 100);
// eslint-disable-next-line consistent-return // eslint-disable-next-line consistent-return
return () => clearTimeout(id); return () => clearTimeout(id);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [apiRef, selectionVersion]); }, [apiRef, selectionVersion]);
return ( return (
......
/* eslint-disable react-hooks/exhaustive-deps */
import Box from '@mui/material/Box'; import Box from '@mui/material/Box';
import CircularProgress from '@mui/material/CircularProgress'; import CircularProgress from '@mui/material/CircularProgress';
import DialogContent from '@mui/material/DialogContent'; import DialogContent from '@mui/material/DialogContent';
......
...@@ -2,7 +2,7 @@ import { CalculateRounded } from '@mui/icons-material'; ...@@ -2,7 +2,7 @@ import { CalculateRounded } from '@mui/icons-material';
import { LoadingButton } from '@mui/lab'; import { LoadingButton } from '@mui/lab';
import { Divider, Grid, Stack, Typography } from '@mui/material'; import { Divider, Grid, Stack, Typography } from '@mui/material';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import { memo, useEffect } from 'react'; import { useEffect } from 'react';
import { useFormContext } from 'react-hook-form'; import { useFormContext } from 'react-hook-form';
import { Field } from 'src/components/hook-form'; import { Field } from 'src/components/hook-form';
import { RHFNumeric } from 'src/components/hook-form/rhf-numeric'; import { RHFNumeric } from 'src/components/hook-form/rhf-numeric';
...@@ -19,6 +19,7 @@ import { FORM_FIELDS, FORM_SECTIONS, getFieldNameByIndex, isFieldReadOnly } from ...@@ -19,6 +19,7 @@ import { FORM_FIELDS, FORM_SECTIONS, getFieldNameByIndex, isFieldReadOnly } from
export const FormFieldLabel = ({ export const FormFieldLabel = ({
number, number,
text, text,
// eslint-disable-next-line react/jsx-no-useless-fragment
children = <></>, children = <></>,
}: { }: {
number: number; number: number;
......
/* eslint-disable @typescript-eslint/no-unused-vars */
type FilterItem = { type FilterItem = {
field: string; field: string;
operator: string; operator: string;
......
...@@ -18,7 +18,6 @@ import type { ...@@ -18,7 +18,6 @@ import type {
} from '@mui/x-data-grid-premium'; } from '@mui/x-data-grid-premium';
import { DataGridPremium, useGridApiRef } from '@mui/x-data-grid-premium'; import { DataGridPremium, useGridApiRef } from '@mui/x-data-grid-premium';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import { isEmpty } from 'lodash';
import { enqueueSnackbar } from 'notistack'; import { enqueueSnackbar } from 'notistack';
import { startTransition, useCallback, useEffect, useMemo, useRef, useState } from 'react'; import { startTransition, useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { unstable_batchedUpdates } from 'react-dom'; import { unstable_batchedUpdates } from 'react-dom';
...@@ -270,7 +269,6 @@ export function TahunanA1ListView() { ...@@ -270,7 +269,6 @@ export function TahunanA1ListView() {
const [rowSelectionModel, setRowSelectionModel] = useState<GridRowSelectionModel | undefined>( const [rowSelectionModel, setRowSelectionModel] = useState<GridRowSelectionModel | undefined>(
undefined undefined
); );
const [selectionVersion, setSelectionVersion] = useState(0);
const [modals, setModals] = useState({ const [modals, setModals] = useState({
delete: false, delete: false,
...@@ -393,7 +391,6 @@ export function TahunanA1ListView() { ...@@ -393,7 +391,6 @@ export function TahunanA1ListView() {
unstable_batchedUpdates(() => { unstable_batchedUpdates(() => {
dataSelectedRef.current = selectedData; dataSelectedRef.current = selectedData;
setRowSelectionModel(newSelection); setRowSelectionModel(newSelection);
setSelectionVersion((v) => v + 1);
}); });
}, 150); }, 150);
...@@ -409,7 +406,6 @@ export function TahunanA1ListView() { ...@@ -409,7 +406,6 @@ export function TahunanA1ListView() {
const updatedSelected = ids.map((id) => api.getRow(id)).filter(Boolean); const updatedSelected = ids.map((id) => api.getRow(id)).filter(Boolean);
dataSelectedRef.current = updatedSelected; dataSelectedRef.current = updatedSelected;
setSelectionVersion((v) => v + 1);
}; };
if ((window as any).requestIdleCallback) { if ((window as any).requestIdleCallback) {
......
...@@ -25,7 +25,6 @@ import { ...@@ -25,7 +25,6 @@ import {
PTKP_TEXT, PTKP_TEXT,
PTKP_TITLE, PTKP_TITLE,
SETAHUN, SETAHUN,
SETAHUN_TEXT,
} from 'src/sections/bupot-21-26/constant'; } from 'src/sections/bupot-21-26/constant';
import Agreement from 'src/shared/components/agreement/Agreement'; import Agreement from 'src/shared/components/agreement/Agreement';
import HeadingRekam from 'src/shared/components/HeadingRekam'; import HeadingRekam from 'src/shared/components/HeadingRekam';
......
/* eslint-disable react-hooks/exhaustive-deps */
import Box from '@mui/material/Box'; import Box from '@mui/material/Box';
import CircularProgress from '@mui/material/CircularProgress'; import CircularProgress from '@mui/material/CircularProgress';
import DialogContent from '@mui/material/DialogContent'; import DialogContent from '@mui/material/DialogContent';
......
...@@ -54,6 +54,7 @@ export function useAdvancedFilter() { ...@@ -54,6 +54,7 @@ export function useAdvancedFilter() {
const digits = String(value).replace(/[^0-9]/g, ''); const digits = String(value).replace(/[^0-9]/g, '');
if (digits.length >= 8) return digits.slice(0, 8); if (digits.length >= 8) return digits.slice(0, 8);
return digits; return digits;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
} catch (error) { } catch (error) {
console.warn('Invalid date format:', value); console.warn('Invalid date format:', value);
return ''; return '';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment