(exportType, displayName)
| 11645 | } |
| 11646 | // Converts to dataExport type and calls dataExportHandler to deal with data |
| 11647 | createExport(exportType, displayName) { |
| 11648 | const final = (data)=>{ |
| 11649 | this.props.dataExportHandler(data, exportType, displayName); |
| 11650 | this.close(); |
| 11651 | }; |
| 11652 | const json = JSON.stringify(this.props.data, columnReplacer); |
| 11653 | switch(exportType){ |
| 11654 | case "json": |
| 11655 | final(json); |
| 11656 | break; |
| 11657 | case "csv": |
| 11658 | final((0, _exportDelimited.convertToDelimited)(JSON.parse(json), ",")); |
| 11659 | break; |
| 11660 | case "tsv": |
| 11661 | final((0, _exportDelimited.convertToDelimited)(JSON.parse(json), " ")); |
| 11662 | break; |
| 11663 | case "html": |
| 11664 | { |
| 11665 | const csv = (0, _exportDelimited.convertToDelimited)(JSON.parse(json), ","); |
| 11666 | const html = (0, _dataExporterHtml.embedHtml)(`${(0, _language.strings).appName} - ${escape(displayName)}`, embedScript(csv, displayName)); |
| 11667 | final(html); |
| 11668 | } |
| 11669 | } |
| 11670 | } |
| 11671 | close() { |
| 11672 | this.setState({ |
| 11673 | dialogHidden: true, |
no test coverage detected