-
-
Notifications
You must be signed in to change notification settings - Fork 321
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
web: Import & export, permissions from CLI or headers #821
web: Import & export, permissions from CLI or headers #821
Conversation
I forgot to mention - there are no immediate eye catching differences. Only when you start it with |
Ok, building with |
Looks good! Thank you! Providing an invalid capability name to --capability causes it to serve "Internal Server Error", it should give a command-line error. When started without the view capability, perhaps it could also hide the journal's file name. --capability sounds like the right technical term, but I don't love it for the user experience. Is there something more friendly and familiar - --access, --permission[s], ... ? I will go ahead and merge, as a release is due tomorrow. I will just say the addform (and perhaps the others in the past) were in the default template for a reason: to make them always available so that you could hit a to start data entry no matter where you navigate in the app. Lack of this may become more noticeable if we add more screens. But perhaps the old way was ugly and unsustainable. |
PS I see this does even more than I noticed, I'll have to read the linked issues. And, I forgot about docs. We should document the changes in the hledger-web manual (and the web help dialog if you think it appropriate). |
I think I also misread the CI status.
After that we should also check |
I'll respond more in the evening but for now - |
Nevermind, I don't remember changing the testsuite - I only recall considering removing it, as right now, it is AFAIK useless. |
@zarybnicky: I disabled hledger-web's test suite for now. How would you feel about changing the zero toggle key to Z, for consistency with hledger-ui and to free up the valuable e/E keys for edit operations ? See #641 (comment) for more context. |
@simonmichael I was about to get into this again, at least for today :)
Yes, I saw that comment earlier today. I have no strong feelings either way, I'll include
Currently, the tests do nothing even if they compile (well, they test that the app starts at all...). I'm not sure how valuable
Will look into it.
An oversight on my part, I knew I forgot something...
See #834, which I've opened for further discussion.
I'm aware of that. I've tried leaving it in, but Bloodhound (the JS auto-completion library) refused to work when there were two addForms on the page (on /add, after POSTing a badly filled out add form). I'm sure there's a way to fix that, but supporting two add forms on a single page requires a lot of JS changes - this was simply the easier solution. What I could add is a Edit: Oh, and docs, that's another thing. |
Oh, wow. I never saw this PR. I need to look at updating the Sandstorm package! |
@ocdtrekkie If you do, can you look if the protobuf settings for permissions are correct? I meant to look into testing Sandstorm before, but I never got around to it... |
Yeah, I've got a big to-do backlog at the moment, but I'd absolutely test those out. |
More or less a complete overhaul of hledger-web - the diff is quite scary...
I've attempted to split it into well-defined commits but at the end, I was moving around large chunks of code, so the resulting diff is more-or-less "delete everything & write it anew"...
I've added two new CLI flags:
--capabilities
, which statically controls the capabilities of the application, and--capabilities-header
, which overrides the previous flag and enables reading the (comma-separated) capabilities from the header given as a parameter.Also, I've resurrected, finished, and refactored the import and edit forms (of which only one of them had been working at all, not sure which one), added a separate 'Manage journal files' page with a list of all the files the current journal is composed of (and edit/upload/download buttons for each of them).
In addition, having all of the forms as separate endpoints for both GET and POST plays well with yesod-form's error messages - after submitting the add form, I redirect the user to /add (with just the add form), where the error message is displayed next to the relevant field.
This PR also addresses a few other issues:
I haven't actually tested it on Sandstorm, only locally - I haven't really looked into what's needed for that. I've defined the permissions in the
*.capnproto
file, edited thelauncher.sh
file, so the only thing remaining is to test it. I've however ran out of time in the short term, so I've finished all the changes to code and opened this PR...