Minor cleanup for ProManager
This commit is contained in:
@@ -28,6 +28,7 @@ import {DateTimeFormatter} from "../../utils/DateFormatter";
|
||||
import FormDateTimePickerComponent from "../form-date-time-picker/form-date-time-picker.component";
|
||||
import dayjs from "../../utils/day";
|
||||
import {useSplitTreatments} from "@splitsoftware/splitio-react";
|
||||
import InstanceRenderManager from "../../utils/instanceRenderMgr";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
bodyshop: selectBodyshop,
|
||||
@@ -635,36 +636,40 @@ export function JobsDetailHeaderActions({
|
||||
disabled: job.status !== bodyshop.md_ro_statuses.default_scheduled,
|
||||
label: t("menus.jobsactions.cancelallappointments")
|
||||
},
|
||||
{
|
||||
key: 'intake',
|
||||
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>
|
||||
)
|
||||
},
|
||||
{
|
||||
key: 'deliver',
|
||||
disabled: !jobInProduction || jobRO,
|
||||
label: !jobInProduction ? (
|
||||
t("jobs.actions.deliver")
|
||||
) : (
|
||||
<Link to={`/manage/jobs/${job.id}/deliver`}>
|
||||
{t("jobs.actions.deliver")}
|
||||
</Link>
|
||||
)
|
||||
},
|
||||
{
|
||||
key: 'checklist',
|
||||
disabled: !job.converted,
|
||||
label: <Link to={`/manage/jobs/${job.id}/checklist`}>
|
||||
{t("jobs.actions.viewchecklist")}
|
||||
</Link>
|
||||
},
|
||||
{
|
||||
...InstanceRenderManager({imex: [ {
|
||||
key: 'intake',
|
||||
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>
|
||||
)
|
||||
},
|
||||
{
|
||||
key: 'deliver',
|
||||
disabled: !jobInProduction || jobRO,
|
||||
label: !jobInProduction ? (
|
||||
t("jobs.actions.deliver")
|
||||
) : (
|
||||
<Link to={`/manage/jobs/${job.id}/deliver`}>
|
||||
{t("jobs.actions.deliver")}
|
||||
</Link>
|
||||
)
|
||||
},
|
||||
{
|
||||
key: 'checklist',
|
||||
disabled: !job.converted,
|
||||
label: <Link to={`/manage/jobs/${job.id}/checklist`}>
|
||||
{t("jobs.actions.viewchecklist")}
|
||||
</Link>
|
||||
},], rome: "USE_IMEX", promanager:[]}),
|
||||
...(InstanceRenderManager({
|
||||
imex: true,
|
||||
rome: "USE_IMEX",
|
||||
promanager: HasFeatureAccess({ featureName: 'timetickets', bodyshop }),
|
||||
}) ? [ {
|
||||
key: "entertimetickets",
|
||||
disabled: !job.converted || (!bodyshop.tt_allow_post_to_invoiced && job.date_invoiced),
|
||||
label: t("timetickets.actions.enter"),
|
||||
@@ -681,7 +686,8 @@ export function JobsDetailHeaderActions({
|
||||
},
|
||||
});
|
||||
}
|
||||
}];
|
||||
}] : [])
|
||||
];
|
||||
|
||||
if (bodyshop.md_tasks_presets.enable_tasks) {
|
||||
menuItems.push({
|
||||
@@ -729,13 +735,15 @@ export function JobsDetailHeaderActions({
|
||||
);
|
||||
}
|
||||
|
||||
menuItems.push({
|
||||
key: 'cccontract',
|
||||
disabled: jobRO || !job.converted,
|
||||
label: <Link state={{jobId: job.id}} to='/manage/courtesycars/contracts/new'>
|
||||
{t("menus.jobsactions.newcccontract")}
|
||||
</Link>
|
||||
});
|
||||
if(HasFeatureAccess({featureName: 'courtesycars'})){
|
||||
menuItems.push({
|
||||
key: 'cccontract',
|
||||
disabled: jobRO || !job.converted,
|
||||
label: <Link state={{jobId: job.id}} to='/manage/courtesycars/contracts/new'>
|
||||
{t("menus.jobsactions.newcccontract")}
|
||||
</Link>
|
||||
});
|
||||
}
|
||||
|
||||
menuItems.push(
|
||||
job.inproduction ?
|
||||
@@ -800,7 +808,11 @@ export function JobsDetailHeaderActions({
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
... InstanceRenderManager({
|
||||
imex: true,
|
||||
rome: true,
|
||||
promanager: HasFeatureAccess({ featureName: 'bills', bodyshop }),
|
||||
}) ? [ {
|
||||
key: 'postbills',
|
||||
disabled: !job.converted,
|
||||
label: t("jobs.actions.postbills"),
|
||||
@@ -814,7 +826,8 @@ export function JobsDetailHeaderActions({
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
},] : [],
|
||||
|
||||
{
|
||||
key: 'addtopartsqueue',
|
||||
disabled: !job.converted || !jobInProduction || jobRO,
|
||||
@@ -867,14 +880,21 @@ export function JobsDetailHeaderActions({
|
||||
}
|
||||
);
|
||||
|
||||
menuItems.push(
|
||||
{
|
||||
key: 'exportcustdata',
|
||||
disabled: !job.converted,
|
||||
label: t("jobs.actions.exportcustdata"),
|
||||
onClick: handleExportCustData
|
||||
}
|
||||
);
|
||||
if( InstanceRenderManager({
|
||||
imex: true,
|
||||
rome: true,
|
||||
promanager: HasFeatureAccess({ featureName: 'export', bodyshop }),
|
||||
})){
|
||||
|
||||
menuItems.push(
|
||||
{
|
||||
key: 'exportcustdata',
|
||||
disabled: !job.converted,
|
||||
label: t("jobs.actions.exportcustdata"),
|
||||
onClick: handleExportCustData
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
if (HasFeatureAccess({featureName: "csi", bodyshop})) {
|
||||
const children = [
|
||||
|
||||
Reference in New Issue
Block a user