General gendoc function & reprint parts orders IO-411
This commit is contained in:
@@ -1,13 +1,11 @@
|
||||
import { Button, Typography, List } from "antd";
|
||||
import { Button, List, Typography } from "antd";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
import RenderTemplate, {
|
||||
displayTemplateInWindow,
|
||||
} from "../../utils/RenderTemplate";
|
||||
import { GenerateDocument } from "../../utils/RenderTemplate";
|
||||
import { TemplateList } from "../../utils/TemplateConstants";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
@@ -20,17 +18,18 @@ const mapDispatchToProps = (dispatch) => ({
|
||||
export function PrintCenterSpeedPrint({ bodyshop, jobId }) {
|
||||
const { speedprint } = bodyshop;
|
||||
const { t } = useTranslation();
|
||||
|
||||
const renderTemplate = async (templateKey) => {
|
||||
logImEXEvent("speed_print_template_render");
|
||||
|
||||
const html = await RenderTemplate(
|
||||
GenerateDocument(
|
||||
{
|
||||
name: templateKey,
|
||||
variables: { id: jobId },
|
||||
},
|
||||
bodyshop
|
||||
{},
|
||||
"p"
|
||||
);
|
||||
displayTemplateInWindow(html);
|
||||
};
|
||||
|
||||
const renderAllTemplates = (templateKeys) => {
|
||||
|
||||
Reference in New Issue
Block a user