Skip to content

Commit

Permalink
## Which problem is this PR solving?
Browse files Browse the repository at this point in the history
- Resolves #663

## Short description of the changes
- Add a button with download functionality

Signed-off-by: katarzyna <katarzyna@smaato.com>
  • Loading branch information
Katarzyna-B committed Mar 21, 2023
1 parent 2485d34 commit e1eb059
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ type Props = {

export default function DownloadResults(props: Props) {
const { onDownloadResultsClicked } = props;
const downloadBtn = (
<Button className="ub-ml2" htmlType="button" onClick={onDownloadResultsClicked}>
Download Results
</Button>
return (
<Button className="ub-ml2" htmlType="button" onClick={onDownloadResultsClicked}>
Download Results
</Button>
);
return <>{downloadBtn}</>;
}
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export class UnconnectedSearchResults extends React.PureComponent<SearchResultsP
const file = new Blob([JSON.stringify(this.props.rawTraces)], { type: 'application/json' });
const element = document.createElement('a');
element.href = URL.createObjectURL(file);
element.download = 'traces-' + Date.now() + '.json';
element.download = `traces-${Date.now()}.json`;
document.body.appendChild(element);
element.click();
URL.revokeObjectURL(element.href);
Expand Down

0 comments on commit e1eb059

Please sign in to comment.