Commit Graph

10252 Commits

Author SHA1 Message Date
Daniel Lockyer
c317b22005 Updated Admin to v4.34.1 2022-02-01 08:50:37 +00:00
Rishabh
93596a1375 Updated frontend routing to include products for page/post
refs https://github.com/TryGhost/Team/issues/1071

- `products` relation is needed on post/page to tackle custom tiers visibility, this change attaches `products` as default include for frontend controllers
2022-02-01 11:13:51 +05:30
Rishabh
15d692dc01 Updated frontend helpers to handle tiers visibility
refs https://github.com/TryGhost/Team/issues/1071

- visibility handling for posts/pages with restricted tiers access has changed, this change updates frontend helpers
2022-02-01 11:13:51 +05:30
Rishabh
b259bb2431 Updated content gating to use new tiers visibility
refs https://github.com/TryGhost/Team/issues/1071

- `tiers` are now attached as a list on post with restricted tiers access
2022-02-01 11:13:51 +05:30
Rishabh
d461525978 Updated validation for post/page
refs https://github.com/TryGhost/Team/issues/1071

- ignores `tiers` as its a valid visibility filter
2022-02-01 11:13:51 +05:30
Rishabh
bc5c00ba05 Updated post model to attach products relation
refs https://github.com/TryGhost/Team/issues/1071

- attaches products relation for post/pages to include tiers with access when applicable
2022-02-01 11:13:51 +05:30
Rishabh
7ab4c44475 Updated serialization for handling tiers visibility
refs https://github.com/TryGhost/Team/issues/1071

Going forward, if the visibility of a page/post is set for specific tiers, we send a `tiers` array in API response that contains list of tiers with access. This change -

