Skip to content
This repository has been archived by the owner on Oct 8, 2019. It is now read-only.

Commit

Permalink
Small export history fixes (#580)
Browse files Browse the repository at this point in the history
* fix(Export): escape tx notes with quotes when exporting history

* style(Export): add padding to both sides of arrow icon
  • Loading branch information
jtormey authored and Sjors committed Aug 30, 2016
1 parent b647a1a commit 22c053e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/partials/export-history.jade
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ form(role="form" name="exportForm" ng-submit="submit()" autocomplete="off" noval
placeholder="{{'START_DATE'|translate}}"
required)
span.pxs.ti-calendar.pointer(ng-click="start.open=true")
i.ti-arrow-right.blue
i.ti-arrow-right.blue.pll.prl
p.input-group.flex-center
input.form-control(
type="text"
Expand Down
2 changes: 1 addition & 1 deletion assets/js/services/wallet.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -1132,7 +1132,7 @@ function Wallet ($http, $window, $timeout, $location, Alerts, MyWallet, MyBlockc
wallet.exportHistory = (start, end, active) => {
let json2csv = (json) => {
let headers = Object.keys(json[0]);
let makeRow = (obj) => `"${Object.keys(obj).map(key => obj[key]).join('","')}"`;
let makeRow = (obj) => JSON.stringify(Object.keys(obj).map(key => obj[key])).slice(1, -1);
return [headers.join(',')].concat(json.map(makeRow)).join('\n');
};

Expand Down
2 changes: 1 addition & 1 deletion tests/services/wallet_service_spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ describe "walletServices", () ->
spyOn(Wallet, 'getNote').and.callFake((hash) -> hash == 'asdf' && 'test_note')
spyOn($rootScope, '$broadcast')
Wallet.exportHistory().then (data) ->
expect(data).toEqual('sent,receive,tx,note\n"1","0","asdf","test_note"\n"0","2","qwer",""')
expect(data).toEqual('sent,receive,tx,note\n1,0,"asdf","test_note"\n0,2,"qwer",""')
done()
$rootScope.$digest()

Expand Down

0 comments on commit 22c053e

Please sign in to comment.