Commit d96c2477 authored by Rais Aryaguna's avatar Rais Aryaguna

fix eslint

parent 71923273
import { Close } from '@mui/icons-material'; import { Close } from '@mui/icons-material';
import { Dialog, DialogContent, DialogTitle, IconButton, Typography } from '@mui/material'; import { Dialog, DialogContent, DialogTitle, IconButton, Typography } from '@mui/material';
import { useState } from 'react'; // import { useState } from 'react';
import { useForm } from 'react-hook-form'; import { useForm } from 'react-hook-form';
import { Field } from 'src/components/hook-form'; import { Field } from 'src/components/hook-form';
import { useAppSelector } from 'src/store'; import { useAppSelector } from 'src/store';
...@@ -24,13 +24,13 @@ export default function DialogPenandatangan({ ...@@ -24,13 +24,13 @@ export default function DialogPenandatangan({
onClose, onClose,
title = 'Penandatangan', title = 'Penandatangan',
}: DialogPenandatanganProps) { }: DialogPenandatanganProps) {
const penandatanganOptions = useAppSelector((state) => state.user.data.signer_npwp); const penandatanganOptions = useAppSelector((state: any) => state.user.data.signer_npwp);
const form = useForm({ const form = useForm({
mode: 'all', mode: 'all',
}); });
const [isCheckedAgreement, setIsCheckedAgreement] = useState(false); // const [isCheckedAgreement, setIsCheckedAgreement] = useState(false);
const handleClose = () => { const handleClose = () => {
form.reset(); form.reset();
...@@ -65,7 +65,7 @@ export default function DialogPenandatangan({ ...@@ -65,7 +65,7 @@ export default function DialogPenandatangan({
<IconButton <IconButton
aria-label="close" aria-label="close"
onClick={handleClose} onClick={handleClose}
sx={(theme) => ({ sx={(theme: any) => ({
position: 'absolute', position: 'absolute',
right: 8, right: 8,
top: 8, top: 8,
......
import Grid from '@mui/material/Grid'; import Grid from '@mui/material/Grid';
import { useState } from 'react'; import { useState } from 'react';
import { useFormContext } from 'react-hook-form'; import { useFormContext } from 'react-hook-form';
import { useParams } from 'react-router'; // import { useParams } from 'react-router';
import { Field } from 'src/components/hook-form'; import { Field } from 'src/components/hook-form';
type IdentitasProps = { type IdentitasProps = {
...@@ -11,7 +11,7 @@ type IdentitasProps = { ...@@ -11,7 +11,7 @@ type IdentitasProps = {
}; };
const Identitas = ({ isPengganti }: IdentitasProps) => { const Identitas = ({ isPengganti }: IdentitasProps) => {
const { dnId } = useParams(); // const { dnId } = useParams();
const { setValue } = useFormContext(); const { setValue } = useFormContext();
const [jumlahKeterangan, setJumlahKeterangan] = useState<number>(0); const [jumlahKeterangan, setJumlahKeterangan] = useState<number>(0);
...@@ -35,16 +35,16 @@ const Identitas = ({ isPengganti }: IdentitasProps) => { ...@@ -35,16 +35,16 @@ const Identitas = ({ isPengganti }: IdentitasProps) => {
return ( return (
<Grid container rowSpacing={2} alignItems="center" columnSpacing={2}> <Grid container rowSpacing={2} alignItems="center" columnSpacing={2}>
<Grid size={{ md: 6 }}> <Grid size={{ md: 6 }}>
<Field.DatePicker name="tglPemotongan" label="Tanggal Pemotongan" /> <Field.DatePicker name="tglPemotongan" label="Tanggal Pemotongan" />
</Grid>
<Grid size={{ md: 3 }}>
<Field.DatePicker name="thnPajak" label="Tahun Pajak" view="year" format="YYYY" />
</Grid>
<Grid size={{ md: 3 }}>
<Field.DatePicker name="msPajak" label="Masa Pajak" view="month" format="MM" />
</Grid>
</Grid> </Grid>
<Grid size={{ md: 3 }}>
<Field.DatePicker name="thnPajak" label="Tahun Pajak" view="year" format="YYYY" />
</Grid>
<Grid size={{ md: 3 }}>
<Field.DatePicker name="msPajak" label="Masa Pajak" view="month" format="MM" />
</Grid>
</Grid>
); );
}; };
......
import React, { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import { enqueueSnackbar } from 'notistack'; import { enqueueSnackbar } from 'notistack';
import DialogUmum from 'src/shared/components/dialog/DialogUmum'; import DialogUmum from 'src/shared/components/dialog/DialogUmum';
import DialogContent from '@mui/material/DialogContent'; import DialogContent from '@mui/material/DialogContent';
......
/* eslint-disable react-hooks/exhaustive-deps */
// import Divider from '@mui/material/Divider'; // import Divider from '@mui/material/Divider';
// import Grid from '@mui/material/Grid'; // import Grid from '@mui/material/Grid';
// import MenuItem from '@mui/material/MenuItem'; // import MenuItem from '@mui/material/MenuItem';
......
...@@ -3,7 +3,7 @@ import { CustomBreadcrumbs } from 'src/components/custom-breadcrumbs'; ...@@ -3,7 +3,7 @@ import { CustomBreadcrumbs } from 'src/components/custom-breadcrumbs';
import { DashboardContent } from 'src/layouts/dashboard'; import { DashboardContent } from 'src/layouts/dashboard';
import { RouterLink } from 'src/routes/components'; import { RouterLink } from 'src/routes/components';
import { paths } from 'src/routes/paths'; import { paths } from 'src/routes/paths';
import React, { useCallback, useEffect, useMemo, useRef, useState, startTransition } from 'react'; import { useCallback, useEffect, useMemo, useRef, useState, startTransition } from 'react';
import { useNavigate } from 'react-router'; import { useNavigate } from 'react-router';
import type { import type {
GridColDef, GridColDef,
...@@ -12,11 +12,9 @@ import type { ...@@ -12,11 +12,9 @@ import type {
GridRowSelectionModel, GridRowSelectionModel,
GridSortModel, GridSortModel,
GridToolbarProps, GridToolbarProps,
GridPaginationModel} from '@mui/x-data-grid-premium'; GridPaginationModel,
import {
DataGridPremium,
useGridApiRef
} from '@mui/x-data-grid-premium'; } from '@mui/x-data-grid-premium';
import { DataGridPremium, useGridApiRef } from '@mui/x-data-grid-premium';
import { unstable_batchedUpdates } from 'react-dom'; import { unstable_batchedUpdates } from 'react-dom';
import { import {
...@@ -105,7 +103,7 @@ export function DnListView() { ...@@ -105,7 +103,7 @@ export function DnListView() {
const [selectionVersion, setSelectionVersion] = useState(0); const [selectionVersion, setSelectionVersion] = useState(0);
const [kodeObjekPajaks, setKodeObjekPajaks] = useState<TKodeObjekPajak[]>([]); const [kodeObjekPajaks, setKodeObjekPajaks] = useState<TKodeObjekPajak[]>([]);
const { data: kodeObjekPajak, isLoading: isLoadingKop } = useGetKodeObjekPajak(); const { data: kodeObjekPajak } = useGetKodeObjekPajak();
const { buildAdvancedFilter, buildRequestParams } = useAdvancedFilter(); const { buildAdvancedFilter, buildRequestParams } = useAdvancedFilter();
...@@ -216,6 +214,7 @@ export function DnListView() { ...@@ -216,6 +214,7 @@ export function DnListView() {
// ---------- 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' },
......
...@@ -64,11 +64,11 @@ const DokumenDipersamakanRekamView = () => { ...@@ -64,11 +64,11 @@ const DokumenDipersamakanRekamView = () => {
defaultValues, defaultValues,
}); });
const { // const {
reset, // reset,
handleSubmit, // handleSubmit,
formState: { isSubmitting }, // formState: { isSubmitting },
} = methods; // } = methods;
const SubmitRekam = () => { const SubmitRekam = () => {
console.log('Submit API'); console.log('Submit API');
...@@ -76,61 +76,58 @@ const DokumenDipersamakanRekamView = () => { ...@@ -76,61 +76,58 @@ const DokumenDipersamakanRekamView = () => {
return ( return (
<DashboardContent> <DashboardContent>
<CustomBreadcrumbs <CustomBreadcrumbs
heading="Add Bupot Unifikasi Non Residen" heading="Add Bupot Unifikasi Non Residen"
links={[ links={[
{ name: 'Dashboard', href: paths.dashboard.root }, { name: 'Dashboard', href: paths.dashboard.root },
{ name: 'e-Bupot Unifikasi Non Residen', href: paths.unifikasi.nr }, { name: 'e-Bupot Unifikasi Non Residen', href: paths.unifikasi.nr },
{ name: 'Add Bupot Unifikasi Non Residen' }, { name: 'Add Bupot Unifikasi Non Residen' },
]} ]}
/> />
<HeadingRekam label="Rekam Data Bukti Potong PPh Non Residen" /> <HeadingRekam label="Rekam Data Bukti Potong PPh Non Residen" />
<Grid container columnSpacing={2} /* container otomatis */> <Grid container columnSpacing={2} /* container otomatis */>
<Grid size={{ xs: isOpenPanduan ? 8 : 11 }}> <Grid size={{ xs: isOpenPanduan ? 8 : 11 }}>
<form onSubmit={methods.handleSubmit(SubmitRekam)}> <form onSubmit={methods.handleSubmit(SubmitRekam)}>
<FormProvider {...methods}> <FormProvider {...methods}>
<Suspense fallback={<FormSkeleton />}>
<Identitas isPengganti />
<Divider />
<Suspense fallback={<FormSkeleton />}> <Suspense fallback={<FormSkeleton />}>
<Identitas isPengganti /> <PphDipotong kodeObjectPajak={data?.data ?? []} />
<Divider /> </Suspense>
<Suspense fallback={<FormSkeleton />}>
<PphDipotong kodeObjectPajak={data?.data ?? []} />
</Suspense>
<Grid size={12}> <Grid size={12}>
<Agreement <Agreement
isCheckedAgreement={isCheckedAgreement} isCheckedAgreement={isCheckedAgreement}
setIsCheckedAgreement={setIsCheckedAgreement} setIsCheckedAgreement={setIsCheckedAgreement}
text="Dengan ini saya menyatakan bahwa Bukti Pemotongan/Pemungutan Unifikasi telah text="Dengan ini saya menyatakan bahwa Bukti Pemotongan/Pemungutan Unifikasi telah
saya isi dengan benar secara elektronik sesuai saya isi dengan benar secara elektronik sesuai
dengan" dengan"
/> />
</Grid> </Grid>
<Stack direction="row" gap={2} justifyContent="end" marginTop={2}> <Stack direction="row" gap={2} justifyContent="end" marginTop={2}>
<LoadingButton <LoadingButton
type="button" type="button"
disabled={!isCheckedAgreement} disabled={!isCheckedAgreement}
// onClick={handleClickUploadSsp} // onClick={handleClickUploadSsp}
// loading={uploadDn.isLoading} // loading={uploadDn.isLoading}
variant="contained" variant="contained"
sx={{ background: '#143B88' }} sx={{ background: '#143B88' }}
> >
Save Save
</LoadingButton> </LoadingButton>
</Stack> </Stack>
</Suspense> </Suspense>
</FormProvider> </FormProvider>
</form> </form>
</Grid> </Grid>
<Grid size={{ xs: isOpenPanduan ? 4 : 1 }}> <Grid size={{ xs: isOpenPanduan ? 4 : 1 }}>
<PanduanDokumenDipersamakanRekam <PanduanDokumenDipersamakanRekam handleOpen={handleOpenPanduan} isOpen={isOpenPanduan} />
handleOpen={handleOpenPanduan}
isOpen={isOpenPanduan}
/>
</Grid>
</Grid> </Grid>
</DashboardContent> </Grid>
</DashboardContent>
); );
}; };
......
import Grid from '@mui/material/Grid'; import Grid from '@mui/material/Grid';
import { useState } from 'react'; import { useState } from 'react';
import { useFormContext } from 'react-hook-form'; import { useFormContext } from 'react-hook-form';
import { useParams } from 'react-router'; // import { useParams } from 'react-router';
import { Field } from 'src/components/hook-form'; import { Field } from 'src/components/hook-form';
type IdentitasProps = { type IdentitasProps = {
...@@ -11,7 +11,7 @@ type IdentitasProps = { ...@@ -11,7 +11,7 @@ type IdentitasProps = {
}; };
const Identitas = ({ isPengganti }: IdentitasProps) => { const Identitas = ({ isPengganti }: IdentitasProps) => {
const { dnId } = useParams(); // const { dnId } = useParams();
const { setValue } = useFormContext(); const { setValue } = useFormContext();
const [jumlahKeterangan, setJumlahKeterangan] = useState<number>(0); const [jumlahKeterangan, setJumlahKeterangan] = useState<number>(0);
...@@ -35,16 +35,16 @@ const Identitas = ({ isPengganti }: IdentitasProps) => { ...@@ -35,16 +35,16 @@ const Identitas = ({ isPengganti }: IdentitasProps) => {
return ( return (
<Grid container rowSpacing={2} alignItems="center" columnSpacing={2}> <Grid container rowSpacing={2} alignItems="center" columnSpacing={2}>
<Grid size={{ md: 6 }}> <Grid size={{ md: 6 }}>
<Field.DatePicker name="tglPemotongan" label="Tanggal Pemotongan" /> <Field.DatePicker name="tglPemotongan" label="Tanggal Pemotongan" />
</Grid>
<Grid size={{ md: 3 }}>
<Field.DatePicker name="thnPajak" label="Tahun Pajak" view="year" format="YYYY" />
</Grid>
<Grid size={{ md: 3 }}>
<Field.DatePicker name="msPajak" label="Masa Pajak" view="month" format="MM" />
</Grid>
</Grid> </Grid>
<Grid size={{ md: 3 }}>
<Field.DatePicker name="thnPajak" label="Tahun Pajak" view="year" format="YYYY" />
</Grid>
<Grid size={{ md: 3 }}>
<Field.DatePicker name="msPajak" label="Masa Pajak" view="month" format="MM" />
</Grid>
</Grid>
); );
}; };
......
...@@ -74,7 +74,7 @@ export function SspListView() { ...@@ -74,7 +74,7 @@ export function SspListView() {
.join(' AND '); .join(' AND ');
}; };
const { data, isLoading, isError } = useGetDn({ const { data, isLoading } = useGetDn({
params: { params: {
Page: paginationModel.page + 1, // API biasanya 1-based Page: paginationModel.page + 1, // API biasanya 1-based
Limit: paginationModel.pageSize, Limit: paginationModel.pageSize,
...@@ -82,7 +82,7 @@ export function SspListView() { ...@@ -82,7 +82,7 @@ export function SspListView() {
sortingMode: sortModel[0]?.field, sortingMode: sortModel[0]?.field,
sortingMethod: sortModel[0]?.sort, sortingMethod: sortModel[0]?.sort,
}, },
refetchOnWindowFocus: false, // refetchOnWindowFocus: false,
}); });
const totalRows = data?.total || 0; const totalRows = data?.total || 0;
......
...@@ -66,7 +66,7 @@ const vswpApi = { ...@@ -66,7 +66,7 @@ const vswpApi = {
const { const {
data: { status, data }, data: { status, data },
status: httpStatus, // status: httpStatus,
} = await dashboardClient.post<TVswpResponse>('/sandbox/vswp/npwp', payload); } = await dashboardClient.post<TVswpResponse>('/sandbox/vswp/npwp', payload);
// ✅ status adalah dari body, bukan httpStatus // ✅ status adalah dari body, bukan httpStatus
...@@ -82,7 +82,7 @@ const vswpApi = { ...@@ -82,7 +82,7 @@ const vswpApi = {
const { const {
data: { status, data }, data: { status, data },
status: httpStatus, // status: httpStatus,
} = await dashboardClient.post<TVswpResponse>('/sandbox/vswp/nik', payload); } = await dashboardClient.post<TVswpResponse>('/sandbox/vswp/nik', payload);
if (status !== 1) { if (status !== 1) {
......
...@@ -88,6 +88,7 @@ const useDialogProgressBar = (): UseDialogProgressBarReturn => { ...@@ -88,6 +88,7 @@ const useDialogProgressBar = (): UseDialogProgressBarReturn => {
useEffect(() => { useEffect(() => {
handleStatus(); handleStatus();
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [numberOfDataProcessed, numberOfData]); }, [numberOfDataProcessed, numberOfData]);
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