Trevor Buckner
0a5ff213de
use same theme endpoint for user and static themes
...
`getThemeBundle()` rework no longer needs two separate endpoints
2024-07-20 11:39:23 -04:00
Víctor Losada Hernández
df265ffc8a
Merge branch 'master' of https://github.com/naturalcrit/homebrewery into metadata-api-endpoint
2024-07-19 08:59:04 +02:00
Víctor Losada Hernández
73a400b882
Merge branch 'metadata-api-endpoint' of https://github.com/naturalcrit/homebrewery into metadata-api-endpoint
2024-07-19 08:58:21 +02:00
Víctor Losada Hernández
bcef4006dc
Remove console.log statement in /metadata/:id route handler
2024-07-19 08:58:19 +02:00
Trevor Buckner
0448f15322
Classify user brews as V3 if they use V3
...
Each theme in the theme chain, including user brews, must use the same renderer. When moving to V4 or future versions, it will be important to distinguish which themes are compatible with each other
2024-07-19 00:05:45 -04:00
Trevor Buckner
af5434c9b7
cleanup
2024-07-15 16:45:55 -04:00
Trevor Buckner
484b0a6dff
simplify getThemeBundle() by using just one loop
...
Also, removes need for special handling of the "first" theme.
2024-07-15 16:38:19 -04:00
Trevor Buckner
4951b9bf1a
Add async error handler to /edit and /new
...
Since /edit and /new endpoints now have an `await` inside that could return an error (`getUsersBrewThemes()`), asyncHandler must be added to pass errors along instead of just crashing
2024-07-13 19:46:12 -04:00
Trevor Buckner
62c619de24
userThemes need not be nested inside a Brew object
2024-07-13 19:38:51 -04:00
Trevor Buckner
44c96aad04
spacing
2024-07-13 18:11:04 -04:00
Trevor Buckner
f392216ff4
Spacing
2024-07-13 18:08:29 -04:00
Trevor Buckner
591cae0e8f
more renaming engine to renderer
2024-07-13 18:08:00 -04:00
Trevor Buckner
e222811d03
Rename engine to renderer to unify naming
...
This value is named `renderer` everywhere else. Relabeling to a consistent name.
2024-07-13 18:06:46 -04:00
Trevor Buckner
c9b885f868
include theme as baseTheme when getting user brew themes
...
`baseTheme` for a user brew theme is just the `theme` value of that brew.
2024-07-13 18:01:50 -04:00
Trevor Buckner
47f912750b
Extract getting userThemes from getBrew()
...
`getBrew()` should do one thing only; retrieve a brew. UI elements like the list of themes available to the user are not part of a brew.
Moved into the handers for the `/edit/` and `/new/` endpoints
2024-07-13 17:44:23 -04:00
Trevor Buckner
f29a5e346e
Remove id parameter from getUsersBrewThemes
...
Filtering out the current brew can be done later as needed; certain situations may call for retrieving the whole list.
2024-07-13 17:35:19 -04:00
Trevor Buckner
ee381c91fe
Simplify getUserBrewThemes function a bit
2024-07-13 17:26:38 -04:00
Trevor Buckner
5f8d46f1b6
Reuse splitTextStyleAndMetadata from helpers.js
2024-07-13 17:09:45 -04:00
David Bolack
ade819c70c
A not so light rework.
...
This removes the existing endpoints and replaces them with /theme.
/theme/:id - return a theme bundle containing all styling from this USER theme and any parents.
/theme/:engine/:id - return a theme bundle containing all styling from this STATIC theme and any parents
The theme bundle returns a marshalled JSON object containing:
styles - an array of strings representing the collected styles in loading order
snippets - an array ( currently empty ) of collected snippets.
The various bits of theme rendering code for <style> an style <link> have been swapped out with an 'onDidMount' call that loads the thendpoint and appends a series of <style> blocks to the brewRender's head.
This loses some caching advantages, but probably won't matter in the long run.
2024-07-13 12:12:05 -05:00
Trevor Buckner
29c2274a19
Unify some variable naming
2024-07-10 18:54:45 -04:00
Trevor Buckner
a6f787ea8f
Remove getBrewThemeParentCSS
2024-07-10 17:56:39 -04:00
Trevor Buckner
24c86dd199
Remove unused test
2024-07-10 17:49:57 -04:00
Trevor Buckner
88578a3d16
Fix failing test
2024-07-10 14:22:42 -04:00
Trevor Buckner
28446d3ae2
Comments for theme CSS endpoints
2024-07-10 14:21:23 -04:00
Trevor Buckner
a247e50c9f
renaming "get" functions
...
rename `getStaticTheme` to `getStaticThemeCSS`
rename `getBrewThemeWithCSS` to `getBrewThemeCSS`
rename `getBrewThemeParent` to `getBrewThemeParentCSS`
to avoid confusion with other "get" endpoints like `getBrew`, and unify naming for endpoint functions that return CSS.
Simplify `isStaticTheme` function (getting the parent theme is handled elsewhere)
2024-07-10 14:15:03 -04:00
David Bolack
656edb07ea
Rework detection of user brews to look up themeid in static themes list before assuming is a user brew.
...
Ended up being a fairly straightforward change. A few ternaries got smooshed or inverted. Passes builtin and local tests. Need to compare on the test instance.
2024-07-08 18:12:58 -05:00
Víctor Losada Hernández
4680e7a5cc
i messed up authentication entirely, this commit restores it
2024-06-16 17:21:55 +02:00
Víctor Losada Hernández
f07252d670
errors for access denied and authorization required
2024-06-16 17:14:27 +02:00
Víctor Losada Hernández
f15c831b70
proper error page
2024-06-16 17:06:18 +02:00
David Bolack
0945a5e47e
Merge branch 'master' into brew_themes_user_selection
2024-06-13 15:15:30 -05:00
Víctor Losada Hernández
90431efbc9
"Removed ArchivePage and related files, replaced with VaultPage, updated routes and API endpoints, and made minor changes to theme configuration and error handling."
2024-06-11 00:33:36 +02:00
Víctor Losada Hernández
99b0c2b54e
Merge branch 'master' of https://github.com/naturalcrit/homebrewery into experimental-development
2024-06-10 23:25:42 +02:00
Víctor Losada Hernández
8c09772605
Merge branch 'master' into metadata-api-endpoint
2024-06-06 01:02:10 +02:00
David Bolack
587831652c
Merge branch 'master' into Issue_1958
2024-06-02 12:33:14 -05:00
David Bolack
5442f232d5
Merge branch 'master' into brew_themes_user_selection
2024-05-31 22:32:14 -05:00
G.Ambatte
2424d34682
Merge branch 'master' into addLockNotification-#3326
2024-06-01 12:14:04 +12:00
Trevor Buckner
695b9916dd
Remove old /print page
2024-05-28 12:39:43 -04:00
Víctor Losada Hernández
6e0aff525f
Updated rate limiter window name
2024-05-25 20:51:44 +02:00
Víctor Losada Hernández
748c25aae4
"Added express-rate-limit package and implemented rate limiting for admin API login attempts"
2024-05-24 20:42:25 +02:00
Víctor Losada Hernández
609f5a3330
more logs
2024-05-23 14:08:37 +02:00
Víctor Losada Hernández
879a1f5a57
fix page size to count
2024-05-22 08:51:49 +02:00
Víctor Losada Hernández
0f9ba1a5ae
Merge branch 'master' of https://github.com/naturalcrit/homebrewery into experimental-development
2024-05-22 08:23:53 +02:00
Trevor Buckner
e62e185214
Lint a bunch of things
2024-05-21 17:32:17 -04:00
Víctor Losada Hernández
a711f8eb89
remove regex search
2024-05-18 23:07:43 +02:00
David Bolack
c6f62142e1
Change the ID used for User Brews to the shareId for future-proofing.
2024-05-17 20:53:06 -05:00
Víctor Losada Hernández
b7717171b3
Server and shared folders
2024-05-17 22:34:40 +02:00
Víctor Losada Hernández
243038474e
Initial commit
2024-05-17 21:23:31 +02:00
Víctor Losada Hernández
4b10686336
simplify logic
2024-05-14 09:49:14 +02:00
Víctor Losada Hernández
153812c6e5
simplify console log and remove unused code
2024-05-14 09:36:59 +02:00
David Bolack
66e39d9c65
Update Theme Selector display
...
For User/Brew Themes, display the first author instead of Brew/V3 in the first column.
2024-05-13 22:24:41 -05:00