Lint all the things
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { Card } from "antd";
|
||||
import _ from "lodash";
|
||||
import dayjs from "../../../utils/day";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Bar, CartesianGrid, ComposedChart, Legend, Line, ResponsiveContainer, Tooltip, XAxis, YAxis } from "recharts";
|
||||
import * as Utils from "../../scoreboard-targets-table/scoreboard-targets-table.util";
|
||||
@@ -19,7 +18,7 @@ export default function DashboardMonthlyEmployeeEfficiency({ data, ...cardProps
|
||||
const chartData = listOfDays.reduce((acc, val) => {
|
||||
//Sum up the current day.
|
||||
let dailyHrs;
|
||||
if (!!ticketsByDate[val]) {
|
||||
if (ticketsByDate[val]) {
|
||||
dailyHrs = ticketsByDate[val].reduce(
|
||||
(dayAcc, dayVal) => {
|
||||
return {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Card, Input, Space, Table, Typography } from "antd";
|
||||
import axios from "axios";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { useEffect, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { alphaSort } from "../../../utils/sorters";
|
||||
import LoadingSkeleton from "../../loading-skeleton/loading-skeleton.component";
|
||||
@@ -19,7 +19,7 @@ export default function DashboardMonthlyJobCosting({ data, ...cardProps }) {
|
||||
|
||||
useEffect(() => {
|
||||
async function getCostingData() {
|
||||
if (data && data.monthly_sales) {
|
||||
if (data?.monthly_sales) {
|
||||
setLoading(true);
|
||||
const response = await axios.post("/job/costingmulti", {
|
||||
jobids: data.monthly_sales.map((x) => x.id)
|
||||
@@ -79,7 +79,7 @@ export default function DashboardMonthlyJobCosting({ data, ...cardProps }) {
|
||||
];
|
||||
const filteredData =
|
||||
searchText === ""
|
||||
? (costingData && costingData.allCostCenterData) || []
|
||||
? costingData?.allCostCenterData || []
|
||||
: costingData.allCostCenterData.filter((d) =>
|
||||
(d.cost_center || "").toString().toLowerCase().includes(searchText.toLowerCase())
|
||||
);
|
||||
@@ -117,15 +117,13 @@ export default function DashboardMonthlyJobCosting({ data, ...cardProps }) {
|
||||
<Typography.Title level={4}>{t("general.labels.totals")}</Typography.Title>
|
||||
</Table.Summary.Cell>
|
||||
<Table.Summary.Cell>
|
||||
{Dinero(
|
||||
costingData && costingData.allSummaryData && costingData.allSummaryData.totalSales
|
||||
).toFormat()}
|
||||
{Dinero(costingData?.allSummaryData && costingData.allSummaryData.totalSales).toFormat()}
|
||||
</Table.Summary.Cell>
|
||||
<Table.Summary.Cell>
|
||||
{Dinero(costingData && costingData.allSummaryData && costingData.allSummaryData.totalCost).toFormat()}
|
||||
{Dinero(costingData?.allSummaryData && costingData.allSummaryData.totalCost).toFormat()}
|
||||
</Table.Summary.Cell>
|
||||
<Table.Summary.Cell>
|
||||
{Dinero(costingData && costingData.allSummaryData && costingData.allSummaryData.gpdollars).toFormat()}
|
||||
{Dinero(costingData?.allSummaryData && costingData.allSummaryData.gpdollars).toFormat()}
|
||||
</Table.Summary.Cell>
|
||||
<Table.Summary.Cell></Table.Summary.Cell>
|
||||
</Table.Summary.Row>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Card } from "antd";
|
||||
import Dinero from "dinero.js";
|
||||
import React, { useState } from "react";
|
||||
import { useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Cell, Pie, PieChart, ResponsiveContainer, Sector } from "recharts";
|
||||
import DashboardRefreshRequired from "../refresh-required.component";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Card } from "antd";
|
||||
import Dinero from "dinero.js";
|
||||
import React, { useState } from "react";
|
||||
import { useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Cell, Pie, PieChart, ResponsiveContainer, Sector } from "recharts";
|
||||
import DashboardRefreshRequired from "../refresh-required.component";
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Card } from "antd";
|
||||
import dayjs from "../../../utils/day";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import _ from "lodash";
|
||||
import { Area, Bar, CartesianGrid, ComposedChart, Legend, ResponsiveContainer, Tooltip, XAxis, YAxis } from "recharts";
|
||||
@@ -20,7 +19,7 @@ export default function DashboardMonthlyRevenueGraph({ data, ...cardProps }) {
|
||||
const chartData = listOfDays.reduce((acc, val) => {
|
||||
//Sum up the current day.
|
||||
let dailySales;
|
||||
if (!!jobsByDate[val]) {
|
||||
if (jobsByDate[val]) {
|
||||
dailySales = jobsByDate[val].reduce((dayAcc, dayVal) => {
|
||||
return dayAcc.add(Dinero((dayVal.job_totals && dayVal.job_totals.totals.subtotal) || 0));
|
||||
}, Dinero());
|
||||
@@ -46,7 +45,7 @@ export default function DashboardMonthlyRevenueGraph({ data, ...cardProps }) {
|
||||
<CartesianGrid stroke="#f5f5f5" />
|
||||
<XAxis dataKey="date" />
|
||||
<YAxis />
|
||||
<Tooltip formatter={(value, name, props) => value && value.toFixed(2)} />
|
||||
<Tooltip formatter={(value) => value && value.toFixed(2)} />
|
||||
<Legend />
|
||||
<Area type="monotone" name="Accumulated Sales" dataKey="accSales" fill="#3CB371" stroke="#3CB371" />
|
||||
<Bar
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { Card, Statistic } from "antd";
|
||||
import Dinero from "dinero.js";
|
||||
import dayjs from "../../../utils/day";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import DashboardRefreshRequired from "../refresh-required.component";
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { SyncOutlined } from "@ant-design/icons";
|
||||
import { Card } from "antd";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export default function DashboardRefreshRequired(props) {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Card, Statistic } from "antd";
|
||||
import Dinero from "dinero.js";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import DashboardRefreshRequired from "../refresh-required.component";
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { Card, Space, Statistic } from "antd";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
@@ -9,7 +8,7 @@ import DashboardRefreshRequired from "../refresh-required.component";
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
bodyshop: selectBodyshop
|
||||
});
|
||||
const mapDispatchToProps = (dispatch) => ({});
|
||||
const mapDispatchToProps = () => ({});
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(DashboardTotalProductionHours);
|
||||
|
||||
export function DashboardTotalProductionHours({ bodyshop, data, ...cardProps }) {
|
||||
|
||||
Reference in New Issue
Block a user