Commit Graph

9875 Commits

Author SHA1 Message Date
Rishabh
2aa353a1a0 Added custom audio player UI for audio card
refs https://github.com/TryGhost/Team/issues/1230

- adds custom css and js for custom audio card player
- bumps `kg-default-cards` to add custom audio player ui for theme
2021-12-06 14:24:41 +05:30
Naz
abcd715907 Fixed express app stacking
refs https://github.com/TryGhost/Toolbox/issues/152

- Because the root app module was initialized only once per runtime it caused all the express apps to stack on each other causing all sorts of strange behavior when trying to test redirects/vhost mounts etc. Lesson here: be very cautious of how the module is initialized, an explicit function is almost always a better way!
2021-12-06 21:28:53 +13:00
Naz
91338b23d9 Fixed typo 2021-12-06 21:28:53 +13:00
Naz
de121e1219 Modified boot to conditionally return an express app
refs 3c7a8dead4

- The idea is a rip-off from the referenced commit. It allows to isolate initialization logic to "frontend" mounted on top of a "parent"
- Gives path to simplify the express-mock tests

Co-authored-by: Hannah Wolfe <erisds@gmail.com>
2021-12-06 21:28:53 +13:00
Naz
b19424acb3 Moved vhost mounts into boot file
refs https://github.com/TryGhost/Toolbox/issues/152

- This stops the mounting of the admin and frontend from being buried deep in express initialisation
- Instead it's explicit, which makes two things almost possible:
   1. we can potentially boot the frontend or backend independently
   2. we can pass services and settings loaded during boot into the frontend
- This needs more work, but we can start to group all the frontend code together
- Meanwhile we also need to rip apart the routing and url services to decouple the frontend from the backend fully
- BABY STEPS!

Co-authored-by: Hannah Wolfe <erisds@gmail.com>
2021-12-06 21:28:53 +13:00
Daniel Lockyer
71b647aab1
Removed unused import
refs ec28478435

- I removed use of the `logging` variable in the last commit so we no
  longer need the library import
- this fixes a linting issue
2021-12-06 08:17:07 +00:00
Daniel Lockyer
ec28478435
🐛 Fixed error when sending messages via bootstrap socket
refs https://github.com/TryGhost/Ghost/issues/13837

- a [refactor](9fa8800b9d) in `@tryghost/bootstrap-socket` changed the signature of the method it exprots, but the use of this
  library wasn't updated in Ghost
- therefore, the library was trying to send the `@tryghost/logging` library, which caused
  errors with Ghost-CLI down the line, as mentioned in the issue
- this commit updates the method signature to match what is expected
2021-12-06 08:04:26 +00:00
Peter Zimon
8515388ce6 Added Twitter styles to email template 2021-12-04 10:34:47 -04:00
Fabien egg O'Carroll
94cfbb19fc Added fallback for NFT title when name is missing
no-issue

Some NFT's are created without a title, for example the Bored Ape Yacht
Club collection does not name the tokens, instead just referring to them
by ID. This change falls back to the token_id, which is unqiue within
the collection to support these tokens.
2021-12-03 21:16:22 +02:00
Fabien egg O'Carroll
e5068a6557 Updated email content for paid signups
refs https://github.com/TryGhost/Team/issues/1067

Changes based on product feedback.
2021-12-03 21:15:55 +02:00
djordje vlaisavljevic
18be68a4bb Updated the spacing between toggle cards on frontend
refs https://github.com/TryGhost/Team/issues/1209
2021-12-03 17:55:26 +01:00
Daniel Lockyer
4716c76044 Updated Admin to v4.25.1 2021-12-03 16:00:37 +00:00
djordje vlaisavljevic
c229ada2b5 Updated toggle styles
refs https://github.com/TryGhost/Team/issues/1209
2021-12-03 16:41:50 +01:00
Sanne de Vries
c0d5711d6d Added link styling for callout card with brand color as background
Refs https://github.com/TryGhost/Team/issues/1206
2021-12-03 14:08:18 +00:00
Sanne de Vries
a07580b890 Updated callout card default styles
No ref

