0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-27 22:49:56 -05:00
Commit graph

6240 commits

Author SHA1 Message Date
Naz
db125ec0b9 Added post tag assignment on user deletion
closes https://github.com/TryGhost/Ghost/issues/15008

- To improve searchability of the posts written by a removed user we are adding an internal tag to all the posts the user was an author or a co-author of
- This improvement should make managing and disovering deleted user's post way easier
2022-07-13 03:06:04 +12:00
Simon Backx
a6842e8a20 Added support for blockquote in comments
refs https://github.com/TryGhost/Team/issues/1664
2022-07-12 10:24:02 +02:00
Kevin Ansfield
129836f52e Extracted email-related functionality out of base comments service file
refs https://github.com/TryGhost/Team/issues/1664
2022-07-12 10:24:02 +02:00
Simon Backx
9893147d58 Added <a> to comment html sanitizer
refs https://github.com/TryGhost/Team/issues/1664
2022-07-12 10:24:02 +02:00
Fabien "egg" O'Carroll
9ee003f8b2 Added initial counts api for comments
refs https://github.com/TryGhost/Team/issues/1664
2022-07-12 10:24:02 +02:00
Simon Backx
484e5102e2 Added comment for the add comment endpoint
refs https://github.com/TryGhost/Team/issues/1664
2022-07-12 10:24:02 +02:00
Simon Backx
96504008c1 Added member API for changing enable_comment_notifications and comments_enabled setting
refs https://github.com/TryGhost/Team/issues/1664

These changes are required for Portal to be able to edit the member notification preferences for comments, and to be able to know whether comments are enabled for the site.
2022-07-12 10:24:02 +02:00
Kevin Ansfield
379771ccc7 Stripped all HTML except <p> and <br> when saving comments
refs https://github.com/TryGhost/Team/issues/1664
2022-07-12 10:24:02 +02:00
Kevin Ansfield
38eb755056 Changed member name to "Anonymous" in emails when not set
refs https://github.com/TryGhost/Team/issues/1664
2022-07-12 10:24:02 +02:00
Kevin Ansfield
c63f3eb8c1 Added comment reply email notifications
refs https://github.com/TryGhost/Team/issues/1664
2022-07-12 10:24:02 +02:00
Hannah Wolfe
14020f46d2 Handle comment replies in the browse API
refs https://github.com/TryGhost/Team/issues/1664
- replies are a sub-record inside of a comment
2022-07-12 10:24:02 +02:00
Hannah Wolfe
cf529111f6 Updated comment API to only return top-level comments
refs https://github.com/TryGhost/Team/issues/1664

- we will have a separate concept of returning replies
2022-07-12 10:24:02 +02:00
Simon Backx
0d4b3a2baa Readded uuid to comment members relation output
refs https://github.com/TryGhost/Team/issues/1664
2022-07-12 10:24:02 +02:00
Fabien "egg" O'Carroll
7fa335d179 Added initial Admin API for Comments
refs https://github.com/TryGhost/Team/issues/1664

This allows a Comment to have its status changed to either 'hidden' or 'published'
2022-07-12 10:24:02 +02:00
Kevin Ansfield
70f57210b1 Wired up comment notification email data
refs https://github.com/TryGhost/Team/issues/1664
2022-07-12 10:24:02 +02:00
Simon Backx
876c1024c9 Added liked property to comments
refs https://github.com/TryGhost/Team/issues/1664
2022-07-12 10:24:02 +02:00
Simon Backx
54e7a6cec3 Added default comment relations
refs https://github.com/TryGhost/Team/issues/1664
2022-07-12 10:24:02 +02:00
Peter Zimon
ef989ed55c Improved comment notification email template
refs https://github.com/TryGhost/Team/issues/1664

- added comment
- refined copy
2022-07-12 10:24:02 +02:00
Hannah Wolfe
caef9d74e0 Added mapper for comments API
refs https://github.com/TryGhost/Team/issues/1664

