diff --git a/client/src/components/_test/test.component.jsx b/client/src/components/_test/test.component.jsx index 43cb233b2..37810cb23 100644 --- a/client/src/components/_test/test.component.jsx +++ b/client/src/components/_test/test.component.jsx @@ -1,143 +1,49 @@ -import { Editor } from "@tinymce/tinymce-react"; import axios from "axios"; -import React, { useState } from "react"; +import React from "react"; import { connect } from "react-redux"; import { createStructuredSelector } from "reselect"; -import { EmailSettings } from "../../utils/TemplateConstants"; -import { - endLoading, - startLoading, -} from "../../redux/application/application.actions"; -import { setEmailOptions } from "../../redux/email/email.actions"; import { selectBodyshop } from "../../redux/user/user.selectors"; +import { auth } from "../../firebase/firebase.utils"; + const mapStateToProps = createStructuredSelector({ - //currentUser: selectCurrentUser bodyshop: selectBodyshop, }); -const mapDispatchToProps = (dispatch) => ({ - setEmailOptions: (e) => dispatch(setEmailOptions(e)), - load: () => dispatch(startLoading()), - endload: () => dispatch(endLoading()), -}); + +const mapDispatchToProps = (dispatch) => ({}); export default connect( mapStateToProps, mapDispatchToProps -)(function Test({ setEmailOptions, load, endload, bodyshop }) { - const [state, setState] = useState(temp); - - const handleEditorChange = (content, editor) => { - setState(content); +)(function Test({ bodyshop }) { + const handle = async () => { + console.log( + "await auth.currentUser.getIdToken(true)", + await auth.currentUser.getIdToken(true) + ); + const response = await axios.post( + "/accounting/iif/receivables", + { jobId: "661dd1d5-bf06-426f-8bd2-bd9e41de8eb1" }, + { + headers: { + Authorization: `Bearer ${await auth.currentUser.getIdToken(true)}`, + }, + } + ); + console.log("handle -> result", response); + const url = window.URL.createObjectURL(new Blob([response.data])); + const link = document.createElement("a"); + link.href = url; + link.setAttribute( + "download", + response.headers.filename || "receivables.iif" + ); //or any other extension + document.body.appendChild(link); + link.click(); }; return (
- - - - - +
); }); - -const temp = `
-

This is a full-featured editor demo. Please explore! ←

-

 

-

TinyMCE is the world's most customizable, and flexible, rich text editor.

-

A featherweight download, TinyMCE can handle any challenge you throw at it.

-

 

-

 

- - - - - - - - - - - - - - - - - - - - - -
🛠 50+ Plugins💡 Premium Support🖍 Custom Skins⚙ Full API Access
{{#each people}}
{{this}}{{this}}{{this}}{{this}}
{{/each}}
-
`; diff --git a/client/src/components/jobs-close-save-button/jobs-close-save-button.component.jsx b/client/src/components/jobs-close-save-button/jobs-close-save-button.component.jsx index 553c9492d..bd44110de 100644 --- a/client/src/components/jobs-close-save-button/jobs-close-save-button.component.jsx +++ b/client/src/components/jobs-close-save-button/jobs-close-save-button.component.jsx @@ -50,7 +50,7 @@ export function JobsCloseSaveButton({ } setLoading(false); }; - console.log("suspense", suspenseAmount); + return (