Lint all the things
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Button, Card, Checkbox, Col, Form, Input, InputNumber, Row, Select } from "antd";
|
||||
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
||||
import { useCallback, useEffect, useMemo, useState } from "react";
|
||||
import { fetchFilterData } from "../../utils/RenderTemplate";
|
||||
import { DeleteFilled } from "@ant-design/icons";
|
||||
import { useTranslation } from "react-i18next";
|
||||
@@ -387,6 +387,8 @@ function RenderFilters({ templateId, form, bodyshop }) {
|
||||
if (data?.success) {
|
||||
if (data?.data?.sorters && data?.data?.sorters.length > 0) {
|
||||
const defaultSorters = data?.data?.sorters
|
||||
// TODO Why?
|
||||
// eslint-disable-next-line no-prototype-builtins
|
||||
.filter((sorter) => sorter.hasOwnProperty("default"))
|
||||
.map((sorter) => {
|
||||
return {
|
||||
|
||||
@@ -105,7 +105,7 @@ const generateSpecialReflections = (bodyshop, finalPath, t) => {
|
||||
case "employee_teams":
|
||||
return generateOptionsFromObject(bodyshop, "employee_teams", "name", "id");
|
||||
// Special case because Employees uses a concatenation of first_name and last_name
|
||||
case "employees":
|
||||
case "employees": {
|
||||
const employeesOptions = getValueFromPath(bodyshop, "employees");
|
||||
return uniqBy(
|
||||
Object.values(employeesOptions).map((value) => ({
|
||||
@@ -114,16 +114,18 @@ const generateSpecialReflections = (bodyshop, finalPath, t) => {
|
||||
})),
|
||||
"value"
|
||||
);
|
||||
}
|
||||
case "last_names":
|
||||
return generateOptionsFromObject(bodyshop, "employees", "last_name", "last_name");
|
||||
case "first_names":
|
||||
return generateOptionsFromObject(bodyshop, "employees", "first_name", "first_name");
|
||||
case "job_statuses":
|
||||
case "job_statuses": {
|
||||
const statusOptions = getValueFromPath(bodyshop, "md_ro_statuses.statuses");
|
||||
return Object.values(statusOptions).map((value) => ({
|
||||
label: value,
|
||||
value
|
||||
}));
|
||||
}
|
||||
default:
|
||||
console.error("Invalid Special reflection provided by Report Filters");
|
||||
return [];
|
||||
|
||||
@@ -2,7 +2,7 @@ import { useLazyQuery } from "@apollo/client";
|
||||
import { useSplitTreatments } from "@splitsoftware/splitio-react";
|
||||
import { Button, Card, Col, DatePicker, Form, Input, Radio, Row, Typography } from "antd";
|
||||
import _ from "lodash";
|
||||
import React, { useState } from "react";
|
||||
import { useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
@@ -28,7 +28,7 @@ const mapStateToProps = createStructuredSelector({
|
||||
reportCenterModal: selectReportCenter,
|
||||
bodyshop: selectBodyshop
|
||||
});
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
const mapDispatchToProps = () => ({
|
||||
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||
});
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(ReportCenterModalComponent);
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { Modal } from "antd";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
|
||||
Reference in New Issue
Block a user