- Added default font sizes and line heights
- Switched from absolute to relative units to adapt to different themes
2021-12-03 13:28:19 +00:00
djordje vlaisavljevic
5c7e935b78 Removed the background from the arrow button
refs https://github.com/TryGhost/Team/issues/1209
2021-12-03 10:41:22 +01:00
Sanne de Vries
dae4cd7de6 Updated AMP styling for callout cards
Refs https://github.com/TryGhost/Team/issues/1206
2021-12-03 09:39:49 +00:00
djordje vlaisavljevic
07855bf8dc Updated toggle transition
refs https://github.com/TryGhost/Team/issues/1209
2021-12-02 19:42:38 +01:00
djordje vlaisavljevic
1a3b78bbff Fixed toggle transition
refs https://github.com/TryGhost/Team/issues/1209
2021-12-02 18:49:18 +01:00
James Morris
6f9fd79120 Add a basic style for alternative quote for AMP 2021-12-02 14:13:50 +00:00
James Morris
f13a49233c Add blockquote alternative card styling 2021-12-02 14:13:50 +00:00
James Morris
1731723624 Alternative quote for email template 2021-12-02 14:13:50 +00:00
Fabien egg O'Carroll
24e78dc60f Added alpha flag for Before/After card
refs https://github.com/TryGhost/Team/issues/1249

Until release this card will be behind a flag.
2021-12-02 12:29:11 +02:00
Thibaut Patel
77c0364efd 🐛 Fixed malformed URLs crashing the url helper
refs https://github.com/TryGhost/Team/issues/960

- Character like "%%" or "%80" would crash our current url escaping behavior. We consider they aren't valid URLs as the percentages haven't been properly escaped.
2021-12-02 10:34:24 +01:00
Hannah Wolfe
ecbdb2284e
Fixed MIME type for public/cards.min.js part deux
refs: 580ebfad39

