Introduced JS report and refactored some doc generation. IO-585

This commit is contained in:
Patrick Fic
2021-01-06 17:56:46 -08:00
parent 1c967ece2e
commit 2d260dceb8
33 changed files with 311 additions and 676 deletions

View File

@@ -109,11 +109,18 @@ export function EmailOverlayContainer({
const render = async () => {
logImEXEvent("email_render_template", { template: emailConfig.template });
setLoading(true);
let html = await RenderTemplate(emailConfig.template, bodyshop);
let html = await RenderTemplate(emailConfig.template, bodyshop, true);
const response = await axios.post("/render/inlinecss", {
html: html,
url: `${window.location.protocol}://${window.location.host}/`,
});
console.log("response", response);
setMessageOptions({
...emailConfig.messageOptions,
...defaultEmailFrom,
html: html,
html: response.data,
fileList: [],
});
setLoading(false);

View File

@@ -25,14 +25,14 @@ export function PrintCenterItemComponent({
disabled,
}) {
const renderToNewWindow = async () => {
const html = await RenderTemplate(
await RenderTemplate(
{
name: item.key,
variables: { id: id },
},
bodyshop
);
displayTemplateInWindow(html);
// displayTemplateInWindow(html);
};
if (disabled) return <li className="print-center-item">{item.title} </li>;

View File

@@ -22,11 +22,7 @@ export default function ShopTemplateSaveButton({
html: data.html,
url: `${window.location.protocol}://${window.location.host}/`,
});
console.log(
"🚀 ~ file: shop-template-editor-save-button.component.jsx ~ line 25 ~ emailEditorRef.current.exportHtml ~ inlineHtml",
response
);
const result = await updateTemplate({
variables: {
templateId: templateId,