packages feed

hledger-web 1.16.1 → 1.16.2

raw patch · 7 files changed

+84/−55 lines, 7 filesdep ~hledgerdep ~hledger-libdep ~megaparsecPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: hledger, hledger-lib, megaparsec

API changes (from Hackage documentation)

Files

CHANGES.md view
@@ -1,6 +1,12 @@ User-visible changes in hledger-web. See also the hledger changelog. +# 1.16.2 2020-01-14++- add support for megaparsec 8 (#1175)++- fix add form completions (#1156)+ # 1.16.1 2019-12-03  - Drop old json dependency (#1190)
Hledger/Web/Widget/AddForm.hs view
@@ -13,7 +13,7 @@  import Control.Monad.State.Strict (evalStateT) import Data.Bifunctor (first)-import Data.List (dropWhileEnd, nub, sort, unfoldr)+import Data.List (dropWhileEnd, intercalate, nub, sort, unfoldr) import Data.Maybe (isJust) #if !(MIN_VERSION_base(4,13,0)) import Data.Semigroup ((<>))@@ -73,10 +73,6 @@   -- bindings used in add-form.hamlet   let descriptions = sort $ nub $ tdescription <$> jtxns j       journals = fst <$> jfiles j-      listToJsonArray :: [Text] -> Markup-      listToJsonArray = preEscapedString . escapeJSSpecialChars . show . toJSON-        where-          escapeJSSpecialChars = regexReplaceCI "</script>" "<\\/script>" -- #236    pure (validateTransaction dateRes descRes postRes, $(widgetFile "add-form")) @@ -97,6 +93,28 @@       , fieldView = error "Don't render using this!"       , fieldEnctype = UrlEncoded       }++    -- Used in add-form.hamlet+    toBloodhoundJson :: [Text] -> Markup+    toBloodhoundJson ts =+      -- This used to work, but since 1.16, it seems like something changed.+      -- toJSON ("a"::Text) gives String "a" instead of "a", etc.+      -- preEscapedString . escapeJSSpecialChars . show . toJSON+      preEscapedString $ concat [+        "[",+        intercalate "," $ map (+          ("{\"value\":" ++).+          (++"}").+          escapeJSSpecialChars .+          drop 7 .  -- "String "+          show .+          toJSON+          ) ts,+        "]"+        ]+      where+        -- avoid https://github.com/simonmichael/hledger/issues/236+        escapeJSSpecialChars = regexReplaceCI "</script>" "<\\/script>"  validateTransaction ::      FormResult Day
hledger-web.1 view
@@ -1,5 +1,5 @@ -.TH "hledger-web" "1" "December 2019" "hledger-web 1.16.1" "hledger User Manuals"+.TH "hledger-web" "1" "January 2020" "hledger-web 1.16.2" "hledger User Manuals"   @@ -51,123 +51,123 @@ Note: if invoking hledger-web as a hledger subcommand, write \f[C]--\f[R] before options, as shown in the synopsis above. .TP-.B \f[C]--serve\f[R]+\f[B]\f[CB]--serve\f[B]\f[R] serve and log requests, don\[aq]t browse or auto-exit .TP-.B \f[C]--serve-api\f[R]+\f[B]\f[CB]--serve-api\f[B]\f[R] like --serve, but serve only the JSON web API, without the server-side web UI .TP-.B \f[C]--host=IPADDR\f[R]+\f[B]\f[CB]--host=IPADDR\f[B]\f[R] listen on this IP address (default: 127.0.0.1) .TP-.B \f[C]--port=PORT\f[R]+\f[B]\f[CB]--port=PORT\f[B]\f[R] listen on this TCP port (default: 5000) .TP-.B \f[C]--base-url=URL\f[R]+\f[B]\f[CB]--base-url=URL\f[B]\f[R] set the base url (default: http://IPADDR:PORT). You would change this when sharing over the network, or integrating within a larger website. .TP-.B \f[C]--file-url=URL\f[R]+\f[B]\f[CB]--file-url=URL\f[B]\f[R] set the static files url (default: BASEURL/static). hledger-web normally serves static files itself, but if you wanted to serve them from another server for efficiency, you would set the url with this. .TP-.B \f[C]--capabilities=CAP[,CAP..]\f[R]+\f[B]\f[CB]--capabilities=CAP[,CAP..]\f[B]\f[R] enable the view, add, and/or manage capabilities (default: view,add) .TP-.B \f[C]--capabilities-header=HTTPHEADER\f[R]+\f[B]\f[CB]--capabilities-header=HTTPHEADER\f[B]\f[R] read capabilities to enable from a HTTP header, like X-Sandstorm-Permissions (default: disabled) .PP hledger input options: .TP-.B \f[C]-f FILE --file=FILE\f[R]+\f[B]\f[CB]-f FILE --file=FILE\f[B]\f[R] use a different input file. For stdin, use - (default: \f[C]$LEDGER_FILE\f[R] or \f[C]$HOME/.hledger.journal\f[R]) .TP-.B \f[C]--rules-file=RULESFILE\f[R]+\f[B]\f[CB]--rules-file=RULESFILE\f[B]\f[R] Conversion rules file to use when reading CSV (default: FILE.rules) .TP-.B \f[C]--separator=CHAR\f[R]+\f[B]\f[CB]--separator=CHAR\f[B]\f[R] Field separator to expect when reading CSV (default: \[aq],\[aq]) .TP-.B \f[C]--alias=OLD=NEW\f[R]+\f[B]\f[CB]--alias=OLD=NEW\f[B]\f[R] rename accounts named OLD to NEW .TP-.B \f[C]--anon\f[R]+\f[B]\f[CB]--anon\f[B]\f[R] anonymize accounts and payees .TP-.B \f[C]--pivot FIELDNAME\f[R]+\f[B]\f[CB]--pivot FIELDNAME\f[B]\f[R] use some other field or tag for the account name .TP-.B \f[C]-I --ignore-assertions\f[R]+\f[B]\f[CB]-I --ignore-assertions\f[B]\f[R] ignore any failing balance assertions .PP hledger reporting options: .TP-.B \f[C]-b --begin=DATE\f[R]+\f[B]\f[CB]-b --begin=DATE\f[B]\f[R] include postings/txns on or after this date .TP-.B \f[C]-e --end=DATE\f[R]+\f[B]\f[CB]-e --end=DATE\f[B]\f[R] include postings/txns before this date .TP-.B \f[C]-D --daily\f[R]+\f[B]\f[CB]-D --daily\f[B]\f[R] multiperiod/multicolumn report by day .TP-.B \f[C]-W --weekly\f[R]+\f[B]\f[CB]-W --weekly\f[B]\f[R] multiperiod/multicolumn report by week .TP-.B \f[C]-M --monthly\f[R]+\f[B]\f[CB]-M --monthly\f[B]\f[R] multiperiod/multicolumn report by month .TP-.B \f[C]-Q --quarterly\f[R]+\f[B]\f[CB]-Q --quarterly\f[B]\f[R] multiperiod/multicolumn report by quarter .TP-.B \f[C]-Y --yearly\f[R]+\f[B]\f[CB]-Y --yearly\f[B]\f[R] multiperiod/multicolumn report by year .TP-.B \f[C]-p --period=PERIODEXP\f[R]+\f[B]\f[CB]-p --period=PERIODEXP\f[B]\f[R] set start date, end date, and/or reporting interval all at once using period expressions syntax .TP-.B \f[C]--date2\f[R]+\f[B]\f[CB]--date2\f[B]\f[R] match the secondary date instead (see command help for other effects) .TP-.B \f[C]-U --unmarked\f[R]+\f[B]\f[CB]-U --unmarked\f[B]\f[R] include only unmarked postings/txns (can combine with -P or -C) .TP-.B \f[C]-P --pending\f[R]+\f[B]\f[CB]-P --pending\f[B]\f[R] include only pending postings/txns .TP-.B \f[C]-C --cleared\f[R]+\f[B]\f[CB]-C --cleared\f[B]\f[R] include only cleared postings/txns .TP-.B \f[C]-R --real\f[R]+\f[B]\f[CB]-R --real\f[B]\f[R] include only non-virtual postings .TP-.B \f[C]-NUM --depth=NUM\f[R]+\f[B]\f[CB]-NUM --depth=NUM\f[B]\f[R] hide/aggregate accounts or postings more than NUM levels deep .TP-.B \f[C]-E --empty\f[R]+\f[B]\f[CB]-E --empty\f[B]\f[R] show items with zero amount, normally hidden (and vice-versa in hledger-ui/hledger-web) .TP-.B \f[C]-B --cost\f[R]+\f[B]\f[CB]-B --cost\f[B]\f[R] convert amounts to their cost at transaction time (using the transaction price, if any) .TP-.B \f[C]-V --value\f[R]+\f[B]\f[CB]-V --value\f[B]\f[R] convert amounts to their market value on the report end date (using the most recent applicable market price, if any) .TP-.B \f[C]--auto\f[R]+\f[B]\f[CB]--auto\f[B]\f[R] apply automated posting rules to modify transactions. .TP-.B \f[C]--forecast\f[R]+\f[B]\f[CB]--forecast\f[B]\f[R] apply periodic transaction rules to generate future transactions, to 6 months from now or report end date. .PP@@ -178,13 +178,13 @@ .PP hledger help options: .TP-.B \f[C]-h --help\f[R]+\f[B]\f[CB]-h --help\f[B]\f[R] show general usage (or after COMMAND, command usage) .TP-.B \f[C]--version\f[R]+\f[B]\f[CB]--version\f[B]\f[R] show version .TP-.B \f[C]--debug[=N]\f[R]+\f[B]\f[CB]--debug[=N]\f[B]\f[R] show debug output (levels 1-9, default: 1) .PP A \[at]FILE argument will be expanded to the contents of FILE, which
hledger-web.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: e75b2c52f9b849b13eff2f1b6d6c15c8c0d6ffcaa24883475a63d8743c2cbfa9+-- hash: 4c599d719d293cac5bb59f0e672d9aaf251a5a548a7010c5b8155f557bd56895  name:           hledger-web-version:        1.16.1+version:        1.16.2 synopsis:       Web interface for the hledger accounting tool description:    This is hledger's web interface.                 It provides a more user-friendly and collaborative UI than the@@ -151,7 +151,7 @@   hs-source-dirs:       ./.   ghc-options: -Wall -fwarn-tabs -Wcompat -Wincomplete-uni-patterns -Wincomplete-record-updates -Wredundant-constraints-  cpp-options: -DVERSION="1.16.1"+  cpp-options: -DVERSION="1.16.2"   build-depends:       Decimal     , aeson@@ -169,12 +169,12 @@     , directory     , filepath     , hjsmin-    , hledger >=1.16.1 && <1.17-    , hledger-lib >=1.16.1 && <1.17+    , hledger >=1.16.2 && <1.17+    , hledger-lib >=1.16.2 && <1.17     , http-client     , http-conduit     , http-types-    , megaparsec >=7.0.0 && <8+    , megaparsec >=7.0.0 && <8.1     , mtl >=2.2.1     , semigroups     , shakespeare >=2.0.2.2@@ -206,7 +206,7 @@   hs-source-dirs:       app   ghc-options: -Wall -fwarn-tabs -Wcompat -Wincomplete-uni-patterns -Wincomplete-record-updates -Wredundant-constraints-  cpp-options: -DVERSION="1.16.1"+  cpp-options: -DVERSION="1.16.2"   build-depends:       base     , hledger-web
hledger-web.info view
@@ -1,9 +1,9 @@-This is hledger-web.info, produced by makeinfo version 6.5 from stdin.+This is hledger-web.info, produced by makeinfo version 6.7 from stdin.   File: hledger-web.info,  Node: Top,  Next: OPTIONS,  Up: (dir) -hledger-web(1) hledger-web 1.16.1+hledger-web(1) hledger-web 1.16.2 *********************************  hledger-web is hledger's web interface.  It starts a simple web@@ -352,3 +352,8 @@ Ref: #json-api9770  End Tag Table+++Local Variables:+coding: utf-8+End:
hledger-web.txt view
@@ -357,4 +357,4 @@   -hledger-web 1.16.1               December 2019                  hledger-web(1)+hledger-web 1.16.2               January 2020                   hledger-web(1)
templates/add-form.hamlet view
@@ -1,7 +1,7 @@ <script>   jQuery(document).ready(function() {     descriptionsSuggester = new Bloodhound({-      local:#{listToJsonArray descriptions},+      local:#{toBloodhoundJson descriptions},       limit:100,       datumTokenizer: function(d) { return [d.value]; },       queryTokenizer: function(q) { return [q]; }@@ -9,7 +9,7 @@     descriptionsSuggester.initialize();      accountsSuggester = new Bloodhound({-      local:#{listToJsonArray (journalAccountNamesDeclaredOrImplied j)},+      local:#{toBloodhoundJson (journalAccountNamesDeclaredOrImplied j)},       limit:100,       datumTokenizer: function(d) { return [d.value]; },       queryTokenizer: function(q) { return [q]; }