Majority of Dropdown Overlay Menu refactors.

Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
Dave Richer
2023-12-29 13:26:37 -05:00
parent 79dce5d069
commit 07b46ed92b
32 changed files with 744 additions and 833 deletions

View File

@@ -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";
@@ -81,32 +81,28 @@ export function JobsChangeStatus({ job, bodyshop, jobRO, insertAuditTrail }) {
}
}, [job, setAvailableStatuses, bodyshop]);
const statusmenu = (
<Menu
onClick={(e) => {
updateJobStatus(e.key);
}}
items={[
...availableStatuses.map((item) => ({
key: item,
label: item,
})),
...(job.converted
? [
{ key: "divider", label: <hr />, disabled: true },
...otherStages.map((item) => ({
key: item,
label: item,
})),
]
: []),
]}
/>
);
const statusMenu = {
items: [
...availableStatuses.map((item) => ({
key: item,
label: item,
})),
...(job.converted
? [
{ key: "divider", label: <hr />, disabled: true },
...otherStages.map((item) => ({
key: item,
label: item,
})),
]
: []),
],
onClick: (e) => updateJobStatus(e.key)
}
return (
<Dropdown
menu={statusmenu}
menu={statusMenu}
trigger={["click"]}
key="changestatus"
disabled={jobRO || !job.converted}