From 117aefcf0527a6fc3d7e34983db209a2ebcdef49 Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Wed, 17 Jun 2020 19:50:01 -0500 Subject: [PATCH] Partial export processing --- src/components/InfoDetails/InfoDetails.js | 38 ++++++- src/containers/SkynetExport/SkynetExport.js | 108 +++++++++++++------- src/helpers.js | 42 ++++++++ src/renderer/ipc/SkynetIPC.js | 21 +++- 4 files changed, 163 insertions(+), 46 deletions(-) diff --git a/src/components/InfoDetails/InfoDetails.js b/src/components/InfoDetails/InfoDetails.js index 0678c2a..aaf52fc 100644 --- a/src/components/InfoDetails/InfoDetails.js +++ b/src/components/InfoDetails/InfoDetails.js @@ -20,16 +20,46 @@ const mapDispatchToProps = dispatch => { export default connect(mapStateToProps, mapDispatchToProps)(props => { let msg = props.InfoMessage.message; const classes = ['InfoDetailsContent']; - if (props.InfoMessage.message.startsWith('!alternate!')) { - classes.push('Alternate'); - msg = props.InfoMessage.message.substr('!alternate!'.length) + + let changed = true; + let copyable = false; + while (changed) { + changed = false; + if (msg.startsWith('!alternate!')) { + classes.push('Alternate'); + msg = msg.substr('!alternate!'.length); + changed = true; + } + if (msg.startsWith('!copyable!')) { + classes.push('Copyable'); + msg = msg.substr('!copyable!'.length); + copyable = changed = true; + } } + const scrollToTop = textArea => { + if (!textArea.firstClick) { + textArea.firstClick = true; + textArea.scrollTop = 0; + textArea.setSelectionRange(0, 0); + } + }; + return (

{props.InfoMessage.title}

-

{msg}

+ { + copyable ? ( +