Minor cleanup for ProManager

This commit is contained in:
Patrick Fic
2024-02-27 11:24:13 -08:00
parent 55ef205907
commit d9020de77b
10 changed files with 132 additions and 80 deletions

View File

@@ -8,5 +8,7 @@
"export": "date",
"csi": "Date",
"courtesycars": "date",
"media": "date"
"media": "date",
"visualboard": "date",
"scoreboard": "date"
}

View File

@@ -28,8 +28,10 @@ switch (this.location.hostname) {
// measurementId: "${config.measurementId}",
};
break;
//TODO:AIO Update this for pro manager and include all .env files for server and client.
case "romeonline.io":
case "test.romeonline.io":
case "test.promanager.web-est.com":
case "promanager.web-est.com":
firebaseConfig = {
apiKey: "AIzaSyAuLQR9SV5LsVxjU8wh9hvFLdhcAHU6cxE",
authDomain: "rome-prod-1.firebaseapp.com",
@@ -40,6 +42,7 @@ switch (this.location.hostname) {
measurementId: "G-G8Z9DRHTZS",
};
break;
case "imex.online":
default:
firebaseConfig = {

View File

@@ -24,13 +24,15 @@ const defaultTheme = {
},
},
token: {
colorPrimary: InstanceRenderMgr({ //TODO:AIO Add in ProMan colors.
colorPrimary: InstanceRenderMgr({
imex: '#1890ff',
rome: '#326ade',
promanager:"#1d69a6"
}),
colorInfo: InstanceRenderMgr({
imex: '#1890ff',
rome: '#326ade',
promanager:"#1d69a6"
}),
},
};

View File

@@ -343,19 +343,38 @@ function Header({
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>,
},
...(InstanceRenderManager({
imex: true,
rome: true,
promanager: HasFeatureAccess({ featureName: 'visualboard', bodyshop }),
})
? [
{
key: 'productionboard',
icon: <Icon component={BsKanban} />,
label: (
<Link to="/manage/production/board">{t('menus.header.productionboard')}</Link>
),
},
]
: []),
...(InstanceRenderManager({
imex: true,
rome: true,
promanager: HasFeatureAccess({ featureName: 'scoreboard', bodyshop }),
})
? [
{
type: 'divider',
},
{
key: 'scoreboard',
icon: <LineChartOutlined />,
label: <Link to="/manage/scoreboard">{t('menus.header.scoreboard')}</Link>,
},
]
: []),
],
},
{

View File

@@ -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 = [

View File

@@ -29,6 +29,7 @@ export function JobsDetailRatesTaxes({
rootElements: true,
bodyshop,
jobRO,
key: `root${tyCounter}`
})
);
@@ -39,11 +40,13 @@ export function JobsDetailRatesTaxes({
typeNumIterator: iterator,
rootElements: false,
jobRO,
key: `nonroot${iterator}`
})
);
}
formItems.push(<>
<Space wrap>
<Space key={`section${tyCounter}`} wrap>
{section}
</Space>
<Divider/>
@@ -71,13 +74,15 @@ function TaxFormItems({
rootElements,
bodyshopjobRO,
jobRO,
key
}) {
const {t} = useTranslation();
if (rootElements)
return (
<>
<Form.Item
key={key}
label={t("bodyshop.fields.responsibilitycenter_tax_type", {
typeNum,
typeNumIterator,
@@ -92,7 +97,7 @@ function TaxFormItems({
>
<Input disabled={jobRO}/>
</Form.Item>
</>
);
return (
@@ -102,6 +107,7 @@ function TaxFormItems({
typeNum,
typeNumIterator,
})}
key={key + "tax_tier"}
rules={[
{
required: true,
@@ -117,6 +123,7 @@ function TaxFormItems({
typeNum,
typeNumIterator,
})}
key={key + "tax_thres"}
rules={[
{
required: true,
@@ -132,6 +139,7 @@ function TaxFormItems({
typeNum,
typeNumIterator,
})}
key={key + "tax_rate"}
rules={[
{
required: true,
@@ -147,6 +155,7 @@ function TaxFormItems({
typeNum,
typeNumIterator,
})}
key={key + "tax_sur"}
rules={[
{
required: true,

View File

@@ -130,7 +130,6 @@ export function ProductionBoardKanbanComponent({
newChildCard ? newChildCard.id : null,
newChildCardNewParent
),
// TODO: optimisticResponse
});
insertAuditTrail({
jobid: card.id,

View File

@@ -244,15 +244,14 @@ export function TimeTicketModalComponent({
>
<InputNumber precision={1}/>
</Form.Item>
{
// TODO:AIO Check if this is still needed?
}
<TimeTicketCalculatorComponent
jobid={form.getFieldValue("jobid")}
setProductiveHours={(productivehrs) =>
form.setFieldsValue({productivehrs})
}
/>
{
// <TimeTicketCalculatorComponent
// jobid={form.getFieldValue("jobid")}
// setProductiveHours={(productivehrs) =>
// form.setFieldsValue({productivehrs})
// }
// />
}
</>
)}
</Form.Item>

View File

@@ -37,7 +37,7 @@ export function ProductionBoardContainer({
}, [t, setBreadcrumbs, setSelectedHeader]);
return (
<FeatureWrapper featureName="production-board">
<FeatureWrapper featureName="visualboard">
<RbacWrapper action="production:board">
<ProductionBoardComponent/>
</RbacWrapper>

View File

@@ -260,8 +260,7 @@ export function* sendPasswordResetEmailSaga({payload}) {
try {
yield sendPasswordResetEmail(auth, payload, {
url:
InstanceRenderManager({imex: "https://imex.online/passwordreset", rome:"https://romeonline.io/passwordreset"})
//TODO:AIO Update for Promanager firebase instance.
InstanceRenderManager({imex: "https://imex.online/passwordreset", rome:"https://romeonline.io/passwordreset", promanager:"https:promanager.web-est.com/passwordreset"})
,
});