Revert all package upgrades to unblock testing.

This commit is contained in:
Patrick Fic
2023-01-25 11:20:51 -08:00
parent d8cc25a54f
commit 66a80e439f
131 changed files with 18482 additions and 10892 deletions

View File

@@ -1,5 +1,6 @@
// craco.config.js
const TerserPlugin = require("terser-webpack-plugin");
const CracoLessPlugin = require("craco-less");
const SentryWebpackPlugin = require("@sentry/webpack-plugin");
module.exports = {
@@ -19,6 +20,37 @@ module.exports = {
ignore: ["node_modules", "webpack.config.js"],
},
},
{
plugin: CracoLessPlugin,
options: {
lessLoaderOptions: {
lessOptions: {
modifyVars: {
...(process.env.NODE_ENV === "development"
? { "@primary-color": "#B22234" }
: {
//"@primary-color": "#1DA57A"
}),
// "@primary-color": " #1890ff", // primary color for all components
// "@link-color": "#1890ff", // link color
// "@success-color": "#52c41a", // success state color
// "@warning-color": "#faad14", // warning state color
// "@error-color": "#f5222d", // error state color
// "@font-size-base": "14px", // major text font size
// " @heading-color": "rgba(0, 0, 0, 0.85)", // heading text color
// "@text-color": "rgba(0, 0, 0, 0.65)", // major text color
// "@text-color-secondary": "rgba(0, 0, 0, 0.45)", // secondary text color
// "@disabled-color": "rgba(0, 0, 0, 0.25)", // disable state color
// "@border-radius-base": "2px", // major border radius
// "@border-color-base": "#d9d9d9", // major border color
// "@box-shadow-base":
// "0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08),0 9px 28px 8px rgba(0, 0, 0, 0.05); // major shadow for layers }",
},
javascriptEnabled: true,
},
},
},
},
],
webpack: {
configure: (webpackConfig) => ({

View File

@@ -4,55 +4,59 @@
"private": true,
"proxy": "http://localhost:4000",
"dependencies": {
"@ant-design/pro-layout": "^7.6.1",
"@apollo/client": "^3.6.9",
"@asseinfo/react-kanban": "^2.2.0",
"@craco/craco": "^7.0.0",
"@craco/craco": "^6.4.5",
"@fingerprintjs/fingerprintjs": "^3.3.3",
"@jsreport/browser-client": "^3.1.0",
"@sentry/react": "^7.28.1",
"@sentry/tracing": "^7.28.1",
"@splitsoftware/splitio-react": "^1.6.0",
"@tanem/react-nprogress": "^5.0.8",
"antd": "5.1.5",
"antd": "^4.22.3",
"apollo-link-logger": "^2.0.0",
"axios": "^1.2.3",
"axios": "^0.27.2",
"craco-less": "^1.20.0",
"dinero.js": "^1.9.1",
"dotenv": "^16.0.1",
"enquire-js": "^0.2.1",
"env-cmd": "^10.1.0",
"exifr": "^7.1.3",
"firebase": "^9.9.1",
"graphql": "^16.5.0",
"i18next": "^22.4.6",
"i18next-browser-languagedetector": "^7.0.1",
"i18next": "^21.8.14",
"i18next-browser-languagedetector": "^6.1.4",
"jsoneditor": "^9.9.0",
"jsreport-browser-client-dist": "^1.3.0",
"libphonenumber-js": "^1.10.9",
"logrocket": "^3.0.1",
"markerjs2": "^2.22.0",
"moment-business-days": "^1.2.0",
"moment-timezone": "^0.5.34",
"normalize-url": "^8.0.0",
"phone": "^3.1.32",
"normalize-url": "^7.0.3",
"phone": "^3.1.23",
"preval.macro": "^5.0.0",
"prop-types": "^15.8.1",
"query-string": "^8.1.0",
"query-string": "^7.1.1",
"rc-queue-anim": "^2.0.0",
"rc-scroll-anim": "^2.7.6",
"react": "^18.2.0",
"react-big-calendar": "^1.5.2",
"react": "^17.0.2",
"react-big-calendar": "^1.5.0",
"react-color": "^2.19.3",
"react-dom": "^18.2.0",
"react-drag-listview": "^2.0.0",
"react-grid-gallery": "^1.0.0",
"react-cookie": "^4.1.1",
"react-dom": "^17.0.2",
"react-drag-listview": "^0.2.1",
"react-grid-gallery": "^0.5.5",
"react-grid-layout": "^1.3.4",
"react-i18next": "^12.1.1",
"react-icons": "^4.7.1",
"react-image-lightbox": "^5.1.4",
"react-number-format": "^5.1.2",
"react-redux": "^8.0.5",
"react-i18next": "^11.18.1",
"react-icons": "^4.4.0",
"react-number-format": "^4.9.3",
"react-redux": "^7.2.8",
"react-resizable": "^3.0.4",
"react-router-dom": "^5.3.0",
"react-scripts": "^5.0.1",
"react-scripts": "^4.0.3",
"react-sticky": "^6.0.3",
"react-sublime-video": "^0.2.5",
"react-virtualized": "^9.22.3",
"recharts": "^2.1.12",
"redux": "^4.2.0",
@@ -64,7 +68,7 @@
"socket.io-client": "^4.5.1",
"styled-components": "^5.3.5",
"subscriptions-transport-ws": "^0.11.0",
"web-vitals": "^3.1.0",
"web-vitals": "^2.1.4",
"workbox-background-sync": "^6.5.3",
"workbox-broadcast-update": "^6.5.3",
"workbox-cacheable-response": "^6.5.3",
@@ -76,12 +80,12 @@
"workbox-range-requests": "^6.5.3",
"workbox-routing": "^6.5.3",
"workbox-strategies": "^6.5.3",
"workbox-streams": "^6.5.3"
"workbox-streams": "^6.5.3",
"yauzl": "^2.10.0"
},
"scripts": {
"analyze": "source-map-explorer 'build/static/js/*.js'",
"start": "craco start",
"startrs": "react-scripts start",
"build": "REACT_APP_GIT_SHA=`git rev-parse --short HEAD` craco build",
"build:test": "env-cmd -f .env.test yarn run build",
"build-deploy:test": "yarn run build:test && s3cmd sync build/* s3://imex-online-test && echo '🚀 TESTING Deployed!'",
@@ -114,8 +118,8 @@
},
"devDependencies": {
"@sentry/webpack-plugin": "^1.20.0",
"@testing-library/cypress": "^9.0.0",
"cypress": "^12.3.0",
"@testing-library/cypress": "^8.0.3",
"cypress": "^10.3.1",
"eslint-plugin-cypress": "^2.12.1",
"react-error-overlay": "6.0.11",
"redux-logger": "^3.0.6",

View File

@@ -61,7 +61,7 @@ export function AllocationsAssignmentComponent({
);
return (
<Popover content={popContent} open={visibility}>
<Popover content={popContent} visible={visibility}>
<Button onClick={() => setVisibility(true)}>
{t("allocations.actions.assign")}
</Button>

View File

@@ -59,7 +59,7 @@ export default connect(
);
return (
<Popover content={popContent} open={visibility}>
<Popover content={popContent} visible={visibility}>
<Button disabled={disabled} onClick={() => setVisibility(true)}>
{t("allocations.actions.assign")}
</Button>

View File

@@ -1,6 +1,5 @@
import { useMutation, useQuery } from "@apollo/client";
import { PageHeader } from '@ant-design/pro-layout';
import { Button, Form, Popconfirm, Space } from "antd";
import { Button, Form, PageHeader, Popconfirm, Space } from "antd";
import moment from "moment";
import queryString from "query-string";
import React, { useState } from "react";
@@ -179,7 +178,7 @@ export function BillDetailEditcontainer({
<BillDetailEditReturn data={data} />
<Popconfirm
open={visible}
visible={visible}
onConfirm={() => form.submit()}
onCancel={() => setVisible(false)}
okButtonProps={{ loading: updateLoading }}

View File

@@ -77,7 +77,7 @@ export function BillDetailEditReturn({
return (
<>
<Modal
open={visible}
visible={visible}
onCancel={() => setVisible(false)}
destroyOnClose
title={t("bills.actions.return")}

View File

@@ -32,7 +32,7 @@ export default function BillDetailEditcontainer() {
history.push({ search: queryString.stringify(search) });
}}
destroyOnClose
open={search.billid}
visible={search.billid}
>
<BillDetailEditComponent />
</Drawer>

View File

@@ -344,7 +344,7 @@ function BillEnterModalContainer({
<Modal
title={t("bills.labels.new")}
width={"98%"}
open={billEnterModal.visible}
visible={billEnterModal.visible}
okText={t("general.actions.save")}
keyboard="false"
onOk={() => form.submit()}

View File

@@ -70,7 +70,7 @@ export function ContractsFindModalContainer({
return (
<Modal
open={visible}
visible={visible}
width="70%"
title={t("payments.labels.findermodal")}
onCancel={() => toggleModalVisible()}

View File

@@ -35,7 +35,7 @@ export default function CABCpvrtCalculator({ disabled, form }) {
<Popover
destroyTooltipOnHide
content={popContent}
open={visibility}
visible={visibility}
disabled={disabled}
>
<Button disabled={disabled} onClick={() => setVisibility(true)}>

View File

@@ -88,8 +88,8 @@ export function ChatMediaSelector({
}
title={t("messaging.labels.selectmedia")}
trigger="click"
open={visible}
onOpenChange={handleVisibleChange}
visible={visible}
onVisibleChange={handleVisibleChange}
>
<Badge count={selectedMedia.filter((s) => s.isSelected).length}>
<PictureFilled style={{ margin: "0 .5rem" }} />

View File

@@ -1,5 +1,5 @@
import { PlusCircleOutlined } from "@ant-design/icons";
import { Dropdown } from "antd";
import { Dropdown, Menu } from "antd";
import React from "react";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
@@ -16,15 +16,19 @@ const mapDispatchToProps = (dispatch) => ({
});
export function ChatPresetsComponent({ bodyshop, setMessage, className }) {
const menu = bodyshop.md_messaging_presets.map((i, idx) => ({
label: i.label,
key: idx,
onClick: () => setMessage(i.text),
}));
const menu = (
<Menu>
{bodyshop.md_messaging_presets.map((i, idx) => (
<Menu.Item onClick={() => setMessage(i.text)} key={idx}>
{i.label}
</Menu.Item>
))}
</Menu>
);
return (
<div className={className}>
<Dropdown trigger={["click"]} menu={{ items: menu }} placement="top">
<Dropdown trigger={["click"]} overlay={menu}>
<PlusCircleOutlined />
</Dropdown>
</div>

View File

@@ -390,7 +390,7 @@ export function ContractConvertToRo({
return (
<div>
<Popover content={popContent} open={visible}>
<Popover content={popContent} visible={visible}>
<Button
onClick={() => setVisible(true)}
loading={loading}

View File

@@ -55,7 +55,7 @@ export default function ContractLicenseDecodeButton({ form }) {
return (
<div>
<Modal
open={modalVisible}
visible={modalVisible}
okText={t("contracts.actions.senddltoform")}
onOk={handleInsertForm}
okButtonProps={{ disabled: !!!decodedBarcode }}

View File

@@ -59,7 +59,7 @@ export function ContractsFindModalContainer({
return (
<Modal
open={visible}
visible={visible}
width="70%"
title={t("contracts.labels.findermodal")}
onCancel={() => toggleModalVisible()}

View File

@@ -1,5 +1,5 @@
import { DownOutlined } from "@ant-design/icons";
import { Dropdown } from "antd";
import { Dropdown, Menu } from "antd";
import React from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
@@ -13,14 +13,25 @@ const mapStateToProps = createStructuredSelector({
export function ContractsRatesChangeButton({ disabled, form, bodyshop }) {
const { t } = useTranslation();
const menu = bodyshop.md_ccc_rates.map((rate, idx) => ({
onClick: () => form.setFieldsValue(rate),
key: idx,
label: rate.label,
}));
const handleClick = ({ item, key, keyPath }) => {
const { label, ...rate } = item.props.value;
form.setFieldsValue(rate);
};
const menu = (
<div>
<Menu onClick={handleClick}>
{bodyshop.md_ccc_rates.map((rate, idx) => (
<Menu.Item value={rate} key={idx}>
{rate.label}
</Menu.Item>
))}
</Menu>
</div>
);
return (
<Dropdown menu={{ items: menu }} disabled={disabled}>
<Dropdown overlay={menu} disabled={disabled}>
<a
className="ant-dropdown-link"
href=" #"

View File

@@ -1,7 +1,6 @@
import { WarningFilled } from "@ant-design/icons";
import { useApolloClient } from "@apollo/client";
import { PageHeader } from '@ant-design/pro-layout';
import { Button, Form, Input, InputNumber, Space } from "antd";
import { Button, Form, Input, InputNumber, PageHeader, Space } from "antd";
import moment from "moment";
import React from "react";
import { useTranslation } from "react-i18next";

View File

@@ -64,7 +64,7 @@ export function CCReturnModalContainer({
return (
<Modal
title={t("courtesycars.labels.return")}
open={visible}
visible={visible}
onCancel={() => toggleModalVisible()}
width={"90%"}
okText={t("general.actions.save")}

View File

@@ -3,19 +3,21 @@ import {
Button,
Card,
Dropdown,
Input, Space,
Input,
Menu,
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 { GenerateDocument } from "../../utils/RenderTemplate";
import { alphaSort } from "../../utils/sorters";
import { TemplateList } from "../../utils/TemplateConstants";
import { OwnerNameDisplayFunction } from "../owner-name-display/owner-name-display.component";
import moment from "moment";
import { GenerateDocument } from "../../utils/RenderTemplate";
import { TemplateList } from "../../utils/TemplateConstants";
export default function CourtesyCarsList({ loading, courtesycars, refetch }) {
const [state, setState] = useState({
sortedInfo: {},
@@ -177,14 +179,10 @@ export default function CourtesyCarsList({ loading, courtesycars, refetch }) {
</Button>
<Dropdown
trigger="click"
menu={{
items: [
{
label: t(
"printcenter.courtesycarcontract.courtesy_car_inventory"
),
key: "cc_inv",
onClick: () =>
overlay={
<Menu>
<Menu.Item
onClick={() =>
GenerateDocument(
{
name: TemplateList("courtesycar").courtesy_car_inventory
@@ -195,10 +193,13 @@ export default function CourtesyCarsList({ loading, courtesycars, refetch }) {
},
{},
"p"
),
},
],
}}
)
}
>
{t("printcenter.courtesycarcontract.courtesy_car_inventory")}
</Menu.Item>
</Menu>
}
>
<Button>{t("general.labels.print")}</Button>
</Dropdown>

View File

@@ -1,7 +1,6 @@
import Icon, { SyncOutlined } from "@ant-design/icons";
import { gql, useMutation, useQuery } from "@apollo/client";
import { PageHeader } from '@ant-design/pro-layout';
import { Button, Dropdown, Menu, notification, Space } from "antd";
import { Button, Dropdown, Menu, notification, PageHeader, Space } from "antd";
import i18next from "i18next";
import _ from "lodash";
import moment from "moment";
@@ -118,15 +117,17 @@ export function DashboardGridComponent({ currentUser, bodyshop }) {
);
const existingLayoutKeys = state.items.map((i) => i.i);
const addComponentOverlay = (
<Menu
onClick={handleAddComponent}
items={Object.keys(componentList).map((key) => ({
key: key,
value: key,
disabled: existingLayoutKeys.includes(key),
label: componentList[key].label,
}))}
></Menu>
<Menu onClick={handleAddComponent}>
{Object.keys(componentList).map((key) => (
<Menu.Item
key={key}
value={key}
disabled={existingLayoutKeys.includes(key)}
>
{componentList[key].label}
</Menu.Item>
))}
</Menu>
);
if (error) return <AlertComponent message={error.message} type="error" />;
@@ -282,12 +283,8 @@ const createDashboardQuery = (state) => {
monthly_sales: jobs(where: {_and: [
{ voided: {_eq: false}},
{date_invoiced: {_gte: "${moment()
.startOf("month")
.startOf("day")
.toISOString()}"}}, {date_invoiced: {_lte: "${moment()
.endOf("month")
.endOf("day")
.toISOString()}"}}]}) {
.startOf("month").startOf('day').toISOString()}"}}, {date_invoiced: {_lte: "${moment()
.endOf("month").endOf('day').toISOString()}"}}]}) {
id
ro_number
date_invoiced

View File

@@ -51,7 +51,7 @@ export function DmsCdkVehicles({ bodyshop, form, socket, job }) {
<>
<Modal
width={"90%"}
open={visible}
visible={visible}
onCancel={() => setVisible(false)}
onOk={() => {
form.setFieldsValue({

View File

@@ -6,10 +6,12 @@ import {
Dropdown,
Form,
Input,
InputNumber, Select,
InputNumber,
Menu,
Select,
Space,
Statistic,
Typography
Typography,
} from "antd";
import Dinero from "dinero.js";
import moment from "moment";
@@ -275,32 +277,36 @@ export function DmsPostForm({ bodyshop, socket, job, logsRef }) {
<div>
{t("jobs.fields.dms.payer.controlnumber")}{" "}
<Dropdown
menu={{
items:
bodyshop.cdk_configuration.controllist &&
bodyshop.cdk_configuration.controllist.map(
(key, idx) => ({
key: idx,
label: key.name,
onClick: () => {
form.setFieldsValue({
payers: form
.getFieldValue("payers")
.map((row, mapIndex) => {
if (index !== mapIndex)
return row;
overlay={
<Menu>
{bodyshop.cdk_configuration.controllist &&
bodyshop.cdk_configuration.controllist.map(
(key, idx) => (
<Menu.Item
key={idx}
onClick={() => {
form.setFieldsValue({
payers: form
.getFieldValue("payers")
.map((row, mapIndex) => {
if (index !== mapIndex)
return row;
return {
...row,
controlnumber:
key.controlnumber,
};
}),
});
},
})
),
}}
return {
...row,
controlnumber:
key.controlnumber,
};
}),
});
}}
>
{key.name}
</Menu.Item>
)
)}
</Menu>
}
>
<a href=" #" onClick={(e) => e.preventDefault()}>
<DownOutlined />

View File

@@ -57,23 +57,20 @@ export function EmailOverlayComponent({
const menu = (
<div>
<Menu
onClick={handleClick}
items={[
...bodyshop.employees
.filter((e) => e.user_email)
.map((e, idx) => ({
value: e.user_email,
key: idx,
label: `${e.first_name} ${e.last_name}`,
})),
...bodyshop.md_to_emails.map((e, idx) => ({
value: e.emails,
key: idx + "group",
label: e.label,
})),
]}
/>
<Menu onClick={handleClick}>
{bodyshop.employees
.filter((e) => e.user_email)
.map((e, idx) => (
<Menu.Item value={e.user_email} key={idx}>
{`${e.first_name} ${e.last_name}`}
</Menu.Item>
))}
{bodyshop.md_to_emails.map((e, idx) => (
<Menu.Item value={e.emails} key={idx + "group"}>
{e.label}
</Menu.Item>
))}
</Menu>
</div>
);

View File

@@ -174,7 +174,7 @@ export function EmailOverlayContainer({
return (
<Modal
destroyOnClose={true}
open={modalVisible}
visible={modalVisible}
maskClosable={false}
width={"80%"}
onOk={() => form.submit()}

View File

@@ -94,7 +94,7 @@ const FormInputNUmberCalculator = (
return (
<div>
<Popover content={popContent} open={history.length > 0}>
<Popover content={popContent} visible={history.length > 0}>
<InputNumber
ref={ref}
value={value}

View File

@@ -106,421 +106,304 @@ function Header({
selectedKeys={[selectedHeader]}
onClick={handleMenuClick}
subMenuCloseDelay={0.3}
items={[
{
key: "home",
icon: <HomeFilled />,
label: <Link to="/manage">{t("menus.header.home")}</Link>,
},
{
key: "schedule",
icon: <Icon component={FaCalendarAlt} />,
label: (
<Link to="/manage/schedule">{t("menus.header.schedule")}</Link>
),
},
{
key: "jobssubmenu",
icon: <Icon component={FaCarCrash} />,
label: t("menus.header.jobs"),
children: [
{
key: "activejobs",
icon: <FileFilled />,
label: (
<Link to="/manage/jobs">{t("menus.header.activejobs")}</Link>
),
},
{
key: "readyjobs",
icon: <CheckCircleOutlined />,
label: (
<Link to="/manage/jobs/ready">
{t("menus.header.readyjobs")}
</Link>
),
},
{
key: "parts-queue",
icon: <ToolFilled />,
label: (
<Link to="/manage/partsqueue">
{t("menus.header.parts-queue")}
</Link>
),
},
{
key: "availablejobs",
icon: <ImportOutlined />,
label: (
<Link to="/manage/available">
{t("menus.header.availablejobs")}
</Link>
),
},
{
key: "newjob",
icon: <FileAddOutlined />,
label: (
<Link to="/manage/jobs/new">{t("menus.header.newjob")}</Link>
),
},
{ type: "divider" },
{
key: "alljobs",
icon: <UnorderedListOutlined />,
label: (
<Link to="/manage/jobs/all">{t("menus.header.alljobs")}</Link>
),
},
{ type: "divider" },
{
key: "productionlist",
icon: <ScheduleOutlined />,
label: (
<Link to="/manage/production/list">
{t("menus.header.productionlist")}
</Link>
),
},
{
key: "productionboard",
icon: <Icon component={BsKanban} />,
label: (
<Link to="/manage/production/board">
{t("menus.header.productionboard")}
</Link>
),
},
{
type: "divider",
},
{
key: "scoreboard",
icon: <LineChartOutlined />,
label: (
<Link to="/manage/scoreboard">
{t("menus.header.scoreboard")}
</Link>
),
},
],
},
{
key: "customers",
icon: <UserOutlined />,
label: t("menus.header.customers"),
children: [
{
key: "owners",
icon: <TeamOutlined />,
label: (
<Link to="/manage/owners">{t("menus.header.owners")}</Link>
),
},
{
key: "vehicles",
icon: <CarFilled />,
label: (
<Link to="/manage/vehicles">
{t("menus.header.vehicles")}
</Link>
),
},
],
},
{
key: "ccs",
icon: <CarFilled />,
label: t("menus.header.courtesycars"),
children: [
{
key: "courtesycarsall",
icon: <CarFilled />,
label: (
<Link to="/manage/courtesycars">
{t("menus.header.courtesycars-all")}
</Link>
),
},
{
key: "contracts",
icon: <FileFilled />,
label: (
<Link to="/manage/courtesycars/contracts">
{t("menus.header.courtesycars-contracts")}
</Link>
),
},
{
key: "newcontract",
icon: <FileAddFilled />,
label: (
<Link to="/manage/courtesycars/contracts/new">
{t("menus.header.courtesycars-newcontract")}
</Link>
),
},
],
},
{
key: "accounting",
icon: <DollarCircleFilled />,
label: t("menus.header.accounting"),
children: [
{
key: "bills",
icon: <Icon component={FaFileInvoiceDollar} />,
label: (
<Link to="/manage/bills">{t("menus.header.bills")}</Link>
),
},
{
key: "enterbills",
icon: <Icon component={GiPayMoney} />,
onClick: () => {
setBillEnterContext({
actions: {},
context: {},
});
},
label: t("menus.header.enterbills"),
},
...(Simple_Inventory.treatment === "on"
? [
{
type: "divider",
},
{
key: "inventory",
icon: <Icon component={FaFileInvoiceDollar} />,
label: (
<Link to="/manage/inventory">
{t("menus.header.inventory")}
</Link>
),
},
]
: []),
{ type: "divider" },
{
key: "allpayments",
icon: <BankFilled />,
label: (
<Link to="/manage/payments">
{t("menus.header.allpayments")}
</Link>
),
},
{
key: "enterpayments",
onClick: () => {
setPaymentContext({
actions: {},
context: null,
});
},
icon: <Icon component={FaCreditCard} />,
label: t("menus.header.enterpayment"),
},
{ type: "divider" },
{
key: "timetickets",
icon: <FieldTimeOutlined />,
label: (
<Link to="/manage/timetickets">
{t("menus.header.timetickets")}
</Link>
),
},
{
key: "entertimetickets",
icon: <Icon component={GiPlayerTime} />,
onClick: () => {
setTimeTicketContext({
actions: {},
context: {},
});
},
label: t("menus.header.entertimeticket"),
},
{ type: "divider" },
{
key: "accountingexport",
icon: <ExportOutlined />,
label: t("menus.header.export"),
children: [
{
key: "receivables",
label: (
<Link to="/manage/accounting/receivables">
{t("menus.header.accounting-receivables")}
</Link>
),
},
...(!(
(bodyshop && bodyshop.cdk_dealerid) ||
(bodyshop && bodyshop.pbs_serialnumber)
) || DmsAp.treatment === "on"
? [
{
key: "payables",
label: (
<Link to="/manage/accounting/payables">
{t("menus.header.accounting-payables")}
</Link>
),
},
]
: []),
...(!(
(bodyshop && bodyshop.cdk_dealerid) ||
(bodyshop && bodyshop.pbs_serialnumber)
)
? [
{
key: "payments",
label: (
<Link to="/manage/accounting/payments">
{t("menus.header.accounting-payments")}
</Link>
),
},
]
: []),
{
key: "export-logs",
label: (
<Link to="/manage/accounting/exportlogs">
{t("menus.header.export-logs")}
</Link>
),
},
],
},
],
},
{
key: "phonebook",
icon: <PhoneOutlined />,
label: (
<Link to="/manage/phonebook">{t("menus.header.phonebook")}</Link>
),
},
{
key: "temporarydocs",
icon: <PaperClipOutlined />,
label: (
<Link to="/manage/temporarydocs">
{t("menus.header.temporarydocs")}
>
<Menu.Item key="home" icon={<HomeFilled />}>
<Link to="/manage">{t("menus.header.home")}</Link>
</Menu.Item>
<Menu.Item key="schedule" icon={<Icon component={FaCalendarAlt} />}>
<Link to="/manage/schedule">{t("menus.header.schedule")}</Link>
</Menu.Item>
<Menu.SubMenu
key="jobssubmenu"
icon={<Icon component={FaCarCrash} />}
title={t("menus.header.jobs")}
>
<Menu.Item key="activejobs" icon={<FileFilled />}>
<Link to="/manage/jobs">{t("menus.header.activejobs")}</Link>
</Menu.Item>
<Menu.Item key="readyjobs" icon={<CheckCircleOutlined />}>
<Link to="/manage/jobs/ready">{t("menus.header.readyjobs")}</Link>
</Menu.Item>
<Menu.Item key="parts-queue" icon={<ToolFilled />}>
<Link to="/manage/partsqueue">{t("menus.header.parts-queue")}</Link>
</Menu.Item>
<Menu.Item key="availablejobs" icon={<ImportOutlined />}>
<Link to="/manage/available">
{t("menus.header.availablejobs")}
</Link>
</Menu.Item>
<Menu.Item key="newjob" icon={<FileAddOutlined />}>
<Link to="/manage/jobs/new">{t("menus.header.newjob")}</Link>
</Menu.Item>
<Menu.Divider key="div1" />
<Menu.Item key="alljobs" icon={<UnorderedListOutlined />}>
<Link to="/manage/jobs/all">{t("menus.header.alljobs")}</Link>
</Menu.Item>
<Menu.Divider key="div2" />
<Menu.Item key="productionlist" icon={<ScheduleOutlined />}>
<Link to="/manage/production/list">
{t("menus.header.productionlist")}
</Link>
</Menu.Item>
<Menu.Item key="productionboard" icon={<Icon component={BsKanban} />}>
<Link to="/manage/production/board">
{t("menus.header.productionboard")}
</Link>
</Menu.Item>
<Menu.Divider key="div3" />
<Menu.Item key="scoreboard" icon={<LineChartOutlined />}>
<Link to="/manage/scoreboard">{t("menus.header.scoreboard")}</Link>
</Menu.Item>
</Menu.SubMenu>
<Menu.SubMenu
key="customers"
icon={<UserOutlined />}
title={t("menus.header.customers")}
>
<Menu.Item key="owners" icon={<TeamOutlined />}>
<Link to="/manage/owners">{t("menus.header.owners")}</Link>
</Menu.Item>
<Menu.Item key="vehicles" icon={<CarFilled />}>
<Link to="/manage/vehicles">{t("menus.header.vehicles")}</Link>
</Menu.Item>
</Menu.SubMenu>
<Menu.SubMenu
key="ccs"
icon={<CarFilled />}
title={t("menus.header.courtesycars")}
>
<Menu.Item key="courtesycarsall" icon={<CarFilled />}>
<Link to="/manage/courtesycars">
{t("menus.header.courtesycars-all")}
</Link>
</Menu.Item>
<Menu.Item key="contracts" icon={<FileFilled />}>
<Link to="/manage/courtesycars/contracts">
{t("menus.header.courtesycars-contracts")}
</Link>
</Menu.Item>
<Menu.Item key="newcontract" icon={<FileAddFilled />}>
<Link to="/manage/courtesycars/contracts/new">
{t("menus.header.courtesycars-newcontract")}
</Link>
</Menu.Item>
</Menu.SubMenu>
<Menu.SubMenu
key="accounting"
icon={<DollarCircleFilled />}
title={t("menus.header.accounting")}
>
<Menu.Item
key="bills"
icon={<Icon component={FaFileInvoiceDollar} />}
>
<Link to="/manage/bills">{t("menus.header.bills")}</Link>
</Menu.Item>
<Menu.Item
key="enterbills"
icon={<Icon component={GiPayMoney} />}
onClick={() => {
setBillEnterContext({
actions: {},
context: {},
});
}}
>
{t("menus.header.enterbills")}
</Menu.Item>
{Simple_Inventory.treatment === "on" && (
<>
<Menu.Divider key="div4" />
<Menu.Item
key="inventory"
icon={<Icon component={FaFileInvoiceDollar} />}
>
<Link to="/manage/inventory">
{t("menus.header.inventory")}
</Link>
</Menu.Item>
</>
)}
<Menu.Divider key="div7" />
<Menu.Item key="allpayments" icon={<BankFilled />}>
<Link to="/manage/payments">{t("menus.header.allpayments")}</Link>
</Menu.Item>
<Menu.Item
key="enterpayments"
onClick={() => {
setPaymentContext({
actions: {},
context: null,
});
}}
icon={<Icon component={FaCreditCard} />}
>
{t("menus.header.enterpayment")}
</Menu.Item>
<Menu.Divider key="div5" />
<Menu.Item key="timetickets" icon={<FieldTimeOutlined />}>
<Link to="/manage/timetickets">
{t("menus.header.timetickets")}
</Link>
</Menu.Item>
<Menu.Item
key="entertimetickets"
icon={<Icon component={GiPlayerTime} />}
onClick={() => {
setTimeTicketContext({
actions: {},
context: {},
});
}}
>
{t("menus.header.entertimeticket")}
</Menu.Item>
<Menu.Divider key="div6" />
<Menu.SubMenu
key="accountingexport"
title={t("menus.header.export")}
icon={<ExportOutlined />}
>
<Menu.Item key="receivables">
<Link to="/manage/accounting/receivables">
{t("menus.header.accounting-receivables")}
</Link>
),
},
</Menu.Item>
{(!(
(bodyshop && bodyshop.cdk_dealerid) ||
(bodyshop && bodyshop.pbs_serialnumber)
) ||
DmsAp.treatment === "on") && (
<Menu.Item key="payables">
<Link to="/manage/accounting/payables">
{t("menus.header.accounting-payables")}
</Link>
</Menu.Item>
)}
{!(
(bodyshop && bodyshop.cdk_dealerid) ||
(bodyshop && bodyshop.pbs_serialnumber)
) && (
<Menu.Item key="payments">
<Link to="/manage/accounting/payments">
{t("menus.header.accounting-payments")}
</Link>
</Menu.Item>
)}
<Menu.Item key="export-logs">
<Link to="/manage/accounting/exportlogs">
{t("menus.header.export-logs")}
</Link>
</Menu.Item>
</Menu.SubMenu>
</Menu.SubMenu>
<Menu.Item key="phonebook" icon={<PhoneOutlined />}>
<Link to="/manage/phonebook">{t("menus.header.phonebook")}</Link>
</Menu.Item>
<Menu.Item key="temporarydocs" icon={<PaperClipOutlined />}>
<Link to="/manage/temporarydocs">
{t("menus.header.temporarydocs")}
</Link>
</Menu.Item>
<Menu.SubMenu
key="shopsubmenu"
title={t("menus.header.shop")}
icon={<SettingOutlined />}
>
<Menu.Item key="shop" icon={<Icon component={GiSettingsKnobs} />}>
<Link to="/manage/shop">{t("menus.header.shop_config")}</Link>
</Menu.Item>
<Menu.Item key="dashboard" icon={<DashboardFilled />}>
<Link to="/manage/dashboard">{t("menus.header.dashboard")}</Link>
</Menu.Item>
<Menu.Item
key="reportcenter"
icon={<BarChartOutlined />}
onClick={() => {
setReportCenterContext({
actions: {},
context: {},
});
}}
>
{t("menus.header.reportcenter")}
</Menu.Item>
<Menu.Item
key="shop-vendors"
icon={<Icon component={IoBusinessOutline} />}
>
<Link to="/manage/shop/vendors">
{t("menus.header.shop_vendors")}
</Link>
</Menu.Item>
<Menu.Item key="shop-csi" icon={<Icon component={RiSurveyLine} />}>
<Link to="/manage/shop/csi">{t("menus.header.shop_csi")}</Link>
</Menu.Item>
</Menu.SubMenu>
<Menu.SubMenu
key="user"
title={
currentUser.displayName ||
currentUser.email ||
t("general.labels.unknown")
}
>
<Menu.Item key="signout" danger onClick={() => signOutStart()}>
{t("user.actions.signout")}
</Menu.Item>
<Menu.Item
key="help"
onClick={() => {
window.open("https://help.imex.online/", "_blank");
}}
icon={<Icon component={QuestionCircleFilled} />}
>
{t("menus.header.help")}
</Menu.Item>
<Menu.Item
key="rescue"
onClick={() => {
window.open("https://imexrescue.com/", "_blank");
}}
>
{t("menus.header.rescueme")}
</Menu.Item>
<Menu.Item key="shiftclock">
<Link to="/manage/shiftclock">{t("menus.header.shiftclock")}</Link>
</Menu.Item>
<Menu.Item key="profile">
<Link to="/manage/profile">{t("menus.currentuser.profile")}</Link>
</Menu.Item>
{
key: "shopsubmenu",
icon: <SettingOutlined />,
label: t("menus.header.shop"),
children: [
{
key: "shop",
icon: <Icon component={GiSettingsKnobs} />,
label: (
<Link to="/manage/shop">{t("menus.header.shop_config")}</Link>
),
},
{
key: "dashboard",
icon: <DashboardFilled />,
label: (
<Link to="/manage/dashboard">
{t("menus.header.dashboard")}
</Link>
),
},
{
key: "reportcenter",
icon: <BarChartOutlined />,
onClick: () => {
setReportCenterContext({
actions: {},
context: {},
});
},
label: t("menus.header.reportcenter"),
},
{
key: "shop-vendors",
icon: <Icon component={IoBusinessOutline} />,
label: (
<Link to="/manage/shop/vendors">
{t("menus.header.shop_vendors")}
</Link>
),
},
{
key: "shop-csi",
icon: <Icon component={RiSurveyLine} />,
label: (
<Link to="/manage/shop/csi">
{t("menus.header.shop_csi")}
</Link>
),
},
],
},
{
key: "user",
label:
currentUser.displayName ||
currentUser.email ||
t("general.labels.unknown"),
children: [
{
key: "signout",
danger: true,
onClick: () => signOutStart(),
label: t("user.actions.signout"),
},
{
key: "help",
icon: <Icon component={QuestionCircleFilled} />,
onClick: () => {
window.open("https://help.imex.online/", "_blank");
},
label: t("menus.header.help"),
},
{
key: "shiftclock",
label: (
<Link to="/manage/shiftclock">
{t("menus.header.shiftclock")}
</Link>
),
},
{
key: "profile",
label: (
<Link to="/manage/profile">
{t("menus.currentuser.profile")}
</Link>
),
},
],
},
{
key: "recent",
label: <ClockCircleFilled />,
children: recentItems.map((i, idx) => ({
key: idx,
label: <Link to={i.url}>{i.label}</Link>,
})),
},
]}
></Menu>
// <Menu.SubMenu
// key="langselecter"
// title={
// <span>
// <GlobalOutlined />
// <span>{t("menus.currentuser.languageselector")}</span>
// </span>
// }
// >
// <Menu.Item actiontype="lang-select" key="en-US">
// {t("general.languages.english")}
// </Menu.Item>
// <Menu.Item actiontype="lang-select" key="fr-CA">
// {t("general.languages.french")}
// </Menu.Item>
// <Menu.Item actiontype="lang-select" key="es-MX">
// {t("general.languages.spanish")}
// </Menu.Item>
// </Menu.SubMenu>
}
</Menu.SubMenu>
<Menu.SubMenu key="recent" title={<ClockCircleFilled />}>
{recentItems.map((i, idx) => (
<Menu.Item key={idx}>
<Link to={i.url}>{i.label}</Link>
</Menu.Item>
))}
</Menu.SubMenu>
</Menu>
</Layout.Header>
);
}

View File

@@ -103,7 +103,7 @@ export function InventoryUpsertModalContainer({
? t("inventory.actions.edit")
: t("inventory.actions.new")
}
open={visible}
visible={visible}
okText={t("general.actions.save")}
onOk={() => {
form.submit();

View File

@@ -96,7 +96,7 @@ export function Jobd3RdPartyModal({ bodyshop, jobId, job }) {
return (
<>
<Button onClick={showModal}>{t("printcenter.jobs.3rdpartypayer")}</Button>
<Modal open={isModalVisible} onOk={handleOk} onCancel={handleCancel}>
<Modal visible={isModalVisible} onOk={handleOk} onCancel={handleCancel}>
<Form
onFinish={handleFinish}
autoComplete={"off"}

View File

@@ -1,11 +1,11 @@
import { DownOutlined } from "@ant-design/icons";
import { useMutation } from "@apollo/client";
import { Dropdown, notification } from "antd";
import React from "react";
import { useMutation } from "@apollo/client";
import { UPDATE_JOB } from "../../graphql/jobs.queries";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { UPDATE_JOB } from "../../graphql/jobs.queries";
import { Dropdown, Menu, notification } from "antd";
import { DownOutlined } from "@ant-design/icons";
import { selectBodyshop } from "../../redux/user/user.selectors";
const mapStateToProps = createStructuredSelector({
@@ -37,19 +37,18 @@ export function JobAltTransportChange({ bodyshop, job }) {
});
}
};
const menu = [
...(bodyshop.appt_alt_transport &&
bodyshop.appt_alt_transport.map((alt) => ({
key: alt,
label: alt,
value: alt,
onClick,
}))),
{ type: "divider" },
{ key: "null", label: t("general.actions.clear"), onClick },
];
const menu = (
<Menu selectedKeys={[job && job.alt_transport]} onClick={onClick}>
{bodyshop.appt_alt_transport &&
bodyshop.appt_alt_transport.map((alt) => (
<Menu.Item key={alt}>{alt}</Menu.Item>
))}
<Menu.Divider />
<Menu.Item key={"null"}>{t("general.actions.clear")}</Menu.Item>
</Menu>
);
return (
<Dropdown menu={{ items: menu }}>
<Dropdown overlay={menu}>
<a href=" #" onClick={(e) => e.preventDefault()}>
<DownOutlined />
</a>

View File

@@ -1,11 +1,11 @@
import { DownOutlined } from "@ant-design/icons";
import { useMutation } from "@apollo/client";
import { Dropdown, notification } from "antd";
import React from "react";
import { useMutation } from "@apollo/client";
import { UPDATE_APPOINTMENT } from "../../graphql/appointments.queries";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { UPDATE_APPOINTMENT } from "../../graphql/appointments.queries";
import { Dropdown, Menu, notification } from "antd";
import { DownOutlined } from "@ant-design/icons";
import { selectBodyshop } from "../../redux/user/user.selectors";
const mapStateToProps = createStructuredSelector({
@@ -44,23 +44,21 @@ export function ScheduleEventColor({ bodyshop, event }) {
bodyshop.appt_colors.filter((color) => color.color.hex === event.color)[0]
?.label;
const menu = {
items: [
...(bodyshop.appt_colors &&
bodyshop.appt_colors.map((color) => ({
style: { color: color.color.hex },
key: color.color.hex,
label: color.label,
}))),
{ type: "divider" },
{ key: "null", value: t("general.actions.clear") },
],
selectedKeys: [event.color],
onClick: onClick,
};
const menu = (
<Menu selectedKeys={[event.color]} onClick={onClick}>
{bodyshop.appt_colors &&
bodyshop.appt_colors.map((color) => (
<Menu.Item style={{ color: color.color.hex }} key={color.color.hex}>
{color.label}
</Menu.Item>
))}
<Menu.Divider />
<Menu.Item key={"null"}>{t("general.actions.clear")}</Menu.Item>
</Menu>
);
return (
<Dropdown menu={menu}>
<Dropdown overlay={menu}>
<a href=" #" onClick={(e) => e.preventDefault()}>
{selectedColor}
<DownOutlined />

View File

@@ -2,9 +2,11 @@ import { AlertFilled } from "@ant-design/icons";
import {
Button,
Divider,
Dropdown, notification,
Dropdown,
Menu,
notification,
Popover,
Space
Space,
} from "antd";
import parsePhoneNumber from "libphonenumber-js";
import moment from "moment";
@@ -16,7 +18,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";
@@ -25,11 +27,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,
@@ -147,12 +149,10 @@ export function ScheduleEventComponent({
) : null}
{event.job ? (
<Dropdown
menu={{
items: [
{
disabled: event.arrived,
label: t("general.labels.email"),
onClick: () => {
overlay={
<Menu>
<Menu.Item
onClick={() => {
const Template = TemplateList("job").appointment_reminder;
GenerateDocument(
{
@@ -166,12 +166,13 @@ export function ScheduleEventComponent({
"e",
event.job && event.job.id
);
},
},
{
label: t("general.labels.sms"),
disabled: event.arrived || !bodyshop.messagingservicesid,
onClick: () => {
}}
disabled={event.arrived}
>
{t("general.labels.email")}
</Menu.Item>
<Menu.Item
onClick={() => {
const p = parsePhoneNumber(event.job.ownr_ph1, "CA");
if (p && p.isValid()) {
openChatByPhone({
@@ -191,10 +192,13 @@ export function ScheduleEventComponent({
message: t("messaging.error.invalidphone"),
});
}
},
},
],
}}
}}
disabled={event.arrived || !bodyshop.messagingservicesid}
>
{t("general.labels.sms")}
</Menu.Item>
</Menu>
}
>
<Button>{t("appointments.actions.sendreminder")}</Button>
</Dropdown>
@@ -245,7 +249,7 @@ export function ScheduleEventComponent({
const RegularEvent = event.isintake ? (
<Space
wrap
size="small"
size='small'
style={{
backgroundColor:
event.color && event.color.hex ? event.color.hex : event.color,
@@ -283,8 +287,8 @@ export function ScheduleEventComponent({
return (
<Popover
open={visible}
onOpenChange={(vis) => !event.vacation && setVisible(vis)}
visible={visible}
onVisibleChange={(vis) => !event.vacation && setVisible(vis)}
trigger="click"
content={event.block ? blockContent : popoverContent}
style={{

View File

@@ -39,7 +39,7 @@ export function JobCostingModalContainer({
return (
<Modal
open={visible}
visible={visible}
title={t("jobs.labels.jobcosting")}
onOk={() => {
toggleModalVisible();

View File

@@ -76,7 +76,7 @@ export function JobDetailCards({ bodyshop, setPrintCenterContext }) {
return (
<Drawer
open={!!selected}
visible={!!selected}
destroyOnClose
width={drawerPercentage}
placement="right"

View File

@@ -1,16 +1,24 @@
import {
DeleteFilled,
EditFilled,
FilterFilled,
HomeOutlined,
MinusCircleTwoTone,
PlusCircleTwoTone,
SyncOutlined,
WarningFilled,
EditFilled,
PlusCircleTwoTone,
MinusCircleTwoTone,
HomeOutlined,
} from "@ant-design/icons";
import { useMutation } from "@apollo/client";
import { PageHeader } from '@ant-design/pro-layout';
import { Button, Dropdown, Input, Space, Table, Tag } from "antd";
import {
Button,
Dropdown,
Input,
Menu,
PageHeader,
Space,
Table,
Tag,
} from "antd";
import axios from "axios";
import React, { useState } from "react";
import { useTranslation } from "react-i18next";
@@ -30,13 +38,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 _ from "lodash";
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 _ 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 JobLineConvertToLabor from "../job-line-convert-to-labor/job-line-convert-to-labor.component";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
@@ -95,9 +103,7 @@ export function JobLinesComponent({
fixed: "left",
key: "line_desc",
sorter: (a, b) => alphaSort(a.line_desc, b.line_desc),
onCell: (record) => ({
className: record.manual_line && "job-line-manual",
}),
onCell: (record) => ({ className: record.manual_line && "job-line-manual" }),
sortOrder:
state.sortedInfo.columnKey === "line_desc" && state.sortedInfo.order,
ellipsis: true,
@@ -399,17 +405,16 @@ export function JobLinesComponent({
}
};
const markMenu = {
onClick: handleMark,
items: [
{ key: "PAA", label: t("joblines.fields.part_types.PAA") },
{ key: "PAN", label: t("joblines.fields.part_types.PAN") },
{ key: "PAL", label: t("joblines.fields.part_types.PAL") },
{ key: "PAS", label: t("joblines.fields.part_types.PAS") },
{ type: "divider" },
{ key: "clear", label: t("general.labels.clear") },
],
};
const markMenu = (
<Menu onClick={handleMark}>
<Menu.Item key="PAA">{t("joblines.fields.part_types.PAA")}</Menu.Item>
<Menu.Item key="PAN">{t("joblines.fields.part_types.PAN")}</Menu.Item>
<Menu.Item key="PAL">{t("joblines.fields.part_types.PAL")}</Menu.Item>
<Menu.Item key="PAS">{t("joblines.fields.part_types.PAS")}</Menu.Item>
<Menu.Divider />
<Menu.Item key="clear">{t("general.labels.clear")}</Menu.Item>
</Menu>
);
return (
<div>
@@ -539,7 +544,7 @@ export function JobLinesComponent({
>
<FilterFilled /> {t("jobs.actions.filterpartsonly")}
</Button>
<Dropdown menu={markMenu} trigger={["click"]}>
<Dropdown overlay={markMenu} trigger={["click"]}>
<Button>{t("jobs.actions.mark")}</Button>
</Dropdown>
<Button

View File

@@ -87,7 +87,7 @@ export function JobEmployeeAssignments({
);
return (
<Popover destroyTooltipOnHide content={popContent} open={visibility}>
<Popover destroyTooltipOnHide content={popContent} visible={visibility}>
<Spin spinning={loading}>
<DataLabel label={t("jobs.fields.employee_body")}>
{body ? (

View File

@@ -225,7 +225,7 @@ export function JobLineConvertToLabor({
<Popover
disabled={jobline.convertedtolbr}
content={overlay}
open={visibility}
visible={visibility}
placement="bottom"
>
<Tooltip title={t("joblines.actions.converttolabor")}>

View File

@@ -1,5 +1,5 @@
import { DownOutlined } from "@ant-design/icons";
import { Dropdown } from "antd";
import { Dropdown, Menu } from "antd";
import React from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
@@ -21,17 +21,19 @@ export function JoblinePresetButton({ bodyshop, form }) {
form.setFieldsValue(item);
};
const menu = {
items: bodyshop.md_jobline_presets.map((i, idx) => ({
onClick: () => handleSelect(i),
key: idx,
label: i.label,
})),
};
const menu = (
<Menu>
{bodyshop.md_jobline_presets.map((i, idx) => (
<Menu.Item onClick={() => handleSelect(i)} key={idx}>
{i.label}
</Menu.Item>
))}
</Menu>
);
return (
<div>
<Dropdown trigger={["click"]} menu={menu}>
<Dropdown trigger={["click"]} overlay={menu}>
<a
className="ant-dropdown-link"
href="# "

View File

@@ -54,7 +54,7 @@ export function JobLinesUpsertModalComponent({
: t("joblines.labels.new")
}
forceRender
open={visible}
visible={visible}
width="60%"
okText={t("general.actions.save")}
onOk={() => form.submit()}

View File

@@ -42,7 +42,7 @@ function JobReconciliationModalContainer({
<Modal
title={t("jobs.labels.reconciliationheader")}
width={"95%"}
open={visible}
visible={visible}
okText={t("general.actions.close")}
onOk={handleCancel}
onCancel={handleCancel}

View File

@@ -186,7 +186,7 @@ export default function ScoreboardAddButton({
};
return (
<Popover content={overlay} open={visibility} placement="bottom">
<Popover content={overlay} visible={visibility} placement="bottom">
<Button
loading={loading}
disabled={disabled}

View File

@@ -1,6 +1,6 @@
import { DownCircleFilled } from "@ant-design/icons";
import { useMutation } from "@apollo/client";
import { Button, Dropdown, notification } from "antd";
import { Button, Dropdown, Menu, notification } from "antd";
import React from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
@@ -40,18 +40,20 @@ export function JobsAdminStatus({ insertAuditTrail, bodyshop, job }) {
});
};
const statusmenu = {
onClick: (e) => {
updateJobStatus(e.key);
},
items: bodyshop.md_ro_statuses.statuses.map((item) => ({
key: item,
label: item,
})),
};
const statusmenu = (
<Menu
onClick={(e) => {
updateJobStatus(e.key);
}}
>
{bodyshop.md_ro_statuses.statuses.map((item) => (
<Menu.Item key={item}>{item}</Menu.Item>
))}
</Menu>
);
return (
<Dropdown menu={statusmenu} trigger={["click"]} key="changestatus">
<Dropdown overlay={statusmenu} trigger={["click"]} key="changestatus">
<Button shape="round">
<span>{job.status}</span>

View File

@@ -1,6 +1,6 @@
import { DownCircleFilled } from "@ant-design/icons";
import { useMutation } from "@apollo/client";
import { Button, Dropdown, notification } from "antd";
import { Button, Dropdown, Menu, notification } from "antd";
import React, { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
@@ -81,32 +81,29 @@ export function JobsChangeStatus({ job, bodyshop, jobRO, insertAuditTrail }) {
}
}, [job, setAvailableStatuses, bodyshop]);
const statusmenu = {
onClick: (e) => {
updateJobStatus(e.key);
},
items: [
...availableStatuses.map((item) => ({
key: item,
label: item,
})),
...(job.converted
? [
{
type: "divider",
},
...otherStages.map((item, idx) => ({
key: item,
label: item,
})),
]
: []),
],
};
const statusmenu = (
<Menu
onClick={(e) => {
updateJobStatus(e.key);
}}
>
{availableStatuses.map((item) => (
<Menu.Item key={item}>{item}</Menu.Item>
))}
{job.converted && (
<>
<Menu.Divider />
{otherStages.map((item, idx) => (
<Menu.Item key={item}>{item}</Menu.Item>
))}
</>
)}
</Menu>
);
return (
<Dropdown
menu={statusmenu}
overlay={statusmenu}
trigger={["click"]}
key="changestatus"
disabled={jobRO || !job.converted}

View File

@@ -1,4 +1,4 @@
import { Button, Dropdown } from "antd";
import { Button, Dropdown, Menu } from "antd";
import _ from "lodash";
import React from "react";
import { useTranslation } from "react-i18next";
@@ -62,17 +62,18 @@ export function JobsCloseAutoAllocate({ bodyshop, joblines, form, disabled }) {
);
};
const overlay = {
onClick: handleMenuClick,
items: bodyshop.md_responsibility_centers.dms_defaults.map((mapping) => ({
label: mapping.name,
key: mapping.name,
disabled: disabled,
})),
};
const overlay = (bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber) && (
<Menu onClick={handleMenuClick}>
{bodyshop.md_responsibility_centers.dms_defaults.map((mapping) => (
<Menu.Item disabled={disabled} key={mapping.name}>
{mapping.name}
</Menu.Item>
))}
</Menu>
);
return bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber ? (
<Dropdown menu={overlay}>
<Dropdown overlay={overlay}>
<Button disabled={disabled}>{t("jobs.actions.dmsautoallocate")}</Button>
</Dropdown>
) : (

View File

@@ -226,7 +226,7 @@ export function JobsConvertButton({
if (job.converted) return <></>;
return (
<Popover open={visible} content={popMenu}>
<Popover visible={visible} content={popMenu}>
<Button
key="convert"
type="danger"

View File

@@ -1,5 +1,5 @@
import { DownOutlined } from "@ant-design/icons";
import { Dropdown } from "antd";
import { Dropdown, Menu } from "antd";
import React from "react";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
@@ -15,17 +15,20 @@ export function JobsDetailChangeEstimator({ disabled, form, bodyshop }) {
form.setFieldsValue(est);
};
const menu = {
onClick: handleClick,
items: bodyshop.md_estimators.map((est, idx) => ({
value: est,
key: idx,
label: `${est.est_ct_fn || ""} ${est.est_ct_ln || ""}`.trim(),
})),
};
const menu = (
<div>
<Menu onClick={handleClick}>
{bodyshop.md_estimators.map((est, idx) => (
<Menu.Item value={est} key={idx}>
{`${est.est_ct_fn} ${est.est_ct_ln}`}
</Menu.Item>
))}
</Menu>
</div>
);
return (
<Dropdown menu={menu} disabled={disabled}>
<Dropdown overlay={menu} disabled={disabled}>
<a
className="ant-dropdown-link"
href=" #"

View File

@@ -1,5 +1,5 @@
import { DownOutlined } from "@ant-design/icons";
import { Dropdown } from "antd";
import { Dropdown, Menu } from "antd";
import React from "react";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
@@ -15,21 +15,23 @@ export function JobsDetailChangeFilehandler({ disabled, form, bodyshop }) {
form.setFieldsValue(est);
};
const menu = {
onClick: handleClick,
style: {
columnCount: Math.floor(bodyshop.md_filehandlers.length / 10) + 1,
},
items: bodyshop.md_filehandlers.map((est, idx) => ({
value: est,
key: idx,
style: { breakInside: "avoid" },
label: `${est.ins_ct_fn || ""} ${est.ins_ct_ln || ""}`.trim(),
})),
};
const menu = (
<Menu
onClick={handleClick}
style={{
columnCount: Math.floor(bodyshop.md_filehandlers.length / 10) + 1,
}}
>
{bodyshop.md_filehandlers.map((est, idx) => (
<Menu.Item value={est} key={idx} style={{ breakInside: "avoid" }}>
{`${est.ins_ct_fn} ${est.ins_ct_ln}`}
</Menu.Item>
))}
</Menu>
);
return (
<Dropdown menu={menu} disabled={disabled}>
<Dropdown overlay={menu} disabled={disabled}>
<a
className="ant-dropdown-link"
href=" #"

View File

@@ -4,6 +4,7 @@ import {
Card,
Form,
Input,
Menu,
notification,
Popover,
Select,
@@ -12,11 +13,25 @@ import {
import moment from "moment";
import React, { useState } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { logImEXEvent } from "../../firebase/firebase.utils";
import { INSERT_MANUAL_APPT } from "../../graphql/appointments.queries";
import { selectBodyshop } from "../../redux/user/user.selectors";
import FormDateTimePickerComponent from "../form-date-time-picker/form-date-time-picker.component";
export default function JobsDetailHeaderAddEvent({ bodyshop, jobid }) {
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
});
const mapDispatchToProps = (dispatch) => ({
//setUserLanguage: language => dispatch(setUserLanguage(language))
});
export default connect(
mapStateToProps,
mapDispatchToProps
)(JobsDetailHeaderAddEvent);
export function JobsDetailHeaderAddEvent({ bodyshop, jobid, ...props }) {
const { t } = useTranslation();
const [insertAppointment] = useMutation(INSERT_MANUAL_APPT);
@@ -138,12 +153,11 @@ export default function JobsDetailHeaderAddEvent({ bodyshop, jobid }) {
setVisibility(true);
};
return {
key: "addmanualevent",
label: (
<Popover content={overlay} open={visibility} onClick={handleClick}>
return (
<Popover content={overlay} visible={visibility}>
<Menu.Item {...props} onClick={handleClick}>
{t("appointments.labels.manualevent")}
</Popover>
),
};
</Menu.Item>
</Popover>
);
}

View File

@@ -1,6 +1,6 @@
import { DownCircleFilled } from "@ant-design/icons";
import { useApolloClient, useMutation } from "@apollo/client";
import { Button, Dropdown, notification, Popconfirm } from "antd";
import { Button, Dropdown, Menu, 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";
@@ -105,14 +105,13 @@ export function JobsDetailHeaderActions({
});
};
const statusmenu = {
items: [
{
key: "schedule",
disabled: !jobInPreProduction || !job.converted || jobRO,
label: t("jobs.actions.schedule"),
onClick: () => {
const statusmenu = (
<Menu key="popovermenu">
<Menu.Item
disabled={!jobInPreProduction || !job.converted || jobRO}
onClick={() => {
logImEXEvent("job_header_schedule");
setScheduleContext({
actions: { refetch: refetch },
context: {
@@ -121,228 +120,200 @@ export function JobsDetailHeaderActions({
alt_transport: job.alt_transport,
},
});
},
},
{
key: "cancelappts",
disabled: job.status !== bodyshop.md_ro_statuses.default_scheduled,
label: (
<Popconfirm
title={t("general.labels.areyousure")}
okText="Yes"
cancelText="No"
onClick={(e) => e.stopPropagation()}
disabled={job.status !== bodyshop.md_ro_statuses.default_scheduled}
onConfirm={async () => {
const jobUpdate = await cancelAllAppointments({
variables: {
jobid: job.id,
job: {
date_scheduled: null,
scheduled_in: null,
scheduled_completion: null,
status: bodyshop.md_ro_statuses.default_imported,
},
}}
>
{t("jobs.actions.schedule")}
</Menu.Item>
<Menu.Item
disabled={job.status !== bodyshop.md_ro_statuses.default_scheduled}
>
<Popconfirm
title={t("general.labels.areyousure")}
okText="Yes"
cancelText="No"
onClick={(e) => e.stopPropagation()}
disabled={job.status !== bodyshop.md_ro_statuses.default_scheduled}
onConfirm={async () => {
const jobUpdate = await cancelAllAppointments({
variables: {
jobid: job.id,
job: {
date_scheduled: null,
scheduled_in: null,
scheduled_completion: null,
status: bodyshop.md_ro_statuses.default_imported,
},
},
});
if (!jobUpdate.errors) {
notification["success"]({
message: t("appointments.successes.canceled"),
});
if (!jobUpdate.errors) {
notification["success"]({
message: t("appointments.successes.canceled"),
});
return;
}
}}
getPopupContainer={(trigger) => trigger.parentNode}
>
{t("menus.jobsactions.cancelallappointments")}
</Popconfirm>
),
},
{
key: "intake",
disabled:
return;
}
}}
getPopupContainer={(trigger) => trigger.parentNode}
>
{t("menus.jobsactions.cancelallappointments")}
</Popconfirm>
</Menu.Item>
<Menu.Item
disabled={
!!job.intakechecklist ||
!jobInPreProduction ||
!job.converted ||
jobRO,
label:
!!job.intakechecklist ||
!jobInPreProduction ||
!job.converted ||
jobRO ? (
t("jobs.actions.intake")
) : (
<Link to={`/manage/jobs/${job.id}/intake`}>
{t("jobs.actions.intake")}
</Link>
),
},
{
disabled: !jobInProduction || jobRO,
key: "deliver",
label: !jobInProduction ? (
jobRO
}
>
{!!job.intakechecklist ||
!jobInPreProduction ||
!job.converted ||
jobRO ? (
t("jobs.actions.intake")
) : (
<Link to={`/manage/jobs/${job.id}/intake`}>
{t("jobs.actions.intake")}
</Link>
)}
</Menu.Item>
<Menu.Item disabled={!jobInProduction || jobRO}>
{!jobInProduction ? (
t("jobs.actions.deliver")
) : (
<Link to={`/manage/jobs/${job.id}/deliver`}>
{t("jobs.actions.deliver")}
</Link>
),
},
{
key: "viewchecklist",
disabled: !job.converted,
label: (
<Link to={`/manage/jobs/${job.id}/checklist`}>
{t("jobs.actions.viewchecklist")}
</Link>
),
},
{
key: "entertimetickets",
disabled:
)}
</Menu.Item>
<Menu.Item disabled={!job.converted}>
<Link to={`/manage/jobs/${job.id}/checklist`}>
{t("jobs.actions.viewchecklist")}
</Link>
</Menu.Item>
<Menu.Item
key="entertimetickets"
disabled={
!job.converted ||
(!bodyshop.tt_allow_post_to_invoiced && job.date_invoiced),
onClick: () => {
(!bodyshop.tt_allow_post_to_invoiced && job.date_invoiced)
}
onClick={() => {
logImEXEvent("job_header_enter_time_ticekts");
setTimeTicketContext({
actions: {},
context: { jobId: job.id },
});
},
label: t("timetickets.actions.enter"),
},
{
key: "enterpayments",
disabled: !job.converted,
label: t("menus.header.enterpayment"),
onClick: () => {
}}
>
{t("timetickets.actions.enter")}
</Menu.Item>
<Menu.Item
key="enterpayments"
disabled={!job.converted}
onClick={() => {
logImEXEvent("job_header_enter_payment");
setPaymentContext({
actions: {},
context: { jobid: job.id },
});
},
},
{
key: "cccontract",
disabled: jobRO || !job.converted,
label: (
<Link
to={{
pathname: "/manage/courtesycars/contracts/new",
state: { jobId: job.id },
}}
>
{t("menus.jobsactions.newcccontract")}
</Link>
),
},
...(job.inproduction
? [
{
key: "removetoproduction",
disabled: !job.converted,
onClick: () => AddToProduction(client, job.id, refetch, true),
label: t("jobs.actions.removefromproduction"),
},
]
: [
{
key: "addtoproduction",
disabled: !job.converted,
onClick: () => AddToProduction(client, job.id, refetch),
label: t("jobs.actions.addtoproduction"),
},
]),
{
key: "togglesuspend",
onClick: handleSuspend,
label: job.suspended
}}
>
{t("menus.header.enterpayment")}
</Menu.Item>
<Menu.Item key="cccontract" disabled={jobRO || !job.converted}>
<Link
to={{
pathname: "/manage/courtesycars/contracts/new",
state: { jobId: job.id },
}}
>
{t("menus.jobsactions.newcccontract")}
</Link>
</Menu.Item>
{job.inproduction ? (
<Menu.Item
key="addtoproduction"
disabled={!job.converted}
onClick={() => AddToProduction(client, job.id, refetch, true)}
>
{t("jobs.actions.removefromproduction")}
</Menu.Item>
) : (
<Menu.Item
key="addtoproduction"
disabled={!job.converted}
onClick={() => AddToProduction(client, job.id, refetch)}
>
{t("jobs.actions.addtoproduction")}
</Menu.Item>
)}
<Menu.Item key="togglesuspend" onClick={handleSuspend}>
{job.suspended
? t("production.actions.unsuspend")
: t("production.actions.suspend"),
},
{
key: "toggleAlert",
onClick: handleAlertToggle,
label:
job.production_vars && job.production_vars.alert
? t("production.labels.alertoff")
: t("production.labels.alerton"),
},
{
key: "dupe",
label: t("menus.jobsactions.duplicate"),
children: [
{
key: "dupewithlines",
label: (
<Popconfirm
title={t("jobs.labels.duplicateconfirm")}
okText="Yes"
cancelText="No"
onClick={(e) => e.stopPropagation()}
onConfirm={() =>
DuplicateJob(
client,
job.id,
{
defaultOpenStatus:
bodyshop.md_ro_statuses.default_imported,
},
(newJobId) => {
history.push(`/manage/jobs/${newJobId}`);
notification["success"]({
message: t("jobs.successes.duplicated"),
});
},
true
)
: t("production.actions.suspend")}
</Menu.Item>
<Menu.Item key="toggleAlert" onClick={handleAlertToggle}>
{job.production_vars && job.production_vars.alert
? t("production.labels.alertoff")
: t("production.labels.alerton")}
</Menu.Item>
<Menu.SubMenu key="dupe" title={t("menus.jobsactions.duplicate")}>
<Menu.Item>
<Popconfirm
title={t("jobs.labels.duplicateconfirm")}
okText="Yes"
cancelText="No"
onClick={(e) => e.stopPropagation()}
onConfirm={() =>
DuplicateJob(
client,
job.id,
{ defaultOpenStatus: bodyshop.md_ro_statuses.default_imported },
(newJobId) => {
history.push(`/manage/jobs/${newJobId}`);
notification["success"]({
message: t("jobs.successes.duplicated"),
});
},
true
)
}
getPopupContainer={(trigger) => trigger.parentNode}
>
{t("menus.jobsactions.duplicate")}
</Popconfirm>
</Menu.Item>
<Menu.Item>
<Popconfirm
title={t("jobs.labels.duplicateconfirm")}
okText="Yes"
cancelText="No"
onClick={(e) => e.stopPropagation()}
onConfirm={() =>
DuplicateJob(
client,
job.id,
{ defaultOpenStatus: bodyshop.md_ro_statuses.default_imported },
(newJobId) => {
history.push(`/manage/jobs/${newJobId}`);
notification["success"]({
message: t("jobs.successes.duplicated"),
});
}
getPopupContainer={(trigger) => trigger.parentNode}
>
{t("menus.jobsactions.duplicate")}
</Popconfirm>
),
},
{
key: "dupewithoutlines",
label: (
<Popconfirm
title={t("jobs.labels.duplicateconfirm")}
okText="Yes"
cancelText="No"
onClick={(e) => e.stopPropagation()}
onConfirm={() =>
DuplicateJob(
client,
job.id,
{
defaultOpenStatus:
bodyshop.md_ro_statuses.default_imported,
},
(newJobId) => {
history.push(`/manage/jobs/${newJobId}`);
notification["success"]({
message: t("jobs.successes.duplicated"),
});
}
)
}
getPopupContainer={(trigger) => trigger.parentNode}
>
{t("menus.jobsactions.duplicatenolines")}
</Popconfirm>
),
},
],
},
{
key: "postbills",
disabled: !job.converted,
label: t("jobs.actions.postbills"),
onClick: () => {
)
}
getPopupContainer={(trigger) => trigger.parentNode}
>
{t("menus.jobsactions.duplicatenolines")}
</Popconfirm>
</Menu.Item>
</Menu.SubMenu>
<Menu.Item
key="postbills"
disabled={!job.converted}
onClick={() => {
logImEXEvent("job_header_enter_bills");
setBillEnterContext({
@@ -351,13 +322,14 @@ export function JobsDetailHeaderActions({
job: job,
},
});
},
},
{
key: "addtopartsqueue",
disabled: !job.converted || !jobInProduction || jobRO,
label: t("jobs.actions.addtopartsqueue"),
onClick: async () => {
}}
>
{t("jobs.actions.postbills")}
</Menu.Item>
<Menu.Item
key="addtopartsqueue"
disabled={!job.converted || !jobInProduction || jobRO}
onClick={async () => {
const result = await updateJob({
variables: {
jobId: job.id,
@@ -376,12 +348,12 @@ export function JobsDetailHeaderActions({
}),
});
}
},
},
{
disabled: !jobInPostProduction,
key: "closejob",
label: !jobInPostProduction ? (
}}
>
{t("jobs.actions.addtopartsqueue")}
</Menu.Item>
<Menu.Item disabled={!jobInPostProduction} key="closejob">
{!jobInPostProduction ? (
t("menus.jobsactions.closejob")
) : (
<Link
@@ -391,27 +363,23 @@ export function JobsDetailHeaderActions({
>
{t("menus.jobsactions.closejob")}
</Link>
),
},
{
key: "admin",
label: (
<Link
to={{
pathname: `/manage/jobs/${job.id}/admin`,
}}
>
{t("menus.jobsactions.admin")}
</Link>
),
},
JobsDetailHeaderActionsExportcustdataComponent({ bodyshop, job }),
JobsDetaiLheaderCsi({ job, bodyshop }),
{
key: "jobcosting",
label: t("jobs.labels.jobcosting"),
disabled: !job.converted,
onClick: () => {
)}
</Menu.Item>
<Menu.Item key="admin">
<Link
to={{
pathname: `/manage/jobs/${job.id}/admin`,
}}
>
{t("menus.jobsactions.admin")}
</Link>
</Menu.Item>
<JobsDetailHeaderActionsExportcustdataComponent job={job} />
<JobsDetaiLheaderCsi job={job} />
<Menu.Item
key="jobcosting"
disabled={!job.converted}
onClick={() => {
logImEXEvent("job_header_job_costing");
setJobCostingContext({
actions: { refetch: refetch },
@@ -419,108 +387,96 @@ export function JobsDetailHeaderActions({
jobId: job.id,
},
});
},
},
...(job && !job.converted
? [
{
key: "deletejob",
label: (
<Popconfirm
title={t("jobs.labels.deleteconfirm")}
okText={t("general.labels.yes")}
cancelText={t("general.labels.no")}
onClick={(e) => e.stopPropagation()}
onConfirm={async () => {
//delete the job.
const result = await deleteJob({
variables: { id: job.id },
});
}}
>
{t("jobs.labels.jobcosting")}
</Menu.Item>
{job && !job.converted && (
<Menu.Item>
<Popconfirm
title={t("jobs.labels.deleteconfirm")}
okText={t("general.labels.yes")}
cancelText={t("general.labels.no")}
onClick={(e) => e.stopPropagation()}
onConfirm={async () => {
//delete the job.
const result = await deleteJob({ variables: { id: job.id } });
if (!!!result.errors) {
notification["success"]({
message: t("jobs.successes.delete"),
});
//go back to jobs list.
history.push(`/manage/`);
} else {
notification["error"]({
message: t("jobs.errors.deleted", {
error: JSON.stringify(result.errors),
}),
});
}
}}
getPopupContainer={(trigger) => trigger.parentNode}
>
{t("menus.jobsactions.deletejob")}
</Popconfirm>
),
},
]
: []),
///////HEADER ADD EVENT ITEM
JobsDetailHeaderActionsAddevent({ jobid: job.id, bodyshop }),
...(!jobRO && job.converted
? [
{
key: "voidjob",
label: (
<Popconfirm
title={t("jobs.labels.voidjob")}
okText="Yes"
cancelText="No"
onClick={(e) => e.stopPropagation()}
onConfirm={async () => {
//delete the job.
const result = await voidJob({
variables: {
jobId: job.id,
job: {
status: bodyshop.md_ro_statuses.default_void,
voided: true,
scheduled_in: null,
scheduled_completion: null,
inproduction: false,
},
note: [
{
jobid: job.id,
created_by: currentUser.email,
audit: true,
text: t("jobs.labels.voidnote"),
},
],
},
});
if (!!!result.errors) {
notification["success"]({
message: t("jobs.successes.voided"),
});
//go back to jobs list.
history.push(`/manage/`);
} else {
notification["error"]({
message: t("jobs.errors.voiding", {
error: JSON.stringify(result.errors),
}),
});
}
}}
getPopupContainer={(trigger) => trigger.parentNode}
>
{t("menus.jobsactions.void")}
</Popconfirm>
),
},
]
: []),
],
};
if (!!!result.errors) {
notification["success"]({
message: t("jobs.successes.delete"),
});
//go back to jobs list.
history.push(`/manage/`);
} else {
notification["error"]({
message: t("jobs.errors.deleted", {
error: JSON.stringify(result.errors),
}),
});
}
}}
getPopupContainer={(trigger) => trigger.parentNode}
>
{t("menus.jobsactions.deletejob")}
</Popconfirm>
</Menu.Item>
)}
<JobsDetailHeaderActionsAddevent jobid={job.id} />
{!jobRO && job.converted && (
<Menu.Item>
<Popconfirm
title={t("jobs.labels.voidjob")}
okText="Yes"
cancelText="No"
onClick={(e) => e.stopPropagation()}
onConfirm={async () => {
//delete the job.
const result = await voidJob({
variables: {
jobId: job.id,
job: {
status: bodyshop.md_ro_statuses.default_void,
voided: true,
scheduled_in: null,
scheduled_completion: null,
inproduction: false,
},
note: [
{
jobid: job.id,
created_by: currentUser.email,
audit: true,
text: t("jobs.labels.voidnote"),
},
],
},
});
if (!!!result.errors) {
notification["success"]({
message: t("jobs.successes.voided"),
});
//go back to jobs list.
history.push(`/manage/`);
} else {
notification["error"]({
message: t("jobs.errors.voiding", {
error: JSON.stringify(result.errors),
}),
});
}
}}
getPopupContainer={(trigger) => trigger.parentNode}
>
{t("menus.jobsactions.void")}
</Popconfirm>
</Menu.Item>
)}
</Menu>
);
return (
<Dropdown menu={statusmenu} trigger={["click"]} key="changestatus">
<Dropdown overlay={statusmenu} trigger={["click"]} key="changestatus">
<Button>
<span>{t("general.labels.actions")}</span>

View File

@@ -1,8 +1,11 @@
import { useApolloClient, useMutation } from "@apollo/client";
import { notification } from "antd";
import { Menu, notification } from "antd";
import parsePhoneNumber from "libphonenumber-js";
import React from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
import { Link } from "react-router-dom";
import { createStructuredSelector } from "reselect";
import { logImEXEvent } from "../../firebase/firebase.utils";
import {
GET_CURRENT_QUESTIONSET_ID,
@@ -13,14 +16,30 @@ import {
openChatByPhone,
setMessage,
} from "../../redux/messaging/messaging.actions";
import { store } from "../../redux/store";
import i18n from "../../translations/i18n";
import { selectBodyshop } from "../../redux/user/user.selectors";
import { DateTimeFormatter } from "../../utils/DateFormatter";
import { TemplateList } from "../../utils/TemplateConstants";
import { HasFeatureAccess } from "../feature-wrapper/feature-wrapper.component";
export default function JobsDetailHeaderCsi({ bodyshop, job }) {
const { t } = i18n;
const mapStateToProps = createStructuredSelector({
//currentUser: selectCurrentUser'
bodyshop: selectBodyshop,
});
const mapDispatchToProps = (dispatch) => ({
setEmailOptions: (e) => dispatch(setEmailOptions(e)),
openChatByPhone: (phone) => dispatch(openChatByPhone(phone)),
setMessage: (text) => dispatch(setMessage(text)),
});
export function JobsDetailHeaderCsi({
setEmailOptions,
bodyshop,
job,
openChatByPhone,
setMessage,
...props
}) {
const { t } = useTranslation();
const [insertCsi] = useMutation(INSERT_CSI);
const client = useApolloClient();
@@ -78,35 +97,29 @@ export default function JobsDetailHeaderCsi({ bodyshop, job }) {
return;
}
if (e.key === "email")
store.dispatch(
setEmailOptions({
jobid: job.id,
messageOptions: {
to: [job.ownr_ea],
replyTo: bodyshop.email,
setEmailOptions({
jobid: job.id,
messageOptions: {
to: [job.ownr_ea],
replyTo: bodyshop.email,
},
template: {
name: TemplateList("job_special").csi_invitation_action.key,
variables: {
id: result.data.insert_csi.returning[0].id,
},
template: {
name: TemplateList("job_special").csi_invitation_action.key,
variables: {
id: result.data.insert_csi.returning[0].id,
},
},
})
);
},
});
if (e.key === "text") {
const p = parsePhoneNumber(job.ownr_ph1, "CA");
if (p && p.isValid()) {
store.dispatch(
openChatByPhone({
phone_num: p.formatInternational(),
jobid: job.id,
})
);
store.dispatch(
setMessage(
`${window.location.protocol}//${window.location.host}/csi/${result.data.insert_csi.returning[0].id}`
)
openChatByPhone({
phone_num: p.formatInternational(),
jobid: job.id,
});
setMessage(
`${window.location.protocol}//${window.location.host}/csi/${result.data.insert_csi.returning[0].id}`
);
} else {
notification["error"]({
@@ -127,35 +140,29 @@ export default function JobsDetailHeaderCsi({ bodyshop, job }) {
}
} else {
if (e.key === "email")
store.dispatch(
setEmailOptions({
jobid: job.id,
messageOptions: {
to: [job.ownr_ea],
replyTo: bodyshop.email,
setEmailOptions({
jobid: job.id,
messageOptions: {
to: [job.ownr_ea],
replyTo: bodyshop.email,
},
template: {
name: TemplateList("job_special").csi_invitation_action.key,
variables: {
id: job.csiinvites[0].id,
},
template: {
name: TemplateList("job_special").csi_invitation_action.key,
variables: {
id: job.csiinvites[0].id,
},
},
})
);
},
});
if (e.key === "text") {
const p = parsePhoneNumber(job.ownr_ph1, "CA");
if (p && p.isValid()) {
store.dispatch(
openChatByPhone({
phone_num: p.formatInternational(),
jobid: job.id,
})
);
store.dispatch(
setMessage(
`${window.location.protocol}//${window.location.host}/csi/${job.csiinvites[0].id}`
)
openChatByPhone({
phone_num: p.formatInternational(),
jobid: job.id,
});
setMessage(
`${window.location.protocol}//${window.location.host}/csi/${job.csiinvites[0].id}`
);
} else {
notification["error"]({
@@ -173,51 +180,61 @@ export default function JobsDetailHeaderCsi({ bodyshop, job }) {
}
};
if (!HasFeatureAccess({ featureName: "csi", bodyshop })) return {};
if (!HasFeatureAccess({ featureName: "csi", bodyshop })) return <></>;
return {
key: "sendcsi",
label: t("jobs.actions.sendcsi"),
children: [
{
key: "email",
onClick: handleCreateCsi,
disabled: !!!job.ownr_ea,
label: t("general.labels.email"),
},
{
onClick: handleCreateCsi,
key: "text",
disabled: !!!job.ownr_ph1,
label: t("general.labels.text"),
},
{
key: "generate",
onClick: handleCreateCsi,
disabled: job.csiinvites && job.csiinvites.length > 0,
label: t("jobs.actions.generatecsi"),
},
{ type: "divider" },
...job.csiinvites.map((item, idx) => {
return item.completedon
? {
key: idx,
label: (
<Link to={`/manage/shop/csi?responseid=${item.id}`}>
<DateTimeFormatter>{item.completedon}</DateTimeFormatter>
</Link>
),
}
: {
key: idx,
onClick: () => {
navigator.clipboard.writeText(
`${window.location.protocol}//${window.location.host}/csi/${item.id}`
);
},
label: t("general.actions.copylink"),
};
}),
],
};
return (
<Menu.SubMenu
key="sendcsi"
title={t("jobs.actions.sendcsi")}
disabled={!job.converted}
{...props}
>
<Menu.Item
onClick={handleCreateCsi}
key="email"
disabled={!!!job.ownr_ea}
>
{t("general.labels.email")}
</Menu.Item>
<Menu.Item
onClick={handleCreateCsi}
key="text"
disabled={!!!job.ownr_ph1}
>
{t("general.labels.text")}
</Menu.Item>
<Menu.Item
onClick={handleCreateCsi}
key="generate"
disabled={job.csiinvites && job.csiinvites.length > 0}
>
{t("jobs.actions.generatecsi")}
</Menu.Item>
<Menu.Divider />
{job.csiinvites.map((item, idx) => {
return item.completedon ? (
<Menu.Item key={idx}>
<Link to={`/manage/shop/csi?responseid=${item.id}`}>
<DateTimeFormatter>{item.completedon}</DateTimeFormatter>
</Link>
</Menu.Item>
) : (
<Menu.Item
key={idx}
onClick={() => {
navigator.clipboard.writeText(
`${window.location.protocol}//${window.location.host}/csi/${item.id}`
);
}}
>
{t("general.actions.copylink")}
</Menu.Item>
);
})}
</Menu.SubMenu>
);
}
export default connect(
mapStateToProps,
mapDispatchToProps
)(JobsDetailHeaderCsi);

View File

@@ -1,13 +1,23 @@
import { notification } from "antd";
import { Menu, notification } from "antd";
import axios from "axios";
import i18next from "i18next";
import React from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { auth, logImEXEvent } from "../../firebase/firebase.utils";
import { selectBodyshop } from "../../redux/user/user.selectors";
export default function JobsDetailHeaderActionexportCustomerData({
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
});
const mapDispatchToProps = (dispatch) => ({});
export function JobsDetailHeaderActionexportCustomerData({
bodyshop,
job,
...props
}) {
const { t } = i18next;
const { t } = useTranslation();
const handleExportCustData = async (e) => {
logImEXEvent("job_export_cust_data");
@@ -90,20 +100,18 @@ export default function JobsDetailHeaderActionexportCustomerData({
}
};
return {
onClick: handleExportCustData,
key: "exportcustdata",
disabled: !job.converted,
label: t("jobs.actions.exportcustdata"),
};
// (
// <Menu.Item
// {...props}
// onClick={handleExportCustData}
// key="exportcustdata"
// disabled={!job.converted}
// >
// {t("jobs.actions.exportcustdata")}
// </Menu.Item>
// );
return (
<Menu.Item
{...props}
onClick={handleExportCustData}
key="exportcustdata"
disabled={!job.converted}
>
{t("jobs.actions.exportcustdata")}
</Menu.Item>
);
}
export default connect(
mapStateToProps,
mapDispatchToProps
)(JobsDetailHeaderActionexportCustomerData);

View File

@@ -1,5 +1,5 @@
import { DownOutlined } from "@ant-design/icons";
import { Dropdown } from "antd";
import { Dropdown, Menu } from "antd";
import React from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
@@ -18,16 +18,20 @@ export function JobsDetailRatesChangeButton({ disabled, form, bodyshop }) {
form.setFieldsValue({ ...rate, labor_rate_desc: rate.rate_label });
};
const menu = {
onClick: handleClick,
items: bodyshop.md_labor_rates.map((rate, idx) => ({
key: idx,
value: rate,
label: 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>
);
return (
<Dropdown menu={menu} disabled={disabled}>
<Dropdown overlay={menu} disabled={disabled}>
<a
className="ant-dropdown-link"
href=" #"

View File

@@ -5,7 +5,7 @@ import { useTranslation } from "react-i18next";
import { logImEXEvent } from "../../firebase/firebase.utils";
import cleanAxios from "../../utils/CleanAxios";
import formatBytes from "../../utils/formatbytes";
//import yauzl from "yauzl";
import yauzl from "yauzl";
import { useTreatments } from "@splitsoftware/splitio-react";
import { connect } from "react-redux";
@@ -36,7 +36,7 @@ export function JobsDocumentsDownloadButton({
);
const imagesToDownload = [
...galleryImages.images.filter((image) => image.isSelected),
...galleryImages.other.filter((image) => image.isSelected),
...galleryImages.other.filter((image) => image.isSelected),
];
function downloadProgress(progressEvent) {
@@ -69,42 +69,44 @@ export function JobsDocumentsDownloadButton({
setDownload(null);
if (Direct_Media_Download.treatment === "on") {
try {
// const parentDir = await window.showDirectoryPicker({
// id: "media",
// startIn: "downloads",
// });
// const directory = await parentDir.getDirectoryHandle(identifier, {
// create: true,
// });
// yauzl.fromBuffer(
// Buffer.from(theDownloadedZip.data),
// {},
// (err, zipFile) => {
// if (err) throw err;
// zipFile.on("entry", (entry) => {
// zipFile.openReadStream(entry, async (readErr, readStream) => {
// if (readErr) {
// zipFile.close();
// throw readErr;
// }
// if (err) throw err;
// let fileSystemHandle = await directory.getFileHandle(
// entry.fileName,
// {
// create: true,
// }
// );
// const writable = await fileSystemHandle.createWritable();
// readStream.on("data", async function (chunk) {
// await writable.write(chunk);
// });
// readStream.on("end", async function () {
// await writable.close();
// });
// });
// });
// }
// );
const parentDir = await window.showDirectoryPicker({
id: "media",
startIn: "downloads",
});
const directory = await parentDir.getDirectoryHandle(identifier, {
create: true,
});
yauzl.fromBuffer(
Buffer.from(theDownloadedZip.data),
{},
(err, zipFile) => {
if (err) throw err;
zipFile.on("entry", (entry) => {
zipFile.openReadStream(entry, async (readErr, readStream) => {
if (readErr) {
zipFile.close();
throw readErr;
}
if (err) throw err;
let fileSystemHandle = await directory.getFileHandle(
entry.fileName,
{
create: true,
}
);
const writable = await fileSystemHandle.createWritable();
readStream.on("data", async function (chunk) {
await writable.write(chunk);
});
readStream.on("end", async function () {
await writable.close();
});
});
});
}
);
} catch (e) {
console.log(e);
standardMediaDownload(theDownloadedZip.data);
@@ -121,7 +123,7 @@ export function JobsDocumentsDownloadButton({
a.click();
}
};
return (
<>
<Button

View File

@@ -159,7 +159,7 @@ export function JobsDocumentsGalleryReassign({
);
return (
<Popover content={popContent} open={visible}>
<Popover content={popContent} visible={visible}>
<Button
disabled={selectedImages.length < 1}
onClick={() => setVisible(true)}

View File

@@ -1,7 +1,7 @@
import { EditFilled, FileExcelFilled, SyncOutlined } from "@ant-design/icons";
import { Button, Card, Col, Row, Space } from "antd";
import React, { useEffect, useState } from "react";
import { Gallery } from "react-grid-gallery";
import Gallery from "react-grid-gallery";
import { useTranslation } from "react-i18next";
import DocumentsUploadComponent from "../documents-upload/documents-upload.component";
import { DetermineFileType } from "../documents-upload/documents-upload.utility";
@@ -10,8 +10,7 @@ import JobsDocumentsDownloadButton from "./jobs-document-gallery.download.compon
import JobsDocumentsGalleryReassign from "./jobs-document-gallery.reassign.component";
import JobsDocumentsDeleteButton from "./jobs-documents-gallery.delete.component";
import JobsDocumentsGallerySelectAllComponent from "./jobs-documents-gallery.selectall.component";
import Lightbox from "react-image-lightbox";
import "react-image-lightbox/style.css";
function JobsDocumentsComponent({
data,
jobId,
@@ -24,7 +23,11 @@ function JobsDocumentsComponent({
}) {
const [galleryImages, setgalleryImages] = useState({ images: [], other: [] });
const { t } = useTranslation();
const [modalState, setModalState] = useState({ open: false, index: 0 });
const [index, setIndex] = useState(0);
const onCurrentImageChange = (index) => {
setIndex(index);
};
useEffect(() => {
let documents = data.reduce(
@@ -32,12 +35,10 @@ function JobsDocumentsComponent({
const fileType = DetermineFileType(value.type);
if (value.type.startsWith("image")) {
acc.images.push({
// src: GenerateSrcUrl(value),
// thumbnail: GenerateThumbUrl(value),
fullsize: GenerateSrcUrl(value),
src: GenerateThumbUrl(value),
height: 225,
width: 225,
src: GenerateSrcUrl(value),
thumbnail: GenerateThumbUrl(value),
thumbnailHeight: 225,
thumbnailWidth: 225,
isSelected: false,
key: value.key,
extension: value.extension,
@@ -61,8 +62,8 @@ function JobsDocumentsComponent({
const fileName = value.key.split("/").pop();
acc.other.push({
source: GenerateSrcUrl(value),
//src: "",
src: thumb,
src: "",
thumbnail: thumb,
tags: [
{
value: fileName,
@@ -84,8 +85,8 @@ function JobsDocumentsComponent({
]
: []),
],
height: 225,
width: 225,
thumbnailHeight: 225,
thumbnailWidth: 225,
isSelected: false,
extension: value.extension,
@@ -147,15 +148,35 @@ function JobsDocumentsComponent({
<Card title={t("jobs.labels.documents-images")}>
<Gallery
images={galleryImages.images}
onClick={(index, item) => {
setModalState({ open: true, index: index });
// window.open(
// item.fullsize,
// "_blank",
// "toolbar=0,location=0,menubar=0"
// );
backdropClosesModal={true}
currentImageWillChange={onCurrentImageChange}
customControls={[
<Button
key="edit-button"
style={{
float: "right",
zIndex: "5",
}}
onClick={() => {
const newWindow = window.open(
`${window.location.protocol}//${window.location.host}/edit?documentId=${galleryImages.images[index].id}`,
"_blank",
"noopener,noreferrer"
);
if (newWindow) newWindow.opener = null;
}}
>
<EditFilled />
</Button>,
]}
onClickImage={(props) => {
window.open(
props.target.src,
"_blank",
"toolbar=0,location=0,menubar=0"
);
}}
onSelect={(index, image) => {
onSelectImage={(index, image) => {
setgalleryImages({
...galleryImages,
images: galleryImages.images.map((g, idx) =>
@@ -170,6 +191,8 @@ function JobsDocumentsComponent({
<Card title={t("jobs.labels.documents-other")}>
<Gallery
images={galleryImages.other}
backdropClosesModal={true}
enableLightbox={false}
thumbnailStyle={() => {
return {
backgroundImage: <FileExcelFilled />,
@@ -178,14 +201,14 @@ function JobsDocumentsComponent({
cursor: "pointer",
};
}}
onClick={(index) => {
onClickThumbnail={(index) => {
window.open(
galleryImages.other[index].source,
"_blank",
"toolbar=0,location=0,menubar=0"
);
}}
onSelect={(index) => {
onSelectImage={(index) => {
setgalleryImages({
...galleryImages,
other: galleryImages.other.map((g, idx) =>
@@ -197,53 +220,6 @@ function JobsDocumentsComponent({
</Card>
</Col>
</Row>
{modalState.open && (
<Lightbox
toolbarButtons={[
<EditFilled
onClick={() => {
const newWindow = window.open(
`${window.location.protocol}//${
window.location.host
}/edit?documentId=${
galleryImages.images[modalState.index].id
}`,
"_blank",
"noopener,noreferrer"
);
if (newWindow) newWindow.opener = null;
}}
/>,
]}
mainSrc={galleryImages.images[modalState.index].fullsize}
nextSrc={
galleryImages.images[
(modalState.index + 1) % galleryImages.images.length
].fullsize
}
prevSrc={
galleryImages.images[
(modalState.index + galleryImages.images.length - 1) %
galleryImages.images.length
].fullsize
}
onCloseRequest={() => setModalState({ open: false, index: 0 })}
onMovePrevRequest={() =>
setModalState({
...modalState,
index:
(modalState.index + galleryImages.images.length - 1) %
galleryImages.images.length,
})
}
onMoveNextRequest={() =>
setModalState({
...modalState,
index: (modalState.index + 1) % galleryImages.images.length,
})
}
/>
)}
</div>
);
}

View File

@@ -1,7 +1,7 @@
import { SyncOutlined, FileExcelFilled } from "@ant-design/icons";
import { Alert, Button, Card, Space } from "antd";
import React, { useEffect, useState } from "react";
import { Gallery } from "react-grid-gallery";
import React, { useEffect } from "react";
import Gallery from "react-grid-gallery";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
@@ -18,8 +18,6 @@ import JobsDocumentsLocalDeleteButton from "./jobs-documents-local-gallery.delet
import JobsLocalGalleryDownloadButton from "./jobs-documents-local-gallery.download";
import JobsDocumentsLocalGalleryReassign from "./jobs-documents-local-gallery.reassign.component";
import JobsDocumentsLocalGallerySelectAllComponent from "./jobs-documents-local-gallery.selectall.component";
import Lightbox from "react-image-lightbox";
import "react-image-lightbox/style.css";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
@@ -51,7 +49,6 @@ export function JobsDocumentsLocalGallery({
vendorid,
}) {
const { t } = useTranslation();
const [modalState, setModalState] = useState({ open: false, index: 0 });
useEffect(() => {
if (job) {
if (invoice_number) {
@@ -61,7 +58,6 @@ export function JobsDocumentsLocalGallery({
}
}
}, [job, invoice_number, getJobMedia, getBillMedia]);
let optimized;
const jobMedia =
allMedia && allMedia[job.id]
@@ -74,20 +70,12 @@ export function JobsDocumentsLocalGallery({
) {
acc.images.push({
...val,
fullsize: val.src,
src: val.thumbnail,
height: val.thumbnailHeight,
width: val.thumbnailWidth,
...(val.optimized && { src: val.optimized, fullsize: val.src }),
});
if (val.optimized) optimized = true;
} else {
acc.other.push({
...val,
fullsize: val.src,
src: val.thumbnail,
height: val.thumbnailHeight,
width: val.thumbnailWidth,
tags: [{ value: val.filename, title: val.filename }],
});
}
@@ -132,7 +120,8 @@ export function JobsDocumentsLocalGallery({
<Card title={t("jobs.labels.documents-images")}>
<Gallery
images={jobMedia.images}
onSelect={(index, image) => {
backdropClosesModal={true}
onSelectImage={(index, image) => {
toggleMediaSelected({ jobid: job.id, filename: image.filename });
}}
{...(optimized && {
@@ -144,23 +133,24 @@ export function JobsDocumentsLocalGallery({
/>,
],
})}
onClick={(index, item) => {
setModalState({ open: true, index: index });
// const media = allMedia[job.id].find(
// (m) => m.optimized === item.src
// );
onClickImage={(props) => {
const media = allMedia[job.id].find(
(m) => m.optimized === props.target.src
);
// window.open(
// media ? media.fullsize : item.fullsize,
// "_blank",
// "toolbar=0,location=0,menubar=0"
// );
window.open(
media ? media.src : props.target.src,
"_blank",
"toolbar=0,location=0,menubar=0"
);
}}
/>
</Card>
<Card title={t("jobs.labels.documents-other")}>
<Gallery
images={jobMedia.other}
backdropClosesModal={true}
enableLightbox={false}
thumbnailStyle={() => {
return {
backgroundImage: <FileExcelFilled />,
@@ -169,48 +159,18 @@ export function JobsDocumentsLocalGallery({
cursor: "pointer",
};
}}
onClick={(index) => {
onClickThumbnail={(index) => {
window.open(
jobMedia.other[index].fullsize,
jobMedia.other[index].src,
"_blank",
"toolbar=0,location=0,menubar=0"
);
}}
onSelect={(index, image) => {
onSelectImage={(index, image) => {
toggleMediaSelected({ jobid: job.id, filename: image.filename });
}}
/>
</Card>
{modalState.open && (
<Lightbox
mainSrc={jobMedia.images[modalState.index].fullsize}
nextSrc={
jobMedia.images[(modalState.index + 1) % jobMedia.images.length]
.fullsize
}
prevSrc={
jobMedia.images[
(modalState.index + jobMedia.images.length - 1) %
jobMedia.images.length
].fullsize
}
onCloseRequest={() => setModalState({ open: false, index: 0 })}
onMovePrevRequest={() =>
setModalState({
...modalState,
index:
(modalState.index + jobMedia.images.length - 1) %
jobMedia.images.length,
})
}
onMoveNextRequest={() =>
setModalState({
...modalState,
index: (modalState.index + 1) % jobMedia.images.length,
})
}
/>
)}
</div>
);
}

View File

@@ -1,5 +1,5 @@
import React, { useEffect } from "react";
import { Gallery } from "react-grid-gallery";
import Gallery from "react-grid-gallery";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
@@ -38,7 +38,7 @@ function JobDocumentsLocalGalleryExternal({
const { t } = useTranslation();
useEffect(() => {
if (jobId) {
if ( jobId) {
getJobMedia(jobId);
}
}, [jobId, getJobMedia]);
@@ -52,7 +52,7 @@ function JobDocumentsLocalGalleryExternal({
val.type.mime &&
val.type.mime.startsWith("image")
) {
acc.push({ ...val, src: val.thumbnail });
acc.push(val);
}
return acc;
}, [])
@@ -65,6 +65,7 @@ function JobDocumentsLocalGalleryExternal({
<div className="clearfix">
<Gallery
images={galleryImages}
backdropClosesModal={true}
onSelectImage={(index, image) => {
setgalleryImages(
galleryImages.map((g, idx) =>

View File

@@ -83,7 +83,7 @@ export function JobsDocumentsLocalGalleryReassign({
);
return (
<Popover content={popContent} open={visible}>
<Popover content={popContent} visible={visible}>
<Button
//disabled={selectedImages.length < 1}
onClick={() => setVisible(true)}

View File

@@ -171,8 +171,8 @@ export function LaborAllocationsAdjustmentEdit({
return (
<Popover
open={visible}
onOpenChange={(vis) => setVisible(vis)}
visible={visible}
onVisibleChange={(vis) => setVisible(vis)}
content={overlay}
trigger="click"
>

View File

@@ -117,7 +117,7 @@ export function NoteUpsertModalContainer({
return (
<Modal
title={existingNote ? t("notes.actions.edit") : t("notes.actions.new")}
open={visible}
visible={visible}
okText={t("general.actions.save")}
onOk={() => {
form.submit();

View File

@@ -1,5 +1,5 @@
import { DownOutlined } from "@ant-design/icons";
import { Dropdown } from "antd";
import { Dropdown, Menu } from "antd";
import React from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
@@ -21,21 +21,27 @@ export function NotesPresetButton({ bodyshop, form }) {
form.setFieldsValue({ text: item.text });
};
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,
})),
};
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>
);
return (
<div>
<Dropdown trigger={["click"]} menu={menu}>
<Dropdown trigger={["click"]} overlay={menu}>
<a
className="ant-dropdown-link"
href="# "

View File

@@ -1,5 +1,4 @@
import { PageHeader } from '@ant-design/pro-layout';
import { Button, Form, notification } from "antd";
import { Button, Form, notification, PageHeader } from "antd";
import React, { useState } from "react";
import { useMutation } from "@apollo/client";
import { useTranslation } from "react-i18next";

View File

@@ -76,7 +76,7 @@ export function PartsOrderBackorderEta({
<Popover
destroyTooltipOnHide
content={popContent}
open={visibility}
visible={visibility}
disabled={disabled}
>
<DateFormatter>{backordered_eta}</DateFormatter>

View File

@@ -92,7 +92,7 @@ export function PartsOrderLineBackorderButton({
<Popover
destroyTooltipOnHide
content={popContent}
open={visibility}
visible={visibility}
disabled={disabled}
>
<Button loading={loading} onClick={handlePopover}>

View File

@@ -1,7 +1,17 @@
import { DeleteFilled, EyeFilled, SyncOutlined } from "@ant-design/icons";
import { useMutation } from "@apollo/client";
import { PageHeader } from '@ant-design/pro-layout';
import { Button, Card, Checkbox, Drawer, Grid, Input, Popconfirm, Space, Table } from "antd";
import {
Button,
Card,
Checkbox,
Drawer,
Grid,
Input,
PageHeader,
Popconfirm,
Space,
Table,
} from "antd";
import queryString from "query-string";
import React, { useState } from "react";
import { useTranslation } from "react-i18next";
@@ -461,7 +471,7 @@ export function PartsOrderListTableComponent({
<Drawer
placement="right"
onClose={() => handleOnRowClick(null)}
open={selectedpartsorder}
visible={selectedpartsorder}
closable
width={drawerPercentage}
>

View File

@@ -1,11 +1,17 @@
import { DeleteFilled, DownOutlined, WarningFilled } from "@ant-design/icons";
import { DeleteFilled, WarningFilled, DownOutlined } from "@ant-design/icons";
import { useTreatments } from "@splitsoftware/splitio-react";
import {
Checkbox, Divider, Dropdown, Form,
Divider,
Form,
Input,
InputNumber,
Radio, Select, Space,
Tag
Radio,
Space,
Tag,
Select,
Menu,
Dropdown,
Checkbox,
} from "antd";
import React from "react";
import { useTranslation } from "react-i18next";
@@ -55,14 +61,17 @@ export function PartsOrderModalComponent({
form.setFieldsValue({ comments: item.props.value });
};
const menu = {
onClick: handleClick,
items: bodyshop.md_parts_order_comment.map((comment, idx) => ({
key: idx,
value: comment.comment,
label: comment.label,
})),
};
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>
);
return (
<div>
@@ -299,7 +308,7 @@ export function PartsOrderModalComponent({
label={
<Space>
{t("parts_orders.fields.comments")}
<Dropdown menu={menu}>
<Dropdown overlay={menu}>
<a
className="ant-dropdown-link"
href=" #"

View File

@@ -350,7 +350,7 @@ export function PartsOrderModalContainer({
return (
<Modal
open={visible}
visible={visible}
title={
isReturn
? `${t("parts_orders.labels.returnpartsorder")} ${invoiceNumber}`

View File

@@ -92,7 +92,7 @@ export function PartsReceiveModalContainer({
return (
<Modal
open={visible}
visible={visible}
title={t("parts_orders.labels.receive")}
onCancel={() => toggleModalVisible()}
onOk={() => form.submit()}

View File

@@ -90,7 +90,7 @@ export function BillMarkSelectedExported({
return (
<Popconfirm
open={visible}
visible={visible}
title={t("general.labels.areyousure")}
onCancel={() => setVisible(false)}
onConfirm={handleUpdate}

View File

@@ -93,7 +93,7 @@ export function PaymentMarkSelectedExported({
return (
<Popconfirm
open={visible}
visible={visible}
title={t("general.labels.areyousure")}
onCancel={() => setVisible(false)}
onConfirm={handleUpdate}

View File

@@ -138,7 +138,7 @@ function PaymentModalContainer({
? t("payments.labels.new")
: t("payments.labels.edit")
}
open={visible}
visible={visible}
okText={t("general.actions.save")}
onOk={() => form.submit()}
width="50%"

View File

@@ -1,5 +1,4 @@
import { PageHeader } from '@ant-design/pro-layout';
import { Button, Form, Input, Space } from "antd";
import { Button, Form, Input, PageHeader, Space } from "antd";
import React from "react";
import { useTranslation } from "react-i18next";
import FormFieldsChanged from "../form-fields-changed-alert/form-fields-changed-alert.component";

View File

@@ -123,7 +123,7 @@ export function PrintCenterJobsLabels({ bodyshop, jobId }) {
</Card>
);
return (
<Popover content={content} open={isModalVisible}>
<Popover content={content} visible={isModalVisible}>
<Button onClick={() => setIsModalVisible(true)}>
{t("printcenter.jobs.labels.labels")}
</Button>

View File

@@ -28,7 +28,7 @@ export function PrintCenterModalContainer({
return (
<Modal
open={visible}
visible={visible}
onOk={() => toggleModalVisible()}
onCancel={() => toggleModalVisible()}
cancelButtonProps={{ style: { display: "none" } }}

View File

@@ -1,5 +1,4 @@
import { PageHeader } from '@ant-design/pro-layout';
import { Button, List } from "antd";
import { Button, List, PageHeader } from "antd";
import React, { useState } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";

View File

@@ -166,7 +166,7 @@ export default function ProductionBoardKanbanCardSettings({
</div>
);
return (
<Popover content={overlay} open={visible}>
<Popover content={overlay} visible={visible}>
<Button loading={loading} onClick={() => setVisible(true)}>
{t("production.labels.cardsettings")}
</Button>

View File

@@ -1,8 +1,7 @@
import { SyncOutlined } from "@ant-design/icons";
import { useApolloClient } from "@apollo/client";
import Board, { moveCard } from "@asseinfo/react-kanban";
import { PageHeader } from '@ant-design/pro-layout';
import { Button, Grid, notification, Space, Statistic } from "antd";
import { Button, Grid, notification, PageHeader, Space, Statistic } from "antd";
import React, { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";

View File

@@ -1,7 +1,7 @@
import { Button, Dropdown } from "antd";
import React from "react";
import { useTranslation } from "react-i18next";
import { Button, Dropdown, Menu } from "antd";
import dataSource from "./production-list-columns.data";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
@@ -47,24 +47,37 @@ export function ProductionColumnsComponent({
state: tableState,
activeStatuses: bodyshop.md_ro_statuses.active_statuses,
});
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,
})),
};
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>
);
return (
<div>
<Dropdown menu={menu}>
<Dropdown overlay={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)));
// }}
// />

View File

@@ -1,10 +1,10 @@
import { ExclamationCircleFilled } from "@ant-design/icons";
import { useMutation } from "@apollo/client";
import { Dropdown } from "antd";
import { Dropdown, Menu } from "antd";
import React from "react";
import { useTranslation } from "react-i18next";
import { logImEXEvent } from "../../firebase/firebase.utils";
import { useMutation } from "@apollo/client";
import { UPDATE_JOB } from "../../graphql/jobs.queries";
import { logImEXEvent } from "../../firebase/firebase.utils";
export default function ProductionListColumnAlert({ record }) {
const { t } = useTranslation();
@@ -34,18 +34,15 @@ export default function ProductionListColumnAlert({ record }) {
return (
<Dropdown
menu={{
items: [
{
key: "toggleAlert",
onClick: handleAlertToggle,
label:
record.production_vars && record.production_vars.alert
? t("production.labels.alertoff")
: t("production.labels.alerton"),
},
],
}}
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>
}
trigger={["contextMenu"]}
>
<div

View File

@@ -1,9 +1,9 @@
import { useMutation } from "@apollo/client";
import { Dropdown } from "antd";
import { Dropdown, Menu } from "antd";
import React from "react";
import { useTranslation } from "react-i18next";
import { logImEXEvent } from "../../firebase/firebase.utils";
import { UPDATE_JOB } from "../../graphql/jobs.queries";
import { logImEXEvent } from "../../firebase/firebase.utils";
export default function ProductionListColumnBodyPriority({ record }) {
const { t } = useTranslation();
@@ -31,27 +31,25 @@ export default function ProductionListColumnBodyPriority({ record }) {
return (
<Dropdown
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: (
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}>
<div style={{ marginLeft: "2rem", marginRight: "2rem" }}>
{index + 1}
</div>
),
})),
},
],
}}
</Menu.Item>
))}
</Menu.SubMenu>
</Menu>
}
trigger={["click"]}
>
<div style={{ width: "100%", height: "19px" }}>

View File

@@ -41,8 +41,8 @@ export default function ProductionListColumnComment({ record }) {
return (
<Popover
onOpenChange={handleVisibleChange}
open={visible}
onVisibleChange={handleVisibleChange}
visible={visible}
content={
<div style={{ width: "30em" }}>
<Input.TextArea

View File

@@ -52,7 +52,7 @@ export default function ProductionListDate({
return (
<Dropdown
//trigger={["click"]}
open={visible}
visible={visible}
style={{
height: "19px",
}}

View File

@@ -1,9 +1,9 @@
import { useMutation } from "@apollo/client";
import { Dropdown } from "antd";
import { Dropdown, Menu } from "antd";
import React from "react";
import { useTranslation } from "react-i18next";
import { logImEXEvent } from "../../firebase/firebase.utils";
import { UPDATE_JOB } from "../../graphql/jobs.queries";
import { logImEXEvent } from "../../firebase/firebase.utils";
export default function ProductionListColumnDetailPriority({ record }) {
const { t } = useTranslation();
@@ -31,27 +31,25 @@ export default function ProductionListColumnDetailPriority({ record }) {
return (
<Dropdown
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: (
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}>
<div style={{ marginLeft: "2rem", marginRight: "2rem" }}>
{index + 1}
</div>
),
})),
},
],
}}
</Menu.Item>
))}
</Menu.SubMenu>
</Menu>
}
trigger={["click"]}
>
<div style={{ width: "100%", height: "19px" }}>

View File

@@ -153,7 +153,7 @@ export function ProductionListEmpAssignment({
theEmployee = bodyshop.employees.find((e) => e.id === record[type]);
return (
<Popover destroyTooltipOnHide content={popContent} open={visibility}>
<Popover destroyTooltipOnHide content={popContent} visible={visibility}>
<Spin spinning={loading}>
{record[type] ? (
<div>

View File

@@ -93,7 +93,7 @@ export function ProductionLastContacted({ currentUser, record }) {
<div>
<Dropdown
//trigger={["click"]}
open={visible}
visible={visible}
style={{
height: "19px",
}}

View File

@@ -1,9 +1,9 @@
import { useMutation } from "@apollo/client";
import { Dropdown } from "antd";
import { Dropdown, Menu } from "antd";
import React from "react";
import { useTranslation } from "react-i18next";
import { logImEXEvent } from "../../firebase/firebase.utils";
import { UPDATE_JOB } from "../../graphql/jobs.queries";
import { logImEXEvent } from "../../firebase/firebase.utils";
export default function ProductionListColumnPaintPriority({ record }) {
const { t } = useTranslation();
@@ -31,27 +31,25 @@ export default function ProductionListColumnPaintPriority({ record }) {
return (
<Dropdown
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: (
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}>
<div style={{ marginLeft: "2rem", marginRight: "2rem" }}>
{index + 1}
</div>
),
})),
},
],
}}
</Menu.Item>
))}
</Menu.SubMenu>
</Menu>
}
trigger={["click"]}
>
<div style={{ width: "100%", height: "19px" }}>

View File

@@ -49,8 +49,8 @@ export default function ProductionListColumnProductionNote({ record }) {
return (
<Popover
onOpenChange={handleVisibleChange}
open={visible}
onVisibleChange={handleVisibleChange}
visible={visible}
content={
<div style={{ width: "30em" }}>
<Input.TextArea

View File

@@ -1,5 +1,5 @@
import { useMutation } from "@apollo/client";
import { Dropdown, Spin } from "antd";
import { Dropdown, Menu, Spin } from "antd";
import React, { useState } from "react";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
@@ -38,14 +38,16 @@ export function ProductionListColumnCategory({ record, bodyshop }) {
return (
<Dropdown
menu={{
style: { maxHeight: "200px", overflowY: "auto" },
onClick: handleSetStatus,
items: bodyshop.md_categories.map((item) => ({
key: item,
label: item,
})),
}}
overlay={
<Menu
style={{ maxHeight: "200px", overflowY: "auto" }}
onClick={handleSetStatus}
>
{bodyshop.md_categories.map((item) => (
<Menu.Item key={item}>{item}</Menu.Item>
))}
</Menu>
}
trigger={["click"]}
>
<div style={{ width: "100%", height: "19px", cursor: "pointer" }}>

View File

@@ -1,12 +1,12 @@
import { useMutation } from "@apollo/client";
import { Dropdown, Spin } from "antd";
import { Dropdown, Menu, 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 { insertAuditTrail } from "../../redux/application/application.actions";
import { selectBodyshop } from "../../redux/user/user.selectors";
import { insertAuditTrail } from "../../redux/application/application.actions";
import AuditTrailMapping from "../../utils/AuditTrailMappings";
const mapStateToProps = createStructuredSelector({
@@ -47,14 +47,16 @@ export function ProductionListColumnStatus({
return (
<Dropdown
menu={{
style: { maxHeight: "200px", overflowY: "auto" },
onClick: handleSetStatus,
items: bodyshop.md_ro_statuses.production_statuses.map((item) => ({
key: item,
label: item,
})),
}}
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>
}
trigger={["click"]}
>
<div style={{ width: "100%", height: "19px", cursor: "pointer" }}>

View File

@@ -1,6 +1,5 @@
import { useQuery } from "@apollo/client";
import { PageHeader } from '@ant-design/pro-layout';
import { Descriptions, Drawer, Space, Button } from "antd";
import { Descriptions, Drawer, Space, PageHeader, Button } from "antd";
import queryString from "query-string";
import React from "react";
import { useTranslation } from "react-i18next";
@@ -91,7 +90,7 @@ export function ProductionListDetail({
placement="right"
width={"33%"}
onClose={handleClose}
open={selected}
visible={selected}
>
{loading && <LoadingSkeleton />}
{error && <AlertComponent error={JSON.stringify(error)} />}

View File

@@ -88,7 +88,7 @@ export function ProductionListSaveConfigButton({
);
return (
<Popover open={visible} content={popMenu}>
<Popover visible={visible} content={popMenu}>
<Button loading={loading} onClick={() => setVisible(true)}>
{t("production.actions.saveconfig")}
</Button>

View File

@@ -1,8 +1,8 @@
import { Button, Dropdown } from "antd";
import { Button, Dropdown, Menu } 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,86 +31,98 @@ export function ProductionListPrint({ bodyshop }) {
return (
<Dropdown
trigger="click"
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 () => {
overlay={
<Menu>
{Object.keys(ProdTemplates).map((key) => (
<Menu.Item
key={key}
onClick={async () => {
setLoading(true);
await GenerateDocument(
{
name: production_by_technician_one.key,
variables: { id: e.id },
name: ProdTemplates[key].key,
// variables: { id: contract.id },
},
{},
"p"
);
setLoading(false);
},
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,
})),
},
],
}}
}}
>
{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>
}
>
<Button loading={loading}>{t("general.labels.print")}</Button>
</Dropdown>

View File

@@ -1,7 +1,15 @@
import { SyncOutlined } from "@ant-design/icons";
import { useTreatments } from "@splitsoftware/splitio-react";
import { PageHeader } from '@ant-design/pro-layout';
import { Button, Dropdown, Input, Space, Statistic, Table } from "antd";
import {
Button,
Dropdown,
Input,
Menu,
PageHeader,
Space,
Statistic,
Table,
} from "antd";
import React, { useMemo, useState } from "react";
import ReactDragListView from "react-drag-listview";
import { useTranslation } from "react-i18next";
@@ -113,10 +121,13 @@ export function ProductionListTable({
const headerItem = (col) => (
<Dropdown
className="prod-header-dropdown"
menu={{
onClick: removeColumn,
items: [{ key: col.key, label: t("production.actions.removecolumn") }],
}}
overlay={
<Menu onClick={removeColumn}>
<Menu.Item key={col.key}>
{t("production.actions.removecolumn")}
</Menu.Item>
</Menu>
}
trigger={["contextMenu"]}
>
<span>{col.title}</span>

View File

@@ -2,13 +2,14 @@ import { Space } from "antd";
import Axios from "axios";
import queryString from "query-string";
import React, { useEffect } from "react";
import { useCookies } from "react-cookie";
import { useHistory, useLocation } from "react-router-dom";
import QboSignIn from "../../assets/qbo/C2QB_green_btn_med_default.svg";
export default function QboAuthorizeComponent() {
const location = useLocation();
const history = useHistory();
const [, setCookie] = useCookies(["access_token", "refresh_token"]);
const handleQbSignIn = async () => {
const result = await Axios.post("/qbo/authorize");
@@ -41,7 +42,7 @@ export default function QboAuthorizeComponent() {
history.push({ pathname: `/manage/accounting/receivables` });
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [qs, location]);
}, [qs, location, setCookie]);
return (
<Space>

View File

@@ -25,7 +25,7 @@ export function ReportCenterModalContainer({
return (
<Modal
open={visible}
visible={visible}
title={t("printcenter.labels.reportcentermodal")}
onOk={() => toggleModalVisible()}
onCancel={() => toggleModalVisible()}

View File

@@ -1,13 +1,13 @@
import { useMutation } from "@apollo/client";
import { Dropdown, notification } from "antd";
import { Dropdown, Menu, 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,12 +55,15 @@ export function ScheduleBlockDay({
}
};
const menu = (
<Menu onClick={handleMenu}>
<Menu.Item key="block">{t("appointments.actions.block")}</Menu.Item>
</Menu>
);
return (
<Dropdown
menu={{
onClick: handleMenu,
items: [{ key: 'block', label: t("appointments.actions.block") }],
}}
overlay={menu}
disabled={alreadyBlocked}
trigger={["contextMenu"]}
>

View File

@@ -1,6 +1,5 @@
import { SyncOutlined } from "@ant-design/icons";
import { PageHeader } from '@ant-design/pro-layout';
import { Button, Card, Checkbox, Col, Row, Space } from "antd";
import { Button, Card, Checkbox, Col, PageHeader, Row, Space } from "antd";
import { t } from "i18next";
import React, { useMemo } from "react";
import useLocalStorage from "../../utils/useLocalStorage";

View File

@@ -184,7 +184,7 @@ export function ScheduleJobModalContainer({
return (
<Modal
open={visible}
visible={visible}
onCancel={() => toggleModalVisible()}
onOk={() => form.submit()}
width={"90%"}

View File

@@ -154,7 +154,7 @@ export function ScheduleManualEvent({ bodyshop, event }) {
};
return (
<Popover content={overlay} open={visibility}>
<Popover content={overlay} visible={visibility}>
<Button loading={loading} onClick={handleClick}>
{event
? t("appointments.actions.reschedule")

View File

@@ -90,7 +90,7 @@ export default function ScoreboardEntryEdit({ entry }) {
return (
<div>
<Dropdown open={visible} overlay={popContent}>
<Dropdown visible={visible} overlay={popContent}>
<Button
onClick={(e) => {
e.stopPropagation();

View File

@@ -100,7 +100,7 @@ export default function ScoreboardJobsList({ scoreBoardlist }) {
return (
<>
<Modal
open={state.visible}
visible={state.visible}
destroyOnClose
width="80%"
cancelButtonProps={{ style: { display: "none" } }}

Some files were not shown because too many files have changed in this diff Show More