Lint all the things
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import {DateLocalizer} from "react-big-calendar";
|
||||
import { DateLocalizer } from "react-big-calendar";
|
||||
|
||||
function arrayWithHoles(arr) {
|
||||
if (Array.isArray(arr)) return arr;
|
||||
@@ -22,7 +22,9 @@ function iterableToArrayLimit(arr, i) {
|
||||
try {
|
||||
if (!_n && _i["return"] != null) _i["return"]();
|
||||
} finally {
|
||||
if (_d) { // noinspection ThrowInsideFinallyBlockJS
|
||||
if (_d) {
|
||||
// noinspection ThrowInsideFinallyBlockJS
|
||||
// eslint-disable-next-line no-unsafe-finally
|
||||
throw _e;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
import { RadarChartOutlined } from "@ant-design/icons";
|
||||
import { Popover, Space } from "antd";
|
||||
import React, { useMemo } from "react";
|
||||
import { useMemo } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
import { Legend, PolarAngleAxis, PolarGrid, PolarRadiusAxis, Radar, RadarChart, Tooltip } from "recharts";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
import BlurWrapperComponent from "../feature-wrapper/blur-wrapper.component";
|
||||
import { UpsellMaskWrapper, upsellEnum } from "../upsell/upsell.component";
|
||||
import { upsellEnum, UpsellMaskWrapper } from "../upsell/upsell.component";
|
||||
import { HasFeatureAccess } from "../feature-wrapper/feature-wrapper.component";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
bodyshop: selectBodyshop
|
||||
});
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
const mapDispatchToProps = () => ({
|
||||
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||
});
|
||||
|
||||
@@ -22,15 +22,14 @@ export function ScheduleCalendarHeaderGraph({ bodyshop, loadData }) {
|
||||
const { t } = useTranslation();
|
||||
const data = useMemo(() => {
|
||||
return (
|
||||
(loadData &&
|
||||
loadData.expectedLoad &&
|
||||
(loadData?.expectedLoad &&
|
||||
Object.keys(loadData.expectedLoad).map((key) => {
|
||||
const metadataBucket = ssbuckets.filter((b) => b.id === key)[0];
|
||||
|
||||
return {
|
||||
bucket: loadData.expectedLoad[key].label,
|
||||
current: loadData.expectedLoad[key].count,
|
||||
target: metadataBucket && metadataBucket.target
|
||||
target: metadataBucket?.target
|
||||
};
|
||||
})) ||
|
||||
[]
|
||||
@@ -39,24 +38,22 @@ export function ScheduleCalendarHeaderGraph({ bodyshop, loadData }) {
|
||||
const hasSmartSchedulingAccess = HasFeatureAccess({ featureName: "smartscheduling", bodyshop });
|
||||
|
||||
const chartContents = (
|
||||
<>
|
||||
<RadarChart
|
||||
// cx={300}
|
||||
// cy={250}
|
||||
// outerRadius={150}
|
||||
width={800}
|
||||
height={600}
|
||||
data={data}
|
||||
>
|
||||
<PolarGrid />
|
||||
<PolarAngleAxis dataKey="bucket" />
|
||||
<PolarRadiusAxis angle={90} />
|
||||
<Radar name="Ideal Load" dataKey="target" stroke="darkgreen" fill="white" fillOpacity={0} />
|
||||
<Radar name="EOD Load" dataKey="current" stroke="dodgerblue" fill="dodgerblue" fillOpacity={0.6} />
|
||||
<Tooltip />
|
||||
<Legend />
|
||||
</RadarChart>
|
||||
</>
|
||||
<RadarChart
|
||||
// cx={300}
|
||||
// cy={250}
|
||||
// outerRadius={150}
|
||||
width={800}
|
||||
height={600}
|
||||
data={data}
|
||||
>
|
||||
<PolarGrid />
|
||||
<PolarAngleAxis dataKey="bucket" />
|
||||
<PolarRadiusAxis angle={90} />
|
||||
<Radar name="Ideal Load" dataKey="target" stroke="darkgreen" fill="white" fillOpacity={0} />
|
||||
<Radar name="EOD Load" dataKey="current" stroke="dodgerblue" fill="dodgerblue" fillOpacity={0.6} />
|
||||
<Tooltip />
|
||||
<Legend />
|
||||
</RadarChart>
|
||||
);
|
||||
|
||||
const popContent = (
|
||||
|
||||
@@ -212,10 +212,6 @@ export function ScheduleCalendarHeaderComponent({ bodyshop, label, refetch, date
|
||||
return bodyshop.workingdays[day];
|
||||
};
|
||||
|
||||
const blocked = isDayBlocked.length > 0;
|
||||
const headerStyle = blocked ? { color: "#fff" } : { color: isShopOpen(date) ? "" : "tomato" };
|
||||
const headerClass = `imex-calendar-header-card ${blocked ? "imex-calendar-header-card--blocked" : ""}`.trim();
|
||||
|
||||
return (
|
||||
<div className="imex-calendar-load">
|
||||
<ScheduleBlockDay alreadyBlocked={isDayBlocked.length > 0} date={date} refetch={refetch}>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Alert, Collapse, Space } from "antd";
|
||||
import queryString from "query-string";
|
||||
import React from "react";
|
||||
import { Calendar } from "react-big-calendar";
|
||||
import { Trans, useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
@@ -40,7 +39,7 @@ export function ScheduleCalendarWrapperComponent({
|
||||
// Determine current view to compute styles consistently
|
||||
const currentView = search.view || defaultView || "week";
|
||||
|
||||
const handleEventPropStyles = (event, start, end, isSelected) => {
|
||||
const handleEventPropStyles = (event) => {
|
||||
const hasColor = Boolean(event?.color?.hex || event?.color);
|
||||
const useBg = currentView !== "agenda";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user