mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-17 12:35:46 +00:00
[PUI] Switch linting to biome (#8317)
* bump pre-commit * add biome * autofixes * use number functions * fix string usage * use specific variable definition * fix missing translations * reduce alerts * add missing keys * fix index creation * fix more strings * fix types * fix function * add missing keys * fiy array access * fix string functions * do not redefine var * extend exlcusions * reduce unnecessary operators * simplify request * use number functions * fix missing translation * add missing type * fix filter * use newer func * remove unused fragment * fix confusing assigment * pass children as elements * add missing translation * fix imports * fix import * auto-fix problems * add autfix for unused imports * fix SAST error * fix useSelfClosingElements * fix useTemplate * add codespell exception * Update pui_printing.spec.ts * Update pui_printing.spec.ts * add vscode defaults
This commit is contained in:
@ -6,7 +6,10 @@ import { useNavigate, useParams } from 'react-router-dom';
|
||||
|
||||
import PrimaryActionButton from '../../components/buttons/PrimaryActionButton';
|
||||
import { PrintingActions } from '../../components/buttons/PrintingActions';
|
||||
import { DetailsField, DetailsTable } from '../../components/details/Details';
|
||||
import {
|
||||
type DetailsField,
|
||||
DetailsTable
|
||||
} from '../../components/details/Details';
|
||||
import DetailsBadge from '../../components/details/DetailsBadge';
|
||||
import { DetailsImage } from '../../components/details/DetailsImage';
|
||||
import { ItemDetailsGrid } from '../../components/details/ItemDetails';
|
||||
@ -20,7 +23,7 @@ import InstanceDetail from '../../components/nav/InstanceDetail';
|
||||
import { PageDetail } from '../../components/nav/PageDetail';
|
||||
import AttachmentPanel from '../../components/panels/AttachmentPanel';
|
||||
import NotesPanel from '../../components/panels/NotesPanel';
|
||||
import { PanelType } from '../../components/panels/Panel';
|
||||
import type { PanelType } from '../../components/panels/Panel';
|
||||
import { PanelGroup } from '../../components/panels/PanelGroup';
|
||||
import { formatDate } from '../../defaults/formatters';
|
||||
import { ApiEndpoints } from '../../enums/ApiEndpoints';
|
||||
@ -76,7 +79,7 @@ export default function SalesOrderShipmentDetail() {
|
||||
return <Skeleton />;
|
||||
}
|
||||
|
||||
let data: any = {
|
||||
const data: any = {
|
||||
...shipment,
|
||||
customer: customer?.pk,
|
||||
customer_name: customer?.name,
|
||||
@ -84,7 +87,7 @@ export default function SalesOrderShipmentDetail() {
|
||||
};
|
||||
|
||||
// Top Left: Order / customer information
|
||||
let tl: DetailsField[] = [
|
||||
const tl: DetailsField[] = [
|
||||
{
|
||||
type: 'link',
|
||||
model: ModelType.salesorder,
|
||||
@ -126,7 +129,7 @@ export default function SalesOrderShipmentDetail() {
|
||||
];
|
||||
|
||||
// Top right: Shipment information
|
||||
let tr: DetailsField[] = [
|
||||
const tr: DetailsField[] = [
|
||||
{
|
||||
type: 'text',
|
||||
name: 'tracking_number',
|
||||
@ -214,7 +217,7 @@ export default function SalesOrderShipmentDetail() {
|
||||
shipmentId={shipment.pk}
|
||||
showPartInfo
|
||||
allowEdit={isPending}
|
||||
modelField="item"
|
||||
modelField='item'
|
||||
modelTarget={ModelType.stockitem}
|
||||
/>
|
||||
)
|
||||
@ -273,11 +276,22 @@ export default function SalesOrderShipmentDetail() {
|
||||
}
|
||||
|
||||
return [
|
||||
<DetailsBadge label={t`Pending`} color="gray" visible={isPending} />,
|
||||
<DetailsBadge label={t`Shipped`} color="green" visible={!isPending} />,
|
||||
<DetailsBadge
|
||||
key='pending'
|
||||
label={t`Pending`}
|
||||
color='gray'
|
||||
visible={isPending}
|
||||
/>,
|
||||
<DetailsBadge
|
||||
key='shipped'
|
||||
label={t`Shipped`}
|
||||
color='green'
|
||||
visible={!isPending}
|
||||
/>,
|
||||
<DetailsBadge
|
||||
key='delivered'
|
||||
label={t`Delivered`}
|
||||
color="blue"
|
||||
color='blue'
|
||||
visible={!!shipment.delivery_date}
|
||||
/>
|
||||
];
|
||||
@ -290,25 +304,29 @@ export default function SalesOrderShipmentDetail() {
|
||||
|
||||
return [
|
||||
<PrimaryActionButton
|
||||
key='send-shipment'
|
||||
title={t`Send Shipment`}
|
||||
icon="sales_orders"
|
||||
icon='sales_orders'
|
||||
hidden={!isPending}
|
||||
color="green"
|
||||
color='green'
|
||||
onClick={() => {
|
||||
completeShipment.open();
|
||||
}}
|
||||
/>,
|
||||
<BarcodeActionDropdown
|
||||
key='barcode'
|
||||
model={ModelType.salesordershipment}
|
||||
pk={shipment.pk}
|
||||
/>,
|
||||
<PrintingActions
|
||||
key='print'
|
||||
modelType={ModelType.salesordershipment}
|
||||
items={[shipment.pk]}
|
||||
enableLabels
|
||||
enableReports
|
||||
/>,
|
||||
<OptionsActionDropdown
|
||||
key='actions'
|
||||
tooltip={t`Shipment Actions`}
|
||||
actions={[
|
||||
EditItemAction({
|
||||
@ -335,10 +353,10 @@ export default function SalesOrderShipmentDetail() {
|
||||
status={shipmentStatus}
|
||||
loading={shipmentQuery.isFetching || customerQuery.isFetching}
|
||||
>
|
||||
<Stack gap="xs">
|
||||
<Stack gap='xs'>
|
||||
<PageDetail
|
||||
title={t`Sales Order Shipment` + `: ${shipment.reference}`}
|
||||
subtitle={t`Sales Order` + `: ${shipment.order_detail?.reference}`}
|
||||
title={`${t`Sales Order Shipment`}: ${shipment.reference}`}
|
||||
subtitle={`${t`Sales Order`}: ${shipment.order_detail?.reference}`}
|
||||
breadcrumbs={[
|
||||
{ name: t`Sales`, url: '/sales/' },
|
||||
{
|
||||
@ -353,7 +371,7 @@ export default function SalesOrderShipmentDetail() {
|
||||
actions={shipmentActions}
|
||||
/>
|
||||
<PanelGroup
|
||||
pageKey="salesordershipment"
|
||||
pageKey='salesordershipment'
|
||||
panels={shipmentPanels}
|
||||
model={ModelType.salesordershipment}
|
||||
instance={shipment}
|
||||
|
Reference in New Issue
Block a user