mirror of
https://github.com/inventree/InvenTree.git
synced 2025-12-14 16:29:57 +00:00
refactor (frontend): address code scanning issues (#10935)
* remove unused defs * optimize * revert rename
This commit is contained in:
@@ -52,12 +52,12 @@ export function PrintingActions({
|
|||||||
const [labelId, setLabelId] = useState<number | undefined>(undefined);
|
const [labelId, setLabelId] = useState<number | undefined>(undefined);
|
||||||
const [reportId, setReportId] = useState<number | undefined>(undefined);
|
const [reportId, setReportId] = useState<number | undefined>(undefined);
|
||||||
|
|
||||||
const labelProgress = useDataOutput({
|
useDataOutput({
|
||||||
title: t`Printing Labels`,
|
title: t`Printing Labels`,
|
||||||
id: labelId
|
id: labelId
|
||||||
});
|
});
|
||||||
|
|
||||||
const reportProgress = useDataOutput({
|
useDataOutput({
|
||||||
title: t`Printing Reports`,
|
title: t`Printing Reports`,
|
||||||
id: reportId
|
id: reportId
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ export default function useDataExport({
|
|||||||
|
|
||||||
const [exportId, setExportId] = useState<number | undefined>(undefined);
|
const [exportId, setExportId] = useState<number | undefined>(undefined);
|
||||||
|
|
||||||
const progress = useDataOutput({
|
useDataOutput({
|
||||||
title: t`Exporting Data`,
|
title: t`Exporting Data`,
|
||||||
id: exportId
|
id: exportId
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ export default function useDataOutput({
|
|||||||
} else setLoading(false);
|
} else setLoading(false);
|
||||||
}, [id, title]);
|
}, [id, title]);
|
||||||
|
|
||||||
const progress = useQuery({
|
useQuery({
|
||||||
enabled: !!id && loading && visibility === 'visible',
|
enabled: !!id && loading && visibility === 'visible',
|
||||||
refetchInterval: 500,
|
refetchInterval: 500,
|
||||||
queryKey: ['data-output', id, title],
|
queryKey: ['data-output', id, title],
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ export function useImportSession({
|
|||||||
setInstance(data);
|
setInstance(data);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const importSessionStatus = useStatusCodes({
|
useStatusCodes({
|
||||||
modelType: ModelType.importsession
|
modelType: ModelType.importsession
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -72,11 +72,7 @@ export default function SalesOrderShipmentDetail() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const {
|
const { instance: customer, instanceQuery: customerQuery } = useInstance({
|
||||||
instance: customer,
|
|
||||||
instanceQuery: customerQuery,
|
|
||||||
refreshInstance: refreshCustomer
|
|
||||||
} = useInstance({
|
|
||||||
endpoint: ApiEndpoints.company_list,
|
endpoint: ApiEndpoints.company_list,
|
||||||
pk: shipment.order_detail?.customer,
|
pk: shipment.order_detail?.customer,
|
||||||
hasPrimaryKey: true
|
hasPrimaryKey: true
|
||||||
|
|||||||
@@ -103,9 +103,7 @@ export function MachineDriverTable({
|
|||||||
function MachineTypeDrawer({
|
function MachineTypeDrawer({
|
||||||
machineTypeSlug
|
machineTypeSlug
|
||||||
}: Readonly<{ machineTypeSlug: string }>) {
|
}: Readonly<{ machineTypeSlug: string }>) {
|
||||||
const navigate = useNavigate();
|
const { machineTypes, isFetching } = useMachineTypeDriver({
|
||||||
|
|
||||||
const { machineTypes, refresh, isFetching } = useMachineTypeDriver({
|
|
||||||
includeDrivers: false
|
includeDrivers: false
|
||||||
});
|
});
|
||||||
const machineType = useMemo(
|
const machineType = useMemo(
|
||||||
|
|||||||
Reference in New Issue
Block a user