- updates post/page mapper to transform existing data where `visibility` is a custom nql string to tiers array
- updates default include for post/pages to include `products`, which allows attaching relevant tiers from the pivot table
- cleans up usage of `visibility_filter` in serialization
2022-02-01 11:13:51 +05:30
Peter Zimon
209aab12e9
Remove Editor card settings panel alpha flag (#14087) 2022-01-31 14:12:05 +01:00
Fabien "egg" O'Carroll
a75908bb8a Added alpha flag for Tier welcome pages
refs https://github.com/TryGhost/Team/issues/1168
2022-01-31 13:40:33 +02:00
Kevin Ansfield
a0da017ab6 Added "improvedOnboarding" labs flag
refs https://github.com/TryGhost/Team/issues/1294

- used for working on changes to the setup flow and launch wizard
2022-01-31 11:23:14 +00:00
Rishabh Garg
eeafc8603b
Added pivot table to store tiers on post (#14038)
refs https://github.com/TryGhost/Team/issues/1071

We used `posts.visibility` originally to store visibility as `free|paid` with a character limit of 50. This same field was repurposed to store an NQL filter when member tiers is enabled. The NQL filter uses the slug of the tier name, which can easily create a filter longer than 50 characters, adding an unwanted limitation on number of tiers that can be added to post's visibility.
Going forward, we'd like to store the visibility of posts for tiers in a separate pivot table and instead store the value of `visibility` as `tiers` when restricting post access to specific tiers. This change -

- adds a new pivot table fixture for storing relation between posts and tiers
- adds a migration for creating the new table
- updates tests
2022-01-31 15:33:58 +05:30
Fabien "egg" O'Carroll
3d9e4b4c6c Synced Tiers welcome_page_urls with Settings
refs https://github.com/TryGhost/Team/issues/1168

Because Tiers is still behind a flag - any users which are not using
Tiers will still be editing their settings, and when they switch to
Tiers - the redirects will not necessarily be correct, unless we keep
the Tier columns up to date with any settings changes.
2022-01-30 17:41:57 +02:00
Fabien "egg" O'Carroll
0e866aaa1e Updated redirect logic to handle tier based urls
refs https://github.com/TryGhost/Team/issues/1168

This makes the actual switch to use a Tiers redirect URL rather than the
settings when the Tiers feature is enabled.
2022-01-30 17:41:57 +02:00
Fabien "egg" O'Carroll
4f5257859d Added welcome_page_url to Products API
refs https://github.com/TryGhost/Team/issues/1168

This updates the JSON API Schema to allow for the welcome_page_url
property, as well as including the new column in API responses, so that
we can both read and write the value via the API.
2022-01-30 17:41:57 +02:00
Daniel Lockyer
a6154938b8 Updated Admin to v4.34.0 2022-01-28 16:00:27 +00:00
Sam Lord
08829a6f0c
Trigger email verification workflow on API usage
refs: TryGhost/Toolbox#166

The new VerificationTrigger listens to events form the members repository, and will cause the verification workflow to be triggered if the number of events is greater than the configured threshold in a rolling 30 day window.

The importer also no longer depends on the import threshold, so the threshold testing is now done in the processImport method in Ghost - seems sensible since we already had this wrapper and the logic is now tiny, since it's just relying on @tryghost/verification-trigger to handle the real stuff.
2022-01-27 14:06:29 +00:00
Peter Zimon
5713dfe7f7
Updated support email address redirect (#14075)
refs. a488b93465

- Updates redirect to member settings page after changing the support email address
2022-01-27 12:43:01 +01:00
Daniel Lockyer
b79ca4188d
Merged v4.33.2 into main
v4.33.2
2022-01-27 10:29:30 +00:00
Daniel Lockyer
3275f0f07d Updated Admin to v4.33.2 2022-01-27 10:20:51 +00:00
Fabien 'egg' O'Carroll
8393c1e90a
Added welcome_page_url column to products table
refs https://github.com/TryGhost/Team/issues/1168

Rather than using a single url for paid signup redirects, we want to
support setting a welcome page on a tier by tier basis. This column will
be used to store the URL. A text column of length 2000 is how we have
stored URL's elsewhere in the schema.
2022-01-26 11:44:40 +02:00
Fabien "egg" O'Carroll
60777ac7fb Cleaned up Products API add & edit
refs https://github.com/TryGhost/Team/issues/1291

This is cleanup from the initial implementation.
2022-01-25 15:45:20 +02:00
Daniel Lockyer
a2c44efa6a
Merged v4.33.1 into main
v4.33.1
2022-01-24 16:03:16 +00:00
Daniel Lockyer
1559961f66 Updated Admin to v4.33.1 2022-01-24 15:59:59 +00:00
Fabien "egg" O'Carroll
91df910dbb 🐛 Fixed crashing on boot with revoked Stripe keys
no-issue

The refactor of Stripe boot logic missed catching any errors from the
migrations running or the webhooks initialising. This adds try/catches
to the services so that we can log the errors.
2022-01-24 17:50:55 +02:00
Fabien 'egg' O'Carroll
01f30eb632
Included benefits with theme product data (#14051)
refs https://github.com/TryGhost/Team/issues/1079

These were missing when benefits were added to products, and will allow
theme developers to make more useful custom subscribe pages.
2022-01-24 13:55:25 +02:00
Fabien 'egg' O'Carroll
db4da54265
Removed archived Tiers from theme data (#14049)
refs https://github.com/TryGhost/Team/issues/1252

In order to allow existing subscribe pages to continue working without
an extra flag, we're going to filter out the archived tiers.
2022-01-24 12:47:24 +02:00
Hannah Wolfe
9d8089a748
Removed deprecated routes.yaml data format
refs: https://github.com/TryGhost/Ghost/issues/10434
refs: https://github.com/TryGhost/Ghost/pull/10449
refs: https://github.com/TryGhost/Ghost/pull/10559

- We originally had a weird structure returned for data keys in routes.yaml.
- To the best of my knowledge this was never desired or really used
- I'm removing it now simply because I'm trying to remove all references to v2/v3 in tests, and this had a comment saying it was deprecated in v3
- I could have changed the comment to be a proper @deprecated comment and leave this til we rewrite dynamic routing
- However it's weird and confusing and I believe entirely unused - so getting rid is way way better
2022-01-21 20:16:43 +00:00
Thibaut Patel
817e556ea6 Updated the /members/event filtering logic
refs https://github.com/TryGhost/Team/issues/1277

- Enabled the `filter` attribute on the route.
- The events are now filtered in-memory instead of in the database.
- This fixes a wrong logic where the API user would have to know the internal event structure.
2022-01-21 18:35:02 +01:00
Daniel Lockyer
1bd0df3905 Updated Admin to v4.33.0 2022-01-21 16:00:31 +00:00
Fabien "egg" O'Carroll
26ef4afdb9 🐛 Fixed config API not returning boolean
no-issue

The mailgunIsConfigured config should be a boolean, rather than a string/undefined/null.
2022-01-20 18:25:41 +02:00
Fabien 'egg' O'Carroll
231a7b9bf4
Added active flag to products API (#14021)
refs https://github.com/TryGhost/Team/issues/1252

This flag is used to determine whether a Tier (currently product) as
active or archived
2022-01-20 17:46:53 +02:00
Fabien "egg" O'Carroll
1d73c17d5b Fixed unparsed booleans for "boolean" type columns
no-issue

Knex.js aliases "bool" -> "boolean" - this means that you can use either
one in our schema.json file and it'll correctly create the column. Our
model plugin however would only handle columns which used the "bool"
alias. This fixes the plugin to handle both strings.
2022-01-20 17:00:16 +02:00
Fabien 'egg' O'Carroll
534ebecc19
Added active column to products table (#14016)
refs https://github.com/TryGhost/Team/issues/1252

We need a way to signal whether or not a Tier is active or archived, and
we'll be using the active flag in the same way we do for Offers.
2022-01-20 15:50:18 +02:00
Marat Vyshegorodtsev
74b97e99cd
Added timezone and locale to the options of the date helper (#13892)
fixes https://github.com/TryGhost/Ghost/issues/13832

The `date` handlebars helper has only one option currently — `format`. It assumes the locale and timezone from the `options.data.site` object which is not always desired behavior.

The helper sometimes is used, for example, in custom RSS template where we always need the `en-US` locale, not the one that we have configured for the website globally. This change makes the two options configurable, and defaults to the `options.data.site` object values, if not specified in the helper (keeps the backwards compatibility with the current behavior).
2022-01-19 14:43:53 +00:00
Thibaut Patel
a1af064f79 Added three email delivery events to the member/event endpoint
refs https://github.com/TryGhost/Team/issues/1277

- The new events types are: `email_delivered_event`, `email_opened_event` and `email_failed_event`.
- This makes existing data accessible to the admin dashboard
2022-01-19 14:43:29 +01:00
Fabien 'egg' O'Carroll
8a81cd0a36
Removed duplicate offer redemptions (#14011)
refs https://github.com/TryGhost/Team/issues/1257

As well as fixing the code so that we do not create duplicate offer
redemptions going forward, we need to clean up the existing database.

We loop in code because the query to find and delete duplicates is complicated,
and will introduce more risk
2022-01-19 14:36:30 +02:00
Fabien 'egg' O'Carroll
a565da06b2
🐛 Fixed Offer Redemptions being over counted (#13988)
refs https://github.com/TryGhost/Team/issues/1257

Offer Redemptions were being overcounted due to the way we were updating
Stripe configuration for the Members service. We would create a new
instance of the members-api, which would have event handlers for
creating Offer Redemptions - by creating a new instance each time Stripe
config changed, we would overcount them.

Here we've pulled out Stripe related logic into the Stripe service, and
updated it internally - rather than creating a new instance. This means
that we've been able to remove all of the logic for re-instantiating the
members-api.

- Bumped members-api & stripe-service
- Removed reinstantiation of members-api
- Used stripe service to execute migrations
- Updated Stripe Service to handle webhooks & migrations
- Used webhook controller from stripe service
- Used disconnect method from stripe service
- Removed unused stripe dependency
- Removed Stripe webhook config from members-api
2022-01-18 17:56:47 +02:00
Daniel Lockyer
eb68e8d339 Added library for extracting database information
refs https://github.com/TryGhost/Toolbox/issues/175

- we're going to be making some changes in v5 wrt supported databases
- we needed a way of detecting the difference between MySQL 5 + 8,
  MariaDB etc
- I've created `@tryghost/database-info`, which is a small wrapper
  around `knex`, which returns this information
- this commit:
  - adds the library to Ghost
  - initializes the DB info library upon boot
  - updates the Admin API /config/ endpoint and UpdateCheck to return
    the new string - `mysql5`, `mysql8` etc
2022-01-18 09:31:08 +00:00
Rishabh
1f9edcefec Updated Portal to show free tier description and benefits
refs https://github.com/TryGhost/Team/issues/1037

- bumps portal to show free tier description and benefits when tiers beta is enabled
2022-01-17 23:26:58 +05:30
Rishabh
62777d7f26 Handled default product to use first paid product
Since we now have 2 products by default for all ghost sites, free and default paid, the usage of default product which so far was using first product needs to be updated to use the first paid product.

- updates default product usage to use first paid tier
- updates tests
2022-01-17 22:59:34 +05:30
Rishabh
345eb5828c Added tier type in API response
refs https://github.com/TryGhost/Team/issues/1037

Tiers now have a `type` column to differentiate between `free` and `paid` tiers. This change allows `type` data for a tier in Admin and Portal API output.
2022-01-17 22:59:34 +05:30
Rishabh
e54395eab5 Added new default free tier
refs https://github.com/TryGhost/Team/issues/1037

Free tier is now setup the same way as other tiers, to allow custom description/benefits. This change:

- adds a migration to add a default free tier for all sites
- adds a default fixture to insert a free tier for all new sites
2022-01-17 22:59:34 +05:30
Rishabh
761a330e16 Added new type column for tiers
refs https://github.com/TryGhost/Team/issues/1037

- adds new `type` column for tiers to differentiate between free and paid tiers
- all existing tiers are updated to be `paid` tiers
2022-01-17 22:59:34 +05:30
Kevin Ansfield
d77948540a Added membersActivityFeed alpha labs flag
refs https://github.com/TryGhost/Team/issues/1277

- used for prototyping a separate activity feed screen that can show all members activity, combining the events shown in the dashboard with the email events shown on the member screen
2022-01-17 12:23:38 +00:00
Fabien 'egg' O'Carroll
10c214c148
Switched AMP to be 'off' by default in all new Ghost instances (#13907)
refs https://github.com/TryGhost/Team/issues/1189

Support for AMP is slowly in decline, and makes developing new cards trickier,
since AMP no longer has an effect of SEO we're going to disable it by default
as a first step toward moving away from it.

Co-authored-by: Thibaut Patel <thibaut@ghost.org>
2022-01-14 18:55:48 +02:00
Daniel Lockyer
f370d10401 Updated Admin to v4.32.3 2022-01-14 16:00:28 +00:00
Kevin Ansfield
96ec60e393
🐛 Fixed "Create Post" action error in Zapier when assigning new tags (#13972)
closes https://github.com/TryGhost/Zapier/issues/56

- fixes tag creation when creating posts with `tags: [{slug: 'new'}]` which should be supported
  - assigning tags with only `{slug: 'new'}` was triggering our validation for the required `name` property then bubbling up to the `bookshelf-relations` library resulting in a 500 error
  - the fix applied here is to set the `name` field to the same as the `slug` field if a name is not provided
2022-01-14 13:37:20 +00:00
Fabien "egg" O'Carroll
f58b5984cb Updated caching policy for /members/.well-known
refs https://github.com/TryGhost/Team/issues/1273

This endpoint currently only serves the members public key, which should
never change. A 24 hours cache will drastically reduce the number of
requests for the key, with little to no impact on functionality.
2022-01-14 14:04:23 +02:00
Fabien "egg" O'Carroll
5d8f491823 Updated caching policy for /members/api/site
refs https://github.com/TryGhost/Team/issues/1240

As this endpoint is hit on every page load when Portal is enabled, it
can cause a lot of traffic to Ghost. The data does not change very
frequently so we've added a 30s cache policy to alleviate load on servers.
2022-01-14 14:04:23 +02:00
Fabien "egg" O'Carroll
76b33b6e77 Added JSDoc to cache control middleware
no-issue
2022-01-14 14:04:23 +02:00
Daniel Lockyer
dbd6e31fc0
Merged v4.32.2 into main
v4.32.2
2022-01-12 10:02:33 +00:00
Daniel Lockyer
98ac844ee4 Updated Admin to v4.32.2 2022-01-12 10:00:20 +00:00
Fabien 'egg' O'Carroll
0aec18deee Stopped reconfiguring MemberAPI on settings change (#13943)
refs https://github.com/TryGhost/Team/issues/1257
refs https://github.com/TryGhost/Team/issues/1261

Certain event listens are being added twice due to the way we "reload"
the MembersAPI which can cause duplicate counts of Offer Redemptions.

Rather than creating multiple instances of the MembersAPI we're moving
toward being able to reload the config in place or passing getters for
the config which will allows us to use the MembersAPI as a singleton,
and remove any bugs which come from creating multiple instances.

This also fixes a bug with the allowSelfSignup config not refreshing when
the portal_plans setting was changed.
2022-01-12 11:31:59 +02:00
Matt Hanley
620059c7b4 🐛 Fixed incorrect edit redirect for authors
closes https://github.com/TryGhost/Ghost/issues/13942

- Admin routes were updated, and the author page was moved under the settings route, but the /edit redirect was missed
2022-01-10 16:56:33 +00:00
Fabien 'egg' O'Carroll
68127cf4d4
Stopped reconfiguring MemberAPI on settings change (#13943)
refs https://github.com/TryGhost/Team/issues/1257
refs https://github.com/TryGhost/Team/issues/1261

Certain event listens are being added twice due to the way we "reload"
the MembersAPI which can cause duplicate counts of Offer Redemptions.

Rather than creating multiple instances of the MembersAPI we're moving
toward being able to reload the config in place or passing getters for
the config which will allows us to use the MembersAPI as a singleton,
and remove any bugs which come from creating multiple instances.

This also fixes a bug with the allowSelfSignup config not refreshing when
the portal_plans setting was changed.
2022-01-10 18:21:09 +02:00
Daniel Lockyer
2e3628443d Updated Admin to v4.32.1 2022-01-07 16:00:35 +00:00
Rishabh
912d338b6b Added discount information for a member on Portal home page
refs https://github.com/TryGhost/Team/issues/1195

- adds discounted subscription price info where applicable on Portal account home page
2022-01-06 18:47:22 +05:30
Kevin Ansfield
c27ad6e6b8 🎨 Improved copy on member email unsubscribe page
closes https://github.com/TryGhost/Team/issues/1228

- copy updated to clarify the unsubscribe was for emails only, not full account cancelation
- added a link to member account management so members can easily re-subscribe to emails if desired
2022-01-05 15:27:13 +00:00
Thibaut Patel
01e833376b
🐛 Added pagination to sitemap.xml to avoid max 50,000 entries limit
refs https://github.com/TryGhost/Team/issues/1044
refs https://github.com/TryGhost/Ghost/pull/13298

- This splits the sitemaps according to the limit set by Google https://developers.google.com/search/docs/advanced/sitemaps/large-sitemaps

Co-authored-by:
- Kevin Ansfield (@kevinansfield)
2022-01-05 11:54:35 +01:00
Kevin Ansfield
5b5f756a8d Fixed linter error
refs https://github.com/TryGhost/Team/issues/1258

- all uses of `labs` service in the frontend site router have been removed but the require had been left in place
2022-01-04 15:29:00 +00:00
Kevin Ansfield
9b210f9add Fixed linter error
refs https://github.com/TryGhost/Team/issues/1258

- all uses of `labs` service in canary routes have been removed but the require had been left in place
2022-01-04 15:26:17 +00:00
Kevin Ansfield
fc6ed1a45e Removed headerCard GA labs flag
refs https://github.com/TryGhost/Team/issues/1258

- labs flag conditionals have been removed from Admin so the GA flag is no longer necessary
2022-01-04 14:57:46 +00:00
Kevin Ansfield
829b410c78 Removed fileCard GA labs flag
refs https://github.com/TryGhost/Team/issues/1258

- labs flag conditionals have been removed from Admin so the GA flag is no longer necessary
2022-01-04 14:57:25 +00:00
Kevin Ansfield
0de2c7e261 Removed filesAPI GA labs flag
refs https://github.com/TryGhost/Team/issues/1258

- files API is GA so labs flag and conditional access to files API routes is no longer necessary
2022-01-04 14:56:07 +00:00
Kevin Ansfield
ebae98f538 Removed membersAutoLogin GA labs flag
refs https://github.com/TryGhost/Team/issues/1258

- members auto login after Stripe checkout feature is GA so labs flag is no longer necessary
- bumps `@tryghost/members-api` to version that does not use the labs flag
2022-01-04 14:54:11 +00:00
Kevin Ansfield
2773e82e3e Removed mediaAPI GA labs flag
refs https://github.com/TryGhost/Team/issues/1258

- media API is GA so labs flag and conditional access to media API routes is no longer necessary
2022-01-04 13:11:23 +00:00
Kevin Ansfield
09228298b1 Removed audioCard GA labs flag
refs https://github.com/TryGhost/Team/issues/1258

- labs flag conditionals have been removed from Admin so the GA flag is no longer necessary
2022-01-04 13:08:18 +00:00
Kevin Ansfield
afb402991d Removed richTwitterNewsletters GA labs flag
refs https://github.com/TryGhost/Team/issues/1258

- conditional custom-processing of twitter embeds is GA so no longer needs the flag or conditional
2022-01-04 13:07:39 +00:00
Kevin Ansfield
cd745e09a8 Removed productCard GA labs flag
refs https://github.com/TryGhost/Team/issues/1258

- labs flag conditionals have been removed from Admin so the GA flag is no longer necessary
2022-01-04 13:04:53 +00:00
Kevin Ansfield
3d256d200e Removed accordionCard GA labs flag
refs https://github.com/TryGhost/Team/issues/1258

- labs flag conditionals have been removed from Admin so the GA flag is no longer necessary
2022-01-04 13:03:43 +00:00
Kevin Ansfield
ee4ef59c43 Removed videoCard GA labs flag
refs https://github.com/TryGhost/Team/issues/1258

- labs flag conditionals have been removed from Admin so the GA flag is no longer necessary
2022-01-04 12:58:06 +00:00
Kevin Ansfield
81d6385598 Removed calloutCard GA labs flag
refs https://github.com/TryGhost/Team/issues/1258

- labs flag conditionals have been removed from Admin so the GA flag is no longer necessary
2022-01-04 12:56:51 +00:00
Kevin Ansfield
c4caf1c373 Removed nftCard GA labs flag
refs https://github.com/TryGhost/Team/issues/1258

- labs flag conditionals have been removed from Admin so the GA flag is no longer necessary
2022-01-04 12:55:33 +00:00
Kevin Ansfield
30c27ee1c3 🐛 Fixed Flickr embeds appearing distorted in emails
refs https://github.com/TryGhost/Team/issues/1262

- Flickr embeds have fixed width/height attributes on the `img` elements but the displayed width is always constrained to the width of the email content container which is less than the attribute width, however the fixed height is observed by email clients resulting in images that are stretched vertically
- added a `height: auto` CSS override so email clients will correctly recalculate the image size when resized to fit the container width
2022-01-04 11:33:08 +00:00
Fabien O'Carroll
4d457461c9 Deleted all SingleUseTokens on boot
refs https://github.com/TryGhost/Team/issues/1216

Since we are increasing the grace period to 10 minutes, we want to make
sure that server crashes during those 10 minutes do not cause single use
tokens to remain in the system. The quickest was to ensure that without
restartable background jobs is to delete all tokens upon boot.
2022-01-04 11:14:31 +01:00
Matt Hanley
cc7f527a6a
🐛 Added fallback for meta_description to custom_excerpt (#13927)
closes https://github.com/TryGhost/Ghost/issues/13920

- Custom excerpt should be used as a fallback for meta_description in line with the behaviour of OG and Twitter metadata
- We specifically don't want to use the full fallback to the auto-generated preview text when a custom excerpt isn't defined, because we trust search engines to be able to summarise content better than we can
2022-01-03 19:09:03 +00:00
Kevin Ansfield
cabf78e938 Cleaned up customThemeSettings labs flag
closes https://github.com/TryGhost/Team/issues/1164

- `customThemeSettings` feature is GA so any conditionals can be cleaned up
- removed conditional loading of custom theme settings and associated API routes
- removed event trigger for reloading custom theme settings when the feature flag is toggled
- removed flag from labs GA list
2022-01-03 17:45:25 +00:00
Fabien 'egg' O'Carroll
bc75d20cef
Updated SingleUseToken grace period to 10 minutes (#13926)
refs https://github.com/TryGhost/Team/issues/1216

Some email security clients are scanning links at delivery, rather than
at the point the user clicks on them. This is causing magic links to
expire. To get around this we're increasing the grace period in which a
link can be used multiple times to 10 minutes.
2022-01-03 17:55:53 +02:00
Juan Delgadillo
76cde79186
Fixed AMP style compliance (#13912)
no issue

- `!important` qualifier is not allowed in AMP styles as it's disallowed by the framework's spec https://amp.dev/documentation/guides-and-tutorials/develop/style_and_layout/style_pages/#disallowed-styles
2021-12-21 21:32:53 -05:00
Peter Zimon
25748f420c Applied default box sizing to all cards
refs. https://github.com/TryGhost/Ghost/issues/13874

- Improved stability of cards by adding 'box-sizing: border-box;' CSS property to all of them so that it's not required by themes anymore
2021-12-17 15:28:35 +01:00
Daniel Lockyer
435b385d94 Updated Admin to v4.32.0 2021-12-17 11:32:32 +00:00
Daniel Lockyer
3eabc6ca35
Added header card to editor
refs https://github.com/TryGhost/Team/issues/1253

- moves the header card flag to GA for public release
2021-12-17 12:20:10 +01:00
Peter Zimon
e64e646587 Refined default header styles 2021-12-17 07:53:16 +01:00
Peter Zimon
1d46adf07a Updated header card colors and typography 2021-12-17 04:23:46 +01:00
Peter Zimon
fb39a0032e Revert "Used neutral background colors for default header styles"
This reverts commit 999dc867b6.
2021-12-17 04:15:37 +01:00
Peter Zimon
999dc867b6 Used neutral background colors for default header styles 2021-12-17 03:41:50 +01:00
Peter Zimon
384efab031 Updated header frontend styles 2021-12-16 19:39:30 +01:00
James Morris
81374e3040 Updated button for header card frontend to not style inner span
refs https://github.com/TryGhost/Team/issues/1253
2021-12-16 18:26:02 +00:00
Peter Zimon
683ac885fd Updated email template for header card 2021-12-16 18:54:21 +01:00
Thibaut Patel
4984223bf2 Renamed the header styles
refs https://github.com/TryGhost/Team/issues/1253

- The naming is easier to understand for theme developers
2021-12-16 18:22:16 +01:00
James Morris
90c99afcfb Removed unnecessary styles from header card frontend
refs https://github.com/TryGhost/Team/issues/1253
2021-12-16 17:20:12 +00:00
James Morris
c373e41699 Added in proper header link colours
refs https://github.com/TryGhost/Team/issues/1253
2021-12-16 17:05:39 +00:00
James Morris
3490047a36 Updated frontend with header style tweaks
refs https://github.com/TryGhost/Team/issues/1253
2021-12-16 16:37:02 +00:00
Fabien 'egg' O'Carroll
a4783e1800
Removed empty class attribute from emails (#13906)
no-issue

This is causing some ESP's to think our markup is invalid, and this is
affecting deliverability
2021-12-16 16:58:33 +02:00
Sodbileg Gansukh
7898828cc6 Add gap to image card on smaller screen sizes 2021-12-16 21:54:23 +08:00
Sodbileg Gansukh
2649ba4c4b Add gap custom CSS property to image card
This adds margin to the image card next to a gallery card
2021-12-16 21:50:43 +08:00
Fabien 'egg' O'Carroll
0c853a372b
Supported restricting limit="all" in get helper (#13903)
refs https://github.com/TryGhost/Team/issues/1251

With sites that have a huge number of resources, using limit="all" can
cause OOM errors at the Node level. Administrators now have the ability
to cap limit="all" requests via config. This only affects the get helper
used in themes, not the API, this is by design as themes have less
visibility of issues.
2021-12-16 13:59:39 +02:00
Daniel Lockyer
78030ac848 Updated Admin to v4.31.0 2021-12-16 09:33:21 +00:00
Peter Zimon
41e4ba68c9 Updated toggle and product card spacings 2021-12-16 08:49:37 +01:00
Peter Zimon
9a8461e06b Added underline to accented callout card links 2021-12-16 08:45:31 +01:00
Naz
f882ebc58e Added support for additional wav MIME types
refs https://github.com/TryGhost/Toolbox/issues/95
refs 975750afe9

- The `audio/x-wav`, `audio/wav`, and `audio/wave` are also commonly used MIME types for the .wav files.
- As a reference for these new types used https://github.com/jshttp/mime-db
2021-12-16 10:58:39 +04:00
Naz
22d0c1efac Reformatted media content types
no issue

- The list is gonna get longer and has pottential to be edited few more times in the near future. It's a formatting change to allow seeing added/removed entries easier
2021-12-16 10:54:21 +04:00
Rishabh Garg
5927e38084
Added file card to editor
refs https://github.com/TryGhost/Team/issues/1231

- new file card in editor that allows custom file uploads
2021-12-16 01:11:41 +05:30
James Morris
5dc30ba6a9 Added AMP styles for headers as well as more tweaks for email and frontend
refs https://github.com/TryGhost/Team/issues/1253
2021-12-15 18:42:25 +00:00
Fabien egg O'Carroll
9db1c843c3 Updated Before/After card markup
refs https://github.com/TryGhost/Team/issues/1249

This removes some superfluous markup as well as renaming the slider
handle classname
2021-12-15 20:11:16 +02:00
James Morris
ad96ad4baa Next round of styles for headers in frontend and email
refs https://github.com/TryGhost/Team/issues/1253
2021-12-15 17:45:01 +00:00
Peter Zimon
4353763de1 Updated file upload frontend styles 2021-12-15 17:44:37 +01:00
Fabien egg O'Carroll
6938808276 Improved styling of mismatched aspect ratio sliders
refs https://github.com/TryGhost/Team/issues/1249

The height:100%; stops taller images escaping the slider component.
2021-12-15 17:04:06 +02:00
Fabien egg O'Carroll
6f97396c1b Removed focus from slider after use
refs https://github.com/TryGhost/Team/issues/1249

If we leave focus on the slider than after interacting with it, it will
capture scroll events and move the slider rather than scrolling the
page.
2021-12-15 16:59:25 +02:00
Fabien egg O'Carroll
c745211ee4 Fixed small images in "wide" before/after card
refs https://github.com/TryGhost/Team/issues/1249

Because we cannot resize the container of teh slider without affecting
the surrounding content, e.g. in the context of a grid. We need to
stretch images to fit the slider container.

This also applies the `object-fit: cover` property to the slider image
to help with mis-matched aspect ratios
2021-12-15 16:56:46 +02:00
Fabien egg O'Carroll
16c6e535be Fixed image widths for before/after slider
refs https://github.com/TryGhost/Team/issues/1249

Instead of attempting to calculate teh width of the container, we leave
one image to fill up space naturally as the browser allows it, and then
use that to set the width of the secondary image.
2021-12-15 16:32:35 +02:00
Peter Zimon
acd0223f5b Callout style refinements 2021-12-15 14:51:55 +01:00
Thibaut Patel
49170e7ff2 Added a first version of the header card frontend rendering
refs https://github.com/TryGhost/Team/issues/1253

- Based on the editor card, the css isn't correct yet as it has undefined css variables
2021-12-15 14:46:00 +01:00
Fabien egg O'Carroll
a21a436f98 Added handle for before/after slider
refs https://github.com/TryGhost/Team/issues/1249

Using an input as the slider handle meant setting a width of 100% + px,
which could push width over the size of the screen - not good! This
takes the same approach as the CodePen linked below and uses a separate
element, which has the position of it updated by JS in realtime.

https://codepen.io/josephwong2004/pen/NWRGxdR
2021-12-15 15:16:29 +02:00
Daniel Lockyer
66df325721 Updated Admin to v4.30.1 2021-12-15 13:10:47 +00:00
Daniel Lockyer
8397e9489c Updated Admin to v4.30.0 2021-12-15 12:49:15 +00:00
Peter Zimon
45066b11fd Default card style updates
- fixed video styles for small videos
- cleaned up callout card typography spacings
2021-12-15 13:40:26 +01:00
Rishabh Garg
306e565fc1
Added new video card
refs https://github.com/TryGhost/Team/issues/1229

- new video card allows adding custom video files with thumbnail to post/page
2021-12-15 18:02:28 +05:30
Rishabh
ffe502fa84 Refined layout for videos with smaller aspect ratio
refs https://github.com/TryGhost/Team/issues/1229
2021-12-15 17:57:25 +05:30
Peter Zimon
cebbc7ce38
Card css specificity updates (#13895)
The default CSS styles of the new cards that have been released in the past couple of weeks was overoptimised for overridability. It was done by defining the lowest specificity scores for each card style. This resulted in certain default styles being unusable for a lot of themes – e.g. the text color of a button (which is a a element that is usually defined on a higher specificity) could easily be the same color as its background (accent color by default).

The solution to this issue is to increase the specificity level of globally used default elements (such as a's h1 and other headings, p's etc.) to a medium level so that they have precedence over styles that are defined in most themes. Our baseline specificity score for these default style is 21, which seems to be covering most of the cases in popular themes.

This commit contains CSS updates in card default styles that implement this change.
2021-12-15 12:58:24 +01:00
Sodbileg Gansukh
aba5382070 Add pointer cursor to audio/video card buttons by default 2021-12-15 16:27:33 +08:00
Peter Zimon
a3078589dd Updated file styles 2021-12-14 20:50:35 +01:00
Rishabh
e21eb935f4 Fixed video player overlay issue on loop
refs https://github.com/TryGhost/Team/issues/1229
2021-12-15 00:44:49 +05:30
Sanne de Vries
2ac0302da1 Fixed responsive issues for video card
Refs https://github.com/TryGhost/Team/issues/1229
2021-12-14 19:57:06 +01:00
Rishabh
c158f9ebfc Refined video controls hidden behavior
no refs

This reverts commit 182899150f.
2021-12-14 22:41:58 +05:30
Rishabh
182899150f Refined video controls hidden behavior
refs https://github.com/TryGhost/Team/issues/1229
2021-12-14 22:40:03 +05:30
Sanne de Vries
e574a8f2b3 Refined video player controls
Refs https://github.com/TryGhost/Team/issues/1229
2021-12-14 18:04:25 +01:00
Rishabh
e43fe45d24 Removed play icon on video player after first play
refs https://github.com/TryGhost/Team/issues/1229
2021-12-14 22:25:30 +05:30
Rishabh
04baa88c23 Fixed video not playing sometimes via player controls
refs https://github.com/TryGhost/Team/issues/1229
2021-12-14 22:20:55 +05:30
Peter Zimon
ae2a782987 Audio and file card frontend styles refinements 2021-12-14 17:46:30 +01:00
Rishabh
a6a25dbb77 Updated event handling for custom video player
refs https://github.com/TryGhost/Team/issues/1229
2021-12-14 22:15:08 +05:30
Rishabh
61f7f29eed Fixed pause not working for video player
refs https://github.com/TryGhost/Team/issues/1229
2021-12-14 22:05:29 +05:30
Rishabh
9ec83214ba Fixed hidden controls for videos on loop
refs https://github.com/TryGhost/Team/issues/1229
2021-12-14 21:54:56 +05:30
Sanne de Vries
2364de5696 Added animation to control behavior for video cards
Refs https://github.com/TryGhost/Team/issues/1229
2021-12-14 17:22:36 +01:00
Rishabh
b8b0a29a2e Refined video player UI behavior
refs https://github.com/TryGhost/Team/issues/1229

- allows pausing video by clicking on video overlay
2021-12-14 21:50:27 +05:30
Rishabh
441307c6ad Updated video card player behavior
refs https://github.com/TryGhost/Team/issues/1229

- refines player control UI behavior on mouseenter
2021-12-14 21:32:52 +05:30
Sanne de Vries
aa80cf415b Refined video controls behaviour
Refs https://github.com/TryGhost/Team/issues/1229
2021-12-14 16:51:00 +01:00
Sanne de Vries
79a48df75c Updated video card frontend rendering
Refs https://github.com/TryGhost/Team/issues/1229
2021-12-14 16:31:42 +01:00
Rishabh
64b3bbf1a6 Refined video controls behavior
refs https://github.com/TryGhost/Team/issues/1229
2021-12-14 21:01:22 +05:30
Sam Lord
97c68dd388
Replace error handler middleware with @tryghost/mw-error-handler (#13879)
refs: https://github.com/TryGhost/Toolbox/issues/137

Extract error handling middleware and replace with a package.
2021-12-14 15:18:46 +00:00
Rishabh
271d2c02b0 Added video overlay icon handling
refs https://github.com/TryGhost/Team/issues/1229
2021-12-14 20:38:07 +05:30
Sanne de Vries
ad35b4f17e Updated video card frontend rendering
Refs https://github.com/TryGhost/Team/issues/1229
2021-12-14 14:44:57 +01:00
Peter Zimon
5ddb2a8a40 Updated file card frontend styles 2021-12-14 14:37:36 +01:00
Sam Lord
80a385ef0c Replace GhostError with InternalServerError
no issue

@tryghost/errors no longer exports GhostError, as we should only be using subclasses. Replace with InternalServerError as a new default, but should be replaced with a relevant error when one exists.
2021-12-14 12:17:48 +00:00
Sam Lord
76f06fae3c
Revert "Revert "Extract logging from DI patterns, only use @tryghost/logging package"" (#13884)
This reverts commit fa8c3ebe99.

Reverting the revert, which will allow us to fully switch to @tryghost/logging v2.
2021-12-14 11:22:39 +00:00
Sanne de Vries
5a798c35ba Updated video card frontend rendering
Refs https://github.com/TryGhost/Team/issues/1229
2021-12-14 11:48:33 +01:00
Sanne de Vries
7db12650f9 Fixed seeker width jumping when playing audio
Refs https://github.com/TryGhost/Team/issues/1230
2021-12-14 09:46:14 +01:00
Fabien egg O'Carroll
ac5aa4e0c5 Logged in members after Stripe Checkout
refs https://github.com/TryGhost/Team/issues/1067

As well as providing a better UX for Members, allowing them to use the
site immediately after payment, rather than having to check emails and
use the magic link to sign in, this should reduce issues with members
signing up twice due to being confused after Stripe Checkout.
2021-12-14 09:54:46 +02:00
Daniel Lockyer
c20cbbbaa5 Updated Admin to v4.29.0 2021-12-14 07:25:03 +00:00
Rishabh Garg
daea92cf3f
Added new audio card
refs https://github.com/TryGhost/Team/issues/1230

- new audio card allows adding custom audio files with thumbnail to post/page
- also adds new file and media API to manage files/thumbnails uploaded for new cards
2021-12-14 10:54:45 +05:30
Sanne de Vries
93a81fc0ca Updated audio card frontend rendering
Refs https://github.com/TryGhost/Team/issues/1230
2021-12-13 22:15:20 +01:00
Sanne de Vries
57969dea6c Refined audio and bookmark frontend styles
Refs https://github.com/TryGhost/Team/issues/1230
2021-12-13 19:10:06 +01:00
Rishabh
f91bf677ff Removed disallowed amp class names for audio player
refs https://github.com/TryGhost/Team/issues/1230

- `i-amphtml-media-component` class name is not allowed in amp styles as they are disallowed by amp spec
2021-12-13 22:36:30 +05:30
Daniel Lockyer
59d51b58d2 Updated Admin to v4.28.0 2021-12-13 16:58:05 +00:00
Thibaut Patel
3f2e4fc4d0 Added a product card to the editor
closes https://github.com/TryGhost/Team/issues/1245

The product card enables to show product recommendations in pages and posts.
2021-12-13 17:44:53 +01:00
Fabien egg O'Carroll
8966f45993 Added basic input styling for Before/After card
refs https://github.com/TryGhost/Team/issues/1249

This makes the input act as a slider over the image.
2021-12-13 17:41:21 +02:00
Thibaut Patel
2800f538bc Updated the product card classes
refs https://github.com/TryGhost/Team/issues/1245

- Removes dependency from the product card css to other cards' css
2021-12-13 16:13:57 +01:00
Sanne de Vries
8c52e001c1 Refined audio card frontend rendering
Refs https://github.com/TryGhost/Team/issues/1230
2021-12-13 15:54:38 +01:00
Rishabh
7e061cee39 Renamed generic class names for video card
refs https://github.com/TryGhost/Team/issues/1229
2021-12-13 19:01:30 +05:30
Rishabh
cd238c64ba Updated frontend styles for file card
refs https://github.com/TryGhost/Team/issues/1231
2021-12-13 19:01:30 +05:30
djordje vlaisavljevic
1256d28615 Updated product card amp styles
refs https://github.com/TryGhost/Team/issues/1245
2021-12-13 14:23:35 +01:00
Fabien egg O'Carroll
c665b65e03 Added initial CSS&JS for Before/After card
refs https://github.com/TryGhost/Team/issues/1249

This contains the initial frontend code to provide a working slider for
the Before/After card. The JS is enclosed in an IIFE so as to not leak
any variables, and the CSS is all scoped to the card only to avoid
interfering with existing styles.
2021-12-13 15:08:57 +02:00
Sanne de Vries
d4d98d0ab5 Refined audio player UI
Refs https://github.com/TryGhost/Team/issues/1230
2021-12-13 14:08:39 +01:00
Sanne de Vries
10d59e9795 Updated audio player class-names
Refs https://github.com/TryGhost/Team/issues/1230
2021-12-13 13:46:19 +01:00
Sanne de Vries
c10db9a885 Fixed audio thumbnail placeholder in email
Refs https://github.com/TryGhost/Team/issues/1230
2021-12-13 13:35:40 +01:00
Sanne de Vries
c8ebe22a0c Updated audio card AMP styling
Refs https://github.com/TryGhost/Team/issues/1230
2021-12-13 13:16:51 +01:00
Rishabh
f237879251 Updated loop behavior for video player on theme
refs https://github.com/TryGhost/Team/issues/1229
2021-12-13 17:31:57 +05:30
Rishabh
4205951f7a Added accent background color for default audio thumbnail
refs https://github.com/TryGhost/Team/issues/1230
2021-12-13 16:53:41 +05:30
djordje vlaisavljevic
7f248381ec Updated product card styles
refs https://github.com/TryGhost/Team/issues/1245
2021-12-13 12:22:59 +01:00
Sanne de Vries
d8e49cb039 Fixed background color for transparent pngs as audio thumbnails
Refs https://github.com/TryGhost/Team/issues/1230
2021-12-13 11:10:11 +01:00
Sanne de Vries
0322c47a58 Fixed audio card responsive behaviour on frontend
Refs https://github.com/TryGhost/Team/issues/1230
2021-12-13 09:10:32 +01:00
Rishabh
3df7737de7 Added custom video player controls
refs https://github.com/TryGhost/Team/issues/1229

- adds custom video player controls, similar to audio player
2021-12-13 13:25:16 +05:30
Peter Zimon
baf6db2a48 Added dynamic styles for star rating in products 2021-12-13 08:31:06 +01:00
Peter Zimon
14f871e244 Adjusted product card frontend styles 2021-12-13 07:59:49 +01:00
Peter Zimon
3ec833266a Fixed NFT card margin 2021-12-13 07:34:43 +01:00
djordje vlaisavljevic
e0cb8cc3c9 Updated product card styles
refs https://github.com/TryGhost/Team/issues/1245
2021-12-12 19:23:42 +01:00
djordje vlaisavljevic
d55e44e5e9 Switched product card frontend to CSS grid
https://github.com/TryGhost/Team/issues/1245
2021-12-11 17:01:43 +01:00
Daniel Lockyer
8b9e1528f0 Updated Admin to v4.27.2 2021-12-10 16:00:27 +00:00
djordje vlaisavljevic
9b2b37b8f1 Updated product card line heights
ref https://github.com/TryGhost/Team/issues/1245
2021-12-10 16:36:18 +01:00
Sodbileg Gansukh
fc4d8d7de0 Fix audio card player button alignment 2021-12-10 11:27:35 +08:00
Rishabh
4f52e28c04 Cleaned up frontend audio card player script
refs https://github.com/TryGhost/Team/issues/1230

- removes unnecessary use of src attribute in the script as the theme file is already loaded with the src
2021-12-10 01:30:06 +05:30
Rishabh
f272da0536 Added post url option for mobiledoc cards conversion to html
refs https://github.com/TryGhost/Team/issues/1231
refs https://github.com/TryGhost/Team/issues/1230
refs https://github.com/TryGhost/Team/issues/1229

- passes post url to mobiledoc html renderer
- allows using the post url in email templates for upload cards, linking the static card ui to post directly
2021-12-10 00:05:07 +05:30
Kevin Ansfield
0fbec65a6e Added headerCard labs flag
refs https://github.com/TryGhost/Team/issues/1253

- setup for an editor card that lets you lay out a header title with background image
2021-12-09 13:35:29 +00:00
djordje vlaisavljevic
5b3f82dda2 Added padding between paragraphs in product card description
refs https://github.com/TryGhost/Team/issues/1245
2021-12-09 13:41:05 +01:00
djordje vlaisavljevic
7f89b07c85 Updated the way star rating colors are shown
ref https://github.com/TryGhost/Team/issues/1245
2021-12-09 13:41:05 +01:00
Sodbileg Gansukh
00546e6ff3 Add resets to audio card form elements 2021-12-09 19:30:30 +08:00
Peter Zimon
dc6e7a690a Updated NFT styles to use px sizings 2021-12-09 11:55:05 +01:00
Peter Zimon
4d59c7a694 Updated button styles to use relative sizings 2021-12-09 11:50:49 +01:00
Sanne de Vries
fc8ecc352f Updated rendering of audio cards without thumbnail
Refs https://github.com/TryGhost/Team/issues/1230
2021-12-09 09:14:01 +00:00
Kevin Ansfield
d4c110a55b Added first pass of video card rendering
refs https://github.com/TryGhost/Team/issues/1229

- bumped @tryghost/kg-default-cards that contains initial video card rendering
- added video card CSS file with basic style that prevents video element rendering larger than the content width (similar to default image styles in most themes)
2021-12-08 18:01:44 +00:00
Rishabh
2d43c12276 Fixed global variable leak for new card scripts
no issue

- wraps the card js scripts into an IIFE to avoid polluting global variables on the site
- also any fixes errors caused by `swup` and its scripts-plugin that trips over already created global variables
2021-12-08 22:58:22 +05:30
Daniel Lockyer
44ad9fde09 Updated Admin to v4.27.1 2021-12-08 16:02:08 +00:00
Fabien egg O'Carroll
55d7176e51 🐛 Fixed card scripts executing before DOM is parsed
no-issue

Using the async attribute means that the script is downloaded in
parallel with the parsing of the html into DOM, and then executed upon
completion. This means that the script cannot be sure that particular
parts of the DOM exist as it may not have finished parsing. This has
resulted in bugs with the new toggle card not working.

Switching our script to use the defer attribute means that the script is
still downloaded in parallel with parsing, but it is not executed until
parsing is complete. This means that the script can safely access the
DOM.
2021-12-08 17:54:37 +02:00
Daniel Lockyer
52491e7a6e Updated Admin to v4.27.0 2021-12-08 15:38:06 +00:00
Kevin Ansfield
b3a57f702b Removed quoteStyles flag
refs https://github.com/TryGhost/Team/issues/1239

- alternative blockquote style feature is no longer behind the flag in Admin so we no longer need the flag server-side
2021-12-08 15:21:49 +00:00
Fabien egg O'Carroll
d6e6f2e4be Added support for rich Twitter embeds in emails
refs https://github.com/TryGhost/Team/issues/1001

This adds custom rendering to Twitter embeds for email newsletters, so
that rather than displaying a plaintext blockquote with the tweet
contents, we render an rich Twitter card.
2021-12-08 17:19:27 +02:00
Daniel Lockyer
fa8c3ebe99 Revert "Extract logging from DI patterns, only use @tryghost/logging package"
This reverts commit 97451a93cb.
2021-12-08 14:28:41 +00:00
Daniel Lockyer
2d090b8b2a Revert "Remove unnecessary references to ghostVersion"
This reverts commit 443ee369d2.
2021-12-08 14:28:41 +00:00
Sanne de Vries
6e4be46fb3 Updated audio card frontend styles in Chrome
Refs https://github.com/TryGhost/Team/issues/1230
2021-12-08 12:22:39 +00:00
djordje vlaisavljevic
e72092fa5e Updated product card frontend styles
refs https://github.com/TryGhost/Team/issues/1245
2021-12-08 12:40:57 +01:00