- ensure that the comment API returns a minimal and clean set of data and doesn't expose member details
2022-07-12 10:24:02 +02:00
Kevin Ansfield
a2ab9f7a20 Added support for plaintext email templates in comments service
refs https://github.com/TryGhost/Team/issues/1664
2022-07-12 10:24:02 +02:00
Peter Zimon
a1b224bec8 Updated copy for new comment email
refs https://github.com/TryGhost/Team/issues/1664
2022-07-12 10:24:02 +02:00
Simon Backx
e96ff3fa81 Added comments API like and unlike actions
refs https://github.com/TryGhost/Team/issues/1664

- Added comment-like model
- Added like endpoint
- Added unlike endpoint
- Added basic tests for liking and unliking comments
- Added permissions for liking and unliking
- Added migration for permissions
2022-07-12 10:24:02 +02:00
Kevin Ansfield
1b4f8f0c95 Added WIP author email notifications for new comments
refs https://github.com/TryGhost/Team/issues/1664
2022-07-12 10:24:02 +02:00
Hannah Wolfe
78c15933e6 Implemented soft delete for comments
refs https://github.com/TryGhost/Team/issues/1664

- comments are marked as deleted, rather than deleted completely
2022-07-12 10:24:02 +02:00
Hannah Wolfe
d4c8660323 Updated comments.add to use member id from cookie
refs https://github.com/TryGhost/Team/issues/1664

- make sure we only create comments for the currently logged in member
2022-07-12 10:24:02 +02:00
Hannah Wolfe
fc99176fdf Moved comments api to members/api/comments
refs https://github.com/TryGhost/Team/issues/1664
2022-07-12 10:24:02 +02:00
Hannah Wolfe
f5ccec70b6 Use member cookie on comment API
refs https://github.com/TryGhost/Team/issues/1664
2022-07-12 10:24:02 +02:00
Hannah Wolfe
42fc272433 Added members permission system
refs https://github.com/TryGhost/Team/issues/1664

- the new member comments API needs members to have permissions to edit and delete their own posts
- added members as a provider, and then wired up permissible logic at the model level
2022-07-12 10:24:02 +02:00
Hannah Wolfe
00110e541e Added basic comment CRUD model + API
refs https://github.com/TryGhost/Team/issues/1664
2022-07-12 10:24:02 +02:00
Kevin Ansfield
a5874f90fe Added initial Comment model
refs https://github.com/TryGhost/Team/issues/1664
2022-07-12 10:24:02 +02:00
Fabien "egg" O'Carroll
ed7ce2c00f Added initial auth frame
refs https://github.com/TryGhost/Team/issues/1664

This has no security features, we need to replace usage of "*" with the origin of
the frontend site.
2022-07-12 10:24:02 +02:00
Kevin Ansfield
e60ec64454 Added WIP frontend comments app
refs https://github.com/TryGhost/Team/issues/1664
2022-07-12 10:24:02 +02:00
Daniel Lockyer
1dd83e1a0f Added Ghost Explore endpoint
- this new endpoint returns a special set of data for use in Ghost Explore
2022-07-11 16:48:40 +01:00
Fabien "egg" O'Carroll
c756966ce9
Updated admin cookie samesite attribute to 'none'
refs https://github.com/TryGhost/Team/issues/1664

We want to have the ability for the frontend to be aware of and make use of
sessions with the admin. Because these run on different domains we need to
update the cookie attributes to be more lax in terms of cross domain usage.
2022-07-08 16:27:49 +02:00
Kevin Ansfield
fc381b7626 Added comment CRUD+Moderate permissions
refs: https://github.com/TryGhost/Team/issues/1664

- added permissions for comments, including updating test fixtures

Co-authored-by: Simon Backx <simon@ghost.org>
2022-07-08 15:46:11 +02:00
Kevin Ansfield
b88212b603 Added comments_enabled setting
refs https://github.com/TryGhost/Team/issues/1664

