-
Notifications
You must be signed in to change notification settings - Fork 329
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
Add Route for external tool access #1532
Conversation
…document via URL
What happens if ..
|
This re-uses the existing |
Yes. So we need to be clear on whether this route is to be used as an API (in which case it should instead be returning a json resource) or whether it should produce an user-editing environment (in which case it should alter the eventual document.location so a refresh doesn't destroy any user edits). This is similar to the #1499 issue. |
I floated this idea briefly on Gitter, but what if we went in the opposite direction? Disable autosaves (with a big warning bar) so that nothing is stored in Unfortunately the problem with that last sentence is the word that starts with "s". An alternate idea along a similar line would be to lock the Editor on Cloned and Templated Brews, so the only way to unlock it for editing is to save a unique copy first (thus redirecting to the
Based on previous discussions with @calculuschild, I don't believe the intention is to allow external tools to write brews to the HB database directly; but rather to allow the production of a brew which the user may then save/print/whatever at their own discretion. |
I'm uncomfortable with disabling localStorage saving. It is there as a safety net for those brave folk that work for hours on their masterpiece before hitting the save button. If anything, the
|
Agree, rollout of an API to facilitate 3rd-party tools to integrate deserves deeper thought. Started a discussion: #1538 |
I could see this working; on "Yes", update Or, an alternate line of thought: Clones/Templates could save to a different <!- When I was working on #1534 last night, I used |
@G-Ambatte A problem with relying on encoding in the URL is we are limited to something like 2048 characters. That doesn't stretch very far. We probably need to rely on using a homebrewery/server/homebrew.api.js Lines 41 to 42 in 09ca2a4
So instead of looking up a brew object from the database by ID or anything, we already have an object provided by the 3rd party. 3rd party can then just make a button or something using a simple HTML form if they don't want to implement a javascript solution (from stackExchange):
|
Closing. This needs further discussion on the underlying issue to make sure how/whether this needs to be handled going forward. |
This PR adds a
/template
route, which will allow external apps to create a Homebrewery document via URL. This is achieved by allowingtext
,style
,title
, anddescription
to be set via parameters in the URL query.