Commit Graph

318 Commits

Author SHA1 Message Date
Naz
6023b78688 Added "urlCache" labs alpha flag
refs https://github.com/TryGhost/Toolbox/issues/126

- A flag go control the experimental URL Cache alpha feature
2021-11-12 12:24:27 +04:00
Kevin Ansfield
4b78586ad1 Added gifsCard labs flag
refs https://github.com/TryGhost/Team/issues/1217

- labs flag for adding a gif selector in a similar fashion to our Unsplash image selector
2021-11-11 15:07:35 +00:00
Naz
975750afe9 Added ".ogg" audio support to Media API
refs https://github.com/TryGhost/Toolbox/issues/95
refs 9edd299905

- A follow up to the original audio support. ".ogg" format is widely supported by the most popular browsers (ref. https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Containers), so makes sense to support it out of the box too
2021-11-10 10:46:26 +04:00
Rishabh
ac61ac3d53 Added alpha flag for accordion card
refs https://github.com/TryGhost/Team/issues/1209

- adds alpha flag for editor accordion card
2021-11-09 19:07:50 +05:30
Naz
9edd299905 Added audio upload support to Media API
refs https://github.com/TryGhost/Toolbox/issues/95
refs 4907b7bf1e

- We need support for audio media uploads to be able to used them in cards. The new supported formats are .mp4 and .wav
- Example source files downloaded from https://filesamples.com/
2021-11-09 16:39:33 +04:00
Peter Zimon
a789528a56 Added NFT card alpha flag 2021-11-09 13:27:36 +01:00
Thibaut Patel
aebd042d1a Added calloutCard labs flag
refs https://github.com/TryGhost/Team/issues/1205

- flag for editor callout card development
2021-11-08 17:11:35 +01:00
Kevin Ansfield
4d54337a65 Added buttonCard labs flag
no issue

- flag for editor button card development
2021-11-08 15:42:02 +00:00
Naz
c6e1e95c26 Added "filesAPI" labs alpha flag
refs https://github.com/TryGhost/Toolbox/issues/114

- A flag go control the Files API alpha feature
2021-11-08 11:33:06 +04:00
Naz
151ab6968c Added local file storage adapter
refs https://github.com/TryGhost/Toolbox/issues/114

- This adapter is meant to power Files API
- The files will be stored under `/files/` in the configured content path and under `/content/files/` URL.
2021-11-08 11:29:33 +04:00
Naz
22ac28b250 Fixed ThemeStorage inheritance
refs https://github.com/TryGhost/Toolbox/issues/95

- The ThemeStorage was never supposed to inherit image specific mehods. The LocalStorageBase is all it needs, might be even too much
- Look mum no saveRaw!
2021-11-05 17:17:18 +04:00
Naz
2dac3d489f Added "mediaAPI" labs flag
refs https://github.com/TryGhost/Toolbox/issues/95

- A flag go control the Media API alpha feature
2021-11-04 10:48:53 +04:00
Naz
091240db48 Added thumbnail upload support to Media API
refs https://github.com/TryGhost/Toolbox/issues/95