- comments are disabled by default, but can be enabled on any site
2022-07-08 15:46:11 +02:00
Kevin Ansfield
301ae61aa9 Added users.comment_notifications field
refs: https://github.com/TryGhost/Team/issues/1668

- temporary solution until `user_settings` table is in place
2022-07-08 15:46:11 +02:00
Kevin Ansfield
fa59286eff Added comment related fields to members table
refs https://github.com/TryGhost/Team/issues/1664

- `last_commented_at` - to be used for filtering members list in Admin
- `bio` - short field used to show a "title" or similar context alongside name when commenting
- `enable_comment_notifications` - setting for turning on/off email notification of comment replies
2022-07-08 15:46:11 +02:00
Kevin Ansfield
a78eed1799 Added comment_reports table creation migration
refs https://github.com/TryGhost/Team/issues/1664

- new table to handle moderation reports on comments. This is not a join table, so it is comment_reports, rather than comments_reports
2022-07-08 15:46:11 +02:00
Kevin Ansfield
959786b71f Added comment_likes table creation migration
refs https://github.com/TryGhost/Team/issues/1664

- new table to handle likes on comments. This is not a join table, so it is comment_likes, rather than comments_likes
2022-07-08 15:46:11 +02:00
Kevin Ansfield
799a42062c Added comments table creation migration (#14998)
refs https://github.com/TryGhost/Team/issues/1664

Field notes:

- `parent_id` - used for nested comments but will be limited to 1 level in app-level validation
- `member_id` - when a member is deleted for now the member id is kept but in the future may be removed, hence `nullable: true`
- `status` - "hidden" status will be used when a staff user hides a comment, "deleted" is used when a comment author deletes
- `html` - will store pre-sanitised html
- `edited_at` - used to show an "X edited at Y" note when displaying comments, separate to `updated_at` because changing the status would also change `updated_at` but shouldn't show the "edited at" UI
2022-07-08 15:46:11 +02:00
Daniel Lockyer
6d521cc14c Added migration for Ghost Explore permissions
- this adds permissions so the Ghost Explore integration has permission
  to access the `/explore/` endpoint
2022-07-08 11:54:31 +02:00
Daniel Lockyer
3747df1bc8
Added migrations for Ghost Explore integration and API key (#15011) 2022-07-08 09:55:58 +02:00
Ronald Langeveld
2bf4344a63
🐛 Fixed API excerpt field issue (#15005)
* 🐛 Fixed API excerpt field issue
ref https://github.com/TryGhost/Ghost/issues/10396

This fix now allows the API user to add field `excerpt` without the need for `plaintext` as format.
Also added new tests for these functions.
* Added new logic that takes `custom_excerpt` into account if all posts gets queried.
* Removed limits in excerpt & plaintext post.
* Updated snapshot.
2022-07-06 17:57:04 +02:00
Ronald Langeveld
9e8bbc028d Revert "migrated excerpt fix"
This reverts commit 35ab123499.
2022-07-06 12:42:22 +02:00
Ronald Langeveld
f20618679a Revert "fixed linting"
This reverts commit bb509ee02c.
2022-07-06 12:42:13 +02:00
Ronald Langeveld
bb509ee02c fixed linting 2022-07-06 11:07:06 +02:00
Ronald Langeveld
35ab123499 migrated excerpt fix 2022-07-06 11:07:06 +02:00
Hannah Wolfe
ab0dc4769c
Removed straggling canary naming from comments
- we no longer have a versioned API, just an API :)
2022-07-04 15:44:58 +02:00
Daniel Lockyer
c50658953c Renamed API canary/ folder to endpoints/
- now we only have one API version, it doesn't make sense to keep
  "canary" around
- renaming it to `endpoints/` makes more sense for this
- this commit renames the `core/server/api/canary/` folder to
  `core/server/api/endpoints/`
- it also fixes the naming in test titles and the various other places
  we relied on this
2022-07-04 11:14:37 +02:00