-
Notifications
You must be signed in to change notification settings - Fork 326
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
Download Brew Source as Text File #1198
Conversation
Add detailed MongoDB Install instructions
Eliminate requirement to CD into project directory prior to running `npm start` or `node server.js`.
Adds a RC.d daemon script to control the HomeBrewery status. Based on Andrew Pearson's Node-RED script for the same purpose.
Switch to latest version of MongoDB
Add config items and default values: - web_port (8001) - environment (local)
Remove environment variables from rc.d as they are now in config/default.json.
Change to setting NODE_ENV; default to 'local' if not set via environment variable or in the config file.
Remove --force option from `npm audit fix`. While this has not caused any issues to date, there is no guarantee that it will continue to be the case.
Initial write up of install instructions. Includes instruction to `wget` from the `naturalcrit/homebrewery` project rather than the FreeBSD fork, on the assumption that the PR will be merged at some point.
Change to main project repo, on assumption that the PR will be merged at some point
Change of install directory to `/usr/local/homebrewery`
Add `dev_mode` to the HomeBrewery service, which starts the HomeBrewery project in live rebuild mode.
Eliminating unnecessary debugging code, reducing line count and making lint happy :)
Lint is happy, now attempting to pacify CircleCI
Change default port assignment from 8000 to 8001 in config.json and FreeBSD service config
Change to enable use of rcvars for NODE_ENV and PORT
Switch to latest version of MongoDB
Add config items and default values: - web_port (8001) - environment (local)
Remove environment variables from rc.d as they are now in config/default.json.
Change to setting NODE_ENV; default to 'local' if not set via environment variable or in the config file.
Remove --force option from `npm audit fix`. While this has not caused any issues to date, there is no guarantee that it will continue to be the case.
Change to main project repo, on assumption that the PR will be merged at some point
Change of install directory to `/usr/local/homebrewery`
Add `dev_mode` to the HomeBrewery service, which starts the HomeBrewery project in live rebuild mode.
… the brew for the source page. Moved `source` page generation function to a new function module. Added option to function to create plain text download with a sanitized filename and made it accessible from a new page: `download`. Added the `download` item to the BrewItem so it appears on each brew on the User page. Added `sanitize-filename` dependency to `package.json`.
…tter describes it's actual function
Remove new function from `Homebrew.Model.js` Remove `sourceFunctions.jsx` module
Shifted the functions back into
|
…tem.jsx to eliminate white flash on User page when clicking link to download source of a brew.
…ways visible. Adjust eslint line in `server.js` to re-enable the test with a slightly higher maximum value.
Login system now working, including Google linking. Download confirmed working identically for Google-stored brews as it does for locally stored brews. Discussion points:
|
…wery and Google brews. Concats switched to string literals to make Linter happy.
|
@G-Ambatte Just need the config value for Gonna try to trim down the Server.js since a lot of stuff is duplicated between HB and Google brews (replacing |
I was using "Homebrewery' but Gazook89 suggested "HB", which I have no objections to. From memory, I moved it to a config item so it could easily be changed later but also so I didn't actually have to make that decision at the time. |
Ok. I'm just cleaning up the duplicated functions a bit and then this can merge and go out with v2.11.0 |
Download Brew Source
Purpose
The purpose of this branch is to allow users to download the source of a brew as a plain text file.
Work Completed So Far
download
) to get the Brew source using its IDConsiderations
sourceFunctions.jsx
in thesharePage
directory. It seemed logical to also move the code for the existing "source" page here as well, as large portions of the two functions are identical.Conclusion
This functionality has been requested previously (e.g. #1129, or this workaround in JS from Reddit). This also goes some way towards a user being able to download all of their brews at once, either as several text files or a single ZIP archive.
It's probably not the cleanest code I've ever written and it's well past midnight so I'm doing this with only one eye opened as I write this PR, so I'd appreciate any feedback that you might have.
-- G
EDIT: These changes should also fix the issue reported with the unmodified ampersand in the HTML source as reported in issue #1188. I added the check and replacement strings as a key/value array, so it should simplify adding any further items to be replaced in the future, if any more should be discovered.