FIrst round of changes for Instance Manger & Pro Manager
This commit is contained in:
@@ -3,10 +3,13 @@ root = true
|
|||||||
[*]
|
[*]
|
||||||
charset = utf-8
|
charset = utf-8
|
||||||
indent_style = space
|
indent_style = space
|
||||||
indent_size = 4
|
indent_size = 2
|
||||||
end_of_line = lf
|
end_of_line = lf
|
||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
trim_trailing_whitespace = true
|
trim_trailing_whitespace = false
|
||||||
|
quote_type = single
|
||||||
|
max_line_length = 100
|
||||||
|
bracketSpacing = false
|
||||||
|
|
||||||
[*.md]
|
[*.md]
|
||||||
trim_trailing_whitespace = false
|
trim_trailing_whitespace = false
|
||||||
|
|||||||
12
_reference/BodyshopFeatures.json
Normal file
12
_reference/BodyshopFeatures.json
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"mobile": "date",
|
||||||
|
"allAccess": "bool",
|
||||||
|
"timetickets": "date",
|
||||||
|
"payments": "date",
|
||||||
|
"partsorders": "date",
|
||||||
|
"bills": "Date",
|
||||||
|
"export": "date",
|
||||||
|
"csi": "Date",
|
||||||
|
"courtesycars": "date",
|
||||||
|
"media": "date"
|
||||||
|
}
|
||||||
@@ -11,4 +11,4 @@ REACT_APP_STRIPE_PUBLIC_KEY=pk_test_51GqB4TJl3nQjrZ0wCQWAxAhlNF8jKe0tipIa6ExBaxw
|
|||||||
REACT_APP_AXIOS_BASE_API_URL=http://localhost:4000
|
REACT_APP_AXIOS_BASE_API_URL=http://localhost:4000
|
||||||
REACT_APP_REPORTS_SERVER_URL=https://reports3.test.imex.online
|
REACT_APP_REPORTS_SERVER_URL=https://reports3.test.imex.online
|
||||||
REACT_APP_SPLIT_API=ts615lqgnmk84thn72uk18uu5pgce6e0l4rc
|
REACT_APP_SPLIT_API=ts615lqgnmk84thn72uk18uu5pgce6e0l4rc
|
||||||
INSTANCE=IMEX
|
REACT_APP_INSTANCE=IMEX
|
||||||
|
|||||||
@@ -11,4 +11,4 @@ REACT_APP_STRIPE_PUBLIC_KEY=pk_test_51GqB4TJl3nQjrZ0wCQWAxAhlNF8jKe0tipIa6ExBaxw
|
|||||||
REACT_APP_AXIOS_BASE_API_URL=http://localhost:4000
|
REACT_APP_AXIOS_BASE_API_URL=http://localhost:4000
|
||||||
REACT_APP_REPORTS_SERVER_URL=https://reports3.test.imex.online
|
REACT_APP_REPORTS_SERVER_URL=https://reports3.test.imex.online
|
||||||
REACT_APP_SPLIT_API=ts615lqgnmk84thn72uk18uu5pgce6e0l4rc
|
REACT_APP_SPLIT_API=ts615lqgnmk84thn72uk18uu5pgce6e0l4rc
|
||||||
INSTANCE=PROMANAGER
|
REACT_APP_INSTANCE=PROMANAGER
|
||||||
|
|||||||
@@ -12,4 +12,4 @@ REACT_APP_AXIOS_BASE_API_URL=http://localhost:4000
|
|||||||
REACT_APP_REPORTS_SERVER_URL=https://reports3.test.imex.online
|
REACT_APP_REPORTS_SERVER_URL=https://reports3.test.imex.online
|
||||||
REACT_APP_SPLIT_API=ts615lqgnmk84thn72uk18uu5pgce6e0l4rc
|
REACT_APP_SPLIT_API=ts615lqgnmk84thn72uk18uu5pgce6e0l4rc
|
||||||
REACT_APP_COUNTRY=USA
|
REACT_APP_COUNTRY=USA
|
||||||
INSTANCE=ROME
|
REACT_APP_INSTANCE=ROME
|
||||||
|
|||||||
@@ -12,4 +12,4 @@ REACT_APP_STRIPE_PUBLIC_KEY=pk_test_51GqB4TJl3nQjrZ0wCQWAxAhlNF8jKe0tipIa6ExBaxw
|
|||||||
REACT_APP_AXIOS_BASE_API_URL=https://api.imex.online/
|
REACT_APP_AXIOS_BASE_API_URL=https://api.imex.online/
|
||||||
REACT_APP_REPORTS_SERVER_URL=https://reports.imex.online
|
REACT_APP_REPORTS_SERVER_URL=https://reports.imex.online
|
||||||
REACT_APP_SPLIT_API=et9pjkik6bn67he5evpmpr1agoo7gactphgk
|
REACT_APP_SPLIT_API=et9pjkik6bn67he5evpmpr1agoo7gactphgk
|
||||||
INSTANCE=IMEX
|
REACT_APP_INSTANCE=IMEX
|
||||||
|
|||||||
@@ -12,4 +12,4 @@ REACT_APP_STRIPE_PUBLIC_KEY=pk_test_51GqB4TJl3nQjrZ0wCQWAxAhlNF8jKe0tipIa6ExBaxw
|
|||||||
REACT_APP_AXIOS_BASE_API_URL=https://api.imex.online/
|
REACT_APP_AXIOS_BASE_API_URL=https://api.imex.online/
|
||||||
REACT_APP_REPORTS_SERVER_URL=https://reports.imex.online
|
REACT_APP_REPORTS_SERVER_URL=https://reports.imex.online
|
||||||
REACT_APP_SPLIT_API=et9pjkik6bn67he5evpmpr1agoo7gactphgk
|
REACT_APP_SPLIT_API=et9pjkik6bn67he5evpmpr1agoo7gactphgk
|
||||||
INSTANCE=PROMANAGER
|
REACT_APP_INSTANCE=PROMANAGER
|
||||||
|
|||||||
@@ -12,4 +12,4 @@ REACT_APP_STRIPE_PUBLIC_KEY=pk_test_51GqB4TJl3nQjrZ0wCQWAxAhlNF8jKe0tipIa6ExBaxw
|
|||||||
REACT_APP_AXIOS_BASE_API_URL=https://api.romeonline.io/
|
REACT_APP_AXIOS_BASE_API_URL=https://api.romeonline.io/
|
||||||
REACT_APP_REPORTS_SERVER_URL=https://reports.romeonline.io
|
REACT_APP_REPORTS_SERVER_URL=https://reports.romeonline.io
|
||||||
REACT_APP_SPLIT_API=et9pjkik6bn67he5evpmpr1agoo7gactphgk
|
REACT_APP_SPLIT_API=et9pjkik6bn67he5evpmpr1agoo7gactphgk
|
||||||
INSTANCE=ROME
|
REACT_APP_INSTANCE=ROME
|
||||||
|
|||||||
@@ -12,4 +12,4 @@ REACT_APP_AXIOS_BASE_API_URL=https://api.test.imex.online/
|
|||||||
REACT_APP_REPORTS_SERVER_URL=https://reports3.test.imex.online
|
REACT_APP_REPORTS_SERVER_URL=https://reports3.test.imex.online
|
||||||
REACT_APP_IS_TEST=true
|
REACT_APP_IS_TEST=true
|
||||||
REACT_APP_SPLIT_API=ts615lqgnmk84thn72uk18uu5pgce6e0l4rc
|
REACT_APP_SPLIT_API=ts615lqgnmk84thn72uk18uu5pgce6e0l4rc
|
||||||
INSTANCE=IMEX
|
REACT_APP_INSTANCE=IMEX
|
||||||
|
|||||||
@@ -12,4 +12,4 @@ REACT_APP_AXIOS_BASE_API_URL=https://api.test.imex.online/
|
|||||||
REACT_APP_REPORTS_SERVER_URL=https://reports3.test.imex.online
|
REACT_APP_REPORTS_SERVER_URL=https://reports3.test.imex.online
|
||||||
REACT_APP_IS_TEST=true
|
REACT_APP_IS_TEST=true
|
||||||
REACT_APP_SPLIT_API=ts615lqgnmk84thn72uk18uu5pgce6e0l4rc
|
REACT_APP_SPLIT_API=ts615lqgnmk84thn72uk18uu5pgce6e0l4rc
|
||||||
INSTANCE=PROMANAGER
|
REACT_APP_INSTANCE=PROMANAGER
|
||||||
|
|||||||
@@ -12,4 +12,4 @@ REACT_APP_AXIOS_BASE_API_URL=https://api.test.romeonline.io/
|
|||||||
REACT_APP_REPORTS_SERVER_URL=https://reports.test.romeonline.io
|
REACT_APP_REPORTS_SERVER_URL=https://reports.test.romeonline.io
|
||||||
REACT_APP_IS_TEST=true
|
REACT_APP_IS_TEST=true
|
||||||
REACT_APP_SPLIT_API=ts615lqgnmk84thn72uk18uu5pgce6e0l4rc
|
REACT_APP_SPLIT_API=ts615lqgnmk84thn72uk18uu5pgce6e0l4rc
|
||||||
INSTANCE=ROME
|
REACT_APP_INSTANCE=ROME
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import dayjs from "../../utils/day";
|
import dayjs from "../../utils/day";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import {useTranslation} from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import {connect} from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import {createStructuredSelector} from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import {selectBodyshop} from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
import AlertComponent from "../alert/alert.component";
|
import AlertComponent from "../alert/alert.component";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
@@ -16,10 +16,10 @@ function FeatureWrapper({
|
|||||||
noauth,
|
noauth,
|
||||||
children,
|
children,
|
||||||
...restProps
|
...restProps
|
||||||
}) {
|
}) {
|
||||||
const {t} = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
if (HasFeatureAccess({featureName, bodyshop})) return children;
|
if (HasFeatureAccess({ featureName, bodyshop })) return children;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
noauth || (
|
noauth || (
|
||||||
@@ -31,10 +31,10 @@ function FeatureWrapper({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function HasFeatureAccess({featureName, bodyshop}) {
|
export function HasFeatureAccess({ featureName, bodyshop }) {
|
||||||
return (
|
return (
|
||||||
bodyshop.features.allAccess ||
|
bodyshop?.features.allAccess ||
|
||||||
dayjs(bodyshop.features[featureName]).isAfter(dayjs())
|
dayjs(bodyshop?.features[featureName]).isAfter(dayjs())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,26 +24,30 @@ import Icon, {
|
|||||||
ToolFilled,
|
ToolFilled,
|
||||||
UnorderedListOutlined,
|
UnorderedListOutlined,
|
||||||
UserOutlined,
|
UserOutlined,
|
||||||
} from "@ant-design/icons";
|
} from '@ant-design/icons';
|
||||||
import {useSplitTreatments} from "@splitsoftware/splitio-react";
|
import { useSplitTreatments } from '@splitsoftware/splitio-react';
|
||||||
import {Layout, Menu, Switch, Tooltip} from "antd";
|
import { Layout, Menu, Switch, Tooltip } from 'antd';
|
||||||
import React, {useEffect, useState} from "react";
|
import React, { useEffect, useState } from 'react';
|
||||||
import {useTranslation} from "react-i18next";
|
import { useTranslation } from 'react-i18next';
|
||||||
import {BsKanban} from "react-icons/bs";
|
import { BsKanban } from 'react-icons/bs';
|
||||||
import {FaCalendarAlt, FaCarCrash, FaCreditCard, FaFileInvoiceDollar,} from "react-icons/fa";
|
import { FaCalendarAlt, FaCarCrash, FaCreditCard, FaFileInvoiceDollar } from 'react-icons/fa';
|
||||||
import {GiPayMoney, GiPlayerTime, GiSettingsKnobs} from "react-icons/gi";
|
import { GiPayMoney, GiPlayerTime, GiSettingsKnobs } from 'react-icons/gi';
|
||||||
import {IoBusinessOutline} from "react-icons/io5";
|
import { IoBusinessOutline } from 'react-icons/io5';
|
||||||
import {RiSurveyLine} from "react-icons/ri";
|
import { RiSurveyLine } from 'react-icons/ri';
|
||||||
import {connect} from "react-redux";
|
import { connect } from 'react-redux';
|
||||||
import {Link} from "react-router-dom";
|
import { Link } from 'react-router-dom';
|
||||||
import {createStructuredSelector} from "reselect";
|
import { createStructuredSelector } from 'reselect';
|
||||||
import {selectRecentItems, selectSelectedHeader,} from "../../redux/application/application.selectors";
|
import {
|
||||||
import {setModalContext} from "../../redux/modals/modals.actions";
|
selectRecentItems,
|
||||||
import {signOutStart} from "../../redux/user/user.actions";
|
selectSelectedHeader,
|
||||||
import {selectBodyshop, selectCurrentUser,} from "../../redux/user/user.selectors";
|
} from '../../redux/application/application.selectors';
|
||||||
import {FiLogOut} from "react-icons/fi";
|
import { setModalContext } from '../../redux/modals/modals.actions';
|
||||||
import {checkBeta, handleBeta, setBeta} from "../../utils/betaHandler";
|
import { signOutStart } from '../../redux/user/user.actions';
|
||||||
import InstanceRenderManager from "../../utils/instanceRenderMgr";
|
import { selectBodyshop, selectCurrentUser } from '../../redux/user/user.selectors';
|
||||||
|
import { FiLogOut } from 'react-icons/fi';
|
||||||
|
import { checkBeta, handleBeta, setBeta } from '../../utils/betaHandler';
|
||||||
|
import InstanceRenderManager from '../../utils/instanceRenderMgr';
|
||||||
|
import { HasFeatureAccess } from '../feature-wrapper/feature-wrapper.component';
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
currentUser: selectCurrentUser,
|
currentUser: selectCurrentUser,
|
||||||
@@ -54,16 +58,15 @@ const mapStateToProps = createStructuredSelector({
|
|||||||
|
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
setBillEnterContext: (context) =>
|
setBillEnterContext: (context) =>
|
||||||
dispatch(setModalContext({context: context, modal: "billEnter"})),
|
dispatch(setModalContext({ context: context, modal: 'billEnter' })),
|
||||||
setTimeTicketContext: (context) =>
|
setTimeTicketContext: (context) =>
|
||||||
dispatch(setModalContext({context: context, modal: "timeTicket"})),
|
dispatch(setModalContext({ context: context, modal: 'timeTicket' })),
|
||||||
setPaymentContext: (context) =>
|
setPaymentContext: (context) => dispatch(setModalContext({ context: context, modal: 'payment' })),
|
||||||
dispatch(setModalContext({context: context, modal: "payment"})),
|
|
||||||
setReportCenterContext: (context) =>
|
setReportCenterContext: (context) =>
|
||||||
dispatch(setModalContext({context: context, modal: "reportCenter"})),
|
dispatch(setModalContext({ context: context, modal: 'reportCenter' })),
|
||||||
signOutStart: () => dispatch(signOutStart()),
|
signOutStart: () => dispatch(signOutStart()),
|
||||||
setCardPaymentContext: (context) =>
|
setCardPaymentContext: (context) =>
|
||||||
dispatch(setModalContext({context: context, modal: "cardPayment"})),
|
dispatch(setModalContext({ context: context, modal: 'cardPayment' })),
|
||||||
});
|
});
|
||||||
|
|
||||||
function Header({
|
function Header({
|
||||||
@@ -77,73 +80,90 @@ function Header({
|
|||||||
setPaymentContext,
|
setPaymentContext,
|
||||||
setReportCenterContext,
|
setReportCenterContext,
|
||||||
recentItems,
|
recentItems,
|
||||||
setCardPaymentContext
|
setCardPaymentContext,
|
||||||
}) {
|
}) {
|
||||||
|
const {
|
||||||
const {treatments: {ImEXPay, DmsAp, Simple_Inventory}} = useSplitTreatments({
|
treatments: { ImEXPay, DmsAp, Simple_Inventory },
|
||||||
|
} = useSplitTreatments({
|
||||||
attributes: {},
|
attributes: {},
|
||||||
names: ["ImEXPay", "DmsAp", "Simple_Inventory"],
|
names: ['ImEXPay', 'DmsAp', 'Simple_Inventory'],
|
||||||
splitKey: bodyshop && bodyshop.imexshopid,
|
splitKey: bodyshop && bodyshop.imexshopid,
|
||||||
});
|
});
|
||||||
const [betaSwitch, setBetaSwitch] = useState(false);
|
const [betaSwitch, setBetaSwitch] = useState(false);
|
||||||
const {t} = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const isBeta = checkBeta();
|
const isBeta = checkBeta();
|
||||||
setBetaSwitch(isBeta);
|
setBetaSwitch(isBeta);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
|
||||||
const betaSwitchChange = (checked) => {
|
const betaSwitchChange = (checked) => {
|
||||||
setBeta(checked);
|
setBeta(checked);
|
||||||
setBetaSwitch(checked);
|
setBetaSwitch(checked);
|
||||||
handleBeta();
|
handleBeta();
|
||||||
}
|
};
|
||||||
|
|
||||||
const accountingChildren = [
|
const accountingChildren = [];
|
||||||
|
|
||||||
|
if (
|
||||||
|
InstanceRenderManager({
|
||||||
|
imex: true,
|
||||||
|
rome: true,
|
||||||
|
promanager: HasFeatureAccess({ featureName: 'bills', bodyshop }),
|
||||||
|
})
|
||||||
|
) {
|
||||||
|
accountingChildren.push([
|
||||||
{
|
{
|
||||||
key: 'bills',
|
key: 'bills',
|
||||||
icon: <Icon component={FaFileInvoiceDollar}/>,
|
icon: <Icon component={FaFileInvoiceDollar} />,
|
||||||
label: (<Link to="/manage/bills">{t("menus.header.bills")}</Link>)
|
label: <Link to="/manage/bills">{t('menus.header.bills')}</Link>,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'enterbills',
|
key: 'enterbills',
|
||||||
icon: <Icon component={GiPayMoney}/>,
|
icon: <Icon component={GiPayMoney} />,
|
||||||
label: t("menus.header.enterbills"),
|
label: t('menus.header.enterbills'),
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
setBillEnterContext({
|
setBillEnterContext({
|
||||||
actions: {},
|
actions: {},
|
||||||
context: {},
|
context: {},
|
||||||
});
|
});
|
||||||
}
|
|
||||||
},
|
},
|
||||||
];
|
},
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
if (Simple_Inventory.treatment === "on") {
|
if (Simple_Inventory.treatment === 'on') {
|
||||||
accountingChildren.push(
|
accountingChildren.push(
|
||||||
{
|
{
|
||||||
type: 'divider',
|
type: 'divider',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'inventory',
|
key: 'inventory',
|
||||||
icon: <Icon component={FaFileInvoiceDollar}/>,
|
icon: <Icon component={FaFileInvoiceDollar} />,
|
||||||
label: (<Link to="/manage/inventory">{t("menus.header.inventory")}</Link>)
|
label: <Link to="/manage/inventory">{t('menus.header.inventory')}</Link>,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
if (
|
||||||
|
InstanceRenderManager({
|
||||||
|
imex: true,
|
||||||
|
rome: true,
|
||||||
|
promanager: HasFeatureAccess({ featureName: 'payments', bodyshop }),
|
||||||
|
})
|
||||||
|
) {
|
||||||
accountingChildren.push(
|
accountingChildren.push(
|
||||||
{
|
{
|
||||||
type: 'divider'
|
type: 'divider',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'allpayments',
|
key: 'allpayments',
|
||||||
icon: <BankFilled/>,
|
icon: <BankFilled />,
|
||||||
label: (<Link to="/manage/payments">{t("menus.header.allpayments")}</Link>)
|
label: <Link to="/manage/payments">{t('menus.header.allpayments')}</Link>,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'enterpayments',
|
key: 'enterpayments',
|
||||||
icon: <Icon component={FaCreditCard}/>,
|
icon: <Icon component={FaCreditCard} />,
|
||||||
label: t("menus.header.enterpayment"),
|
label: t('menus.header.enterpayment'),
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
setPaymentContext({
|
setPaymentContext({
|
||||||
actions: {},
|
actions: {},
|
||||||
@@ -152,12 +172,13 @@ function Header({
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (ImEXPay.treatment === "on") {
|
if (ImEXPay.treatment === 'on') {
|
||||||
accountingChildren.push({
|
accountingChildren.push({
|
||||||
key: 'entercardpayments',
|
key: 'entercardpayments',
|
||||||
icon: <Icon component={FaCreditCard}/>,
|
icon: <Icon component={FaCreditCard} />,
|
||||||
label: t("menus.header.entercardpayment"),
|
label: t('menus.header.entercardpayment'),
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
setCardPaymentContext({
|
setCardPaymentContext({
|
||||||
actions: {},
|
actions: {},
|
||||||
@@ -167,37 +188,42 @@ function Header({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
InstanceRenderManager({
|
||||||
|
imex: true,
|
||||||
|
rome: true,
|
||||||
|
promanager: HasFeatureAccess({ featureName: 'timetickets', bodyshop }),
|
||||||
|
})
|
||||||
|
) {
|
||||||
accountingChildren.push(
|
accountingChildren.push(
|
||||||
{
|
{
|
||||||
type: 'divider',
|
type: 'divider',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'timetickets',
|
key: 'timetickets',
|
||||||
icon: <FieldTimeOutlined/>,
|
icon: <FieldTimeOutlined />,
|
||||||
label: (<Link to="/manage/timetickets">{t("menus.header.timetickets")}</Link>)
|
label: <Link to="/manage/timetickets">{t('menus.header.timetickets')}</Link>,
|
||||||
});
|
}
|
||||||
|
);
|
||||||
|
|
||||||
if (bodyshop?.md_tasks_presets?.use_approvals) {
|
if (bodyshop?.md_tasks_presets?.use_approvals) {
|
||||||
accountingChildren.push({
|
accountingChildren.push({
|
||||||
key: 'ttapprovals',
|
key: 'ttapprovals',
|
||||||
icon: <FieldTimeOutlined/>,
|
icon: <FieldTimeOutlined />,
|
||||||
label:
|
label: <Link to="/manage/ttapprovals">{t('menus.header.ttapprovals')}</Link>,
|
||||||
<Link to="/manage/ttapprovals">
|
|
||||||
{t("menus.header.ttapprovals")}
|
|
||||||
</Link>
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
accountingChildren.push(
|
||||||
accountingChildren.push({
|
{
|
||||||
key: 'entertimetickets',
|
key: 'entertimetickets',
|
||||||
icon: <Icon component={GiPlayerTime}/>,
|
icon: <Icon component={GiPlayerTime} />,
|
||||||
label: t("menus.header.entertimeticket"),
|
label: t('menus.header.entertimeticket'),
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
setTimeTicketContext({
|
setTimeTicketContext({
|
||||||
actions: {},
|
actions: {},
|
||||||
context: {
|
context: {
|
||||||
created_by: currentUser.displayName
|
created_by: currentUser.displayName
|
||||||
? currentUser.email.concat(" | ", currentUser.displayName)
|
? currentUser.email.concat(' | ', currentUser.displayName)
|
||||||
: currentUser.email,
|
: currentUser.email,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -207,237 +233,287 @@ function Header({
|
|||||||
type: 'divider',
|
type: 'divider',
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
const accountingExportChildren = [
|
const accountingExportChildren = [
|
||||||
{
|
{
|
||||||
key: 'receivables',
|
key: 'receivables',
|
||||||
label: (<Link to="/manage/accounting/receivables">{t("menus.header.accounting-receivables")}</Link>)
|
label: (
|
||||||
|
<Link to="/manage/accounting/receivables">{t('menus.header.accounting-receivables')}</Link>
|
||||||
|
),
|
||||||
},
|
},
|
||||||
]
|
];
|
||||||
|
|
||||||
if (!((bodyshop && bodyshop.cdk_dealerid) || (bodyshop && bodyshop.pbs_serialnumber)) || DmsAp.treatment === "on") {
|
if (
|
||||||
|
!((bodyshop && bodyshop.cdk_dealerid) || (bodyshop && bodyshop.pbs_serialnumber)) ||
|
||||||
|
DmsAp.treatment === 'on'
|
||||||
|
) {
|
||||||
accountingExportChildren.push({
|
accountingExportChildren.push({
|
||||||
key: 'payables',
|
key: 'payables',
|
||||||
label: (<Link to="/manage/accounting/payables">{t("menus.header.accounting-payables")}</Link>)
|
label: <Link to="/manage/accounting/payables">{t('menus.header.accounting-payables')}</Link>,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(
|
if (!((bodyshop && bodyshop.cdk_dealerid) || (bodyshop && bodyshop.pbs_serialnumber))) {
|
||||||
(bodyshop && bodyshop.cdk_dealerid) ||
|
|
||||||
(bodyshop && bodyshop.pbs_serialnumber)
|
|
||||||
)) {
|
|
||||||
accountingExportChildren.push({
|
accountingExportChildren.push({
|
||||||
key: 'payments',
|
key: 'payments',
|
||||||
label: (<Link to="/manage/accounting/payments">{t("menus.header.accounting-payments")}</Link>)
|
label: <Link to="/manage/accounting/payments">{t('menus.header.accounting-payments')}</Link>,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
accountingExportChildren.push({
|
accountingExportChildren.push(
|
||||||
type: 'divider',
|
|
||||||
}, {
|
|
||||||
key: 'exportlogs',
|
|
||||||
label: (<Link to="/manage/accounting/exportlogs">{t("menus.header.export-logs")}</Link>)
|
|
||||||
});
|
|
||||||
|
|
||||||
accountingChildren.push(
|
|
||||||
{
|
{
|
||||||
key: 'accountingexport',
|
type: 'divider',
|
||||||
icon: <ExportOutlined/>,
|
|
||||||
label: t("menus.header.export"),
|
|
||||||
children: accountingExportChildren
|
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
key: 'exportlogs',
|
||||||
|
label: <Link to="/manage/accounting/exportlogs">{t('menus.header.export-logs')}</Link>,
|
||||||
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (
|
||||||
|
InstanceRenderManager({
|
||||||
|
imex: true,
|
||||||
|
rome: true,
|
||||||
|
promanager: HasFeatureAccess({ featureName: 'export', bodyshop }),
|
||||||
|
})
|
||||||
|
) {
|
||||||
|
accountingChildren.push({
|
||||||
|
key: 'accountingexport',
|
||||||
|
icon: <ExportOutlined />,
|
||||||
|
label: t('menus.header.export'),
|
||||||
|
children: accountingExportChildren,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
const menuItems = [
|
const menuItems = [
|
||||||
{
|
{
|
||||||
key: 'home',
|
key: 'home',
|
||||||
icon: <HomeFilled/>,
|
icon: <HomeFilled />,
|
||||||
label: (<Link to="/manage/">{t("menus.header.home")}</Link>)
|
label: <Link to="/manage/">{t('menus.header.home')}</Link>,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'schedule',
|
key: 'schedule',
|
||||||
icon: <Icon component={FaCalendarAlt}/>,
|
icon: <Icon component={FaCalendarAlt} />,
|
||||||
label: (<Link to="/manage/schedule">{t("menus.header.schedule")}</Link>)
|
label: <Link to="/manage/schedule">{t('menus.header.schedule')}</Link>,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'jobssubmenu',
|
key: 'jobssubmenu',
|
||||||
icon: <Icon component={FaCarCrash}/>,
|
icon: <Icon component={FaCarCrash} />,
|
||||||
label: t("menus.header.jobs"),
|
label: t('menus.header.jobs'),
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
key: 'activejobs',
|
key: 'activejobs',
|
||||||
icon: <FileFilled/>,
|
icon: <FileFilled />,
|
||||||
label: (<Link to="/manage/jobs">{t("menus.header.activejobs")}</Link>)
|
label: <Link to="/manage/jobs">{t('menus.header.activejobs')}</Link>,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'readyjobs',
|
key: 'readyjobs',
|
||||||
icon: <CheckCircleOutlined/>,
|
icon: <CheckCircleOutlined />,
|
||||||
label: (<Link to="/manage/jobs/ready">{t("menus.header.readyjobs")}</Link>)
|
label: <Link to="/manage/jobs/ready">{t('menus.header.readyjobs')}</Link>,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'parts-queue',
|
key: 'parts-queue',
|
||||||
icon: <ToolFilled/>,
|
icon: <ToolFilled />,
|
||||||
label: (<Link to="/manage/partsqueue">{t("menus.header.parts-queue")}</Link>)
|
label: <Link to="/manage/partsqueue">{t('menus.header.parts-queue')}</Link>,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'availablejobs',
|
key: 'availablejobs',
|
||||||
icon: <ImportOutlined/>,
|
icon: <ImportOutlined />,
|
||||||
label: (<Link to="/manage/available">{t("menus.header.availablejobs")}</Link>)
|
label: <Link to="/manage/available">{t('menus.header.availablejobs')}</Link>,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'newjob',
|
key: 'newjob',
|
||||||
icon: <FileAddOutlined/>,
|
icon: <FileAddOutlined />,
|
||||||
label: (<Link to="/manage/jobs/new">{t("menus.header.newjob")}</Link>)
|
label: <Link to="/manage/jobs/new">{t('menus.header.newjob')}</Link>,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'divider',
|
type: 'divider',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'alljobs',
|
key: 'alljobs',
|
||||||
icon: <UnorderedListOutlined/>,
|
icon: <UnorderedListOutlined />,
|
||||||
label: (<Link to="/manage/jobs/all">{t("menus.header.alljobs")}</Link>)
|
label: <Link to="/manage/jobs/all">{t('menus.header.alljobs')}</Link>,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'divider',
|
type: 'divider',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'productionlist',
|
key: 'productionlist',
|
||||||
icon: <ScheduleOutlined/>,
|
icon: <ScheduleOutlined />,
|
||||||
label: (<Link to="/manage/production/list">{t("menus.header.productionlist")}</Link>)
|
label: <Link to="/manage/production/list">{t('menus.header.productionlist')}</Link>,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'productionboard',
|
key: 'productionboard',
|
||||||
icon: <Icon component={BsKanban}/>,
|
icon: <Icon component={BsKanban} />,
|
||||||
label: (<Link to="/manage/production/board">{t("menus.header.productionboard")}</Link>)
|
label: <Link to="/manage/production/board">{t('menus.header.productionboard')}</Link>,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'divider',
|
type: 'divider',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'scoreboard',
|
key: 'scoreboard',
|
||||||
icon: <LineChartOutlined/>,
|
icon: <LineChartOutlined />,
|
||||||
label: (<Link to="/manage/scoreboard">{t("menus.header.scoreboard")}</Link>)
|
label: <Link to="/manage/scoreboard">{t('menus.header.scoreboard')}</Link>,
|
||||||
},
|
},
|
||||||
]
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'customers',
|
key: 'customers',
|
||||||
icon: <UserOutlined/>,
|
icon: <UserOutlined />,
|
||||||
label: t("menus.header.customers"),
|
label: t('menus.header.customers'),
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
key: 'owners',
|
key: 'owners',
|
||||||
icon: <TeamOutlined/>,
|
icon: <TeamOutlined />,
|
||||||
label: (<Link to="/manage/owners">{t("menus.header.owners")}</Link>)
|
label: <Link to="/manage/owners">{t('menus.header.owners')}</Link>,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'vehicles',
|
key: 'vehicles',
|
||||||
icon: <CarFilled/>,
|
icon: <CarFilled />,
|
||||||
label: (<Link to="/manage/vehicles">{t("menus.header.vehicles")}</Link>)
|
label: <Link to="/manage/vehicles">{t('menus.header.vehicles')}</Link>,
|
||||||
},
|
},
|
||||||
]
|
],
|
||||||
},
|
},
|
||||||
|
...(InstanceRenderManager({
|
||||||
|
imex: true,
|
||||||
|
rome: true,
|
||||||
|
promanager: HasFeatureAccess({ featureName: 'courtesycards', bodyshop }),
|
||||||
|
})
|
||||||
|
? [
|
||||||
{
|
{
|
||||||
key: 'ccs',
|
key: 'ccs',
|
||||||
icon: <CarFilled/>,
|
icon: <CarFilled />,
|
||||||
label: t("menus.header.courtesycars"),
|
label: t('menus.header.courtesycars'),
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
key: 'courtesycarsall',
|
key: 'courtesycarsall',
|
||||||
icon: <CarFilled/>,
|
icon: <CarFilled />,
|
||||||
label: (<Link to="/manage/courtesycars">{t("menus.header.courtesycars-all")}</Link>)
|
label: <Link to="/manage/courtesycars">{t('menus.header.courtesycars-all')}</Link>,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'contracts',
|
key: 'contracts',
|
||||||
icon: <FileFilled/>,
|
icon: <FileFilled />,
|
||||||
label: (<Link to="/manage/courtesycars/contracts">{t("menus.header.courtesycars-contracts")}</Link>)
|
label: (
|
||||||
|
<Link to="/manage/courtesycars/contracts">
|
||||||
|
{t('menus.header.courtesycars-contracts')}
|
||||||
|
</Link>
|
||||||
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'newcontract',
|
key: 'newcontract',
|
||||||
icon: <FileAddFilled/>,
|
icon: <FileAddFilled />,
|
||||||
label: (<Link
|
label: (
|
||||||
to="/manage/courtesycars/contracts/new">{t("menus.header.courtesycars-newcontract")}</Link>)
|
<Link to="/manage/courtesycars/contracts/new">
|
||||||
|
{t('menus.header.courtesycars-newcontract')}
|
||||||
|
</Link>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
},
|
: []),
|
||||||
|
|
||||||
|
...(accountingChildren.length > 0
|
||||||
|
? [
|
||||||
{
|
{
|
||||||
key: 'accounting',
|
key: 'accounting',
|
||||||
icon: <DollarCircleFilled/>,
|
icon: <DollarCircleFilled />,
|
||||||
label: t("menus.header.accounting"),
|
label: t('menus.header.accounting'),
|
||||||
children: accountingChildren,
|
children: accountingChildren,
|
||||||
},
|
},
|
||||||
|
]
|
||||||
|
: []),
|
||||||
{
|
{
|
||||||
key: 'phonebook',
|
key: 'phonebook',
|
||||||
icon: <PhoneOutlined/>,
|
icon: <PhoneOutlined />,
|
||||||
label: (<Link to="/manage/phonebook">{t("menus.header.phonebook")}</Link>)
|
label: <Link to="/manage/phonebook">{t('menus.header.phonebook')}</Link>,
|
||||||
},
|
},
|
||||||
|
...(InstanceRenderManager({
|
||||||
|
imex: true,
|
||||||
|
rome: true,
|
||||||
|
promanager: HasFeatureAccess({ featureName: 'media', bodyshop }),
|
||||||
|
})
|
||||||
|
? [
|
||||||
{
|
{
|
||||||
key: 'temporarydocs',
|
key: 'temporarydocs',
|
||||||
icon: <PaperClipOutlined/>,
|
icon: <PaperClipOutlined />,
|
||||||
label: (<Link to="/manage/temporarydocs">{t("menus.header.temporarydocs")}</Link>)
|
label: <Link to="/manage/temporarydocs">{t('menus.header.temporarydocs')}</Link>,
|
||||||
},
|
},
|
||||||
|
]
|
||||||
|
: []),
|
||||||
{
|
{
|
||||||
key: 'shopsubmenu',
|
key: 'shopsubmenu',
|
||||||
icon: <SettingOutlined/>,
|
icon: <SettingOutlined />,
|
||||||
label: t("menus.header.shop"),
|
label: t('menus.header.shop'),
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
key: 'shop',
|
key: 'shop',
|
||||||
icon: <Icon component={GiSettingsKnobs}/>,
|
icon: <Icon component={GiSettingsKnobs} />,
|
||||||
label: (<Link to="/manage/shop?tab=info">{t("menus.header.shop_config")}</Link>)
|
label: <Link to="/manage/shop?tab=info">{t('menus.header.shop_config')}</Link>,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'dashboard',
|
key: 'dashboard',
|
||||||
icon: <DashboardFilled/>,
|
icon: <DashboardFilled />,
|
||||||
label: (<Link to="/manage/dashboard">{t("menus.header.dashboard")}</Link>)
|
label: <Link to="/manage/dashboard">{t('menus.header.dashboard')}</Link>,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'reportcenter',
|
key: 'reportcenter',
|
||||||
icon: <BarChartOutlined/>,
|
icon: <BarChartOutlined />,
|
||||||
label: t("menus.header.reportcenter"),
|
label: t('menus.header.reportcenter'),
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
setReportCenterContext({
|
setReportCenterContext({
|
||||||
actions: {},
|
actions: {},
|
||||||
context: {},
|
context: {},
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'shop-vendors',
|
key: 'shop-vendors',
|
||||||
icon: <Icon component={IoBusinessOutline}/>,
|
icon: <Icon component={IoBusinessOutline} />,
|
||||||
label: (<Link to="/manage/shop/vendors">{t("menus.header.shop_vendors")}</Link>)
|
label: <Link to="/manage/shop/vendors">{t('menus.header.shop_vendors')}</Link>,
|
||||||
},
|
},
|
||||||
|
...(InstanceRenderManager({
|
||||||
|
imex: true,
|
||||||
|
rome: true,
|
||||||
|
promanager: HasFeatureAccess({ featureName: 'csi', bodyshop }),
|
||||||
|
})
|
||||||
|
? [
|
||||||
{
|
{
|
||||||
key: 'shop-csi',
|
key: 'shop-csi',
|
||||||
icon: <Icon component={RiSurveyLine}/>,
|
icon: <Icon component={RiSurveyLine} />,
|
||||||
label: (<Link to="/manage/shop/csi">{t("menus.header.shop_csi")}</Link>)
|
label: <Link to="/manage/shop/csi">{t('menus.header.shop_csi')}</Link>,
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
: []),
|
||||||
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'user',
|
key: 'user',
|
||||||
label: (
|
label: currentUser.displayName || currentUser.email || t('general.labels.unknown'),
|
||||||
currentUser.displayName ||
|
|
||||||
currentUser.email ||
|
|
||||||
t("general.labels.unknown")
|
|
||||||
),
|
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
key: 'signout',
|
key: 'signout',
|
||||||
icon: <Icon component={FiLogOut}/>,
|
icon: <Icon component={FiLogOut} />,
|
||||||
danger: true,
|
danger: true,
|
||||||
label: t("user.actions.signout"),
|
label: t('user.actions.signout'),
|
||||||
onClick: () => signOutStart()
|
onClick: () => signOutStart(),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'help',
|
key: 'help',
|
||||||
icon: <Icon component={QuestionCircleFilled}/>,
|
icon: <Icon component={QuestionCircleFilled} />,
|
||||||
label: t("menus.header.help"),
|
label: t('menus.header.help'),
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
window.open(InstanceRenderManager({imex:"https://help.imex.online/",rome: "https://rometech.com//", promanager:"https://web-est.com" })
|
window.open(
|
||||||
|
InstanceRenderManager({
|
||||||
|
imex: 'https://help.imex.online/',
|
||||||
|
rome: 'https://rometech.com//',
|
||||||
|
promanager: 'https://web-est.com',
|
||||||
|
}),
|
||||||
|
|
||||||
, "_blank");
|
'_blank'
|
||||||
}
|
);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
// key: 'rescue',
|
// key: 'rescue',
|
||||||
@@ -447,15 +523,24 @@ function Header({
|
|||||||
// window.open("https://imexrescue.com/", "_blank");
|
// window.open("https://imexrescue.com/", "_blank");
|
||||||
// }
|
// }
|
||||||
// },
|
// },
|
||||||
|
|
||||||
|
...(InstanceRenderManager({
|
||||||
|
imex: true,
|
||||||
|
rome: true,
|
||||||
|
promanager: HasFeatureAccess({ featureName: 'timetickets', bodyshop }),
|
||||||
|
})
|
||||||
|
? [
|
||||||
{
|
{
|
||||||
key: 'shiftclock',
|
key: 'shiftclock',
|
||||||
icon: <Icon component={GiPlayerTime}/>,
|
icon: <Icon component={GiPlayerTime} />,
|
||||||
label: (<Link to="/manage/shiftclock">{t("menus.header.shiftclock")}</Link>)
|
label: <Link to="/manage/shiftclock">{t('menus.header.shiftclock')}</Link>,
|
||||||
},
|
},
|
||||||
|
]
|
||||||
|
: []),
|
||||||
{
|
{
|
||||||
key: 'profile',
|
key: 'profile',
|
||||||
icon: <UserOutlined/>,
|
icon: <UserOutlined />,
|
||||||
label: (<Link to="/manage/profile">{t("menus.currentuser.profile")}</Link>)
|
label: <Link to="/manage/profile">{t('menus.currentuser.profile')}</Link>,
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
// key: 'langselecter',
|
// key: 'langselecter',
|
||||||
@@ -484,46 +569,45 @@ function Header({
|
|||||||
// },
|
// },
|
||||||
// ]
|
// ]
|
||||||
// },
|
// },
|
||||||
]
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'recent',
|
key: 'recent',
|
||||||
icon: <ClockCircleFilled/>,
|
icon: <ClockCircleFilled />,
|
||||||
children: recentItems.map((i, idx) => ({
|
children: recentItems.map((i, idx) => ({
|
||||||
key: idx,
|
key: idx,
|
||||||
label: (<Link to={i.url}>{i.label}</Link>)
|
label: <Link to={i.url}>{i.label}</Link>,
|
||||||
|
|
||||||
})),
|
})),
|
||||||
}
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
menuItems.push({
|
menuItems.push({
|
||||||
key: 'beta-switch',
|
key: 'beta-switch',
|
||||||
style: {marginLeft: 'auto'},
|
style: { marginLeft: 'auto' },
|
||||||
label: (
|
label: (
|
||||||
<Tooltip title={`A more modern ${InstanceRenderManager({imex: 'ImEX Online', rome: "Rome Online"})} is ready for you to try! You can switch back at any time.`}>
|
<Tooltip
|
||||||
<InfoCircleOutlined/>
|
title={`A more modern ${InstanceRenderManager({
|
||||||
<span style={{marginRight: 8}}>Try the new app</span>
|
imex: 'ImEX Online',
|
||||||
<Switch
|
rome: 'Rome Online',
|
||||||
checked={betaSwitch}
|
})} is ready for you to try! You can switch back at any time.`}
|
||||||
onChange={betaSwitchChange}
|
>
|
||||||
/>
|
<InfoCircleOutlined />
|
||||||
|
<span style={{ marginRight: 8 }}>Try the new app</span>
|
||||||
|
<Switch checked={betaSwitch} onChange={betaSwitchChange} />
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
)
|
),
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Layout.Header>
|
<Layout.Header>
|
||||||
<Menu
|
<Menu
|
||||||
mode="horizontal"
|
mode="horizontal"
|
||||||
theme={"dark"}
|
theme={'dark'}
|
||||||
selectedKeys={[selectedHeader]}
|
selectedKeys={[selectedHeader]}
|
||||||
onClick={handleMenuClick}
|
onClick={handleMenuClick}
|
||||||
subMenuCloseDelay={0.3}
|
subMenuCloseDelay={0.3}
|
||||||
items={menuItems}
|
items={menuItems}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
</Layout.Header>
|
</Layout.Header>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ import JoblineTeamAssignment from "../job-line-team-assignment/job-line-team-ass
|
|||||||
import JobLineDispatchButton from "../job-line-dispatch-button/job-line-dispatch-button.component";
|
import JobLineDispatchButton from "../job-line-dispatch-button/job-line-dispatch-button.component";
|
||||||
import JobLineBulkAssignComponent from "../job-line-bulk-assign/job-line-bulk-assign.component";
|
import JobLineBulkAssignComponent from "../job-line-bulk-assign/job-line-bulk-assign.component";
|
||||||
import {useSplitTreatments} from "@splitsoftware/splitio-react";
|
import {useSplitTreatments} from "@splitsoftware/splitio-react";
|
||||||
|
import { HasFeatureAccess } from "../feature-wrapper/feature-wrapper.component";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -318,13 +319,13 @@ export function JobLinesComponent({
|
|||||||
<JobLineLocationPopup jobline={record} disabled={jobRO}/>
|
<JobLineLocationPopup jobline={record} disabled={jobRO}/>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
...HasFeatureAccess({featureName: "bills"}) ? [ {
|
||||||
title: t("joblines.labels.billref"),
|
title: t("joblines.labels.billref"),
|
||||||
dataIndex: "billref",
|
dataIndex: "billref",
|
||||||
key: "billref",
|
key: "billref",
|
||||||
render: (text, record) => <JobLinesBillRefernece jobline={record}/>,
|
render: (text, record) => <JobLinesBillRefernece jobline={record}/>,
|
||||||
responsive: ["md"],
|
responsive: ["md"],
|
||||||
},
|
},] : [],
|
||||||
{
|
{
|
||||||
title: t("joblines.fields.status"),
|
title: t("joblines.fields.status"),
|
||||||
dataIndex: "status",
|
dataIndex: "status",
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import JobBillsTotal from "../job-bills-total/job-bills-total.component";
|
|||||||
import PartsOrderListTableComponent from "../parts-order-list-table/parts-order-list-table.component";
|
import PartsOrderListTableComponent from "../parts-order-list-table/parts-order-list-table.component";
|
||||||
import PartsOrderModal from "../parts-order-modal/parts-order-modal.container";
|
import PartsOrderModal from "../parts-order-modal/parts-order-modal.container";
|
||||||
import PartsDispatchTable from "../parts-dispatch-table/parts-dispatch-table.component";
|
import PartsDispatchTable from "../parts-dispatch-table/parts-dispatch-table.component";
|
||||||
|
import FeatureWrapperComponent from "../feature-wrapper/feature-wrapper.component";
|
||||||
|
|
||||||
export default function JobsDetailPliComponent({
|
export default function JobsDetailPliComponent({
|
||||||
job,
|
job,
|
||||||
@@ -23,6 +24,7 @@ export default function JobsDetailPliComponent({
|
|||||||
) : null}
|
) : null}
|
||||||
<BillDetailEditcontainer/>
|
<BillDetailEditcontainer/>
|
||||||
<Row gutter={[16, 16]}>
|
<Row gutter={[16, 16]}>
|
||||||
|
<FeatureWrapperComponent featureName='bills' noauth={() => null}>
|
||||||
<Col span={24}>
|
<Col span={24}>
|
||||||
<JobBillsTotal
|
<JobBillsTotal
|
||||||
bills={billsQuery.data ? billsQuery.data.bills : []}
|
bills={billsQuery.data ? billsQuery.data.bills : []}
|
||||||
@@ -31,6 +33,7 @@ export default function JobsDetailPliComponent({
|
|||||||
jobTotals={job.job_totals}
|
jobTotals={job.job_totals}
|
||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
|
</FeatureWrapperComponent>
|
||||||
<Col span={24}>
|
<Col span={24}>
|
||||||
<PartsOrderListTableComponent
|
<PartsOrderListTableComponent
|
||||||
job={job}
|
job={job}
|
||||||
@@ -38,6 +41,7 @@ export default function JobsDetailPliComponent({
|
|||||||
billsQuery={billsQuery}
|
billsQuery={billsQuery}
|
||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
|
<FeatureWrapperComponent featureName='bills' noauth={() => null}>
|
||||||
<Col span={24}>
|
<Col span={24}>
|
||||||
<BillsListTable
|
<BillsListTable
|
||||||
job={job}
|
job={job}
|
||||||
@@ -45,6 +49,7 @@ export default function JobsDetailPliComponent({
|
|||||||
billsQuery={billsQuery}
|
billsQuery={billsQuery}
|
||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
|
</FeatureWrapperComponent>
|
||||||
<Col span={24}>
|
<Col span={24}>
|
||||||
<PartsDispatchTable
|
<PartsDispatchTable
|
||||||
job={job}
|
job={job}
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import PartsOrderLineBackorderButton
|
|||||||
from "../parts-order-line-backorder-button/parts-order-line-backorder-button.component";
|
from "../parts-order-line-backorder-button/parts-order-line-backorder-button.component";
|
||||||
import PartsReceiveModalContainer from "../parts-receive-modal/parts-receive-modal.container";
|
import PartsReceiveModalContainer from "../parts-receive-modal/parts-receive-modal.container";
|
||||||
import PrintWrapper from "../print-wrapper/print-wrapper.component";
|
import PrintWrapper from "../print-wrapper/print-wrapper.component";
|
||||||
|
import FeatureWrapperComponent from "../feature-wrapper/feature-wrapper.component";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
jobRO: selectJobReadOnly,
|
jobRO: selectJobReadOnly,
|
||||||
@@ -86,6 +87,7 @@ export function PartsOrderListTableComponent({
|
|||||||
<EyeFilled/>
|
<EyeFilled/>
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
disabled={
|
disabled={
|
||||||
jobRO ||
|
jobRO ||
|
||||||
@@ -115,6 +117,7 @@ export function PartsOrderListTableComponent({
|
|||||||
>
|
>
|
||||||
{t("parts_orders.actions.receive")}
|
{t("parts_orders.actions.receive")}
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<Popconfirm
|
<Popconfirm
|
||||||
title={t("parts_orders.labels.confirmdelete")}
|
title={t("parts_orders.labels.confirmdelete")}
|
||||||
disabled={jobRO}
|
disabled={jobRO}
|
||||||
@@ -141,6 +144,7 @@ export function PartsOrderListTableComponent({
|
|||||||
<DeleteFilled/>
|
<DeleteFilled/>
|
||||||
</Button>
|
</Button>
|
||||||
</Popconfirm>
|
</Popconfirm>
|
||||||
|
<FeatureWrapperComponent featureName='bills' noauth={() => null}>
|
||||||
<Button
|
<Button
|
||||||
disabled={
|
disabled={
|
||||||
(jobRO ? !record.return : jobRO) ||
|
(jobRO ? !record.return : jobRO) ||
|
||||||
@@ -184,6 +188,7 @@ export function PartsOrderListTableComponent({
|
|||||||
>
|
>
|
||||||
{t("parts_orders.actions.receivebill")}
|
{t("parts_orders.actions.receivebill")}
|
||||||
</Button>
|
</Button>
|
||||||
|
</FeatureWrapperComponent>
|
||||||
<PrintWrapper
|
<PrintWrapper
|
||||||
templateObject={{
|
templateObject={{
|
||||||
name: record.return
|
name: record.return
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import LoadingSkeleton from "../loading-skeleton/loading-skeleton.component";
|
|||||||
import OwnerNameDisplay from "../owner-name-display/owner-name-display.component";
|
import OwnerNameDisplay from "../owner-name-display/owner-name-display.component";
|
||||||
import ScheduleBlockDay from "../schedule-block-day/schedule-block-day.component";
|
import ScheduleBlockDay from "../schedule-block-day/schedule-block-day.component";
|
||||||
import ScheduleCalendarHeaderGraph from "./schedule-calendar-header-graph.component";
|
import ScheduleCalendarHeaderGraph from "./schedule-calendar-header-graph.component";
|
||||||
|
import InstanceRenderMgr from '../../utils/instanceRenderMgr'
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -206,9 +207,13 @@ export function ScheduleCalendarHeaderComponent({
|
|||||||
date={date}
|
date={date}
|
||||||
refetch={refetch}
|
refetch={refetch}
|
||||||
>
|
>
|
||||||
<div style={{color: isShopOpen(date) ? "" : "tomato"}}>
|
<div style={{ color: isShopOpen(date) ? "" : "tomato" }}>
|
||||||
{label}
|
{label}
|
||||||
{calculating ? <LoadingSkeleton/> : LoadComponent}
|
{InstanceRenderMgr({
|
||||||
|
imex: calculating ? <LoadingSkeleton /> : LoadComponent,
|
||||||
|
rome: "USE_IMEX",
|
||||||
|
promanager: <></>,
|
||||||
|
})}
|
||||||
</div>
|
</div>
|
||||||
</ScheduleBlockDay>
|
</ScheduleBlockDay>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,18 +1,19 @@
|
|||||||
import dayjs from "../../utils/day";
|
import dayjs from "../../utils/day";
|
||||||
import queryString from "query-string";
|
import queryString from "query-string";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import {Calendar, dayjsLocalizer} from "react-big-calendar";
|
import { Calendar, dayjsLocalizer } from "react-big-calendar";
|
||||||
import {connect} from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import {Link, useLocation, useNavigate} from "react-router-dom";
|
import { Link, useLocation, useNavigate } from "react-router-dom";
|
||||||
import {createStructuredSelector} from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import {selectBodyshop} from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
import Event from "../job-at-change/schedule-event.container";
|
import Event from "../job-at-change/schedule-event.container";
|
||||||
import HeaderComponent from "./schedule-calendar-header.component";
|
import HeaderComponent from "./schedule-calendar-header.component";
|
||||||
import "./schedule-calendar.styles.scss";
|
import "./schedule-calendar.styles.scss";
|
||||||
import JobDetailCards from "../job-detail-cards/job-detail-cards.component";
|
import JobDetailCards from "../job-detail-cards/job-detail-cards.component";
|
||||||
import {selectProblemJobs} from "../../redux/application/application.selectors";
|
import { selectProblemJobs } from "../../redux/application/application.selectors";
|
||||||
import {Alert, Collapse, Space} from "antd";
|
import { Alert, Collapse, Space } from "antd";
|
||||||
import {Trans, useTranslation} from "react-i18next";
|
import { Trans, useTranslation } from "react-i18next";
|
||||||
|
import InstanceRenderManager from "../../utils/instanceRenderMgr";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -29,10 +30,10 @@ export function ScheduleCalendarWrapperComponent({
|
|||||||
setDateRangeCallback,
|
setDateRangeCallback,
|
||||||
date,
|
date,
|
||||||
...otherProps
|
...otherProps
|
||||||
}) {
|
}) {
|
||||||
const search = queryString.parse(useLocation().search);
|
const search = queryString.parse(useLocation().search);
|
||||||
const history = useNavigate();
|
const history = useNavigate();
|
||||||
const {t} = useTranslation();
|
const { t } = useTranslation();
|
||||||
const handleEventPropStyles = (event, start, end, isSelected) => {
|
const handleEventPropStyles = (event, start, end, isSelected) => {
|
||||||
return {
|
return {
|
||||||
...(event.color && !((search.view || defaultView) === "agenda")
|
...(event.color && !((search.view || defaultView) === "agenda")
|
||||||
@@ -53,18 +54,20 @@ export function ScheduleCalendarWrapperComponent({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<JobDetailCards/>
|
<JobDetailCards />
|
||||||
{problemJobs && problemJobs.length > 2 ? (
|
{InstanceRenderManager({
|
||||||
<Collapse style={{marginBottom: '5px'}}>
|
imex:
|
||||||
|
problemJobs && problemJobs.length > 2 ? (
|
||||||
|
<Collapse style={{ marginBottom: "5px" }}>
|
||||||
<Collapse.Panel
|
<Collapse.Panel
|
||||||
key="1"
|
key="1"
|
||||||
header={
|
header={
|
||||||
<span style={{color: "tomato"}}>
|
<span style={{ color: "tomato" }}>
|
||||||
{t("appointments.labels.severalerrorsfound")}
|
{t("appointments.labels.severalerrorsfound")}
|
||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Space direction="vertical" style={{width: '100%'}}>
|
<Space direction="vertical" style={{ width: "100%" }}>
|
||||||
{problemJobs.map((problem) => (
|
{problemJobs.map((problem) => (
|
||||||
<Alert
|
<Alert
|
||||||
key={problem.id}
|
key={problem.id}
|
||||||
@@ -87,13 +90,14 @@ export function ScheduleCalendarWrapperComponent({
|
|||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</Space>
|
</Space>
|
||||||
|
|
||||||
</Collapse.Panel>
|
</Collapse.Panel>
|
||||||
</Collapse>
|
</Collapse>
|
||||||
) : (
|
) : (
|
||||||
<Space direction="vertical" style={{width: '100%', marginBottom: '5px'}}>
|
<Space
|
||||||
{
|
direction="vertical"
|
||||||
problemJobs.map((problem) => (
|
style={{ width: "100%", marginBottom: "5px" }}
|
||||||
|
>
|
||||||
|
{problemJobs.map((problem) => (
|
||||||
<Alert
|
<Alert
|
||||||
key={problem.id}
|
key={problem.id}
|
||||||
type="error"
|
type="error"
|
||||||
@@ -101,7 +105,10 @@ export function ScheduleCalendarWrapperComponent({
|
|||||||
<Trans
|
<Trans
|
||||||
i18nKey="appointments.labels.dataconsistency"
|
i18nKey="appointments.labels.dataconsistency"
|
||||||
components={[
|
components={[
|
||||||
<Link to={`/manage/jobs/${problem.id}`} target="_blank"/>,
|
<Link
|
||||||
|
to={`/manage/jobs/${problem.id}`}
|
||||||
|
target="_blank"
|
||||||
|
/>,
|
||||||
]}
|
]}
|
||||||
values={{
|
values={{
|
||||||
ro_number: problem.ro_number,
|
ro_number: problem.ro_number,
|
||||||
@@ -110,10 +117,13 @@ export function ScheduleCalendarWrapperComponent({
|
|||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
))
|
))}
|
||||||
}
|
|
||||||
</Space>
|
</Space>
|
||||||
)}
|
),
|
||||||
|
|
||||||
|
rome: "USE_IMEX",
|
||||||
|
promanager: <span />,
|
||||||
|
})}
|
||||||
|
|
||||||
<Calendar
|
<Calendar
|
||||||
events={data}
|
events={data}
|
||||||
@@ -121,14 +131,14 @@ export function ScheduleCalendarWrapperComponent({
|
|||||||
date={selectedDate}
|
date={selectedDate}
|
||||||
onNavigate={(date, view, action) => {
|
onNavigate={(date, view, action) => {
|
||||||
search.date = date.toISOString().substr(0, 10);
|
search.date = date.toISOString().substr(0, 10);
|
||||||
history({search: queryString.stringify(search)});
|
history({ search: queryString.stringify(search) });
|
||||||
}}
|
}}
|
||||||
onRangeChange={(start, end) => {
|
onRangeChange={(start, end) => {
|
||||||
if (setDateRangeCallback) setDateRangeCallback({start, end});
|
if (setDateRangeCallback) setDateRangeCallback({ start, end });
|
||||||
}}
|
}}
|
||||||
onView={(view) => {
|
onView={(view) => {
|
||||||
search.view = view;
|
search.view = view;
|
||||||
history({search: queryString.stringify(search)});
|
history({ search: queryString.stringify(search) });
|
||||||
}}
|
}}
|
||||||
step={15}
|
step={15}
|
||||||
// timeslots={1}
|
// timeslots={1}
|
||||||
@@ -147,9 +157,9 @@ export function ScheduleCalendarWrapperComponent({
|
|||||||
eventPropGetter={handleEventPropStyles}
|
eventPropGetter={handleEventPropStyles}
|
||||||
components={{
|
components={{
|
||||||
event: (e) =>
|
event: (e) =>
|
||||||
Event({bodyshop: bodyshop, event: e.event, refetch: refetch}),
|
Event({ bodyshop: bodyshop, event: e.event, refetch: refetch }),
|
||||||
header: (p) => (
|
header: (p) => (
|
||||||
<HeaderComponent {...p} events={data} refetch={refetch}/>
|
<HeaderComponent {...p} events={data} refetch={refetch} />
|
||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
{...otherProps}
|
{...otherProps}
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import ScheduleDayViewContainer from "../schedule-day-view/schedule-day-view.con
|
|||||||
import ScheduleExistingAppointmentsList
|
import ScheduleExistingAppointmentsList
|
||||||
from "../schedule-existing-appointments-list/schedule-existing-appointments-list.component";
|
from "../schedule-existing-appointments-list/schedule-existing-appointments-list.component";
|
||||||
import "./schedule-job-modal.scss";
|
import "./schedule-job-modal.scss";
|
||||||
|
import InstanceRenderManager from "../../utils/instanceRenderMgr";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -92,7 +93,7 @@ export function ScheduleJobModalComponent({
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<DateTimePicker onBlur={handleDateBlur} onlyFuture/>
|
<DateTimePicker onBlur={handleDateBlur} onlyFuture />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name="scheduled_completion"
|
name="scheduled_completion"
|
||||||
@@ -104,19 +105,15 @@ export function ScheduleJobModalComponent({
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<DateTimePicker onlyFuture/>
|
<DateTimePicker onlyFuture />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</LayoutFormRow>
|
</LayoutFormRow>
|
||||||
|
{InstanceRenderManager({
|
||||||
|
imex: (
|
||||||
|
<>
|
||||||
<Typography.Title level={4}>
|
<Typography.Title level={4}>
|
||||||
{t("appointments.labels.smartscheduling")}
|
{t("appointments.labels.smartscheduling")}
|
||||||
</Typography.Title>
|
</Typography.Title>
|
||||||
|
|
||||||
{
|
|
||||||
// smartOptions.length > 0 && (
|
|
||||||
// <div>{t("appointments.labels.suggesteddates")}</div>
|
|
||||||
// )
|
|
||||||
}
|
|
||||||
<Space wrap>
|
<Space wrap>
|
||||||
<Button onClick={handleSmartScheduling} loading={loading}>
|
<Button onClick={handleSmartScheduling} loading={loading}>
|
||||||
{t("appointments.actions.calculate")}
|
{t("appointments.actions.calculate")}
|
||||||
@@ -128,9 +125,11 @@ export function ScheduleJobModalComponent({
|
|||||||
onClick={() => {
|
onClick={() => {
|
||||||
const ssDate = dayjs(d);
|
const ssDate = dayjs(d);
|
||||||
if (ssDate.isBefore(dayjs())) {
|
if (ssDate.isBefore(dayjs())) {
|
||||||
form.setFieldsValue({start: dayjs()});
|
form.setFieldsValue({ start: dayjs() });
|
||||||
} else {
|
} else {
|
||||||
form.setFieldsValue({start: dayjs(d).add(8, "hour")});
|
form.setFieldsValue({
|
||||||
|
start: dayjs(d).add(8, "hour"),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
handleDateBlur();
|
handleDateBlur();
|
||||||
}}
|
}}
|
||||||
@@ -139,6 +138,11 @@ export function ScheduleJobModalComponent({
|
|||||||
</Button>
|
</Button>
|
||||||
))}
|
))}
|
||||||
</Space>
|
</Space>
|
||||||
|
</>
|
||||||
|
),
|
||||||
|
rome: "USE_IMEX",
|
||||||
|
promanager: <></>,
|
||||||
|
})}
|
||||||
|
|
||||||
<LayoutFormRow grow>
|
<LayoutFormRow grow>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
@@ -146,11 +150,11 @@ export function ScheduleJobModalComponent({
|
|||||||
valuePropName="checked"
|
valuePropName="checked"
|
||||||
label={t("jobs.labels.appointmentconfirmation")}
|
label={t("jobs.labels.appointmentconfirmation")}
|
||||||
>
|
>
|
||||||
<Switch/>
|
<Switch />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
||||||
<Form.Item name="email" label={t("jobs.fields.ownr_ea")}>
|
<Form.Item name="email" label={t("jobs.fields.ownr_ea")}>
|
||||||
<EmailInput disabled={!form.getFieldValue("notifyCustomer")}/>
|
<EmailInput disabled={!form.getFieldValue("notifyCustomer")} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</LayoutFormRow>
|
</LayoutFormRow>
|
||||||
<LayoutFormRow grow>
|
<LayoutFormRow grow>
|
||||||
@@ -159,7 +163,7 @@ export function ScheduleJobModalComponent({
|
|||||||
{bodyshop.appt_colors &&
|
{bodyshop.appt_colors &&
|
||||||
bodyshop.appt_colors.map((color) => (
|
bodyshop.appt_colors.map((color) => (
|
||||||
<Select.Option
|
<Select.Option
|
||||||
style={{color: color.color.hex}}
|
style={{ color: color.color.hex }}
|
||||||
key={color.color.hex}
|
key={color.color.hex}
|
||||||
value={color.color.hex}
|
value={color.color.hex}
|
||||||
>
|
>
|
||||||
@@ -180,7 +184,7 @@ export function ScheduleJobModalComponent({
|
|||||||
</Select>
|
</Select>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item name={"note"} label={t("appointments.fields.note")}>
|
<Form.Item name={"note"} label={t("appointments.fields.note")}>
|
||||||
<Input/>
|
<Input />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</LayoutFormRow>
|
</LayoutFormRow>
|
||||||
{t("appointments.labels.history")}
|
{t("appointments.labels.history")}
|
||||||
@@ -197,7 +201,7 @@ export function ScheduleJobModalComponent({
|
|||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<div className="schedule-job-modal">
|
<div className="schedule-job-modal">
|
||||||
<ScheduleDayViewContainer day={values.start}/>
|
<ScheduleDayViewContainer day={values.start} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -66,6 +66,12 @@ const router = createBrowserRouter(
|
|||||||
createRoutesFromElements(<Route path="*" element={<AppContainer />} />)
|
createRoutesFromElements(<Route path="*" element={<AppContainer />} />)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
if (process.env.NODE_ENV === "development") {
|
||||||
|
let styles = 'font-weight: bold; font-size: 50px;color: red; 6px 6px 0 rgb(226,91,14) , 9px 9px 0 rgb(245,221,8) , 12px 12px 0 rgb(5,148,68) '
|
||||||
|
console.log('%c %s', styles, `VER: ${process.env.REACT_APP_INSTANCE}`)
|
||||||
|
}
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
return (
|
return (
|
||||||
<PersistGate
|
<PersistGate
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import {QUERY_BILLS_FOR_EXPORT} from "../../graphql/accounting.queries";
|
|||||||
import {setBreadcrumbs, setSelectedHeader,} from "../../redux/application/application.actions";
|
import {setBreadcrumbs, setSelectedHeader,} from "../../redux/application/application.actions";
|
||||||
import {selectPartnerVersion} from "../../redux/application/application.selectors";
|
import {selectPartnerVersion} from "../../redux/application/application.selectors";
|
||||||
import {selectBodyshop} from "../../redux/user/user.selectors";
|
import {selectBodyshop} from "../../redux/user/user.selectors";
|
||||||
|
import FeatureWrapperComponent from "../../components/feature-wrapper/feature-wrapper.component";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -60,6 +61,7 @@ export function AccountingPayablesContainer({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
<FeatureWrapperComponent featureName='export'>
|
||||||
<RbacWrapper action="accounting:payables">
|
<RbacWrapper action="accounting:payables">
|
||||||
{noPath && (
|
{noPath && (
|
||||||
<AlertComponent
|
<AlertComponent
|
||||||
@@ -73,6 +75,7 @@ export function AccountingPayablesContainer({
|
|||||||
refetch={refetch}
|
refetch={refetch}
|
||||||
/>
|
/>
|
||||||
</RbacWrapper>
|
</RbacWrapper>
|
||||||
|
</FeatureWrapperComponent>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import {selectBodyshop} from "../../redux/user/user.selectors";
|
|||||||
import RbacWrapper from "../../components/rbac-wrapper/rbac-wrapper.component";
|
import RbacWrapper from "../../components/rbac-wrapper/rbac-wrapper.component";
|
||||||
import {checkPartnerStatus} from "../../components/partner-ping/partner-ping.component";
|
import {checkPartnerStatus} from "../../components/partner-ping/partner-ping.component";
|
||||||
import {selectPartnerVersion} from "../../redux/application/application.selectors";
|
import {selectPartnerVersion} from "../../redux/application/application.selectors";
|
||||||
|
import FeatureWrapperComponent from "../../components/feature-wrapper/feature-wrapper.component";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -61,6 +62,7 @@ export function AccountingPaymentsContainer({
|
|||||||
);
|
);
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
<FeatureWrapperComponent featureName='export'>
|
||||||
<RbacWrapper action="accounting:payments">
|
<RbacWrapper action="accounting:payments">
|
||||||
{noPath && (
|
{noPath && (
|
||||||
<AlertComponent
|
<AlertComponent
|
||||||
@@ -74,6 +76,7 @@ export function AccountingPaymentsContainer({
|
|||||||
refetch={refetch}
|
refetch={refetch}
|
||||||
/>
|
/>
|
||||||
</RbacWrapper>
|
</RbacWrapper>
|
||||||
|
</FeatureWrapperComponent>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import {selectBodyshop} from "../../redux/user/user.selectors";
|
|||||||
import RbacWrapper from "../../components/rbac-wrapper/rbac-wrapper.component";
|
import RbacWrapper from "../../components/rbac-wrapper/rbac-wrapper.component";
|
||||||
import {checkPartnerStatus} from "../../components/partner-ping/partner-ping.component";
|
import {checkPartnerStatus} from "../../components/partner-ping/partner-ping.component";
|
||||||
import {selectPartnerVersion} from "../../redux/application/application.selectors";
|
import {selectPartnerVersion} from "../../redux/application/application.selectors";
|
||||||
|
import FeatureWrapperComponent from "../../components/feature-wrapper/feature-wrapper.component";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -64,6 +65,7 @@ export function AccountingReceivablesContainer({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
<FeatureWrapperComponent featureName="export">
|
||||||
<RbacWrapper action="accounting:receivables">
|
<RbacWrapper action="accounting:receivables">
|
||||||
{noPath && (
|
{noPath && (
|
||||||
<AlertComponent
|
<AlertComponent
|
||||||
@@ -77,6 +79,7 @@ export function AccountingReceivablesContainer({
|
|||||||
refetch={refetch}
|
refetch={refetch}
|
||||||
/>
|
/>
|
||||||
</RbacWrapper>
|
</RbacWrapper>
|
||||||
|
</FeatureWrapperComponent>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import {QUERY_ALL_BILLS_PAGINATED} from "../../graphql/bills.queries";
|
|||||||
import {setBreadcrumbs, setSelectedHeader,} from "../../redux/application/application.actions";
|
import {setBreadcrumbs, setSelectedHeader,} from "../../redux/application/application.actions";
|
||||||
import BillsPageComponent from "./bills.page.component";
|
import BillsPageComponent from "./bills.page.component";
|
||||||
import {pageLimit} from "../../utils/config";
|
import {pageLimit} from "../../utils/config";
|
||||||
|
import FeatureWrapperComponent from "../../components/feature-wrapper/feature-wrapper.component";
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
setBreadcrumbs: (breadcrumbs) => dispatch(setBreadcrumbs(breadcrumbs)),
|
setBreadcrumbs: (breadcrumbs) => dispatch(setBreadcrumbs(breadcrumbs)),
|
||||||
@@ -55,6 +56,7 @@ export function BillsPageContainer({setBreadcrumbs, setSelectedHeader}) {
|
|||||||
|
|
||||||
if (error) return <AlertComponent message={error.message} type="error"/>;
|
if (error) return <AlertComponent message={error.message} type="error"/>;
|
||||||
return (
|
return (
|
||||||
|
<FeatureWrapperComponent featureName='bills'>
|
||||||
<RbacWrapper action="bills:list">
|
<RbacWrapper action="bills:list">
|
||||||
<div>
|
<div>
|
||||||
<BillsPageComponent
|
<BillsPageComponent
|
||||||
@@ -67,6 +69,7 @@ export function BillsPageContainer({setBreadcrumbs, setSelectedHeader}) {
|
|||||||
<BillDetailEditContainer/>
|
<BillDetailEditContainer/>
|
||||||
</div>
|
</div>
|
||||||
</RbacWrapper>
|
</RbacWrapper>
|
||||||
|
</FeatureWrapperComponent>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import {addRecentItem, setBreadcrumbs, setSelectedHeader,} from "../../redux/app
|
|||||||
import {CreateRecentItem} from "../../utils/create-recent-item";
|
import {CreateRecentItem} from "../../utils/create-recent-item";
|
||||||
import ContractDetailPageComponent from "./contract-detail.page.component";
|
import ContractDetailPageComponent from "./contract-detail.page.component";
|
||||||
import NotFound from "../../components/not-found/not-found.component";
|
import NotFound from "../../components/not-found/not-found.component";
|
||||||
|
import FeatureWrapperComponent from "../../components/feature-wrapper/feature-wrapper.component";
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
setBreadcrumbs: (breadcrumbs) => dispatch(setBreadcrumbs(breadcrumbs)),
|
setBreadcrumbs: (breadcrumbs) => dispatch(setBreadcrumbs(breadcrumbs)),
|
||||||
@@ -122,6 +123,7 @@ export function ContractDetailPageContainer({
|
|||||||
if (!!!data.cccontracts_by_pk) return <NotFound/>;
|
if (!!!data.cccontracts_by_pk) return <NotFound/>;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<FeatureWrapperComponent featureName='courtesycars'>
|
||||||
<RbacWrapper action="contracts:detail">
|
<RbacWrapper action="contracts:detail">
|
||||||
<div>
|
<div>
|
||||||
<CourtesyCarReturnModalContainer/>
|
<CourtesyCarReturnModalContainer/>
|
||||||
@@ -160,6 +162,7 @@ export function ContractDetailPageContainer({
|
|||||||
</Form>
|
</Form>
|
||||||
</div>
|
</div>
|
||||||
</RbacWrapper>
|
</RbacWrapper>
|
||||||
|
</FeatureWrapperComponent>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import {QUERY_ACTIVE_CONTRACTS_PAGINATED} from "../../graphql/cccontracts.querie
|
|||||||
import {setBreadcrumbs, setSelectedHeader,} from "../../redux/application/application.actions";
|
import {setBreadcrumbs, setSelectedHeader,} from "../../redux/application/application.actions";
|
||||||
import ContractsPageComponent from "./contracts.page.component";
|
import ContractsPageComponent from "./contracts.page.component";
|
||||||
import {pageLimit} from "../../utils/config";
|
import {pageLimit} from "../../utils/config";
|
||||||
|
import FeatureWrapperComponent from "../../components/feature-wrapper/feature-wrapper.component";
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
setBreadcrumbs: (breadcrumbs) => dispatch(setBreadcrumbs(breadcrumbs)),
|
setBreadcrumbs: (breadcrumbs) => dispatch(setBreadcrumbs(breadcrumbs)),
|
||||||
@@ -56,6 +57,7 @@ export function ContractsPageContainer({setBreadcrumbs, setSelectedHeader}) {
|
|||||||
|
|
||||||
if (error) return <AlertComponent message={error.message} type="error"/>;
|
if (error) return <AlertComponent message={error.message} type="error"/>;
|
||||||
return (
|
return (
|
||||||
|
<FeatureWrapperComponent featureName="courtesycars">
|
||||||
<RbacWrapper action="contracts:list">
|
<RbacWrapper action="contracts:list">
|
||||||
<ContractsPageComponent
|
<ContractsPageComponent
|
||||||
loading={loading}
|
loading={loading}
|
||||||
@@ -64,6 +66,7 @@ export function ContractsPageContainer({setBreadcrumbs, setSelectedHeader}) {
|
|||||||
total={data ? data.search_cccontracts_aggregate.aggregate.count : 0}
|
total={data ? data.search_cccontracts_aggregate.aggregate.count : 0}
|
||||||
/>
|
/>
|
||||||
</RbacWrapper>
|
</RbacWrapper>
|
||||||
|
</FeatureWrapperComponent>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import RbacWrapper from "../../components/rbac-wrapper/rbac-wrapper.component";
|
|||||||
import {INSERT_NEW_COURTESY_CAR} from "../../graphql/courtesy-car.queries";
|
import {INSERT_NEW_COURTESY_CAR} from "../../graphql/courtesy-car.queries";
|
||||||
import {setBreadcrumbs, setSelectedHeader,} from "../../redux/application/application.actions";
|
import {setBreadcrumbs, setSelectedHeader,} from "../../redux/application/application.actions";
|
||||||
import {selectBodyshop} from "../../redux/user/user.selectors";
|
import {selectBodyshop} from "../../redux/user/user.selectors";
|
||||||
|
import FeatureWrapperComponent from "../../components/feature-wrapper/feature-wrapper.component";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -68,14 +69,11 @@ export function CourtesyCarCreateContainer({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<RbacWrapper action="courtesycar:create">
|
<RbacWrapper action="courtesycar:create">
|
||||||
<Form
|
<FeatureWrapperComponent featureName="courtesycars">
|
||||||
form={form}
|
<Form form={form} autoComplete="new-password" onFinish={handleFinish} layout="vertical">
|
||||||
autoComplete="new-password"
|
<CourtesyCarFormComponent form={form} saveLoading={loading} />
|
||||||
onFinish={handleFinish}
|
|
||||||
layout="vertical"
|
|
||||||
>
|
|
||||||
<CourtesyCarFormComponent form={form} saveLoading={loading}/>
|
|
||||||
</Form>
|
</Form>
|
||||||
|
</FeatureWrapperComponent>
|
||||||
</RbacWrapper>
|
</RbacWrapper>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import RbacWrapper from "../../components/rbac-wrapper/rbac-wrapper.component";
|
|||||||
import {QUERY_ALL_CC} from "../../graphql/courtesy-car.queries";
|
import {QUERY_ALL_CC} from "../../graphql/courtesy-car.queries";
|
||||||
import {setBreadcrumbs, setSelectedHeader,} from "../../redux/application/application.actions";
|
import {setBreadcrumbs, setSelectedHeader,} from "../../redux/application/application.actions";
|
||||||
import CourtesyCarsPageComponent from "./courtesy-cars.page.component";
|
import CourtesyCarsPageComponent from "./courtesy-cars.page.component";
|
||||||
|
import FeatureWrapperComponent from "../../components/feature-wrapper/feature-wrapper.component";
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
setBreadcrumbs: (breadcrumbs) => dispatch(setBreadcrumbs(breadcrumbs)),
|
setBreadcrumbs: (breadcrumbs) => dispatch(setBreadcrumbs(breadcrumbs)),
|
||||||
@@ -33,11 +34,13 @@ export function CourtesyCarsPageContainer({
|
|||||||
if (error) return <AlertComponent message={error.message} type="error"/>;
|
if (error) return <AlertComponent message={error.message} type="error"/>;
|
||||||
return (
|
return (
|
||||||
<RbacWrapper action="courtesycar:list">
|
<RbacWrapper action="courtesycar:list">
|
||||||
|
<FeatureWrapperComponent featureName="courtesycars">
|
||||||
<CourtesyCarsPageComponent
|
<CourtesyCarsPageComponent
|
||||||
loading={loading}
|
loading={loading}
|
||||||
data={(data && data.courtesycars) || []}
|
data={(data && data.courtesycars) || []}
|
||||||
refetch={refetch}
|
refetch={refetch}
|
||||||
/>
|
/>
|
||||||
|
</FeatureWrapperComponent>
|
||||||
</RbacWrapper>
|
</RbacWrapper>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import {connect} from "react-redux";
|
|||||||
import RbacWrapper from "../../components/rbac-wrapper/rbac-wrapper.component";
|
import RbacWrapper from "../../components/rbac-wrapper/rbac-wrapper.component";
|
||||||
import {setBreadcrumbs, setSelectedHeader,} from "../../redux/application/application.actions";
|
import {setBreadcrumbs, setSelectedHeader,} from "../../redux/application/application.actions";
|
||||||
import ExportLogsPage from "./export-logs.page.component";
|
import ExportLogsPage from "./export-logs.page.component";
|
||||||
|
import FeatureWrapperComponent from "../../components/feature-wrapper/feature-wrapper.component";
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
setBreadcrumbs: (breadcrumbs) => dispatch(setBreadcrumbs(breadcrumbs)),
|
setBreadcrumbs: (breadcrumbs) => dispatch(setBreadcrumbs(breadcrumbs)),
|
||||||
@@ -25,9 +26,11 @@ export function ExportsLogPageContainer({setBreadcrumbs, setSelectedHeader}) {
|
|||||||
}, [setBreadcrumbs, t, setSelectedHeader]);
|
}, [setBreadcrumbs, t, setSelectedHeader]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<FeatureWrapperComponent featureName='export'>
|
||||||
<RbacWrapper action="accounting:exportlogs">
|
<RbacWrapper action="accounting:exportlogs">
|
||||||
<ExportLogsPage/>
|
<ExportLogsPage/>
|
||||||
</RbacWrapper>
|
</RbacWrapper>
|
||||||
|
</FeatureWrapperComponent>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -52,6 +52,8 @@ import _ from "lodash";
|
|||||||
import JobProfileDataWarning from "../../components/job-profile-data-warning/job-profile-data-warning.component";
|
import JobProfileDataWarning from "../../components/job-profile-data-warning/job-profile-data-warning.component";
|
||||||
import {DateTimeFormat} from "../../utils/DateFormatter";
|
import {DateTimeFormat} from "../../utils/DateFormatter";
|
||||||
import JobLifecycleComponent from "../../components/job-lifecycle/job-lifecycle.component";
|
import JobLifecycleComponent from "../../components/job-lifecycle/job-lifecycle.component";
|
||||||
|
import InstanceRenderManager from "../../utils/instanceRenderMgr";
|
||||||
|
import { HasFeatureAccess } from "../../components/feature-wrapper/feature-wrapper.component";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -333,12 +335,12 @@ export function JobsDetailPage({
|
|||||||
label: t("menus.jobsdetail.partssublet"),
|
label: t("menus.jobsdetail.partssublet"),
|
||||||
children: <JobsDetailPliContainer job={job}/>,
|
children: <JobsDetailPliContainer job={job}/>,
|
||||||
},
|
},
|
||||||
{
|
...InstanceRenderManager({ imex: true, rome: true, promanager: HasFeatureAccess({ featureName: 'timetickets', bodyshop }) }) ? [ {
|
||||||
key: "labor",
|
key: "labor",
|
||||||
icon: <Icon component={FaHardHat}/>,
|
icon: <Icon component={FaHardHat}/>,
|
||||||
label: t("menus.jobsdetail.labor"),
|
label: t("menus.jobsdetail.labor"),
|
||||||
children: <JobsDetailLaborContainer job={job} jobId={job.id}/>,
|
children: <JobsDetailLaborContainer job={job} jobId={job.id}/>,
|
||||||
},
|
},]: [],
|
||||||
{
|
{
|
||||||
key: 'lifecycle',
|
key: 'lifecycle',
|
||||||
icon: <BarsOutlined/>,
|
icon: <BarsOutlined/>,
|
||||||
@@ -352,7 +354,7 @@ export function JobsDetailPage({
|
|||||||
forceRender: true,
|
forceRender: true,
|
||||||
children: <JobsDetailDatesComponent job={job}/>,
|
children: <JobsDetailDatesComponent job={job}/>,
|
||||||
},
|
},
|
||||||
{
|
...InstanceRenderManager({ imex: true, rome: true, promanager: HasFeatureAccess({ featureName: 'media', bodyshop }) }) ? [ {
|
||||||
key: "documents",
|
key: "documents",
|
||||||
icon: <FileImageFilled/>,
|
icon: <FileImageFilled/>,
|
||||||
label: t("jobs.labels.documents"),
|
label: t("jobs.labels.documents"),
|
||||||
@@ -361,7 +363,7 @@ export function JobsDetailPage({
|
|||||||
) : (
|
) : (
|
||||||
<JobsDocumentsGalleryContainer jobId={job.id}/>
|
<JobsDocumentsGalleryContainer jobId={job.id}/>
|
||||||
),
|
),
|
||||||
},
|
},]:[],
|
||||||
{
|
{
|
||||||
key: "notes",
|
key: "notes",
|
||||||
icon: <Icon component={FaRegStickyNote}/>,
|
icon: <Icon component={FaRegStickyNote}/>,
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import {QUERY_ALL_PAYMENTS_PAGINATED} from "../../graphql/payments.queries";
|
|||||||
import {setBreadcrumbs, setSelectedHeader,} from "../../redux/application/application.actions";
|
import {setBreadcrumbs, setSelectedHeader,} from "../../redux/application/application.actions";
|
||||||
import {selectBodyshop} from "../../redux/user/user.selectors";
|
import {selectBodyshop} from "../../redux/user/user.selectors";
|
||||||
import {pageLimit} from "../../utils/config";
|
import {pageLimit} from "../../utils/config";
|
||||||
|
import FeatureWrapperComponent from "../../components/feature-wrapper/feature-wrapper.component";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -60,6 +61,7 @@ export function AllJobs({bodyshop, setBreadcrumbs, setSelectedHeader}) {
|
|||||||
|
|
||||||
if (error) return <AlertComponent message={error.message} type="error"/>;
|
if (error) return <AlertComponent message={error.message} type="error"/>;
|
||||||
return (
|
return (
|
||||||
|
<FeatureWrapperComponent featureName='payments'>
|
||||||
<RbacWrapper action="payments:list">
|
<RbacWrapper action="payments:list">
|
||||||
<PaymentsListPaginated
|
<PaymentsListPaginated
|
||||||
refetch={refetch}
|
refetch={refetch}
|
||||||
@@ -69,6 +71,7 @@ export function AllJobs({bodyshop, setBreadcrumbs, setSelectedHeader}) {
|
|||||||
payments={data ? data.payments : []}
|
payments={data ? data.payments : []}
|
||||||
/>
|
/>
|
||||||
</RbacWrapper>
|
</RbacWrapper>
|
||||||
|
</FeatureWrapperComponent>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
import React from "react";
|
import React from 'react';
|
||||||
import RbacWrapper from "../../components/rbac-wrapper/rbac-wrapper.component";
|
import RbacWrapper from '../../components/rbac-wrapper/rbac-wrapper.component';
|
||||||
import TimeTicketShift from "../../components/time-ticket-shift/time-ticket-shift.container";
|
import TimeTicketShift from '../../components/time-ticket-shift/time-ticket-shift.container';
|
||||||
|
import FeatureWrapperComponent from '../../components/feature-wrapper/feature-wrapper.component';
|
||||||
|
|
||||||
export default function ShiftClock() {
|
export default function ShiftClock() {
|
||||||
return (
|
return (
|
||||||
|
<FeatureWrapperComponent featureName="timetickets">
|
||||||
<RbacWrapper action="shiftclock:view">
|
<RbacWrapper action="shiftclock:view">
|
||||||
<TimeTicketShift/>
|
<TimeTicketShift />
|
||||||
</RbacWrapper>
|
</RbacWrapper>
|
||||||
|
</FeatureWrapperComponent>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import RbacWrapper from "../../components/rbac-wrapper/rbac-wrapper.component";
|
|||||||
import {setBreadcrumbs, setSelectedHeader,} from "../../redux/application/application.actions";
|
import {setBreadcrumbs, setSelectedHeader,} from "../../redux/application/application.actions";
|
||||||
import {selectBodyshop} from "../../redux/user/user.selectors";
|
import {selectBodyshop} from "../../redux/user/user.selectors";
|
||||||
import TemporaryDocsComponent from "./temporary-docs.component";
|
import TemporaryDocsComponent from "./temporary-docs.component";
|
||||||
|
import FeatureWrapperComponent from "../../components/feature-wrapper/feature-wrapper.component";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -32,7 +33,9 @@ export function TempDocumentsContainer({setBreadcrumbs, setSelectedHeader}) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<RbacWrapper action="temporarydocs:view">
|
<RbacWrapper action="temporarydocs:view">
|
||||||
<TemporaryDocsComponent/>
|
<FeatureWrapperComponent featureName="media">
|
||||||
|
<TemporaryDocsComponent />
|
||||||
|
</FeatureWrapperComponent>
|
||||||
</RbacWrapper>
|
</RbacWrapper>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import TimeTicketsAttendanceTable
|
|||||||
from "../../components/time-tickets-attendance-table/time-tickets-attendance-table.component";
|
from "../../components/time-tickets-attendance-table/time-tickets-attendance-table.component";
|
||||||
import {setBreadcrumbs, setSelectedHeader,} from "../../redux/application/application.actions";
|
import {setBreadcrumbs, setSelectedHeader,} from "../../redux/application/application.actions";
|
||||||
import TimeTicketsCommit from "../../components/time-tickets-commit/time-tickets-commit.component";
|
import TimeTicketsCommit from "../../components/time-tickets-commit/time-tickets-commit.component";
|
||||||
|
import FeatureWrapperComponent from "../../components/feature-wrapper/feature-wrapper.component";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({});
|
const mapStateToProps = createStructuredSelector({});
|
||||||
|
|
||||||
@@ -64,6 +65,7 @@ export function TimeTicketsContainer({
|
|||||||
if (error) return <AlertComponent message={error.message} type="error"/>;
|
if (error) return <AlertComponent message={error.message} type="error"/>;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<FeatureWrapperComponent featureName='timetickets'>
|
||||||
<RbacWrapper action="timetickets:list">
|
<RbacWrapper action="timetickets:list">
|
||||||
<Row gutter={[16, 16]}>
|
<Row gutter={[16, 16]}>
|
||||||
<Col span={24}>
|
<Col span={24}>
|
||||||
@@ -90,6 +92,7 @@ export function TimeTicketsContainer({
|
|||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
</RbacWrapper>
|
</RbacWrapper>
|
||||||
|
</FeatureWrapperComponent>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import RbacWrapper from "../../components/rbac-wrapper/rbac-wrapper.component";
|
|||||||
import TtApprovalsList from "../../components/tt-approvals-list/tt-approvals-list.container";
|
import TtApprovalsList from "../../components/tt-approvals-list/tt-approvals-list.container";
|
||||||
import {setBreadcrumbs, setSelectedHeader,} from "../../redux/application/application.actions";
|
import {setBreadcrumbs, setSelectedHeader,} from "../../redux/application/application.actions";
|
||||||
import {selectBodyshop} from "../../redux/user/user.selectors";
|
import {selectBodyshop} from "../../redux/user/user.selectors";
|
||||||
|
import FeatureWrapperComponent from "../../components/feature-wrapper/feature-wrapper.component";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -31,9 +32,11 @@ export function TtApprovalsPage({setBreadcrumbs, setSelectedHeader}) {
|
|||||||
}, [t, setBreadcrumbs, setSelectedHeader]);
|
}, [t, setBreadcrumbs, setSelectedHeader]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<FeatureWrapperComponent featureName='timetickets'>
|
||||||
<RbacWrapper action="ttapprovals:view">
|
<RbacWrapper action="ttapprovals:view">
|
||||||
<TtApprovalsList/>
|
<TtApprovalsList/>
|
||||||
</RbacWrapper>
|
</RbacWrapper>
|
||||||
|
</FeatureWrapperComponent>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,30 +9,39 @@
|
|||||||
* @property { string | object | function } imex Return this prop if Rome.
|
* @property { string | object | function } imex Return this prop if Rome.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export default function InstanceRenderManager({
|
export default function InstanceRenderManager({ executeFunction, rome, promanager, imex, debug }) {
|
||||||
executeFunction,
|
|
||||||
rome,
|
|
||||||
promanager,
|
|
||||||
imex,
|
|
||||||
}) {
|
|
||||||
let propToReturn = null;
|
let propToReturn = null;
|
||||||
|
|
||||||
switch (process.env.INSTANCE) {
|
switch (process.env.REACT_APP_INSTANCE) {
|
||||||
case "IMEX":
|
case 'IMEX':
|
||||||
propToReturn = imex;
|
propToReturn = imex;
|
||||||
break;
|
break;
|
||||||
case "ROME":
|
case 'ROME':
|
||||||
propToReturn = rome;
|
propToReturn = rome;
|
||||||
break;
|
break;
|
||||||
case "PROMANAGER":
|
case 'PROMANAGER':
|
||||||
|
//Return the rome prop if USE_ROME.
|
||||||
|
//If not USE_ROME, we want to default back to the rome prop if it's undefined.
|
||||||
|
//If null, we might want to show nothing, so make sure we return null.
|
||||||
propToReturn =
|
propToReturn =
|
||||||
promanager === "USE_ROME" ? rome : promanager || rome; //default promanager back to rome.
|
promanager === 'USE_ROME' ? rome : promanager !== undefined ? promanager : rome;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
propToReturn = imex;
|
propToReturn = imex;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (executeFunction && typeof propToReturn === "function") propToReturn();
|
if (executeFunction && typeof propToReturn === 'function') propToReturn();
|
||||||
|
|
||||||
|
//Checking to see if we need to default to another one.
|
||||||
|
if (propToReturn === 'imex') {
|
||||||
|
propToReturn = imex;
|
||||||
|
}
|
||||||
|
if (debug) {
|
||||||
|
console.log('InstanceRenderManager Debugger');
|
||||||
|
console.log('=========================');
|
||||||
|
console.log({ executeFunction, rome, promanager, imex, debug, propToReturn });
|
||||||
|
console.log('=========================');
|
||||||
|
}
|
||||||
return propToReturn === undefined ? null : propToReturn;
|
return propToReturn === undefined ? null : propToReturn;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user