Lint all the things

This commit is contained in:
Dave
2025-08-19 16:23:29 -04:00
parent f6d6b548be
commit 33fb60ca1a
640 changed files with 2129 additions and 3927 deletions

View File

@@ -1,7 +1,6 @@
import { DeleteFilled, DollarCircleFilled } from "@ant-design/icons";
import { useSplitTreatments } from "@splitsoftware/splitio-react";
import { Button, Checkbox, Form, Input, InputNumber, Select, Space, Switch, Table, Tooltip } from "antd";
import React from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
@@ -16,7 +15,7 @@ const mapStateToProps = createStructuredSelector({
//currentUser: selectCurrentUser
bodyshop: selectBodyshop
});
const mapDispatchToProps = (dispatch) => ({
const mapDispatchToProps = () => ({
//setUserLanguage: language => dispatch(setUserLanguage(language))
});
@@ -27,8 +26,7 @@ export function BillEnterModalLinesComponent({
discount,
form,
responsibilityCenters,
billEdit,
billid
billEdit
}) {
const { t } = useTranslation();
const { setFieldsValue, getFieldsValue, getFieldValue } = form;
@@ -126,7 +124,7 @@ export function BillEnterModalLinesComponent({
]
};
},
formInput: (record, index) => <Input.TextArea disabled={disabled} autoSize />
formInput: () => <Input.TextArea disabled={disabled} autoSize />
},
{
title: t("billlines.fields.quantity"),
@@ -158,7 +156,7 @@ export function BillEnterModalLinesComponent({
]
};
},
formInput: (record, index) => <InputNumber precision={0} min={1} disabled={disabled} />
formInput: () => <InputNumber precision={0} min={1} disabled={disabled} />
},
{
title: t("billlines.fields.actual_price"),
@@ -188,7 +186,7 @@ export function BillEnterModalLinesComponent({
if (idx === index) {
return {
...item,
actual_cost: !!item.actual_cost
actual_cost: item.actual_cost
? item.actual_cost
: Math.round((parseFloat(e.target.value) * (1 - discount) + Number.EPSILON) * 100) / 100
};
@@ -258,7 +256,7 @@ export function BillEnterModalLinesComponent({
<Form.Item shouldUpdate noStyle>
{() => {
const line = getFieldsValue(["billlines"]).billlines[index];
if (!!!line) return null;
if (!line) return null;
let lineDiscount = 1 - line.actual_cost / line.actual_price;
if (isNaN(lineDiscount)) lineDiscount = 0;
return (
@@ -322,7 +320,7 @@ export function BillEnterModalLinesComponent({
]
};
},
formInput: (record, index) => (
formInput: () => (
<Select showSearch style={{ minWidth: "3rem" }} disabled={disabled}>
{bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber
? CiecaSelect(true, false)
@@ -344,7 +342,7 @@ export function BillEnterModalLinesComponent({
name: [field.name, "location"]
};
},
formInput: (record, index) => (
formInput: () => (
<Select disabled={disabled}>
{bodyshop.md_parts_locations.map((loc, idx) => (
<Select.Option key={idx} value={loc}>
@@ -366,7 +364,7 @@ export function BillEnterModalLinesComponent({
name: [field.name, "deductedfromlbr"]
};
},
formInput: (record, index) => <Switch disabled={disabled} />,
formInput: () => <Switch disabled={disabled} />,
additional: (record, index) => (
<Form.Item shouldUpdate noStyle style={{ display: "inline-block" }}>
{() => {
@@ -478,7 +476,7 @@ export function BillEnterModalLinesComponent({
name: [field.name, "applicable_taxes", "federal"]
};
},
formInput: (record, index) => <Switch disabled={disabled} />
formInput: () => <Switch disabled={disabled} />
}
]
}),
@@ -495,7 +493,7 @@ export function BillEnterModalLinesComponent({
name: [field.name, "applicable_taxes", "state"]
};
},
formInput: (record, index) => <Switch disabled={disabled} />
formInput: () => <Switch disabled={disabled} />
},
...InstanceRenderManager({
@@ -513,7 +511,7 @@ export function BillEnterModalLinesComponent({
name: [field.name, "applicable_taxes", "local"]
};
},
formInput: (record, index) => <Switch disabled={disabled} />
formInput: () => <Switch disabled={disabled} />
}
]
}),
@@ -575,7 +573,7 @@ export function BillEnterModalLinesComponent({
}
]}
>
{(fields, { add, remove, move }) => {
{(fields, { add, remove }) => {
return (
<>
<Table
@@ -612,19 +610,7 @@ export function BillEnterModalLinesComponent({
export default connect(mapStateToProps, mapDispatchToProps)(BillEnterModalLinesComponent);
const EditableCell = ({
dataIndex,
title,
inputType,
record,
index,
children,
formInput,
formItemProps,
additional,
wrapper,
...restProps
}) => {
const EditableCell = ({ dataIndex, record, children, formInput, formItemProps, additional, wrapper, ...restProps }) => {
const propsFinal = formItemProps && formItemProps(record);
if (propsFinal && "key" in propsFinal) {
delete propsFinal.key;