-
-
Notifications
You must be signed in to change notification settings - Fork 82
Added member commenting schema for comment moderation #737
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThe PR removes packages/admin-api-schema/lib/schemas/comment_bans-add.json, adds packages/admin-api-schema/lib/schemas/member_commenting-disable.json, renames schema $id/title/description and the definition name from "comment_bans"/"comment_ban" to "member_commenting"/"member_commenting" in packages/admin-api-schema/lib/schemas/member_commenting.json, updates packages/admin-api-schema/lib/schemas/index.js to export 'member_commenting-disable' instead of 'comment_bans-add', replaces an inline comment ban schema in members-edit.json with a $ref to members#/definitions/member-commenting, and replaces the comment_ban property in members.json with a commenting property plus a new member-commenting definition. Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @packages/admin-api-schema/lib/schemas/member_commenting.json:
- Around line 3-7: Index.js still imports or references the removed
"comment_bans-add" schema causing runtime failures; open
packages/admin-api-schema/lib/schemas/index.js, locate the reference to
"comment_bans-add" and either replace it with the new "member_commenting" (or
"member_commenting-disable" if that was intended) or remove the entry if it's
obsolete, and update any export/key names to match the renamed schema
identifiers so the schema loader references the existing member_commenting
files.
🧹 Nitpick comments (1)
packages/admin-api-schema/lib/schemas/member_commenting-disable.json (1)
13-15: Consider simplifying theallOfwrapper.The
allOfwith a single$refis slightly redundant. You can reference the definition directly initems.✨ Suggested simplification
"items": { - "allOf": [{ "$ref": "member_commenting#/definitions/member_commenting" }] + "$ref": "member_commenting#/definitions/member_commenting" }
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
packages/admin-api-schema/lib/schemas/comment_bans-add.jsonpackages/admin-api-schema/lib/schemas/member_commenting-disable.jsonpackages/admin-api-schema/lib/schemas/member_commenting.json
💤 Files with no reviewable changes (1)
- packages/admin-api-schema/lib/schemas/comment_bans-add.json
🔇 Additional comments (1)
packages/admin-api-schema/lib/schemas/member_commenting-disable.json (1)
1-19: Verify if an enable endpoint requires a corresponding schema file.The schema naming convention documented in the README uses
{resourceName}-{methodName}.jsonfor endpoint-specific schemas. Amember_commenting-disable.jsonfile exists, but there is nomember_commenting-enable.json. If an enable endpoint is also being implemented, following the established convention would require adding a corresponding schema file for request body validation. Confirm whether the enable endpoint is in scope for this PR.
a45dc47 to
53b99ac
Compare
21f47a8 to
cddf551
Compare
ref https://linear.app/ghost/issue/FEA-487 - Added `can_comment` (boolean) to member properties - Added `commenting` property to member with `member-commenting` definition: - `disabled` (boolean, required) - `disabled_reason` (string, minLength: 1, maxLength: 2000) - `disabled_until` (string|null, format: date-time) - Added `member_commenting.json` base schema for disable endpoint - Added `member_commenting-disable.json` schema for `/members/:id/commenting` endpoint
cddf551 to
b6b59ff
Compare
ref https://linear.app/ghost/issue/FEA-487 Adds optional `hide_comments` boolean to the disable endpoint, allowing admins to hide a member's existing comments when disabling their ability to comment.
ref https://linear.app/ghost/issue/FEA-487
Summary
Adds schema support for member comment moderation, enabling admins to disable/enable commenting for specific members.
Changes
can_comment(boolean) to member properties - computed field indicating if member can commentcommentingproperty to member schema withmember-commentingdefinition:disabled(boolean, required): whether commenting is disableddisabled_reason(string, minLength: 1, maxLength: 2000): explanation for disablingdisabled_until(string|null, format: date-time): optional expiration for temporary disablesmember_commenting.jsonbase schema for the disable endpointmember_commenting-disable.jsonschema for/members/:id/commentingendpoint