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