From 22c053e82218186a46b3e389d669dc063aa33494 Mon Sep 17 00:00:00 2001 From: Justin Tormey Date: Tue, 30 Aug 2016 03:47:26 -0400 Subject: [PATCH] Small export history fixes (#580) * fix(Export): escape tx notes with quotes when exporting history * style(Export): add padding to both sides of arrow icon --- app/partials/export-history.jade | 2 +- assets/js/services/wallet.service.js | 2 +- tests/services/wallet_service_spec.coffee | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/partials/export-history.jade b/app/partials/export-history.jade index a992633beb..2101f94a6e 100644 --- a/app/partials/export-history.jade +++ b/app/partials/export-history.jade @@ -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" diff --git a/assets/js/services/wallet.service.js b/assets/js/services/wallet.service.js index b836de90b8..4756a829b5 100644 --- a/assets/js/services/wallet.service.js +++ b/assets/js/services/wallet.service.js @@ -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'); }; diff --git a/tests/services/wallet_service_spec.coffee b/tests/services/wallet_service_spec.coffee index 22bd9bf8b2..332908299c 100644 --- a/tests/services/wallet_service_spec.coffee +++ b/tests/services/wallet_service_spec.coffee @@ -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()