Commit Graph

16525 Commits

Author SHA1 Message Date
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
renovate[bot]
4134a6ac4c
Update dependency luxon to v2.5.0 2022-07-11 05:29:16 +00:00
renovate[bot]
780731c8a4
Update metascraper to v5.29.15 2022-07-11 02:23:49 +00:00
renovate[bot]
a07a2361d0
Update dependency @sentry/node to v7.6.0 2022-07-08 23:27:24 +00: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
renovate[bot]
1cadf85020 Update dependency @playwright/test to v1.23.2 2022-07-08 08:45:34 +02:00
Rishabh
ecce576bc8 Updated sodo search script to include admin url
refs https://github.com/TryGhost/Team/issues/1665

- sodo search script only needs the admin url for fetching data from content api
- removes site url and updates the main url to use admin domain
2022-07-07 11:01:21 +02:00
Renovate Bot
dc3a6a4eaa Update peter-evans/create-or-update-comment digest to b95e16d 2022-07-07 08:59:57 +02:00
renovate[bot]
3e1978fd18 Update dependency @sentry/node to v7 2022-07-07 08:58:02 +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
e8306ffa29 Revert "Revert "Updated sodo search test script with version data""
This reverts commit 7c1ef4ecd0.
2022-07-06 12:41:42 +02:00
Ronald Langeveld
7c1ef4ecd0 Revert "Updated sodo search test script with version data"
This reverts commit 7cb37d9091.
2022-07-06 12:28:10 +02:00
Ronald Langeveld
569e16ee1d Revert "updated snapshots"
This reverts commit 4f43c52637.
2022-07-06 12:24:41 +02:00
Ronald Langeveld
4f43c52637 updated snapshots 2022-07-06 11:07:06 +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
Rishabh
7cb37d9091 Updated sodo search test script with version data
refs https://github.com/TryGhost/Team/issues/1665

- sodo search now includes version data in config to allow fetching css directly
2022-07-06 10:47:07 +02:00
Rishabh
67a60353c3 Added version information in sodo search config
refs https://github.com/TryGhost/Team/issues/1665

- version information allows creating the css bundle link for prod
- adds version information from the config
2022-07-06 10:11:15 +02:00
Daniel Lockyer
0aa5748951
Deleted urls.json file
fixes https://github.com/TryGhost/Toolbox/issues/253

- this file is not used and is outdated, so we can just clean it up by
  deleting the file
2022-07-05 15:50:15 +02:00
Daniel Lockyer
ede8b5117b
Merged v5.2.4 into main
v5.2.4
2022-07-05 10:52:52 +02:00
Daniel Lockyer
03c9fd47fa v5.2.4 2022-07-05 09:50:40 +01:00
Daniel Lockyer
a6150bc2df Updated Admin to v5.2.4 2022-07-05 09:50:40 +01:00
renovate[bot]
1bc6148e28
Update dependency supertest to v6.2.4 2022-07-04 17:30:52 +00:00
Naz
b996eadbd4 Renamed sodo search identification attribute
refs https://github.com/TryGhost/Team/issues/1665

- The search script should be uniquiely identifiable in DOM. Previously element for portal scipt element and search element both had `data-ghost` attributes` for identification. Having `data-sodo-search` makes naming unique
2022-07-04 16:44:01 +02:00
Naz
f6b2a83761 Added sodoSearch script output from ghost_head helper
no issue

- The sodoSearch needs to be injected into rendered HTML the same way portal scripts are.
- The feature is behind a `sodoSearch` alpha flag, so the scripts are injected conditionally
2022-07-04 16:44:01 +02:00
Simon Backx
3edbb364fe Renamed data-ghost attribute on comments script 2022-07-04 16:12:35 +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
Kevin Ansfield
3da839e80e Fixed unit tests failing on unknown helper
refs dc49871837

- added the `comments` helper to the experimental helpers list
2022-07-04 15:42:18 +02:00
Kevin Ansfield
dc49871837 Added {{comments}} helper
refs https://github.com/TryGhost/Team/issues/1664

- added `comments:url` config for a similar setup to Portal
- added `{{comments}}` helper that's behind the `comments` labs flag
  - currently outputs a `<script>` tag that points to the comments script with API location+key data attributes
2022-07-04 15:34:01 +02:00
Daniel Lockyer
da3d32e2ed
Fixed straggling use of canary naming
refs c50658953c

- this was missed in the referenced commit
2022-07-04 14:21:29 +02:00
Kevin Ansfield
8b2ba86909 Updated labs API snapshot
refs 46669c7036

- API output changes when labs flags are changed so snapshot needs updating to match
2022-07-04 14:13:43 +02:00
Kevin Ansfield
46669c7036 Added comments labs flag
no issue

- alpha flag for commenting system
2022-07-04 14:07:41 +02:00
Naz
4e539137be Fixed broket test
refs 911ce4f29e

- Fixed the settings snapshot for a news labs flag
- Long term we should look into making the labs property match dynamically as it is updated quite often. We'll forget to update this snapshot!
2022-07-04 17:23:27 +08: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