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

only display time range in statement PDF when range is available (#6896, #6897) #6933

Merged
merged 2 commits into from
Feb 16, 2017
Merged

Conversation

willy-b
Copy link
Contributor

@willy-b willy-b commented Jan 30, 2017

Test Plan

  • either have a payment history or generate one with npm run add-simulated-payment-history
  • open Brave -> Preferences -> Payments (or navigate to about:preferences#payments)
  • click "View Payment History"
  • open your first payment receipt PDF
  • observe there is no date range present
  • open a later payment receipt PDF
  • observe a time range is present

Description

for #6896
(replaces and comes from discussion in #6897 and in https://github.com/willy-b/browser-laptop/commit/a510c87d1598b6e75043bf2924e36643355e4e7e#commitcomment-20667505 , where @mrose17 reviewed this change)

Example: Two consecutive statements

  • where 1st has no time range (since 1st payment):
    statementpdf_norange

  • 2nd does have a time range (begins with date of last statement):
    statementpdf_yesrange

Willy added 2 commits January 29, 2017 19:41
- 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
…lable

if this is the 1st payment in the payment history, do not display statement date range, per @NejcZdovc / @mrose17 suggestion

fixes #6897
@@ -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')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@willy-b - what's the motivation behind this change, i think it might break some other tests...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question, @mrose17. This change ensures Brave has the right path to ledger-state.json when NODE_ENV is set to development.

Reason:
For these utility scripts, the userData path is retrieved via app.getPath(\"userData\") run in ./tools/lib/utilApp/index.js (three directory levels removed from the base of the repo).
Before this change, ./tools/utilAppRunner.js was running brave with --user-data-dir=brave-development, which would cause Brave to look in ./tools/lib/utilApp/brave-development instead of ./brave-development.

What tests do you think it might break?

@bsclifton
Copy link
Member

bsclifton commented Feb 9, 2017

@mrose17 have you had a chance to check this PR out? (test it out, etc) Once it's in a state that you approve of, I'll gladly review / check tests and if good to go, merge 😄

@bsclifton bsclifton closed this Feb 16, 2017
@bsclifton bsclifton reopened this Feb 16, 2017
@mrose17
Copy link
Member

mrose17 commented Feb 16, 2017

it is fine for merge.

@bsclifton
Copy link
Member

Most tests passed CI; the ones that didn't I re-ran. Some (like punycode) are perma-failing... but not related to this change. Merging 😄

@bsclifton bsclifton merged commit 8222db4 into brave:master Feb 16, 2017
@mrose17
Copy link
Member

mrose17 commented Feb 16, 2017

thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants