US4 frontend + backend + permissions (for post-replies & topic-replies)#69
US4 frontend + backend + permissions (for post-replies & topic-replies)#69
Conversation
… not updating after backend change. Added timestamp and identifier of who approved a post to database. Also added more error catching to prevent page getting stuck reloading.
Need to update my branch with the main branch.
…ate dropdown to toggle isAnonymous instead
…g mutated shared user object with anonymous tag
There was a problem hiding this comment.
Pull request overview
Implements US4 “anonymous posting” across frontend and backend, including persistence and permission-based identity masking for topic replies and post replies, plus enhancements to “Supported by Instructor” metadata/badging.
Changes:
- Adds anonymous posting UI hooks (quick-reply + full composer) and persists
isAnonymouson created topics/posts. - Masks author identity for anonymous content when viewed by non-privileged, non-author users (including API/schema updates to expose new fields).
- Extends “Supported by Instructor” with approver UID/time tracking and client-side badge update behavior.
Reviewed changes
Copilot reviewed 12 out of 14 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| vendor/nodebb-theme-harmony-main/templates/partials/topic/post.tpl | Repositions “Supported by Instructor” badge in post header markup. |
| vendor/nodebb-theme-harmony-2.1.35/templates/partials/topic/post.tpl | Same badge repositioning in version-pinned theme templates. |
| test/ta-resolve.js | Adds tests for anonymous save logic and obfuscation behavior. |
| src/topics/posts.js | Adds server-side anonymous obfuscation logic during topic post data assembly. |
| src/posts/summary.js | Includes isAnonymous and supported-by-instructor tracking fields in post summaries. |
| public/src/modules/quickreply.js | Fires a new quickreply data hook to allow plugins to modify payload before posting. |
| public/src/client/topic/supportAnswer.js | Improves badge/menu update robustness and adds success toasts for support/un-support actions. |
| public/openapi/read/admin/extend/plugins.yaml | Adds url field to admin plugin listing schema. |
| public/openapi/components/schemas/PostObject.yaml | Adds isAnonymous and supported-by-instructor tracking fields to OpenAPI post schemas. |
| plugins/ta-resolve/public/ta-resolve-composer.js | Injects “Post as: named/anonymous” UI and attaches isAnonymous to composer/quickreply payloads. |
| plugins/ta-resolve/plugin.json | Registers new client script and backend hooks for anonymous handling and obfuscation. |
| plugins/ta-resolve/library.js | Implements anonymous persistence + obfuscation hooks; adds support-approval tracking + notifications. |
| plugins/ta-resolve/language/en/ta-resolve.json | Adds an English translation string for support-answer messaging. |
| make-anon.js | Adds a standalone script to directly toggle anonymity flags in the DB for test data. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
brendayyu
left a comment
There was a problem hiding this comment.
Applied a suggestion from Copilot but should thoroughly check other Copilot suggestions as well. Everything else looks great!
… fixes Co-authored-by: pskodr <61149119+pskodr@users.noreply.github.com>
valid implementation that fixes security Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
pskodr
left a comment
There was a problem hiding this comment.
Resolved co-pilot's suggestions
Address PR review feedback: security fixes, privilege logic, and code quality
… US4" This reverts commit 8c4309c. test file before copilot changes
…in test/ta-resolve-composer-client.js" This reverts commit 0eca759. revert to latest working commit before copilot changes
Merging my local branch with origin main.
Co-pilot's suggesting breaks implementation of anonymous posting.
PDFour4
left a comment
There was a problem hiding this comment.
Went over copilot suggested comments and marked as resolved. Did not implement all, since they broke functionality.
… in test/ta-resolve-composer-client.js" This reverts commit fc144c9.
…r US4" This reverts commit a29f65a. revert to latest working commit with lin t
…in test/ta-resolve-composer-client.js" This reverts commit 0eca759. revert to latest working commit
… US4" This reverts commit 8c4309c. test if this works latest version
…ing-26-yc26 into u4-frontend pull merge branach from u4 lint debug branch
- Security: Removed unsafe make-anon.js dev script to resolve Copilot warnings. - Config: Restored test_database in config.json for NodeBB core tests. - Docs: Added UserGuide.md synthesizing all custom feature workflows. - Testing: Fixed mock data structures and added missing test blocks to achieve 99.4% coverage for the ta-resolve plugin.
…4-frontend Deleted make-anon file since it is no longer needed.
This PR
Implements User story 4 (for quick-replies and post replies): anonymous posting front end + back end
Fixes #45 #48 #61 #60 #52 #58 #59 #65 #66 #64 #63 #62
Changes & Implementation:
US4 Backend:
US4 Frontend:
US4 Permissions: logic:
US4 Testing
Front end:
Backend:
Permissions:
How to Test (UI):
Also test by running npx mocha test/ta-resolve-composer-client.js and npx mocha test/ta-resolve.js, or just npm run test
and run npm run lint