- correct mime type is application/javascript
- mime types are weird
2021-12-02 09:03:06 +00:00
Marat Vyshegorodtsev
580ebfad39
Fixed MIME type for public/cards.min.js (#13808)
- This script does not load if `x-content-type-options: nosniff` is enforced due to wrong MIME type
2021-12-02 09:01:18 +00:00
Thibaut Patel
7d9721dd54 Added one error catching inside the oembed service
refs https://github.com/TryGhost/Team/issues/1200

- The error was fixed in a1421c2380
- The error catching prevents future 500 errors in the API
- The logging enable visibility on these errors to fix them if they happen
2021-12-01 17:46:23 +01:00
Daniel Lockyer
faef8f5f6d Updated Admin to v4.25.0 2021-12-01 15:49:29 +00:00
Thibaut Patel
a1421c2380 🐛 Fixes oembed bookmark with whitespaces
refs https://github.com/TryGhost/Team/issues/1200

- The leading/trailing whitespaces are trimmed by `new URL()` but are considered invalid in metascraper. Trimming solves this edge case.
2021-12-01 15:58:09 +01:00
Sanne de Vries
ea50944897 Updated callout card class for consistency
No ref

- Swapped "kg-card-callout" for "kg-callout-card"
2021-12-01 14:25:33 +00:00
Fabien egg O'Carroll
1096488446 Added NFT Card support to Ghost
refs https://github.com/TryGhost/Team/issues/1211

The NFT card allows embeding NFT's from OpenSea in posts and pages.
2021-12-01 16:02:52 +02:00
Peter Zimon
a727135800 Updateed Button styles to support alignment 2021-12-01 09:44:32 -04:00
Kevin Ansfield
e9df5b9310 Fixed linter error
refs f91fc2add5

- with the removal of the labs check the labs service require is no longer used
2021-12-01 12:32:10 +00:00
Kevin Ansfield
f91fc2add5 Finished gifsCard labs flag removal
refs 5aa08acd33

- removed the flag check in public config output
- fixes failing tests
2021-12-01 12:29:50 +00:00
Naz
3150c87935 Fixed hidden validation error during frontend reload
refs https://github.com/TryGhost/Toolbox/issues/151
refs cbec6aa49e

- Without the await the try/catch block does not catch a pottential validation error straight away, which leads to a 500 error instead of a validation error being returned. The regression was introduced during the refactor (part of referenced commit).
2021-12-01 16:24:09 +04:00
Kevin Ansfield
5aa08acd33 Removed gifsCard labs flag
refs cec3d91c57

- flag is no longer used by Admin
2021-12-01 12:21:40 +00:00
Kevin Ansfield
9790de1413 Removed buttonCard labs flags
refs e9472b3ee9

- flag is no longer used in Admin
2021-12-01 12:21:09 +00:00
Hannah Wolfe
004371be36
Revert "Removed overly-specific handling of handlebars errors"
This reverts commit 303ea87897.

- Although gscan catches these now, we have a number of sites that have slipped through the net
- Reverting until we get them all cleaned up
2021-12-01 12:04:36 +00:00
Hannah Wolfe
9f11140ec4
Split theme engine middleware into separate files
- one big file full of stuff is never good for clarity
- separating it out helps us see what requires what
- it also highlights the awful naming and opaque behaviour we have in themes - much to do, but this helps us start
2021-12-01 12:04:36 +00:00
Naz
e6503e5148 Fixed invalid filename error during settings restore
refs https://github.com/TryGhost/Toolbox/issues/151
refs cbec6aa49e

- The error was happening due to incorrect "this" context. Because the filename and extension are only used once in this class and only for the purposes of the error message have moved the whole thing into the error message itself. No need to keep additional variables around when there's no clear usecase.
2021-12-01 15:47:13 +04:00
Sam Lord
18b8eddd0d Added linting for use of @tryghost/errors
refs: https://github.com/TryGhost/Toolbox/issues/147
Errors in @tryghost/errors rely on being called with an object (with a `message` member) rather than with a string.
2021-12-01 11:22:21 +00:00
Fabien egg O'Carroll
579b34434f Added separate confirmation email for paid signups
refs https://github.com/TryGhost/Team/issues/1067

As part of the work of automatically logging members in after payment,
we want to revisit the emails. Currently after payment we send an email
asking a member to _confirm_ their subscription, and that they can
ignore the email to cancel the subscription. This is not the case
however, as the member has already been subscribed.
2021-12-01 12:42:11 +02:00
Sam Lord
2887e416da
Switch to @tryghost/errors from ignition errors package (#13807)
refs: TryGhost/Toolbox#147

* Replaces all references to isIgnitionError with isGhostError
* Switches use of GhostError to InternalServerError - as GhostError is no longer public
There are places where InternalServerError is not the valid error, and new errors should be added to the @tryghost/errors package to ensure that we can use semantically correct errors in those cases.
2021-12-01 10:22:01 +00:00
Fabien egg O'Carroll
c77263f35b Redirected to original image when resizing fails
refs https://github.com/TryGhost/Team/issues/1234

Sharp can occasionally fail resizing, this is usually due the the
underlying libvips library failing. We do not want this to cause an
error however, instead we should just show the original image - as
resizing is an optimisation, rather than a requirement.
2021-12-01 10:42:27 +02:00
Fabien egg O'Carroll
616cd107df Updated Tenor default config keys
refs https://github.com/TryGhost/Team/issues/1237

Including the scope & visibility of api keys as outlined in the issue.
2021-11-30 13:35:34 +02:00
Fabien egg O'Carroll
e6856f6ac6 Initial custom embed provider for Twitter
refs https://github.com/TryGhost/Team/issues/1001

We fall back to existing behaviour if no API key is present, or if there
is an error communicating with the Twitter API. We're also currently
requesting all the data, which will be thinned down once we understand
what we need.

This also includes a custom renderer for embeds of type "twitter" which
will be used to output the custom HTML for emails
2021-11-30 12:58:25 +02:00
Fabien egg O'Carroll
c4021b6eb4 Added OpenSea API key to config
refs https://github.com/TryGhost/Team/issues/1237

We want to use an API key for OpenSea where possible so that we do not
run into rate limit issues.
2021-11-30 12:58:25 +02:00
djordje vlaisavljevic
fb95fe2d48 Fixed Toggle card email view refs https://github.com/TryGhost/Team/issues/1209 2021-11-29 19:22:40 +01:00
Hannah Wolfe
ad9eb35746
Moved theme-specific error handling to frontend
- our themeErrorRenderer is only used in the frontend.. move it there
- this required exposing prepareError as shared middleware
- TODO: move these shared compontents to @tryghost/error
2021-11-29 17:04:01 +00:00
Hannah Wolfe
d7c4168452
Removed HTMLErrorRenderer completely
refs: 0799f02e80
refs: 5e931e2e37

- with the referenced two commits I replaced our old HTML renderer with some code borrowed heavily from finalHandler
- I had intended to modify this further to out put our message, context and help error messages
- However, I ended up doing this in prepareError so it's done for all error renderers
- There's now very little point keeping duplicated code from finalHandler just to output the status code
- If we remove this code, express will fall back to finalHandler anyway, so the output is near identical
2021-11-29 17:00:47 +00:00