Additional Menu Refactors
Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
@@ -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";
|
||||
@@ -24,8 +24,7 @@ export function ContractsRatesChangeButton({ disabled, form, bodyshop }) {
|
||||
value: i,
|
||||
}));
|
||||
|
||||
const menu = {items: menuItems, onClick: handleClick}
|
||||
|
||||
const menu = {items: menuItems, onClick: handleClick};
|
||||
|
||||
return (
|
||||
<Dropdown menu={menu} disabled={disabled}>
|
||||
|
||||
@@ -4,7 +4,6 @@ import {
|
||||
Card,
|
||||
Dropdown,
|
||||
Input,
|
||||
Menu,
|
||||
Space,
|
||||
Table,
|
||||
Tooltip,
|
||||
@@ -197,6 +196,8 @@ export default function CourtesyCarsList({ loading, courtesycars, refetch }) {
|
||||
},
|
||||
];
|
||||
|
||||
const menu = { items };
|
||||
|
||||
return (
|
||||
<Card
|
||||
title={t("menus.header.courtesycars")}
|
||||
@@ -205,8 +206,7 @@ export default function CourtesyCarsList({ loading, courtesycars, refetch }) {
|
||||
<Button onClick={() => refetch()}>
|
||||
<SyncOutlined />
|
||||
</Button>
|
||||
<Dropdown trigger="click" menu={{items}}
|
||||
>
|
||||
<Dropdown trigger="click" menu={menu}>
|
||||
<Button>{t("general.labels.print")}</Button>
|
||||
</Dropdown>
|
||||
<Link to={`/manage/courtesycars/new`}>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Icon, { SyncOutlined } from "@ant-design/icons";
|
||||
import { gql, useMutation, useQuery } from "@apollo/client";
|
||||
import { Button, Dropdown, Menu, Space, notification } from "antd";
|
||||
import { Button, Dropdown, Space, notification } from "antd";
|
||||
import {PageHeader} from "@ant-design/pro-layout";
|
||||
import i18next from "i18next";
|
||||
import _ from "lodash";
|
||||
|
||||
@@ -7,7 +7,6 @@ import {
|
||||
Form,
|
||||
Input,
|
||||
InputNumber,
|
||||
Menu,
|
||||
Select,
|
||||
Space,
|
||||
Statistic,
|
||||
|
||||
@@ -48,7 +48,7 @@ export function JobAltTransportChange({ bodyshop, job }) {
|
||||
],
|
||||
onClick: onClick,
|
||||
defaultSelectedKeys: [job && job.alt_transport]
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<Dropdown menu={menu}>
|
||||
|
||||
@@ -419,7 +419,7 @@ export function JobLinesComponent({
|
||||
{ type: 'divider' },
|
||||
{ key: "clear", label: t("general.labels.clear") },
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div>
|
||||
|
||||
@@ -1,58 +1,58 @@
|
||||
import { DownOutlined } from "@ant-design/icons";
|
||||
import { Dropdown } from "antd";
|
||||
import {DownOutlined} from "@ant-design/icons";
|
||||
import {Dropdown} from "antd";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
import {useTranslation} from "react-i18next";
|
||||
import {connect} from "react-redux";
|
||||
import {createStructuredSelector} from "reselect";
|
||||
import {selectBodyshop} from "../../redux/user/user.selectors";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
//currentUser: selectCurrentUser
|
||||
bodyshop: selectBodyshop,
|
||||
//currentUser: selectCurrentUser
|
||||
bodyshop: selectBodyshop,
|
||||
});
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||
});
|
||||
|
||||
export function JoblinePresetButton({ bodyshop, form }) {
|
||||
const { t } = useTranslation();
|
||||
export function JoblinePresetButton({bodyshop, form}) {
|
||||
const {t} = useTranslation();
|
||||
|
||||
const handleSelect = (item) => {
|
||||
form.setFieldsValue(item);
|
||||
};
|
||||
const handleSelect = (item) => {
|
||||
form.setFieldsValue(item);
|
||||
};
|
||||
|
||||
|
||||
const menu = {
|
||||
items: bodyshop.md_jobline_presets.map((i, idx) => ({
|
||||
key: idx,
|
||||
label: i.label,
|
||||
style: { breakInside: "avoid" },
|
||||
onClick: () => handleSelect(i),
|
||||
})),
|
||||
const menu = {
|
||||
items: bodyshop.md_jobline_presets.map((i, idx) => ({
|
||||
key: idx,
|
||||
label: i.label,
|
||||
style: {breakInside: "avoid"},
|
||||
onClick: () => handleSelect(i),
|
||||
})),
|
||||
style: {
|
||||
columnCount: Math.max(
|
||||
Math.floor(bodyshop.md_jobline_presets.length / 15),
|
||||
1
|
||||
),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Dropdown trigger={["click"]} menu={menu}>
|
||||
<a
|
||||
className="ant-dropdown-link"
|
||||
href="# "
|
||||
onClick={(e) => e.preventDefault()}
|
||||
>
|
||||
{t("joblines.labels.presets")} <DownOutlined />
|
||||
</a>
|
||||
</Dropdown>
|
||||
</div>
|
||||
);
|
||||
return (
|
||||
<div>
|
||||
<Dropdown trigger={["click"]} menu={menu}>
|
||||
<a
|
||||
className="ant-dropdown-link"
|
||||
href="# "
|
||||
onClick={(e) => e.preventDefault()}
|
||||
>
|
||||
{t("joblines.labels.presets")} <DownOutlined/>
|
||||
</a>
|
||||
</Dropdown>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(JoblinePresetButton);
|
||||
|
||||
@@ -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,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";
|
||||
|
||||
@@ -153,6 +153,7 @@ export function JobsDetailHeaderAddEvent({ bodyshop, jobid, ...props }) {
|
||||
setVisibility(true);
|
||||
};
|
||||
|
||||
// TODO - Client Update - Why is this a menu item?
|
||||
return (
|
||||
<Popover content={overlay} open={visibility}>
|
||||
<Menu.Item {...props} onClick={handleClick}>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import {DeleteFilled, DownOutlined, WarningFilled} from "@ant-design/icons";
|
||||
import {useSplitTreatments} from "@splitsoftware/splitio-react";
|
||||
import {Checkbox, Divider, Dropdown, Form, Input, InputNumber, Menu, Radio, Select, Space, Tag,} from "antd";
|
||||
import {Checkbox, Divider, Dropdown, Form, Input, InputNumber, Radio, Select, Space, Tag,} from "antd";
|
||||
import React from "react";
|
||||
import {useTranslation} from "react-i18next";
|
||||
import {connect} from "react-redux";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React from "react";
|
||||
import { Button, Dropdown, Menu } from "antd";
|
||||
import { Button, Dropdown } from "antd";
|
||||
import dataSource from "./production-list-columns.data";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
@@ -61,7 +61,7 @@ export function ProductionColumnsComponent({
|
||||
},
|
||||
onClick: handleAdd,
|
||||
};
|
||||
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Dropdown menu={menu}>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
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";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
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";
|
||||
|
||||
@@ -66,11 +66,7 @@ export function ScheduleBlockDay({
|
||||
}
|
||||
|
||||
return (
|
||||
<Dropdown
|
||||
menu={menu}
|
||||
disabled={alreadyBlocked}
|
||||
trigger={["contextMenu"]}
|
||||
>
|
||||
<Dropdown menu={menu} disabled={alreadyBlocked} trigger={["contextMenu"]}>
|
||||
{children}
|
||||
</Dropdown>
|
||||
);
|
||||
|
||||
@@ -80,9 +80,9 @@ export function ShopTemplateAddComponent({ bodyshop, shopTemplateList, refetch})
|
||||
|
||||
return (
|
||||
<Dropdown menu={menu}>
|
||||
<span>
|
||||
{t("bodyshop.actions.addtemplate")} <DownOutlined/>
|
||||
</span>
|
||||
<span>
|
||||
{t("bodyshop.actions.addtemplate")} <DownOutlined/>
|
||||
</span>
|
||||
</Dropdown>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user