From 33bcdda9a45e347414cdb2ee4ea2142cfa4a3027 Mon Sep 17 00:00:00 2001 From: Willy Date: Sun, 29 Jan 2017 19:09:44 -0500 Subject: [PATCH 1/2] Fix "npm run add-simulated-payment-history" script - fix path to "ledger-state.json" for "NODE_ENV=development" "app.getPath(\"userData\")" runs in "./tools/lib/utilApp/index.js" and "./tools/utilAppRunner.js" was running brave with "--user-data-dir=brave-development" causing brave to look in "./tools/lib/utilApp/brave-development" instead of "./brave-development" - fix parsing of optional argument for # of payments to simulate --- tools/lib/utilApp/index.js | 2 +- tools/utilAppRunner.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/lib/utilApp/index.js b/tools/lib/utilApp/index.js index 59ac0f1e976..b41f337435a 100644 --- a/tools/lib/utilApp/index.js +++ b/tools/lib/utilApp/index.js @@ -54,7 +54,7 @@ app.on('ready', () => { cleanUserData(process.argv[3]) break case 'addSimulatedLedgerTransactions': - addSimulatedLedgerTransactions(process.argv[3]) + addSimulatedLedgerTransactions(parseInt(process.argv[3])) break case 'addSimulatedSynopsisVisits': addSimulatedSynopsisVisits(process.argv[3]) diff --git a/tools/utilAppRunner.js b/tools/utilAppRunner.js index 3c073a0271c..f2f2db52f27 100644 --- a/tools/utilAppRunner.js +++ b/tools/utilAppRunner.js @@ -14,7 +14,7 @@ function runUtilApp (cmd, file, stdioOptions) { } cmd = cmd.split(' ') if (process.env.NODE_ENV === 'development') { - cmd.push('--user-data-dir=brave-development') + cmd.push('--user-data-dir=../../../brave-development') } const utilApp = proc.spawnSync('electron', [utilAppDir].concat(cmd), options) if (utilApp.error) { From a9e3f279880b007fe1369ee87f6d73e29587317f Mon Sep 17 00:00:00 2001 From: Willy Date: Sun, 29 Jan 2017 20:06:02 -0500 Subject: [PATCH 2/2] make PDF statement only display contribution range when range is available if this is the 1st payment in the payment history, do not display statement date range, per @nejczdovc / @mrose17 suggestion fixes #6897 --- js/about/contributionStatement.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/js/about/contributionStatement.js b/js/about/contributionStatement.js index 096026c6357..9ebe2631825 100644 --- a/js/about/contributionStatement.js +++ b/js/about/contributionStatement.js @@ -262,12 +262,19 @@ class ContributionStatement extends ImmutableComponent { return pages } + get contributionDateRangeString () { + if (this.lastContributionHumanFormattedDate !== '') { + return (this.lastContributionHumanFormattedDate + ' - ' + this.thisContributionHumanFormattedDate) + } + return null + } + ContributionStatementDetailTable (page, pageIdx, totalPages) { return (
- { this.lastContributionHumanFormattedDate } - { this.thisContributionHumanFormattedDate } + { this.contributionDateRangeString }