Updated Print Center & TemplateList Object IO-587
This commit is contained in:
@@ -1,40 +1,28 @@
|
||||
import { Collapse, Row, Col } from "antd";
|
||||
import { Col, Collapse, Row } from "antd";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { setEmailOptions } from "../../redux/email/email.actions";
|
||||
import { toggleModalVisible } from "../../redux/modals/modals.actions";
|
||||
import { selectPrintCenter } from "../../redux/modals/modals.selectors";
|
||||
import {
|
||||
selectBodyshop,
|
||||
selectCurrentUser,
|
||||
} from "../../redux/user/user.selectors";
|
||||
import { TemplateList } from "../../utils/TemplateConstants";
|
||||
import PrintCenterItem from "../print-center-item/print-center-item.component";
|
||||
import PrintCenterSpeedPrint from "../print-center-speed-print/print-center-speed-print.component";
|
||||
import { TemplateList } from "../../utils/TemplateConstants";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
currentUser: selectCurrentUser,
|
||||
bodyshop: selectBodyshop,
|
||||
printCenterModal: selectPrintCenter,
|
||||
});
|
||||
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
setEmailOptions: (e) => dispatch(setEmailOptions(e)),
|
||||
toggleModalVisible: () => dispatch(toggleModalVisible("printCenter")),
|
||||
});
|
||||
const mapDispatchToProps = (dispatch) => ({});
|
||||
|
||||
const colSpan = { md: { span: 24 }, lg: { span: 12 } };
|
||||
|
||||
export function PrintCenterJobsComponent({ bodyshop, printCenterModal }) {
|
||||
export function PrintCenterJobsComponent({ printCenterModal }) {
|
||||
const { t } = useTranslation();
|
||||
const { id: jobId } = printCenterModal.context;
|
||||
const tempList = TemplateList();
|
||||
const tempList = TemplateList("job", {});
|
||||
const JobsReportsList = Object.keys(tempList).map((key) => {
|
||||
return tempList[key];
|
||||
});
|
||||
console.log("PrintCenterJobsComponent -> JobsReportsList", JobsReportsList);
|
||||
|
||||
return (
|
||||
<div>
|
||||
@@ -45,17 +33,15 @@ export function PrintCenterJobsComponent({ bodyshop, printCenterModal }) {
|
||||
<Col {...colSpan}>
|
||||
<Collapse accordion>
|
||||
<Collapse.Panel header={t("printcenter.labels.repairorder")}>
|
||||
<ul style={{ columns: "2 auto" }}>
|
||||
{JobsReportsList.filter((t) => t.drivingId === "job").map(
|
||||
(item) => (
|
||||
<PrintCenterItem
|
||||
key={item.key}
|
||||
item={item}
|
||||
id={jobId}
|
||||
disabled={item.disabled}
|
||||
/>
|
||||
)
|
||||
)}
|
||||
<ul style={{ columns: "3 auto" }}>
|
||||
{JobsReportsList.map((item) => (
|
||||
<PrintCenterItem
|
||||
key={item.key}
|
||||
item={item}
|
||||
id={jobId}
|
||||
disabled={item.disabled}
|
||||
/>
|
||||
))}
|
||||
</ul>
|
||||
</Collapse.Panel>
|
||||
</Collapse>
|
||||
|
||||
Reference in New Issue
Block a user