0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 16:22:44 +00:00
Commit Graph

120 Commits

Author SHA1 Message Date
Trevor Buckner
9d80f21ae7 Fix empty Google Brews crashing user page 2021-06-11 13:46:03 -04:00
Trevor Buckner
f80d5e6b52 Fix sanitizing brews in user page, hide own G brews on other profiles 2021-06-10 14:22:12 -04:00
Trevor Buckner
e67fadef02 Separate "style" and "metadata" panels 2021-06-05 15:58:31 -04:00
Trevor Buckner
d15bec08a3 Merge pull request #1282 from naturalcrit/ReduceRedundancyInServerJS
[WIP] Move common Server.js logic into functions
2021-03-27 23:43:11 -04:00
Trevor Buckner
a1dbf0f2e5 Popup warning when opening a trashed google brew 2021-03-20 23:33:22 -04:00
Trevor Buckner
2f094801ca Move "get brew" logic to common function
Also add centralized error handling middleware
2021-03-16 00:06:01 -04:00
Trevor Buckner
c4db94e86f Tweaks to work with current Master 2021-03-07 00:34:47 -05:00
Trevor Buckner
08492b943b Merge branch 'master' into pr/1198 2021-03-06 22:42:15 -05:00
G.Ambatte
481c9f067c Fix title issue (#1251)
* Maximum title length set to 100 characters.

* Reverse unnecessary change that was incorrectly included in previous commit.

* Reduced code change to one addition on a single line.

* Revert "Reduced code change to one addition on a single line."

This reverts commit 2a355cf115.

* Use newer syntax to shorten

Co-authored-by: Trevor Buckner <calculuschild@gmail.com>
2021-02-26 17:47:29 -05:00
Alexey Sachkov
7057422077 Enable caching of static assets (#1217)
* Enable caching of static assets

* Remove dependency on mime package

Since we only care about two file extensions at the moment,
there is no need to grab the whole package just to avoid
calling 'endsWith' twice.
2021-02-19 17:58:02 -05:00
Trevor Buckner
ee4ecc0b41 Default 'legacy' if not set. Auto-change styles.
* Fix brew styles overwriting each other.

* Word wrapping, start fixing spacing on Title letter

* Fix \page in legacy brews when not at line start

* Fix Page Padding

* Set 'legacy' as default value if not set in brew saved file.
2021-02-08 15:09:09 -05:00
Trevor Buckner
e2cd7d9f07 Legacy renderer (#1184)
* Include two versions of Marked.js

* Include two versions of Marked.js

* Working two different render pipelines

Adds stylesheet "styleLegacy.less"
Adds markdownHandler "markdownLegacy.js"
The BrewRenderer will switch between these and the new pipeline dependent on the "version" prop passed in.

* Mustache-style div blocks

* Legacy snippets & columnbreak

* Codemirror styling for Div Blocks

* Lint

* Codemirror highlights for inline Divs as well

These will turn red `{{class Content}}`

Multi-line divs will turn purple

```
{{class,class2
content
}}
```

No real need for these to be different colors. Just for testing.

* More lint

* Update dependencies.

* Adding Button to switch render pipelines

* Update Marked.js

* Popup alert to refresh page when renderer changed

* Don't compress files in Development (very slow)

* Block DIV or inline Span depending on {{ placement

* \column emits a Div instead of Span

* Allow share page to use new renderer

* {{ divs no longer need empty lines. Spans work in lists.

* Typo

* Typo

* Enforce \page must be at start of line. Code cleanup.

* Inject newlines after/before {{/}} to avoid needing blank lines

* Fixes issues with tables.

* Remove console.log

* Fix spacing issue for Spans

* Move things from Brewrenderer to Markdown

Try to keep all custom text fiddling in one spot.

* Rename variables

* Update Font-Awesome to v5.15. Fix style issues on popups.

* Update {{ Divs/Spans, Fix nested hilighting

* Fixed Spans/divs with no tags or just commas

* Use blacklist for {{ to allow more characters

* Update package-lock.json

* Update all icons to Font-awesome 5

* V3 hidden behind config variable

Add "globalThis.enable_v3 = true" in the console to enable.

* lint
2021-02-02 20:38:25 -05:00
G.Ambatte
c3bfd1e8bf Prefix loading successfully from config/local.json for both Homebrewery and Google brews.
Concats switched to string literals to make Linter happy.
2021-01-29 22:53:58 +13:00
Trevor Buckner
6a2e39355c V2.10.7 (#1215)
* Fix for box-shadow/border-image issues on blockquotes in new columns (#1179)

* Fix for issues with box-shadow and border-images on blockquotes when they appear at the top of columns other than the first.

* Update phb.style.less

Change to `-webkit-transform` IAW Github PR discussion

* Add comment

Co-authored-by: Sean Robertson <srobertson@fqnz.co.nz>
Co-authored-by: Trevor Buckner <calculuschild@gmail.com>

* Title will always return *something*, and not CSS (#1214)

* Bump codemirror from 5.59.1 to 5.59.2 (#1200)

Bumps [codemirror](https://github.com/codemirror/CodeMirror) from 5.59.1 to 5.59.2.
- [Release notes](https://github.com/codemirror/CodeMirror/releases)
- [Changelog](https://github.com/codemirror/CodeMirror/blob/master/CHANGELOG.md)
- [Commits](https://github.com/codemirror/CodeMirror/compare/5.59.1...5.59.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump mongoose from 5.11.9 to 5.11.13 (#1199)

Bumps [mongoose](https://github.com/Automattic/mongoose) from 5.11.9 to 5.11.13.
- [Release notes](https://github.com/Automattic/mongoose/releases)
- [Changelog](https://github.com/Automattic/mongoose/blob/master/History.md)
- [Commits](https://github.com/Automattic/mongoose/compare/5.11.9...5.11.13)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump fs-extra from 9.0.1 to 9.1.0 (#1197)

Bumps [fs-extra](https://github.com/jprichardson/node-fs-extra) from 9.0.1 to 9.1.0.
- [Release notes](https://github.com/jprichardson/node-fs-extra/releases)
- [Changelog](https://github.com/jprichardson/node-fs-extra/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jprichardson/node-fs-extra/compare/9.0.1...9.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump eslint from 7.17.0 to 7.18.0 (#1195)

Bumps [eslint](https://github.com/eslint/eslint) from 7.17.0 to 7.18.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v7.17.0...v7.18.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump nconf from 0.11.0 to 0.11.1 (#1190)

Bumps [nconf](https://github.com/flatiron/nconf) from 0.11.0 to 0.11.1.
- [Release notes](https://github.com/flatiron/nconf/releases)
- [Changelog](https://github.com/indexzero/nconf/blob/master/CHANGELOG.md)
- [Commits](https://github.com/flatiron/nconf/compare/v0.11.0...v0.11.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump googleapis from 66.0.0 to 67.0.0 (#1189)

Bumps [googleapis](https://github.com/googleapis/google-api-nodejs-client) from 66.0.0 to 67.0.0.
- [Release notes](https://github.com/googleapis/google-api-nodejs-client/releases)
- [Changelog](https://github.com/googleapis/google-api-nodejs-client/blob/master/CHANGELOG.md)
- [Commits](https://github.com/googleapis/google-api-nodejs-client/compare/v66.0.0...v67.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Trevor Buckner <calculuschild@gmail.com>

* Bump express-static-gzip from 2.1.0 to 2.1.1 (#1180)

Bumps [express-static-gzip](https://github.com/tkoenig89/express-static-gzip) from 2.1.0 to 2.1.1.
- [Release notes](https://github.com/tkoenig89/express-static-gzip/releases)
- [Commits](https://github.com/tkoenig89/express-static-gzip/compare/v2.1.0...v2.1.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Trevor Buckner <calculuschild@gmail.com>

* use fa-info-circle instead of fa-bars (#1109)

* use fa-info-circle instead of fa-bars

* Change Metadata button to Info Icon with Text

Co-authored-by: Trevor Buckner <calculuschild@gmail.com>

* Up Version

Co-authored-by: G.Ambatte <sean@robertson-family.nz>
Co-authored-by: Sean Robertson <srobertson@fqnz.co.nz>
Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: ericscheid <ericscheid@users.noreply.github.com>
2021-01-25 21:47:36 -05:00
G.Ambatte
5c7a9c92d1 Integrated download function into server.js
Remove new function from `Homebrew.Model.js`
Remove `sourceFunctions.jsx` module
2021-01-21 20:27:46 +13:00
G.Ambatte
8060ed5f8e Rename sanitizeHtml function to escapeTextForHtmlDisplay which better describes it's actual function 2021-01-21 07:37:50 +13:00
G.Ambatte
e8135fcbb4 Added sanitizeHtml function to Homebrew model to generate HTML from 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`.
2021-01-21 00:02:15 +13:00
Trevor Buckner
8e1951ba67 Access google files with Service Account
Using API key is triggering "automation" warnings from Google
2020-12-25 15:15:51 -05:00
Trevor Buckner
980fdf5ad1 Small bug causing crashes with Tags (#1152)
Also: Force Google to always send to trash instead of fully deleting.

Remove unneeded console.logs to speed up server.
2020-12-11 16:18:28 -05:00
Trevor Buckner
7462e66858 Fix metadata in Google docs
Update view counts via service account since modifying another users' file properties requires increased permission scope
2020-11-22 23:53:34 -05:00
Trevor Buckner
ac2d6fe9a8 Fix share uncompressing views... again 2020-10-19 17:36:58 -04:00
Trevor Buckner
40d120d875 Woops!
Accidentally broke sharing.
2020-10-19 16:56:34 -04:00
Trevor Buckner
57c8c24b20 Lint 2020-10-19 16:38:26 -04:00
Trevor Buckner
460d3fe111 Prevent share view uncompressing text. 2020-10-19 16:37:01 -04:00
Trevor Buckner
1d50cbf684 Update admin.api.js 2020-10-19 16:24:19 -04:00
Trevor Buckner
3a250d3da4 Update admin.api.js 2020-10-19 16:15:41 -04:00
Trevor Buckner
d05b819ff2 Fix recent links when transferring to Google Brews 2020-10-19 15:48:44 -04:00
Trevor Buckner
bf17d6894f use NanoId as function in Mongoose default
For some reason, Mongoose will reuse the old ID generated if you call nanoid directly. If you wrap it in a function, it will call it new each time a new document is created.

Also updated patreon link :)
2020-10-08 11:03:52 -04:00
Trevor Buckner
28ed2fe8f2 Fix Config spelling (must be all lowercase) 2020-10-07 16:17:05 -04:00
Trevor Buckner
131df2d82a Bug Fix 2020-10-07 15:55:07 -04:00
Trevor Buckner
0f5ec6c40c Bug Test... 2020-10-07 15:48:07 -04:00
Trevor Buckner
39cbadb100 Small Typo 2020-10-07 15:39:37 -04:00
Trevor Buckner
0afb503860 Update Version number & cleanup 2020-10-07 15:02:42 -04:00
Trevor Buckner
ed1c589e2d Linting 2020-10-06 14:21:15 -04:00
Trevor Buckner
864cc7a7bb Fix issues making brews when not signed in 2020-10-06 14:20:09 -04:00
Trevor Buckner
657a374895 Code Cleanup
Remove req, res from update, new, and getFolder google actions
2020-10-06 14:08:51 -04:00
Trevor Buckner
35e1ce0df2 Initial Commit. All seems to be working...?
EditPage.jsx and GoogleActions.js need to be cleaned up and shortened...
2020-10-05 23:33:15 -04:00
Trevor Buckner
22a9799674 Update vitreum (#946)
- Updates Vitreum to v6.0.1 + some custom fixes.
  - Stylesheets must be imported with `require('./sheet.less');` but can also can now share stylesheets between jsx components.
  - Should eliminate a lot of security concerns with older nested dependencies.
  - Changed a lot of files to make this work
- Also removes dependency on PicoRouter in favor of React-Router
2020-05-19 01:36:31 -04:00
Trevor Buckner
70430f84e1 Small tweaks and linting 2020-04-14 11:15:05 -04:00
Timothy Cyrus
80db261c88 API Code Cleanup + Alt Endpoints
Added 2 new API Endpoints as alternatives to existing ones:
- PUT /api/:id (same as PUT /api/update/:id)
- DELETE /api/:id (same as GET /api/remove/:id)
2020-04-14 11:15:05 -04:00
Brandon Fryslie
954a393fce Do not force SSL when using Docker 2020-04-03 16:23:13 -04:00
Trevor Buckner
e50f0a1f3b Upping number of compressed brews at once 2020-01-23 15:12:25 -05:00
Trevor Buckner
e862f65166 Up number of brews compressed at once 2020-01-23 12:57:23 -05:00
Trevor Buckner
347575b0ec Lint 2 2020-01-23 12:24:54 -05:00
Trevor Buckner
4ac922482e Lint 2020-01-23 12:24:54 -05:00
Trevor Buckner
27e7af870a Fixed what was breaking 2020-01-23 12:24:54 -05:00
Trevor Buckner
474b2552fd Fix recent crash 2020-01-23 11:47:21 -05:00
Trevor Buckner
a06b29c6f5 Admin controls for compressing old brews 2020-01-23 11:20:31 -05:00
Trevor Buckner
4128670a9f Revert "Merge pull request #867 from naturalcrit/compressBrews"
This reverts commit 94d090277f, reversing
changes made to aeffec1763.
2020-01-23 10:27:30 -05:00
Trevor Buckner
2efb24d692 Lint 2020-01-23 09:47:19 -05:00