- Each media file quires a thumbnail and these changes provide a capability to upload them along with media files.
- The thumbnail file is always required and has to be the format of already supported image formats
- The thumbnail should be uploaded as a part of "thumbnail" attachment in the request
- The regression tests added with this changeset will be claened up and moved to unit-tests (this is a dirty-but-working version!)
- The thumbnail always gets a name of the uploaded media file and keeps it's own extension.
- The thumbnails is accessible under the url present in the "thumbnail_url" reponse field
2021-11-04 10:23:29 +04:00
Fabien 'egg' O'Carroll
da152a0a13
Removed references to Offers labs flag (#13709)
refs https://github.com/TryGhost/Team/issues/1115

This feature is now GA, and the flag has been hardcoded to `true`, here we clean up the
remaining references as they're no longer needed.
2021-11-03 17:11:48 +02:00
Fabien O'Carroll
1386d6ca5c Added membersAutoLogin labs flag
refs https://github.com/TryGhost/Team/issues/1067

- To be used whilst developing the auto-login functionality so we can
  test this on production sites.
2021-11-03 11:17:02 +02:00
Naz
4a551661d9 Implemented '/media/upload' API endpoint
refs https://linear.app/tryghost/issue/CORE-121/create-a-video-storage-adapter

- This is an experimental implementation of video file upload support
- Also the output serializer skipped use of url utils in favor of inline implementatoin - this should almost certainly be it's own package
2021-11-03 00:33:28 +13:00
Naz
5242566252 Added local media storage adapter
refs https://linear.app/tryghost/issue/CORE-121/create-a-video-storage-adapter

- This is an experimental implementation of video file upload support (audio is yet to follow)
- The storage adapter still needs more thinking as it's almost the same as the "LocalStorgeAdapter" that stores images.
- Also the output serializer skipped use of url utils in favor of inline implementatoin - this should almost certainly be it's own package
2021-11-03 00:33:28 +13:00
Kevin Ansfield
b690fce219 Added cardSettingsPanel labs flag
no issue

- used to toggle editor UI experiments/exploration for cards with settings
2021-11-02 09:55:55 +00:00
Fabien O'Carroll
f3bb6b43a5 Added Offers feature to Ghost
refs https://github.com/TryGhost/Team/issues/1115

This allows users to create Offers for Tier/Cadence pairs in order to
provide discounted subscriptions to Members! We have support for
percentage based discounts & fixed price discounts, either for the first
payment, all payments, or a number of monthly payments.

Offers also have a code, which can be used as an easy way to share them,
as visiting https://site.com/offer-code will automatically open Portal
with the Offer prepopulated.
2021-10-22 17:55:34 +02:00
Kevin Ansfield
a6982d5606
Added ability for themes to define custom settings (#13661)
closes https://github.com/TryGhost/Team/issues/1164

Themes can now define custom settings via their `package.json` file, and use them in templates via `@custom.{setting}`. Values for custom settings can be changed by site owners through a redesigned "Design settings" area in the admin interface.

Full announcement, documentation, and examples will be made available soon.

Co-authored-by:
- Sanne de Vries (@sanne-san)
- Thibaut Patel (@tpatel)
2021-10-22 15:02:16 +01:00
Daniel Lockyer
ed6a8dca76 Inlined package requires to save boot time and memory
no issue

- following on from f4fb0fcbaa,
  this commit moves around some package requires in Ghost
- these are often niche packages that do something in a subsystem of
  Ghost, and are not necessarily be needed to boot the application
- these packages use non-negligible CPU and memory when they are
  required, so it makes sense to lazy-require them
- the concern here is that we obscure the code too much by moving
  random requires further into code, but the changes are small and the
  improvements big
- this commit bring the boot time since 4.19.0 down ~31% and initial
  memory usage down by a total of ~12%
2021-10-22 09:57:59 +02:00
Hannah Wolfe
ae33c89707
Moved public folder to frontend
- The files in the public folder are all specific to the frontend:
  - ghost.css / ghost.min.css contains styles for default templates like unsubscribe, private and error
  - favicon is the default for the frontend
  - robots.txt is the default robots.txt for the frontend
  - sitemap.xsl is the stylesheet for the sitemap
- Therefore, they should live in the frontend!
2021-10-16 19:27:34 +01:00
Hannah Wolfe
7280f82722
Moved core/shared/i18n to theme-engine/i18n
- core/shared/i18n is no longer used. Remove it to prevent temptation!
- this class needs merging with the one in themes, but for now just co-locate them as that's quicker and easier
2021-10-15 20:25:56 +01:00
Daniel Lockyer
f4fb0fcbaa Improved Ghost boot time and memory usage by lazy loading routes
no issue

- right now, we mount all API endpoints (v2, v3 and canary), alongside some
  other routes, when Ghost is booting. This is wasteful because we don't
  necessarily need any of the endpoints to get Ghost up and running
- even when Admin is used, it uses `canary` so `v2` and `v3` sit in memory
- the better approach here is to lazy load these endpoints, so they only
  get mounted when needed
- this commit adds the `lazyUse` function into our Express lib,
  which takes a mount path and a module function to execute down the
  line. This gets passed to the wonderful `express-lazy-router` lib which
  detects when we're calling an unmounted module and will mount it for
  us
- from local testing, this speeds up boot time by about 18% and reduces
  initial memory usage by about 6% 🚀
2021-10-15 17:52:07 +02:00
Hannah Wolfe
67821a7bc7
Removed remaining usage of i18n & translation file
refs https://github.com/TryGhost/Ghost/issues/13380

- Now that i18n.t has been removed everywhere, we can cleanup the final usages
- Still TODO: merge the i18n logic into themeI18n, and get rid of shared/i18n entirely
2021-10-15 11:39:07 +01:00
Rishabh
4ba93a33fd Added offers UI in Portal
refs https://github.com/TryGhost/Team/issues/1138
refs https://github.com/TryGhost/Team/issues/1139

- adds new offers screen on Portal for offer URLs
- wires new offers screen to offer data via API
- handles offer url for paid members
2021-10-15 11:50:27 +05:30
Hannah Wolfe
981f11da95
Added basic {{match}} helper
refs: https://github.com/TryGhost/Team/issues/759

- The match helper allows for basic equals and not equals comparisons,
Example:
  {{match title "=" "Getting Started"}}
  {{match slug "!=" "welcome"}}
- There's a lot more functionality we want to add here, so that it ends up being a replacement for {{#has}}
- However, this first iteration is already useful, especially in the context of custom theme settings
- Therefore we are adding it early, and will document it along with custom theme settings when that goes GA very soon
2021-10-14 19:36:56 +01:00
Naz
c65e62b7df Promoted email-only feature to general availability
closes https://github.com/TryGhost/Team/issues/1125
refs 3c822e0457

- Email-only is not considered a general availability feature and can be used without special flags.
- It allows to publish a new post type "email only" that only goes out as an email newletter and is available through an undescoverable URL (does not appear anywhere publicly similarly to preview posts) on the site.
2021-10-07 12:08:56 +02:00
Hannah Wolfe
8743931c7c
Removed unused doesTranslationKeyExist fn from i18n
- With the recent removal of i18n from error handling, we've removed the usecase for this function
- Cleaning up as we slowly get rid of i18n :)
2021-10-04 11:52:10 +01:00
Fabien O'Carroll
da76a6ebf9 Removed labs gating from bulk action endpoint
no-issue

This allows the new filtering feature to perform bulk actions without
using the labs flag.
2021-10-01 14:17:52 +02:00
Rishabh
08a68f200b Added portal redirect for first version of offers
refs https://github.com/TryGhost/Team/issues/1086

- bumps portal to handle offers link which redirects to stripe checkout with coupon applied
- uses hardcoded coupon value for prototype
2021-09-28 18:34:15 +05:30
Naz
fb1d929b9d Refactored i18n out of redirects settings
refs https://linear.app/tryghost/issue/CORE-35/refactor-route-and-redirect-settings

- i18n is an old pattern we are getting rid of
2021-09-27 19:00:08 +02:00
Naz
484bb2eea2 Moved default-routes.yaml file to backend
refs https://linear.app/tryghost/issue/CORE-35/refactor-route-and-redirect-settings
refs c1c9bf0866

- Actions logic related to file system operations (like ensuring files exist) should be done on the backend. Now the route settings initialization logic lives on the backend it makes sense to keep the file closer to the source.
- The move is the opposite to the one refed in the commit with a
difference that the file now lives in "route-settings"
2021-09-28 04:59:41 +13:00
Naz
e9c1aff418 Removed i18n dependency from routing validate module
refs https://linear.app/tryghost/issue/CORE-35/refactor-route-and-redirect-settings

- i18n is an old pattern we are getting rid of. By removing it here we get rid of an extra dependancy on frontend's "proxy" module
2021-09-28 04:59:41 +13:00
Naz
c3f9233165 Removed i18n dependency from yaml parser module
refs https://linear.app/tryghost/issue/CORE-35/refactor-route-and-redirect-settings

- i18n is an old pattern we are getting rid of. By removing it here we get rid of an extra dependancy on frontend's "proxy" module
2021-09-28 04:59:41 +13:00
Naz
fe7f78f527 Removed i18n dependency from settings loader module
refs https://linear.app/tryghost/issue/CORE-35/refactor-route-and-redirect-settings

- i18n is an old pattern we are getting rid of. By removing it here we get rid of an extra dependancy on frontend's "proxy" module
2021-09-28 04:59:41 +13:00
Naz
9822dbc1a2 Removed i18n dependency from ensure settings module
refs https://linear.app/tryghost/issue/CORE-35/refactor-route-and-redirect-settings

- i18n is an old pattern we are getting rid of. By removing it here we get rid of an extra dependancy on frontend's "proxy" module
2021-09-28 04:59:41 +13:00
Kevin Ansfield
04dd409243
Added syncing and theme exposure of custom theme settings (#13354)
refs https://github.com/TryGhost/Team/issues/1070

- added `@tryghost/custom-theme-settings-service` as a dependency
- `core/server/services/custom-theme-settings` creates an instance of the new service passing in the model used for storing the setting keys/values and a cache instance
- requiring `core/shared/services/custom-theme-settings-cache` creates a cache instance, it has no dependencies so can be required anywhere and the first require will initialize the shared instance
- updated the theme activation bridge to trigger the theme settings service to sync the newly activated theme settings and populate the cache
- updated theme validation to pass `labs` through as an option so that we get custom theme settings back as part of the checked theme as that's what is passed to the custom theme settings service
2021-09-23 12:44:39 +01:00
Daniel Lockyer
57664696a4 v4.15.1
-----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQTqYa7kNs8D7Oo9dgLSEYbwtHKVrQUCYUxOIgAKCRDSEYbwtHKV
 reO6AQCL2mFdVLBwRbpVQa2Zs9RlYKk88ivLRMpAZPPiElNblQEAqt710wrVbMwm
 hOOWbWdFpPOWCrop9zhO8GJSPeNpJw0=
 =Ff3M
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQTqYa7kNs8D7Oo9dgLSEYbwtHKVrQUCYUxTawAKCRDSEYbwtHKV
 ra28AQCcambctLCH70Sc7SJmexojA5k6Ti0p3pwOktWY/WygZQEAlMEHSDw89wdY
 3U8R8zY1d1MeXqj51Op95sTYwiDAjg8=
 =HoUL
 -----END PGP SIGNATURE-----

Merged v4.15.1 into main

v4.15.1
2021-09-23 11:13:56 +01:00
Fabien O'Carroll
944c2cc9af
🔒 Fixed member email change vulnerability
refs https://github.com/TryGhost/Ghost/security/advisories/GHSA-65p7-pjj8-ggmr

This updates the signup/signin flow for members to no longer support the
email address change flow - which had missing authentication. It has
been replaced with a dedicated email change flow, and Portal has been
updated to use it.
2021-09-23 10:49:30 +01:00
Peter Zimon
496b98b751 Added Offers Alpha flag 2021-09-22 13:20:36 +02:00
Rishabh
08b7fbc73f Added membersActivity alpha labs flag
refs https://github.com/TryGhost/Team/issues/1060

- Adds new alpha labs flag for controlling upcoming feature to record member activity for analytics
2021-09-16 11:53:27 +05:30
Kevin Ansfield
e2c41c52ee Added customThemeSettings labs flag
refs https://github.com/TryGhost/Team/issues/1045

- alpha flag for working on reworked design settings in Admin and allowing themes to define custom settings
2021-09-14 18:35:59 +01:00
Kevin Ansfield
d735e3a4f3 Removed dashboardTwo labs flag
no issue

The updated dashboard is shelved for now whilst the underlying analytics architecture is improved.
2021-09-14 10:08:43 +01:00
Rishabh
025eb8bd79 Updated tiers as a beta feature from alpha
refs https://github.com/TryGhost/Team/issues/1026

Tiers is moving up as a beta feature with an early-access opt-in flow. This means site owners can now opt-in for early access to Tiers feature in Ghost, but it's a one way door and its not possible to switch off tiers once enabled. This is to ensure that sites don't break in any unexpected ways once the tiers feature is enabled by switching it off.
2021-09-09 16:57:46 +05:30
Naz
6c75de6464 Removed i18t dependency from post scheduling service
refs https://github.com/TryGhost/Team/issues/694

- The i18t pattern has been deprecated. Quick clean up to keep the number of dependencies in the new module to the minimum
2021-09-04 07:49:11 +12:00
Naz
00460c96f4 Removed i18t dependency from installer module
refs https://github.com/TryGhost/Team/issues/694

- The i18t pattern has been deprecated. Quick clean up to keep the number of dependencies in the new module to the minimum
2021-09-03 20:33:28 +04:00
Kevin Ansfield
020acb643e
Removed emailCardSegments labs flag (#13276)
refs https://github.com/TryGhost/Team/issues/993
reqs https://github.com/TryGhost/Admin/pull/2080

- removed labs flag
- removed labs flag usage in conditionals
- moved labs email template changes into main template
2021-09-02 13:11:11 +01:00
Rishabh
c6fc3902c5 Refined Portal change plan design and scrolling behavior
no refs

- adds refinements to change plan UI in Portal
- adds other UI refinements to Portal for multiple tiers
- updates scrolling behavior in Portal in preview mode
- bumps `@tryghost/portal` to `1.9`
2021-09-02 12:31:17 +05:30
Kevin Ansfield
98f1200f77
Removed snippetReplacements labs flag (#13259)
refs https://github.com/TryGhost/Team/issues/1008
reqs https://github.com/TryGhost/Admin/pull/2073

- flag is no longer used by Admin as the feature is out of labs
2021-09-01 09:10:39 +01:00