Commit Graph

327 Commits

Author SHA1 Message Date
Simon Michael
311be367b0 ;doc: cli: simplify, use generic help flags again 2024-05-31 19:54:18 -10:00
Simon Michael
c5f8444627 feat: hledger's tldr pages are now built in, accessible via --tldr
And a few cleanups/fixes related to flag processing.
The help flags are now listed in order of precedence.
2024-05-29 15:32:19 -10:00
Simon Michael
82230e5a1f imp: cli: end help output with a blank line 2024-05-29 14:45:04 -10:00
Simon Michael
f88aa8f871 imp: cli: --info before --man 2024-05-29 09:37:20 -10:00
Simon Michael
a366f3aeaa imp: ui, web, cli, all cli commands now show the general flags grouped
And cli/ui/web each have their own more specific help flags.
2024-05-29 09:37:19 -10:00
Simon Michael
d17b32c7eb imp: cli,ui,web: support ghc-debug for analysing memory/profile info
When built with the ghcdebug flag and started with --debug=-1 (or -2
to pause at startup, or -3 to pause before exit), hledger can be
controlled by ghc-debug clients like ghc-debug-brick or a custom
ghc-debug query script.

Also, refactor version string code.
2024-05-01 13:43:04 -10:00
Simon Michael
23d13c9a9f imp: web: support base64 >=1.0 2024-04-25 06:51:34 -10:00
Simon Michael
bac7171454 imp:web: show zero amounts with their commodity symbol(s?) [#2140]
This was mainly to make the sidebar more informative,
but also affects and hopefully helps, all amounts displayed elsewhere.
2024-03-01 22:51:48 -10:00
Simon Michael
df79aa5e35 dev: distinguish oneLineFmt and oneLineNoCostFmt; add fullZeroFmt 2024-01-23 21:35:06 -10:00
Simon Michael
0cb382cf0e dev: rename AmountDisplayOpts -> AmountFormat, and related constants
noColour          -> defaultFmt
noCost            -> noCostFmt
oneLine           -> oneLineFmt
csvDisplay        -> machineFmt
2024-01-23 21:35:06 -10:00
Simon Michael
ca55c2f0f8 dev: rename other Price helpers to Cost
showAmountWithoutPrice             -> showAmountWithoutCost
mixedAmountStripPrices             -> mixedAmountStripCosts
showMixedAmountWithoutPrice        -> showMixedAmountWithoutCost
showMixedAmountOneLineWithoutPrice -> showMixedAmountOneLineWithoutCost
2024-01-23 21:35:06 -10:00
Simon Michael
2a99b3d456 imp: stack: build with ghc 9.8, latest stackage nightly 2024-01-04 08:24:50 -10:00
Simon Michael
60f7896dd5 fix:web: drop non-working --file-url option for now [#2139] 2023-12-15 13:58:25 -10:00
Simon Michael
13ebf18d24 fix:web: make --base-url work again [#2127], [#2100] 2023-12-15 13:58:25 -10:00
Simon Michael
14a9ab5f28 dev:web:docs 2023-12-15 13:58:25 -10:00
Simon Michael
e81430f05b dev:web: rename makeFoundation* to makeApp* 2023-12-15 13:58:25 -10:00
Simon Michael
8e0370bd58 dev:web: rename Hledger.Web.Foundation to Hledger.Web.App 2023-12-15 13:58:25 -10:00
Simon Michael
0396725e71 dev:web: cleanup 2023-12-15 13:58:25 -10:00
Simon Michael
d5b967834f dev:web: add tests: --base-url, --file-url (disabled) [#2127], [#2139] 2023-12-15 13:58:22 -10:00
Simon Michael
9c56ed1104 imp!:web:tests: respect options when running tests
The hledger-web tests have been cleaned up and now allow more testing
of command line options like (though still not everything).

Note tests now run the app listening on its default host and port,
127.0.0.1 and 5000, instead of "any IPv4 or IPv6 hostname" and 3000.
This would seem to mean hledger-web tests can conflict more with
things running on port 5000, eg a normal hledger-web instance, but I
haven't been able to reproduce it.
2023-12-15 09:57:01 -10:00
Simon Michael
80ebd18d08 imp:web: more accurate startup messages, eg with --socket [#2127] 2023-12-14 17:58:25 -10:00
Simon Michael
569d2c8e5f doc:web: clean up options and manual [#2134] 2023-12-14 15:31:49 -10:00
Simon Michael
862b7e5712 dev: clarify AmountDisplayOpts, add a new flag for symbol display 2023-12-07 23:35:50 -10:00
Simon Michael
5ee2139f18 imp: web: round amounts to display precision as before (precisiongeddon) 2023-11-14 13:26:06 -08:00
Simon Michael
2ba321885d dev:web: refactor permission checking 2023-10-25 12:51:08 +01:00
Simon Michael
795dbd97f8 imp:web: cleanups; use --allow on Sandstorm (#834) 2023-10-24 13:37:36 +01:00
Simon Michael
95d33f20f6 imp:web: access control UX cleanups (fix #834)
Changes:

1. rename the sandstorm "manage" permission to "edit"
(old permission names: view, add, manage;
 new permission names: view, add, edit).

Rationale: "edit" best describes this permission's current powers, to users and to operators.
If we ever added more manager-type features we'd want that to be a new permission,
not a rename of the existing one (which would change the powers of existing users).

2. rename the sandstorm roles for consistency with permissions
(old role names: viewer, editor, manager;
 new role names: viewer, adder, editor)

Rationale: it's needed to avoid confusion.

3. add a new option: --allow=view|add|edit|sandstorm (default: add).
'sandstorm' sets permissions according to the X-Sandstorm-Permissions header.
Drop the --capabilities and --capabilities-header options.

Rationale: it's simpler and more intuitive.

4. replace "capability" with "permission" in ui/docs/code.

Rationale: consistent with the above, more familiar.
2023-10-24 13:37:36 +01:00
Simon Michael
b6a0ecd424 fix:web: check options like --capabilities before starting the app 2023-10-21 08:54:44 +01:00
Simon Michael
9b8044f737 fix:web:edit form: fix broken "File format help" link (fix #2103)
Now not broken, https rather than http, and pointing to the "Data
formats" section, which has links to each of the file formats
(in case editing a non-journal file).
2023-10-21 03:36:04 +01:00
Philipp Klocke
6312446cbf web: Use guessAppRootOr to enable relative root if desired (fix #2099)
This is useful when serving on 0.0.0.0, such that querying from any
other device with <IP>:<PORT> does not fallback to 0.0.0.0:PORT,
which would fail.

Tested: Manually
2023-10-20 09:25:31 +01:00
S. Zeid
ac547142ae imp: web: include adeclarationinfo in accounts JSON 2023-10-13 09:33:36 +01:00
Simon Michael
fffae7f578 ;doc: main module haddock cleanups 2023-10-04 10:03:35 +01:00
Simon Michael
40037afaf1 lib!: export less from cli and web packages, and more from ui 2023-10-04 10:03:35 +01:00
Simon Michael
147d49c66c dev: cln: drop Hledger.Data.RawOptions.inRawOpts 2023-05-09 10:02:24 -10:00
Simon Michael
559f436d3e dev: web: refactor: ViewData q, m -> qparam, q 2023-05-01 13:23:33 -10:00
Simon Michael
981ebb6518 fix: web: a startup depth limit now works, does not hide txns (fix #1763) 2023-05-01 13:11:03 -10:00
Simon Michael
9c4b5a26fa imp: ui, web: use a pager to show command line help, like cli 2023-04-06 15:36:08 -10:00
Simon Michael
fa70f160ae imp: partial/inferred dates are flexible, full dates are not (#1982)
DateSpans are now now aware of exact/flexible dates.
2023-02-17 07:24:19 -10:00
Chris Lemaire
97f15eac03 Fix failing hledger-web test
This test appeared to have failed after adding source positions to
generated transactions. This is because the generated transaction id for
web pages appears to be dependent on whether the transaction has an
associated source file. Because it has one associated now, the id was
updated to be 'transaction-2-1' for instance, instead of
'transaction-0-1' as it would have been before. The fix is to change the
test.
2023-01-21 23:24:43 +01:00
Simon Michael
ae87b1efd5 fix: web: add form's typeahead now shows non-ascii text correctly (#1961)
(Fix contributed by Arsen Arsenović)
2022-12-16 12:48:42 -10:00
Simon Michael
ace185f7d2 ;doc: update old manual links 2022-12-10 18:56:47 -10:00
Simon Michael
c25c5cef44 fix: make no-argument --debug flag work with ui & web also 2022-11-03 08:13:58 -10:00
Simon Michael
07cb6bdc80 fix: web: add: don't fail when there's no file field (#1932) 2022-09-14 08:16:49 -10:00
Simon Michael
c97e05e0dd imp: web: add form: layout improvements, use available space 2022-08-27 12:12:57 +01:00
Simon Michael
3b2999ee29 fix: web: add form: allow empty description 2022-08-26 12:00:23 +01:00
Simon Michael
d718f2c50c fix: web: add form: re-enable the file field (#1229)
It was ignored since cc1241fa2 in 2018. Also simplify some types.
2022-08-26 11:29:22 +01:00
Simon Michael
6503bfec6a dev: web: clarify AddForm a bit (#1229) 2022-08-25 08:18:24 +01:00
Simon Michael
581831b16d dev: web: simplify types a little (#1229) 2022-08-25 08:13:02 +01:00
Simon Michael
c80c72d7cd dev: lib, cli, bin: enable/fix name shadowing warnings
And a few other cleanups.
2022-08-23 12:16:15 +01:00
Simon Michael
53332ee6a5 stack: re-enable hledger-web with ghc 9.2 2022-04-15 15:07:17 -10:00