This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# from | |
# https://quickchart.io/documentation/send-charts-in-email/#render-the-chart-image | |
# https://stackoverflow.com/questions/13137817/how-to-download-image-using-requests | |
# | |
# see also | |
# https://www.chartjs.org/docs/2.9.4/charts/doughnut.html | |
import shutil | |
import requests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const braintreeClientCreate = require('braintree-web/client').create; | |
const braintreeDataCollectorCreate = require('braintree-web/data-collector').create; | |
import {isEmpty, isNil} from 'ramda'; | |
import application from "../common"; | |
// REDUX action types______________________________________________ | |
export const SET_PAYMENT_CLIENT = 'SET_PAYMENT_CLIENT'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
starting reference: https://developer.mozilla.org/en-US/docs/Web/Guide/Printing | |
*/ | |
function closePrint () { | |
document.body.removeChild(this.__container__); | |
} | |
function setPrint () { | |
setTimeout ( () => { | |
this.contentWindow.__container__ = this; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Use case: returning pdf as blob from XHR request, | |
for example when the endpoint is secure and needs an Authorization header | |
NB: responseType on fetch for blobData has to be "blob". | |
PDF files are not UTF-8, they are binary, so otherwise fonts won't appear properly | |
*/ | |
const showFile = (blobData, reportName) => { | |
// Adapted from: https://blog.jayway.com/2017/07/13/open-pdf-downloaded-api-javascript/ | |
const fileName = reportName && `${ reportName }.pdf` || 'myreport.pdf'; |