Lint all the things
This commit is contained in:
@@ -3,23 +3,19 @@ import { useQuery } from "@apollo/client";
|
||||
import { Button, Card, Checkbox, Input, Space, Table, Typography } from "antd";
|
||||
import _ from "lodash";
|
||||
import queryString from "query-string";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
import { Link, useLocation, useNavigate } from "react-router-dom";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import AlertComponent from "../../components/alert/alert.component";
|
||||
import { QUERY_EXPORT_LOG_PAGINATED } from "../../graphql/accounting.queries";
|
||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
import { DateTimeFormatter } from "../../utils/DateFormatter";
|
||||
import { pageLimit } from "../../utils/config";
|
||||
import { alphaSort, dateSort } from "./../../utils/sorters";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
bodyshop: selectBodyshop
|
||||
});
|
||||
const mapStateToProps = createStructuredSelector({});
|
||||
|
||||
export function ExportLogsPageComponent({ bodyshop }) {
|
||||
export function ExportLogsPageComponent() {
|
||||
const searchParams = queryString.parse(useLocation().search);
|
||||
const { page, sortcolumn, sortorder, search } = searchParams;
|
||||
const history = useNavigate();
|
||||
@@ -97,9 +93,7 @@ export function ExportLogsPageComponent({ bodyshop }) {
|
||||
sortOrder: sortcolumn === "ro_number" && sortorder,
|
||||
render: (text, record) =>
|
||||
record.job && (
|
||||
<Link to={`/manage/jobs/${record.job.id}`}>
|
||||
{(record.job && record.job.ro_number) || t("general.labels.na")}
|
||||
</Link>
|
||||
<Link to={`/manage/jobs/${record.job.id}`}>{record.job?.ro_number || t("general.labels.na")}</Link>
|
||||
)
|
||||
},
|
||||
{
|
||||
@@ -109,11 +103,7 @@ export function ExportLogsPageComponent({ bodyshop }) {
|
||||
sorter: (a, b) => alphaSort(a.invoice_number, b.invoice_number),
|
||||
sortOrder: sortcolumn === "invoice_number" && sortorder,
|
||||
render: (text, record) =>
|
||||
record.bill && (
|
||||
<Link to={"/manage/bills?billid=" + (record.bill && record.bill.id)}>
|
||||
{record.bill && record.bill.invoice_number}
|
||||
</Link>
|
||||
)
|
||||
record.bill && <Link to={"/manage/bills?billid=" + record.bill?.id}>{record.bill?.invoice_number}</Link>
|
||||
},
|
||||
{
|
||||
title: t("payments.fields.paymentnum"),
|
||||
@@ -123,9 +113,7 @@ export function ExportLogsPageComponent({ bodyshop }) {
|
||||
sortOrder: sortcolumn === "paymentnum" && sortorder,
|
||||
render: (text, record) =>
|
||||
record.payment && (
|
||||
<Link to={"/manage/payments?search=" + (record.payment && record.payment.paymentnum)}>
|
||||
{record.payment && record.payment.paymentnum}
|
||||
</Link>
|
||||
<Link to={"/manage/payments?search=" + record.payment?.paymentnum}>{record.payment?.paymentnum}</Link>
|
||||
)
|
||||
},
|
||||
{
|
||||
@@ -197,12 +185,12 @@ export function ExportLogsPageComponent({ bodyshop }) {
|
||||
pagination={{
|
||||
position: "top",
|
||||
pageSize: pageLimit,
|
||||
current: parseInt(page || 1),
|
||||
current: parseInt(page || 1, 10),
|
||||
total: data && data.search_exportlog_aggregate.aggregate.count
|
||||
}}
|
||||
columns={columns}
|
||||
rowKey="id"
|
||||
dataSource={data && data.search_exportlog}
|
||||
dataSource={data?.search_exportlog}
|
||||
style={{ height: "100%" }}
|
||||
scroll={{ x: true }}
|
||||
onChange={handleTableChange}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { useEffect } from "react";
|
||||
import { useEffect } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
import RbacWrapper from "../../components/rbac-wrapper/rbac-wrapper.component";
|
||||
|
||||
Reference in New Issue
Block a user