Commit Graph

18328 Commits

Author SHA1 Message Date
Steve Larson
5fe72462bc
Enabled page features (#17544)
no refs
-moved hide page title and feature image to GA
-updated gscan
2023-07-31 14:22:19 -05:00
Simon Backx
841e52ccfe
Added donations API (#17495)
refs https://github.com/TryGhost/Product/issues/3648

- Refactored Members API RouterController.createCheckoutSession: Split the method into smaller parts so we can reuse individual parts for the upcoming donation checkout session.
- Wired up donation checkout creation
- Added donation events
2023-07-31 16:00:52 +00:00
Simon Backx
18cf5dd582
Added migrations for donations API (#17536)
fixes https://github.com/TryGhost/Product/issues/3655

- This adds a new table for storing donation events in the database.
- Makes it possible to store stripe_products without associating it with
a tier/Ghost product (required for one time purchases).
- Updates the schema for stripe_prices to allow enum value of
`donation`, which is required to query specifically on the prices used
for donations (existing one_time is not enough).

Database changes are discussed in the Tech Spec:
https://www.notion.so/ghost/Tech-Spec-5cd6929f7960462ebcbf198176e0d899?pvs=4#1f18cc5a38294f61a091e5be63fe1059
2023-07-31 17:29:36 +02:00
Ronald Langeveld
42a1630740
🐛 Fixed email only to post rescheduling. (#17538)
refs https://github.com/TryGhost/Product/issues/3657

- When reverting a post to a draft, the meta, `email_only` remained
true.
- This fix switches `email_only` back to false when the `revertToDraftTask` is executed.
2023-07-31 13:32:58 +02:00
Ronald Langeveld
e8bf24045b
Bumped Koenig Packages (#17535)
no issue

- We made some styling changes in the rendering nodes for the new header
card.
- This bumps the affected packages.

---

<!-- Leave the line below if you'd like GitHub Copilot to generate a
summary from your commit -->
<!--
copilot:summary
-->
### <samp>🤖 Generated by Copilot at 655e595</samp>

Updated content rendering packages to fix bugs and improve output. This
affects how Ghost converts markdown to `HTML`, `AMP`, or `email`
formats.
2023-07-31 07:52:27 +00:00
Ghost CI
e97140fabb v5.56.0 2023-07-28 15:03:19 +00:00
Steve Larson
e45b947d61
Updated gscan (#17521)
no refs
- add check for unknown global use in themes
- removed `@page` check until ready for release
2023-07-27 15:43:22 +00:00
Daniel Lockyer
6dd18d81d4 Enabled no-explicit-any for majority of packages
refs https://github.com/TryGhost/DevOps/issues/50

- we should default to keeping the rule on and so I've excluded lines
  that currently use `any` to avoid the need to go and fix them all up
2023-07-27 16:49:08 +02:00
Fabien "egg" O'Carroll
fa40485fb1 Handled updating Collections on TagDeletedEvent
closes https://github.com/TryGhost/Arch/issues/62

Because there are many ways in which filters can rely on tags, we will just
recalculate all automatic collections for now, rather than attempting to do
optimised updates.
2023-07-27 16:33:16 +02:00
Fabien "egg" O'Carroll
9288f56649 Improved type definitions
The PostRepository type was using `any` (an anti pattern) rather than
`PostCollection`, and we had optional properties, which are not really
optional. This cleans up the types and updates the tests alongside them.
2023-07-27 16:33:16 +02:00
Daniel Lockyer
c97cc08455 Updated ESLint config for React+Typescript packages
refs https://github.com/TryGhost/DevOps/issues/50

- `react-app` comes from `eslint-config-react-app`, which is a CRA package
- we're moving away from that so this commit switches the linting over
  to a more recently updated plugin
- once that was removed, we started using a newer version of
  `@typescript-eslint/eslint-plugin`, so there were plenty of
  updates/exemptions to make
2023-07-27 11:40:31 +02:00
Ghost CI
145d0b84f5 Merged v5.55.2 into main 2023-07-27 07:38:59 +00:00
Ghost CI
5273b56e88 v5.55.2 2023-07-27 07:38:58 +00:00
renovate[bot]
c05976645c Update sentry-javascript monorepo to v7.60.1 2023-07-27 09:24:27 +02:00
Ronald Langeveld
abc7af8082 Added test email rate limiting (#17505)
refs https://github.com/TryGhost/Product/issues/3651

- This is a security fix that addresses an issue causing malicious users
to abuse the test / preview email API endpoint.
- We have multiple procedures in place now to limit such users.
- First, we now only allow one email address to be passed into the
`sendTestEmail` method. This method only have one purpose, which is to
compliment the test email functionality within the Editor in Admin and
therefore have no reason to send to more than one email address at a
time.
- We then add an additional rate limiter to prevent a user from making
multiple requests, eg via a script.
- The new imposed limit is 10 test emails per hour.
2023-07-27 09:22:26 +02:00
Daniel Lockyer
55d5a8d892 Fixed loading assets from CDN URL
refs https://ghost.slack.com/archives/C027S85FS/p1690202522054729

- this is another set of places where we load assets slightly
  differently
- this should fix user profile images when using assets from a CDN
2023-07-27 09:22:11 +02:00
renovate[bot]
0b661e8eee Update dependency ember-cli-test-loader to v3.1.0 2023-07-27 08:53:13 +02:00
Ronald Langeveld
0029c444ad
Added test email rate limiting (#17505)
refs https://github.com/TryGhost/Product/issues/3651

- This is a security fix that addresses an issue causing malicious users
to abuse the test / preview email API endpoint.
- We have multiple procedures in place now to limit such users.
- First, we now only allow one email address to be passed into the
`sendTestEmail` method. This method only have one purpose, which is to
compliment the test email functionality within the Editor in Admin and
therefore have no reason to send to more than one email address at a
time.
- We then add an additional rate limiter to prevent a user from making
multiple requests, eg via a script.
- The new imposed limit is 10 test emails per hour.
2023-07-27 08:46:50 +02:00
Steve Larson
b77521ece9
Updated gscan (#17509)
no refs
2023-07-26 15:58:22 +00:00
Steve Larson
005e80b466
Updated gscan (#17507)
no refs
2023-07-26 13:06:23 +00:00
Fabien "egg" O'Carroll
8d71841918 Mapped tag.deleted event to TagDeletedEvent
refs https://github.com/TryGhost/Arch/issues/61

Because the tags system is still written in the old way, the tag.deleted
bookshelf event needs to be mapped to the DomainEvents to bridge the gap with
the collections package.
2023-07-26 12:54:42 +02:00
Fabien "egg" O'Carroll
90f92ab2a4 Fixed usage of require in test file
We should be using the import syntax instead of require in our TypeScript files.
2023-07-26 12:54:42 +02:00
Fabien "egg" O'Carroll
607ea8dcd7 Added TagDeletedEvent
refs https://github.com/TryGhost/Arch/issues/60

This will be used to update collections when a tag is deleted. Like the Post
events this should not be in the collections package, instead we should have
these as part of the tags and posts packages. These packages don't exist right
now, so I'm following the existing pattern.
2023-07-26 12:54:42 +02:00
Naz
48ccea818a Fixed unpublished collection posts filtering
closes https://github.com/TryGhost/Arch/issues/58

- Following assumptions were broken:
- Posts Admin API should include posts of all statuses when filtering by collection
-  Posts Content API should not include any unpublished posts
- Updated the "status" filter which fixes the problem. We still disallow any custom filters to be applied on top of collections filter.
2023-07-26 16:45:57 +08:00
Michael Barrett
2fe392c312
Added import tier to members import modal (#17492)
refs https://github.com/TryGhost/Product/issues/3629
2023-07-26 09:19:09 +01:00
Sodbileg Gansukh
dc5cc28036 Cleaned up the styles for the new Header card
no issues

- using .kg-v2 as an indicator to add the v2-specific styles
- .kg-header-card and .kg-header-card-button are the class names that confict with the existing Header card, so only using .kg-v2 to style those elements
2023-07-26 15:18:22 +08:00
Djordje Vlaisavljevic
ae314679fa
Add Tips and donations section to Membership settings (#17497)
refs https://github.com/TryGhost/Product/issues/3561

- Added a static section to Membership settings with a button to copy
the Tips & donations Stripe link
- Added a `tipsAndDonations` feature flag
2023-07-25 22:46:34 +01:00
Fabien "egg" O'Carroll
322dda10ab Removed flag check for running the collection service
This ensures that collections are updated in the background regardless of
whether or not the labs flag is enabled, which is important for the stability
of the collections database tables. In order to make sure we don't add a tonne
of event listeners during the tests we have to add a flag to make sure that the
service is treated as a singleton and only instanciated once. This should only
affect code running in tests, as we don't initialise services multiple times
2023-07-25 17:35:43 +02:00
Fabien "egg" O'Carroll
3d0825ea2f Supported ?include=count.posts for Collections API
Unfortuantely our framework is bookshelf centric so we have to refer to the
`withRelated` property rather than a more generic `include` property.

The collection entity already contains the list of post ids, so we can just
return the length of that array.
2023-07-25 16:56:22 +02:00
Fabien "egg" O'Carroll
431f0ed842 Fixed the "Can add a Collection" test
The test was addign an extra collection, but not cleaning it up - which makes it
hard to reason about other tests, especially when running them in isolation and
the state is different. This just cleans up the test and updates the browse test
to match the right snapshot.
2023-07-25 16:56:22 +02:00
Fabien "egg" O'Carroll
517c406e17 Added Collections Content API
The only usecases we need to support at the moment are reading individual
collections by ID and by Slug. We can extend this API as we get more usescases
in future.
2023-07-25 16:14:02 +02:00
Daniel Lockyer
b0cf1f949a Switched TypeScript eslint config to custom plugin
refs https://github.com/TryGhost/DevOps/issues/50

- this switches the .eslint configs from `node` to `ts`, which is a new
  config to support eslint for TypeScript
- also makes minor changes to adhere to these new rules
2023-07-25 16:12:35 +02:00
Daniel Lockyer
bf53f8ba6f Added missing dependency definition
- `@tryghost/collections` is used within
  `@tryghost/model-to-domain-event-interceptor` but there wasn't a
  dependency on this package, so the build script wouldn't always build
  the dependency first
2023-07-25 15:56:46 +02:00
renovate[bot]
cbdd2f0273 Update dependency @types/nodemailer to v6.4.9 2023-07-25 15:50:24 +02:00
Fabien 'egg' O'Carroll
63ab254e33
Removed posts from Collections API
The correct mechanism for fetching posts from a collection is via the Posts API.
This removes all functionality of getting posts from the Collections API.

Co-authored-by: Naz <hi@nazavo.com>
2023-07-25 13:19:19 +00:00
Daniel Lockyer
87d234403f Deduplicated tsconfig.json to use base config
- this allows for easier maintenance
2023-07-25 13:50:45 +02:00
Naz
658adf0ab1 Fixed build command for nql-filter-expansions
no issue

- The newly generated package did not have the build:ts command needed for nx build to run
2023-07-25 19:01:56 +08:00
Naz
694ab1d32d Added support for expansions in collection filters
refs https://github.com/TryGhost/Arch/issues/46

- Similarly to post filters, collection filters now support both 'tag' and 'tags' nql filter keys when defining a filter for related tag slugs. For example, both `tag:avocado` and `tags:avocado` would both be valid collection filters that would filter by the same 'slug' property of the tags assigned to a post.
- Along with these changes had to rework the tags property of the collection posts to match the shape used in post resources. Moved from:
`tags: ['bacon', 'broc']`
to
`tags:[{slug: 'bacon'}, {slug: 'broc'}]`
2023-07-25 19:01:56 +08:00
Naz
8fa36916d7 Migrated admin and core modules to use nql-filter-expansions
refs https://github.com/TryGhost/Arch/issues/46

- Reused posts expansions from nql-filter-expansions module
2023-07-25 19:01:56 +08:00
Naz
9f979917e3 Added nql-filter-expansions module
refs https://github.com/TryGhost/Arch/issues/46

- This module with be a placeholder for "filter expansions" we use across the codebase. For now it will only contain the expansions for the "post" resource, but any new or refactored expansions should land here too.
2023-07-25 19:01:56 +08:00
Naz
c4351456c6 Made tag snapshots more accurate in collections test suite
refs https://github.com/TryGhost/Arch/issues/46

- Allows to actually verify in the snapshot itself if the tag filter is working correctly or not.
2023-07-25 19:01:56 +08:00
renovate[bot]
3830401d55 Update dependency @playwright/test to v1.36.2 2023-07-25 12:26:15 +02:00
Michael Barrett
8095843939
Added feature flag for import tier functionality (#17480)
refs https://github.com/TryGhost/Product/issues/3629
2023-07-25 10:52:52 +01:00
Sodbileg Gansukh
0b00c653cc Added margin override to the signup card input
no issues

- some themes have global styles applied to inputs and it breaks the card input layout because of the style conflict
- this adds some default margin values to fix the issue
2023-07-25 14:22:44 +08:00
Ghost CI
fc50d1e92c Merged v5.55.1 into main 2023-07-25 02:46:04 +00:00
Ghost CI
95d343a786 v5.55.1 2023-07-25 02:46:02 +00:00
Chris Raible
e50ad7561c
🐛 Fixed image rendering in Outlook email client (#17475)
refs TryGhost/Product#3647

- The latest version of juice (which Ghost uses to inline css in email
newsletters) included new functionality to add height="auto" and
width="auto" for any images with dimensions set to auto in css
- This was causing rendering issues in Outlook, which would render the
image at full width, which often added a horizontal scroll and generally
messed up the flow of the document
- This change prevents juice from modifying the height or width of `<img
/>` tags
2023-07-24 18:33:56 -07:00
Aileen Booker
eb303ec221 Fixed Segment event named wrong 2023-07-24 15:49:33 +01:00
Daniel Lockyer
d5cbb33e54 Pinned dependencies 2023-07-24 16:21:47 +02:00
Daniel Lockyer
bb4c3de992 Deduplicated ts-node and typescript dependencies
refs https://github.com/TryGhost/DevOps/issues/50

- this commit deduplicates where we define the versions of these
  packages to make them easier to maintain
2023-07-24 16:21:47 +02:00