Remainder of menu refactoring updates.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { PlusCircleOutlined } from "@ant-design/icons";
|
||||
import { Dropdown, Menu } from "antd";
|
||||
import { Dropdown } from "antd";
|
||||
import React from "react";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { DownOutlined } from "@ant-design/icons";
|
||||
import { Dropdown, Menu } from "antd";
|
||||
import { Dropdown } from "antd";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
|
||||
@@ -3,21 +3,19 @@ import {
|
||||
Button,
|
||||
Card,
|
||||
Dropdown,
|
||||
Input,
|
||||
Menu,
|
||||
Space,
|
||||
Input, Space,
|
||||
Table,
|
||||
Tooltip,
|
||||
Tooltip
|
||||
} from "antd";
|
||||
import moment from "moment";
|
||||
import React, { useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Link } from "react-router-dom";
|
||||
import { DateTimeFormatter } from "../../utils/DateFormatter";
|
||||
import { alphaSort } from "../../utils/sorters";
|
||||
import { OwnerNameDisplayFunction } from "../owner-name-display/owner-name-display.component";
|
||||
import moment from "moment";
|
||||
import { GenerateDocument } from "../../utils/RenderTemplate";
|
||||
import { alphaSort } from "../../utils/sorters";
|
||||
import { TemplateList } from "../../utils/TemplateConstants";
|
||||
import { OwnerNameDisplayFunction } from "../owner-name-display/owner-name-display.component";
|
||||
export default function CourtesyCarsList({ loading, courtesycars, refetch }) {
|
||||
const [state, setState] = useState({
|
||||
sortedInfo: {},
|
||||
|
||||
@@ -6,12 +6,10 @@ import {
|
||||
Dropdown,
|
||||
Form,
|
||||
Input,
|
||||
InputNumber,
|
||||
Menu,
|
||||
Select,
|
||||
InputNumber, Select,
|
||||
Space,
|
||||
Statistic,
|
||||
Typography,
|
||||
Typography
|
||||
} from "antd";
|
||||
import Dinero from "dinero.js";
|
||||
import moment from "moment";
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import React from "react";
|
||||
import { DownOutlined } from "@ant-design/icons";
|
||||
import { useMutation } from "@apollo/client";
|
||||
import { UPDATE_JOB } from "../../graphql/jobs.queries";
|
||||
import { Dropdown, notification } from "antd";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { Dropdown, Menu, notification } from "antd";
|
||||
import { DownOutlined } from "@ant-design/icons";
|
||||
import { UPDATE_JOB } from "../../graphql/jobs.queries";
|
||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import React from "react";
|
||||
import { DownOutlined } from "@ant-design/icons";
|
||||
import { useMutation } from "@apollo/client";
|
||||
import { UPDATE_APPOINTMENT } from "../../graphql/appointments.queries";
|
||||
import { Dropdown, notification } from "antd";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { Dropdown, Menu, notification } from "antd";
|
||||
import { DownOutlined } from "@ant-design/icons";
|
||||
import { UPDATE_APPOINTMENT } from "../../graphql/appointments.queries";
|
||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
|
||||
@@ -2,11 +2,9 @@ import { AlertFilled } from "@ant-design/icons";
|
||||
import {
|
||||
Button,
|
||||
Divider,
|
||||
Dropdown,
|
||||
Menu,
|
||||
notification,
|
||||
Dropdown, notification,
|
||||
Popover,
|
||||
Space,
|
||||
Space
|
||||
} from "antd";
|
||||
import parsePhoneNumber from "libphonenumber-js";
|
||||
import moment from "moment";
|
||||
@@ -18,7 +16,7 @@ import { Link, useHistory, useLocation } from "react-router-dom";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import {
|
||||
openChatByPhone,
|
||||
setMessage,
|
||||
setMessage
|
||||
} from "../../redux/messaging/messaging.actions";
|
||||
import { setModalContext } from "../../redux/modals/modals.actions";
|
||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
@@ -27,11 +25,11 @@ import { GenerateDocument } from "../../utils/RenderTemplate";
|
||||
import { TemplateList } from "../../utils/TemplateConstants";
|
||||
import ChatOpenButton from "../chat-open-button/chat-open-button.component";
|
||||
import DataLabel from "../data-label/data-label.component";
|
||||
import OwnerNameDisplay from "../owner-name-display/owner-name-display.component";
|
||||
import ScheduleManualEvent from "../schedule-manual-event/schedule-manual-event.component";
|
||||
import ScheduleAtChange from "./job-at-change.component";
|
||||
import ScheduleEventColor from "./schedule-event.color.component";
|
||||
import ScheduleEventNote from "./schedule-event.note.component";
|
||||
import OwnerNameDisplay from "../owner-name-display/owner-name-display.component";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
bodyshop: selectBodyshop,
|
||||
|
||||
@@ -1,24 +1,15 @@
|
||||
import {
|
||||
DeleteFilled,
|
||||
EditFilled,
|
||||
FilterFilled,
|
||||
HomeOutlined,
|
||||
MinusCircleTwoTone,
|
||||
PlusCircleTwoTone,
|
||||
SyncOutlined,
|
||||
WarningFilled,
|
||||
EditFilled,
|
||||
PlusCircleTwoTone,
|
||||
MinusCircleTwoTone,
|
||||
HomeOutlined,
|
||||
} from "@ant-design/icons";
|
||||
import { useMutation } from "@apollo/client";
|
||||
import {
|
||||
Button,
|
||||
Dropdown,
|
||||
Input,
|
||||
Menu,
|
||||
PageHeader,
|
||||
Space,
|
||||
Table,
|
||||
Tag,
|
||||
} from "antd";
|
||||
import { Button, Dropdown, Input, PageHeader, Space, Table, Tag } from "antd";
|
||||
import axios from "axios";
|
||||
import React, { useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
@@ -38,13 +29,13 @@ import JobLinesBillRefernece from "../job-lines-bill-reference/job-lines-bill-re
|
||||
// import AllocationsAssignmentContainer from "../allocations-assignment/allocations-assignment.container";
|
||||
// import AllocationsBulkAssignmentContainer from "../allocations-bulk-assignment/allocations-bulk-assignment.container";
|
||||
// import AllocationsEmployeeLabelContainer from "../allocations-employee-label/allocations-employee-label.container";
|
||||
import PartsOrderModalContainer from "../parts-order-modal/parts-order-modal.container";
|
||||
import _ from "lodash";
|
||||
import JobCreateIOU from "../job-create-iou/job-create-iou.component";
|
||||
import JobLinesExpander from "./job-lines-expander.component";
|
||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
import moment from "moment";
|
||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
import JobCreateIOU from "../job-create-iou/job-create-iou.component";
|
||||
import JobLineConvertToLabor from "../job-line-convert-to-labor/job-line-convert-to-labor.component";
|
||||
import PartsOrderModalContainer from "../parts-order-modal/parts-order-modal.container";
|
||||
import JobLinesExpander from "./job-lines-expander.component";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
bodyshop: selectBodyshop,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { DownOutlined } from "@ant-design/icons";
|
||||
import { Dropdown, Menu } from "antd";
|
||||
import { Dropdown } from "antd";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { DownCircleFilled } from "@ant-design/icons";
|
||||
import { useMutation } from "@apollo/client";
|
||||
import { Button, Dropdown, Menu, notification } from "antd";
|
||||
import { Button, Dropdown, notification } from "antd";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { DownCircleFilled } from "@ant-design/icons";
|
||||
import { useMutation } from "@apollo/client";
|
||||
import { Button, Dropdown, Menu, notification } from "antd";
|
||||
import { Button, Dropdown, notification } from "antd";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Button, Dropdown, Menu } from "antd";
|
||||
import { Button, Dropdown } from "antd";
|
||||
import _ from "lodash";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { DownOutlined } from "@ant-design/icons";
|
||||
import { Dropdown, Menu } from "antd";
|
||||
import { Dropdown } from "antd";
|
||||
import React from "react";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { DownOutlined } from "@ant-design/icons";
|
||||
import { Dropdown, Menu } from "antd";
|
||||
import { Dropdown } from "antd";
|
||||
import React from "react";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { DownCircleFilled } from "@ant-design/icons";
|
||||
import { useApolloClient, useMutation } from "@apollo/client";
|
||||
import { Button, Dropdown, Menu, notification, Popconfirm } from "antd";
|
||||
import { Button, Dropdown, notification, Popconfirm } from "antd";
|
||||
import React, { useMemo } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
@@ -13,7 +13,7 @@ import { selectJobReadOnly } from "../../redux/application/application.selectors
|
||||
import { setModalContext } from "../../redux/modals/modals.actions";
|
||||
import {
|
||||
selectBodyshop,
|
||||
selectCurrentUser,
|
||||
selectCurrentUser
|
||||
} from "../../redux/user/user.selectors";
|
||||
import JobsDetailHeaderActionsAddevent from "./jobs-detail-header-actions.addevent";
|
||||
import AddToProduction from "./jobs-detail-header-actions.addtoproduction.util";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { DownOutlined } from "@ant-design/icons";
|
||||
import { Dropdown, Menu } from "antd";
|
||||
import { Dropdown } from "antd";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
@@ -18,20 +18,16 @@ export function JobsDetailRatesChangeButton({ disabled, form, bodyshop }) {
|
||||
form.setFieldsValue({ ...rate, labor_rate_desc: rate.rate_label });
|
||||
};
|
||||
|
||||
const menu = (
|
||||
<div>
|
||||
<Menu onClick={handleClick}>
|
||||
{bodyshop.md_labor_rates.map((rate, idx) => (
|
||||
<Menu.Item value={rate} key={idx}>
|
||||
{rate.rate_label}
|
||||
</Menu.Item>
|
||||
))}
|
||||
</Menu>
|
||||
</div>
|
||||
);
|
||||
|
||||
const menu = {
|
||||
onClick: handleClick,
|
||||
items: bodyshop.md_labor_rates.map((rate, idx) => ({
|
||||
key: idx,
|
||||
value: rate,
|
||||
label: rate.rate_label,
|
||||
})),
|
||||
};
|
||||
return (
|
||||
<Dropdown overlay={menu} disabled={disabled}>
|
||||
<Dropdown menu={menu} disabled={disabled}>
|
||||
<a
|
||||
className="ant-dropdown-link"
|
||||
href=" #"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { DownOutlined } from "@ant-design/icons";
|
||||
import { Dropdown, Menu } from "antd";
|
||||
import { Dropdown } from "antd";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
@@ -21,27 +21,21 @@ export function NotesPresetButton({ bodyshop, form }) {
|
||||
form.setFieldsValue({ text: item.text });
|
||||
};
|
||||
|
||||
const menu = (
|
||||
<Menu
|
||||
style={{
|
||||
columnCount: Math.floor(bodyshop.md_notes_presets.length / 10) + 1,
|
||||
}}
|
||||
>
|
||||
{bodyshop.md_notes_presets.map((i, idx) => (
|
||||
<Menu.Item
|
||||
onClick={() => handleSelect(i)}
|
||||
key={idx}
|
||||
style={{ breakInside: "avoid" }}
|
||||
>
|
||||
{i.label}
|
||||
</Menu.Item>
|
||||
))}
|
||||
</Menu>
|
||||
);
|
||||
const menu = {
|
||||
style: {
|
||||
columnCount: Math.floor(bodyshop.md_notes_presets.length / 10) + 1,
|
||||
},
|
||||
items: bodyshop.md_notes_presets.map((i, idx) => ({
|
||||
key: idx,
|
||||
style: { breakInside: "avoid" },
|
||||
onClick: () => handleSelect(i),
|
||||
label: i.label,
|
||||
})),
|
||||
};
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Dropdown trigger={["click"]} overlay={menu}>
|
||||
<Dropdown trigger={["click"]} menu={menu}>
|
||||
<a
|
||||
className="ant-dropdown-link"
|
||||
href="# "
|
||||
|
||||
@@ -1,17 +1,11 @@
|
||||
import { DeleteFilled, WarningFilled, DownOutlined } from "@ant-design/icons";
|
||||
import { DeleteFilled, DownOutlined, WarningFilled } from "@ant-design/icons";
|
||||
import { useTreatments } from "@splitsoftware/splitio-react";
|
||||
import {
|
||||
Divider,
|
||||
Form,
|
||||
Checkbox, Divider, Dropdown, Form,
|
||||
Input,
|
||||
InputNumber,
|
||||
Radio,
|
||||
Space,
|
||||
Tag,
|
||||
Select,
|
||||
Menu,
|
||||
Dropdown,
|
||||
Checkbox,
|
||||
Radio, Select, Space,
|
||||
Tag
|
||||
} from "antd";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
@@ -61,17 +55,14 @@ export function PartsOrderModalComponent({
|
||||
form.setFieldsValue({ comments: item.props.value });
|
||||
};
|
||||
|
||||
const menu = (
|
||||
<div>
|
||||
<Menu onClick={handleClick}>
|
||||
{bodyshop.md_parts_order_comment.map((comment, idx) => (
|
||||
<Menu.Item value={comment.comment} key={idx}>
|
||||
{comment.label}
|
||||
</Menu.Item>
|
||||
))}
|
||||
</Menu>
|
||||
</div>
|
||||
);
|
||||
const menu = {
|
||||
onClick: handleClick,
|
||||
items: bodyshop.md_parts_order_comment.map((comment, idx) => ({
|
||||
key: idx,
|
||||
value: comment.comment,
|
||||
label: comment.label,
|
||||
})),
|
||||
};
|
||||
|
||||
return (
|
||||
<div>
|
||||
@@ -308,7 +299,7 @@ export function PartsOrderModalComponent({
|
||||
label={
|
||||
<Space>
|
||||
{t("parts_orders.fields.comments")}
|
||||
<Dropdown overlay={menu}>
|
||||
<Dropdown menu={menu}>
|
||||
<a
|
||||
className="ant-dropdown-link"
|
||||
href=" #"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Button, Dropdown } from "antd";
|
||||
import React from "react";
|
||||
import { Button, Dropdown, Menu } from "antd";
|
||||
import dataSource from "./production-list-columns.data";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import dataSource from "./production-list-columns.data";
|
||||
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
@@ -47,37 +47,24 @@ export function ProductionColumnsComponent({
|
||||
state: tableState,
|
||||
activeStatuses: bodyshop.md_ro_statuses.active_statuses,
|
||||
});
|
||||
const menu = (
|
||||
<Menu
|
||||
onClick={handleAdd}
|
||||
style={{
|
||||
columnCount: Math.max(Math.floor(cols.length / 10), 1),
|
||||
}}
|
||||
>
|
||||
{cols
|
||||
.filter((i) => !columnKeys.includes(i.key))
|
||||
.map((item) => (
|
||||
<Menu.Item key={item.key} style={{ breakInside: "avoid" }}>
|
||||
{item.title}
|
||||
</Menu.Item>
|
||||
))}
|
||||
</Menu>
|
||||
);
|
||||
const menu = {
|
||||
style: {
|
||||
columnCount: Math.max(Math.floor(cols.length / 10), 1),
|
||||
},
|
||||
onClick: handleAdd,
|
||||
items: cols
|
||||
.filter((i) => !columnKeys.includes(i.key))
|
||||
.map((item) => ({
|
||||
key: item.key,
|
||||
style: { breakInside: "avoid" },
|
||||
label: item.title,
|
||||
})),
|
||||
};
|
||||
return (
|
||||
<div>
|
||||
<Dropdown overlay={menu}>
|
||||
<Dropdown menu={menu}>
|
||||
<Button>{t("production.actions.addcolumns")}</Button>
|
||||
</Dropdown>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
// <Transfer
|
||||
// dataSource={dataSource}
|
||||
// titles={["Source", "Target"]}
|
||||
// targetKeys={columns.map((c) => c.key)}
|
||||
// render={(item) => item.title}
|
||||
// onChange={(nextTargetKeys, direction, moveKeys) => {
|
||||
// setColumns(dataSource.filter((i) => nextTargetKeys.includes(i.key)));
|
||||
// }}
|
||||
// />
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { ExclamationCircleFilled } from "@ant-design/icons";
|
||||
import { Dropdown, Menu } from "antd";
|
||||
import { useMutation } from "@apollo/client";
|
||||
import { Dropdown } from "antd";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useMutation } from "@apollo/client";
|
||||
import { UPDATE_JOB } from "../../graphql/jobs.queries";
|
||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||
import { UPDATE_JOB } from "../../graphql/jobs.queries";
|
||||
|
||||
export default function ProductionListColumnAlert({ record }) {
|
||||
const { t } = useTranslation();
|
||||
@@ -34,15 +34,18 @@ export default function ProductionListColumnAlert({ record }) {
|
||||
|
||||
return (
|
||||
<Dropdown
|
||||
overlay={
|
||||
<Menu>
|
||||
<Menu.Item key="toggleAlert" onClick={handleAlertToggle}>
|
||||
{record.production_vars && record.production_vars.alert
|
||||
? t("production.labels.alertoff")
|
||||
: t("production.labels.alerton")}
|
||||
</Menu.Item>
|
||||
</Menu>
|
||||
}
|
||||
menu={{
|
||||
items: [
|
||||
{
|
||||
key: "toggleAlert",
|
||||
onClick: handleAlertToggle,
|
||||
label:
|
||||
record.production_vars && record.production_vars.alert
|
||||
? t("production.labels.alertoff")
|
||||
: t("production.labels.alerton"),
|
||||
},
|
||||
],
|
||||
}}
|
||||
trigger={["contextMenu"]}
|
||||
>
|
||||
<div
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { useMutation } from "@apollo/client";
|
||||
import { Dropdown, Menu } from "antd";
|
||||
import { Dropdown } from "antd";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { UPDATE_JOB } from "../../graphql/jobs.queries";
|
||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||
import { UPDATE_JOB } from "../../graphql/jobs.queries";
|
||||
|
||||
export default function ProductionListColumnBodyPriority({ record }) {
|
||||
const { t } = useTranslation();
|
||||
@@ -31,25 +31,27 @@ export default function ProductionListColumnBodyPriority({ record }) {
|
||||
|
||||
return (
|
||||
<Dropdown
|
||||
overlay={
|
||||
<Menu onClick={handleSetBodyPriority}>
|
||||
<Menu.Item key="clearBodyPriority">
|
||||
{t("production.actions.bodypriority-clear")}
|
||||
</Menu.Item>
|
||||
<Menu.SubMenu
|
||||
key="set"
|
||||
title={t("production.actions.bodypriority-set")}
|
||||
>
|
||||
{new Array(15).fill().map((value, index) => (
|
||||
<Menu.Item key={index + 1}>
|
||||
menu={{
|
||||
onClick: handleSetBodyPriority,
|
||||
items: [
|
||||
{
|
||||
key: "clearBodyPriority",
|
||||
label: t("production.actions.bodypriority-clear"),
|
||||
},
|
||||
{
|
||||
key: "set",
|
||||
label: t("production.actions.bodypriority-set"),
|
||||
children: new Array(15).fill().map((value, index) => ({
|
||||
key: index + 1,
|
||||
label: (
|
||||
<div style={{ marginLeft: "2rem", marginRight: "2rem" }}>
|
||||
{index + 1}
|
||||
</div>
|
||||
</Menu.Item>
|
||||
))}
|
||||
</Menu.SubMenu>
|
||||
</Menu>
|
||||
}
|
||||
),
|
||||
})),
|
||||
},
|
||||
],
|
||||
}}
|
||||
trigger={["click"]}
|
||||
>
|
||||
<div style={{ width: "100%", height: "19px" }}>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { useMutation } from "@apollo/client";
|
||||
import { Dropdown, Menu } from "antd";
|
||||
import { Dropdown } from "antd";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { UPDATE_JOB } from "../../graphql/jobs.queries";
|
||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||
import { UPDATE_JOB } from "../../graphql/jobs.queries";
|
||||
|
||||
export default function ProductionListColumnDetailPriority({ record }) {
|
||||
const { t } = useTranslation();
|
||||
@@ -31,25 +31,27 @@ export default function ProductionListColumnDetailPriority({ record }) {
|
||||
|
||||
return (
|
||||
<Dropdown
|
||||
overlay={
|
||||
<Menu onClick={handleSetDetailPriority}>
|
||||
<Menu.Item key="clearDetailPriority">
|
||||
{t("production.actions.detailpriority-clear")}
|
||||
</Menu.Item>
|
||||
<Menu.SubMenu
|
||||
key="set"
|
||||
title={t("production.actions.detailpriority-set")}
|
||||
>
|
||||
{new Array(15).fill().map((value, index) => (
|
||||
<Menu.Item key={index + 1}>
|
||||
menu={{
|
||||
onClick: handleSetDetailPriority,
|
||||
items: [
|
||||
{
|
||||
key: "clearDetailPriority",
|
||||
label: t("production.actions.detailpriority-clear"),
|
||||
},
|
||||
{
|
||||
key: "set",
|
||||
label: t("production.actions.detailpriority-set"),
|
||||
children: new Array(15).fill().map((value, index) => ({
|
||||
key: index + 1,
|
||||
label: (
|
||||
<div style={{ marginLeft: "2rem", marginRight: "2rem" }}>
|
||||
{index + 1}
|
||||
</div>
|
||||
</Menu.Item>
|
||||
))}
|
||||
</Menu.SubMenu>
|
||||
</Menu>
|
||||
}
|
||||
),
|
||||
})),
|
||||
},
|
||||
],
|
||||
}}
|
||||
trigger={["click"]}
|
||||
>
|
||||
<div style={{ width: "100%", height: "19px" }}>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { useMutation } from "@apollo/client";
|
||||
import { Dropdown, Menu } from "antd";
|
||||
import { Dropdown } from "antd";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { UPDATE_JOB } from "../../graphql/jobs.queries";
|
||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||
import { UPDATE_JOB } from "../../graphql/jobs.queries";
|
||||
|
||||
export default function ProductionListColumnPaintPriority({ record }) {
|
||||
const { t } = useTranslation();
|
||||
@@ -31,25 +31,27 @@ export default function ProductionListColumnPaintPriority({ record }) {
|
||||
|
||||
return (
|
||||
<Dropdown
|
||||
overlay={
|
||||
<Menu onClick={handleSetPaintPriority}>
|
||||
<Menu.Item key="clearPaintPriority">
|
||||
{t("production.actions.paintpriority-clear")}
|
||||
</Menu.Item>
|
||||
<Menu.SubMenu
|
||||
key="set"
|
||||
title={t("production.actions.paintpriority-set")}
|
||||
>
|
||||
{new Array(15).fill().map((value, index) => (
|
||||
<Menu.Item key={index + 1}>
|
||||
menu={{
|
||||
onClick: handleSetPaintPriority,
|
||||
items: [
|
||||
{
|
||||
key: "clearPaintPriority",
|
||||
label: t("production.actions.paintpriority-clear"),
|
||||
},
|
||||
{
|
||||
key: "set",
|
||||
label: t("production.actions.paintpriority-set"),
|
||||
children: new Array(15).fill().map((value, index) => ({
|
||||
key: index + 1,
|
||||
label: (
|
||||
<div style={{ marginLeft: "2rem", marginRight: "2rem" }}>
|
||||
{index + 1}
|
||||
</div>
|
||||
</Menu.Item>
|
||||
))}
|
||||
</Menu.SubMenu>
|
||||
</Menu>
|
||||
}
|
||||
),
|
||||
})),
|
||||
},
|
||||
],
|
||||
}}
|
||||
trigger={["click"]}
|
||||
>
|
||||
<div style={{ width: "100%", height: "19px" }}>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useMutation } from "@apollo/client";
|
||||
import { Dropdown, Menu, Spin } from "antd";
|
||||
import { Dropdown, Spin } from "antd";
|
||||
import React, { useState } from "react";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
@@ -38,16 +38,14 @@ export function ProductionListColumnCategory({ record, bodyshop }) {
|
||||
|
||||
return (
|
||||
<Dropdown
|
||||
overlay={
|
||||
<Menu
|
||||
style={{ maxHeight: "200px", overflowY: "auto" }}
|
||||
onClick={handleSetStatus}
|
||||
>
|
||||
{bodyshop.md_categories.map((item) => (
|
||||
<Menu.Item key={item}>{item}</Menu.Item>
|
||||
))}
|
||||
</Menu>
|
||||
}
|
||||
menu={{
|
||||
style: { maxHeight: "200px", overflowY: "auto" },
|
||||
onClick: handleSetStatus,
|
||||
items: bodyshop.md_categories.map((item) => ({
|
||||
key: item,
|
||||
label: item,
|
||||
})),
|
||||
}}
|
||||
trigger={["click"]}
|
||||
>
|
||||
<div style={{ width: "100%", height: "19px", cursor: "pointer" }}>
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { useMutation } from "@apollo/client";
|
||||
import { Dropdown, Menu, Spin } from "antd";
|
||||
import { Dropdown, Spin } from "antd";
|
||||
import React, { useState } from "react";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||
import { UPDATE_JOB } from "../../graphql/jobs.queries";
|
||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
import { insertAuditTrail } from "../../redux/application/application.actions";
|
||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
import AuditTrailMapping from "../../utils/AuditTrailMappings";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
@@ -47,16 +47,14 @@ export function ProductionListColumnStatus({
|
||||
|
||||
return (
|
||||
<Dropdown
|
||||
overlay={
|
||||
<Menu
|
||||
style={{ maxHeight: "200px", overflowY: "auto" }}
|
||||
onClick={handleSetStatus}
|
||||
>
|
||||
{bodyshop.md_ro_statuses.production_statuses.map((item) => (
|
||||
<Menu.Item key={item}>{item}</Menu.Item>
|
||||
))}
|
||||
</Menu>
|
||||
}
|
||||
menu={{
|
||||
style: { maxHeight: "200px", overflowY: "auto" },
|
||||
onClick: handleSetStatus,
|
||||
items: bodyshop.md_ro_statuses.production_statuses.map((item) => ({
|
||||
key: item,
|
||||
label: item,
|
||||
})),
|
||||
}}
|
||||
trigger={["click"]}
|
||||
>
|
||||
<div style={{ width: "100%", height: "19px", cursor: "pointer" }}>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Button, Dropdown, Menu } from "antd";
|
||||
import { Button, Dropdown } from "antd";
|
||||
import React, { useState } from "react";
|
||||
import { TemplateList } from "../../utils/TemplateConstants";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { GenerateDocument } from "../../utils/RenderTemplate";
|
||||
import { TemplateList } from "../../utils/TemplateConstants";
|
||||
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
@@ -31,98 +31,86 @@ export function ProductionListPrint({ bodyshop }) {
|
||||
return (
|
||||
<Dropdown
|
||||
trigger="click"
|
||||
overlay={
|
||||
<Menu>
|
||||
{Object.keys(ProdTemplates).map((key) => (
|
||||
<Menu.Item
|
||||
key={key}
|
||||
onClick={async () => {
|
||||
menu={{
|
||||
items: [
|
||||
...Object.keys(ProdTemplates).map((key) => ({
|
||||
key: key,
|
||||
onClick: async () => {
|
||||
setLoading(true);
|
||||
await GenerateDocument(
|
||||
{
|
||||
name: ProdTemplates[key].key,
|
||||
// variables: { id: contract.id },
|
||||
},
|
||||
{},
|
||||
"p"
|
||||
);
|
||||
setLoading(false);
|
||||
},
|
||||
label: ProdTemplates[key].title,
|
||||
})),
|
||||
{
|
||||
key: "prodbyonetech",
|
||||
label: t("reportcenter.templates.production_by_technician_one"),
|
||||
children: bodyshop.employees.map((e) => ({
|
||||
key: e.id,
|
||||
onClick: async () => {
|
||||
setLoading(true);
|
||||
await GenerateDocument(
|
||||
{
|
||||
name: ProdTemplates[key].key,
|
||||
// variables: { id: contract.id },
|
||||
name: production_by_technician_one.key,
|
||||
variables: { id: e.id },
|
||||
},
|
||||
{},
|
||||
"p"
|
||||
);
|
||||
setLoading(false);
|
||||
}}
|
||||
>
|
||||
{ProdTemplates[key].title}
|
||||
</Menu.Item>
|
||||
))}
|
||||
<Menu.SubMenu
|
||||
title={t("reportcenter.templates.production_by_technician_one")}
|
||||
>
|
||||
{bodyshop.employees.map((e) => (
|
||||
<Menu.Item
|
||||
key={e.id}
|
||||
onClick={async () => {
|
||||
setLoading(true);
|
||||
await GenerateDocument(
|
||||
{
|
||||
name: production_by_technician_one.key,
|
||||
variables: { id: e.id },
|
||||
},
|
||||
{},
|
||||
"p"
|
||||
);
|
||||
setLoading(false);
|
||||
}}
|
||||
>
|
||||
{e.first_name} {e.last_name}
|
||||
</Menu.Item>
|
||||
))}
|
||||
</Menu.SubMenu>
|
||||
<Menu.SubMenu
|
||||
title={t("reportcenter.templates.production_by_category_one")}
|
||||
>
|
||||
{bodyshop.md_categories.map((e) => (
|
||||
<Menu.Item
|
||||
key={e}
|
||||
onClick={async () => {
|
||||
setLoading(true);
|
||||
await GenerateDocument(
|
||||
{
|
||||
name: production_by_category_one.key,
|
||||
variables: { category: e },
|
||||
},
|
||||
{},
|
||||
"p"
|
||||
);
|
||||
setLoading(false);
|
||||
}}
|
||||
>
|
||||
{e}
|
||||
</Menu.Item>
|
||||
))}
|
||||
</Menu.SubMenu>
|
||||
<Menu.SubMenu
|
||||
title={t("reportcenter.templates.production_by_repair_status_one")}
|
||||
>
|
||||
{bodyshop.md_ro_statuses.production_statuses.map((e) => (
|
||||
<Menu.Item
|
||||
key={e}
|
||||
onClick={async () => {
|
||||
setLoading(true);
|
||||
await GenerateDocument(
|
||||
{
|
||||
name: production_by_repair_status_one.key,
|
||||
variables: { status: e },
|
||||
},
|
||||
{},
|
||||
"p"
|
||||
);
|
||||
setLoading(false);
|
||||
}}
|
||||
>
|
||||
{e}
|
||||
</Menu.Item>
|
||||
))}
|
||||
</Menu.SubMenu>
|
||||
</Menu>
|
||||
}
|
||||
},
|
||||
label: `${e.first_name || ""} ${e.last_name || ""}`.trim(),
|
||||
})),
|
||||
},
|
||||
{
|
||||
key: "prodbycategory",
|
||||
label: t("reportcenter.templates.production_by_category_one"),
|
||||
children: bodyshop.md_categories.map((e) => ({
|
||||
key: e,
|
||||
onClick: async () => {
|
||||
setLoading(true);
|
||||
await GenerateDocument(
|
||||
{
|
||||
name: production_by_category_one.key,
|
||||
variables: { category: e },
|
||||
},
|
||||
{},
|
||||
"p"
|
||||
);
|
||||
setLoading(false);
|
||||
},
|
||||
label: e,
|
||||
})),
|
||||
},
|
||||
{
|
||||
key: "prodbyrepairstatus",
|
||||
label: t("reportcenter.templates.production_by_repair_status_one"),
|
||||
children: bodyshop.md_ro_statuses.production_statuses.map((e) => ({
|
||||
key: e,
|
||||
onClick: async () => {
|
||||
setLoading(true);
|
||||
await GenerateDocument(
|
||||
{
|
||||
name: production_by_repair_status_one.key,
|
||||
variables: { status: e },
|
||||
},
|
||||
{},
|
||||
"p"
|
||||
);
|
||||
setLoading(false);
|
||||
},
|
||||
label: e,
|
||||
})),
|
||||
},
|
||||
],
|
||||
}}
|
||||
>
|
||||
<Button loading={loading}>{t("general.labels.print")}</Button>
|
||||
</Dropdown>
|
||||
|
||||
@@ -4,7 +4,6 @@ import {
|
||||
Button,
|
||||
Dropdown,
|
||||
Input,
|
||||
Menu,
|
||||
PageHeader,
|
||||
Space,
|
||||
Statistic,
|
||||
@@ -121,13 +120,10 @@ export function ProductionListTable({
|
||||
const headerItem = (col) => (
|
||||
<Dropdown
|
||||
className="prod-header-dropdown"
|
||||
overlay={
|
||||
<Menu onClick={removeColumn}>
|
||||
<Menu.Item key={col.key}>
|
||||
{t("production.actions.removecolumn")}
|
||||
</Menu.Item>
|
||||
</Menu>
|
||||
}
|
||||
menu={{
|
||||
onClick: removeColumn,
|
||||
items: [{ key: col.key, label: t("production.actions.removecolumn") }],
|
||||
}}
|
||||
trigger={["contextMenu"]}
|
||||
>
|
||||
<span>{col.title}</span>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { useMutation } from "@apollo/client";
|
||||
import { Dropdown, Menu, notification } from "antd";
|
||||
import { Dropdown, notification } from "antd";
|
||||
import moment from "moment";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||
import { INSERT_APPOINTMENT_BLOCK } from "../../graphql/appointments.queries";
|
||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
bodyshop: selectBodyshop,
|
||||
@@ -55,15 +55,12 @@ export function ScheduleBlockDay({
|
||||
}
|
||||
};
|
||||
|
||||
const menu = (
|
||||
<Menu onClick={handleMenu}>
|
||||
<Menu.Item key="block">{t("appointments.actions.block")}</Menu.Item>
|
||||
</Menu>
|
||||
);
|
||||
|
||||
return (
|
||||
<Dropdown
|
||||
overlay={menu}
|
||||
menu={{
|
||||
onClick: handleMenu,
|
||||
items: [{ key: 'block', label: t("appointments.actions.block") }],
|
||||
}}
|
||||
disabled={alreadyBlocked}
|
||||
trigger={["contextMenu"]}
|
||||
>
|
||||
|
||||
@@ -30,50 +30,68 @@ export function TechSider({ technician, techLogout }) {
|
||||
|
||||
return (
|
||||
<Sider collapsible collapsed={collapsed} onCollapse={onCollapse}>
|
||||
<Menu theme="dark" defaultSelectedKeys={["1"]} mode="inline">
|
||||
<Menu.Item
|
||||
key="1"
|
||||
disabled={!!technician}
|
||||
icon={<Icon component={FiLogIn} />}
|
||||
>
|
||||
<Link to={`/tech/login`}>{t("menus.tech.login")}</Link>
|
||||
</Menu.Item>
|
||||
<Menu.Item key="2" disabled={!!!technician} icon={<SearchOutlined />}>
|
||||
<Link to={`/tech/joblookup`}>{t("menus.tech.joblookup")}</Link>
|
||||
</Menu.Item>
|
||||
<Menu.Item
|
||||
key="3"
|
||||
disabled={!!!technician}
|
||||
icon={<Icon component={FaBusinessTime} />}
|
||||
>
|
||||
<Link to={`/tech/jobclock`}>{t("menus.tech.jobclockin")}</Link>
|
||||
</Menu.Item>
|
||||
<Menu.Item
|
||||
key="4"
|
||||
disabled={!!!technician}
|
||||
icon={<Icon component={MdTimer} />}
|
||||
>
|
||||
<Link to={`/tech/shiftclock`}>{t("menus.tech.shiftclockin")}</Link>
|
||||
</Menu.Item>
|
||||
<Menu.Item key="5" disabled={!!!technician} icon={<ScheduleOutlined />}>
|
||||
<Link to={`/tech/list`}>{t("menus.tech.productionlist")}</Link>
|
||||
</Menu.Item>
|
||||
<Menu.Item
|
||||
key="6"
|
||||
disabled={!!!technician}
|
||||
icon={<Icon component={BsKanban} />}
|
||||
>
|
||||
<Link to={`/tech/board`}> {t("menus.tech.productionboard")}</Link>
|
||||
</Menu.Item>
|
||||
<Menu.Item
|
||||
key="7"
|
||||
disabled={!!!technician}
|
||||
onClick={() => techLogout()}
|
||||
icon={<Icon component={FiLogOut} />}
|
||||
>
|
||||
{t("menus.tech.logout")}
|
||||
</Menu.Item>
|
||||
</Menu>
|
||||
<Menu
|
||||
theme="dark"
|
||||
defaultSelectedKeys={["1"]}
|
||||
mode="inline"
|
||||
items={[
|
||||
{
|
||||
key: "login",
|
||||
disabled: !!technician,
|
||||
icon: <Icon component={FiLogIn} />,
|
||||
label: <Link to={`/tech/login`}>{t("menus.tech.login")}</Link>,
|
||||
},
|
||||
{
|
||||
key: "joblookup",
|
||||
disabled: !!!technician,
|
||||
icon: <SearchOutlined />,
|
||||
label: (
|
||||
<Link to={`/tech/joblookup`}>{t("menus.tech.joblookup")}</Link>
|
||||
),
|
||||
},
|
||||
{
|
||||
key: "jobclockin",
|
||||
disabled: !!!technician,
|
||||
icon: <Icon component={FaBusinessTime} />,
|
||||
label: (
|
||||
<Link to={`/tech/jobclock`}>{t("menus.tech.jobclockin")}</Link>
|
||||
),
|
||||
},
|
||||
{
|
||||
key: "shiftclock",
|
||||
disabled: !!!technician,
|
||||
icon: <Icon component={MdTimer} />,
|
||||
label: (
|
||||
<Link to={`/tech/shiftclock`}>
|
||||
{t("menus.tech.shiftclockin")}
|
||||
</Link>
|
||||
),
|
||||
},
|
||||
{
|
||||
key: "prodlist",
|
||||
disabled: !!!technician,
|
||||
icon: <ScheduleOutlined />,
|
||||
label: (
|
||||
<Link to={`/tech/list`}>{t("menus.tech.productionlist")}</Link>
|
||||
),
|
||||
},
|
||||
{
|
||||
key: "prodboard",
|
||||
disabled: !!!technician,
|
||||
icon: <Icon component={BsKanban} />,
|
||||
label: (
|
||||
<Link to={`/tech/board`}> {t("menus.tech.productionboard")}</Link>
|
||||
),
|
||||
},
|
||||
{
|
||||
key: "logout",
|
||||
disabled: !!!technician,
|
||||
onClick: () => techLogout(),
|
||||
icon: <Icon component={FiLogOut} />,
|
||||
label: t("menus.tech.logout"),
|
||||
},
|
||||
]}
|
||||
></Menu>
|
||||
</Sider>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -3,11 +3,10 @@ import {
|
||||
Col,
|
||||
Dropdown,
|
||||
Form,
|
||||
Menu,
|
||||
PageHeader,
|
||||
Row,
|
||||
Space,
|
||||
Typography,
|
||||
Typography
|
||||
} from "antd";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
@@ -76,10 +75,11 @@ export function ContractDetailPage({
|
||||
</Button>
|
||||
<Dropdown
|
||||
trigger="click"
|
||||
overlay={
|
||||
<Menu>
|
||||
<Menu.Item
|
||||
onClick={() =>
|
||||
menu={{
|
||||
items: [
|
||||
{
|
||||
key: "contract",
|
||||
onClick: () =>
|
||||
GenerateDocument(
|
||||
{
|
||||
name: TemplateList("courtesycarcontract")
|
||||
@@ -88,13 +88,15 @@ export function ContractDetailPage({
|
||||
},
|
||||
{},
|
||||
"p"
|
||||
)
|
||||
}
|
||||
>
|
||||
{t("contracts.actions.printcontract")}
|
||||
</Menu.Item>
|
||||
<Menu.Item
|
||||
onClick={() =>
|
||||
),
|
||||
label: t("contracts.actions.printcontract"),
|
||||
},
|
||||
{
|
||||
key: "terms",
|
||||
label: t(
|
||||
"printcenter.courtesycarcontract.courtesy_car_terms"
|
||||
),
|
||||
onClick: () =>
|
||||
GenerateDocument(
|
||||
{
|
||||
name: TemplateList("courtesycarcontract")
|
||||
@@ -103,15 +105,14 @@ export function ContractDetailPage({
|
||||
},
|
||||
{},
|
||||
"p"
|
||||
)
|
||||
}
|
||||
>
|
||||
{t(
|
||||
"printcenter.courtesycarcontract.courtesy_car_terms"
|
||||
)}
|
||||
</Menu.Item>
|
||||
<Menu.Item
|
||||
onClick={() =>
|
||||
),
|
||||
},
|
||||
{
|
||||
key: "impound",
|
||||
label: t(
|
||||
"printcenter.courtesycarcontract.courtesy_car_impound"
|
||||
),
|
||||
onClick: () =>
|
||||
GenerateDocument(
|
||||
{
|
||||
name: TemplateList("courtesycarcontract")
|
||||
@@ -120,15 +121,10 @@ export function ContractDetailPage({
|
||||
},
|
||||
{},
|
||||
"p"
|
||||
)
|
||||
}
|
||||
>
|
||||
{t(
|
||||
"printcenter.courtesycarcontract.courtesy_car_impound"
|
||||
)}
|
||||
</Menu.Item>
|
||||
</Menu>
|
||||
}
|
||||
),
|
||||
},
|
||||
],
|
||||
}}
|
||||
>
|
||||
<Button>{t("general.labels.print")}</Button>
|
||||
</Dropdown>
|
||||
|
||||
@@ -142,7 +142,7 @@ middlewares.push(
|
||||
|
||||
const cache = new InMemoryCache({});
|
||||
|
||||
export default new ApolloClient({
|
||||
const c = new ApolloClient({
|
||||
link: ApolloLink.from(middlewares),
|
||||
cache,
|
||||
connectToDevTools: process.env.NODE_ENV !== "production",
|
||||
@@ -161,3 +161,5 @@ export default new ApolloClient({
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export default c;
|
||||
|
||||
Reference in New Issue
Block a user