feat: Add admin toggle for anonymous posting#24
Open
avalonsueiro wants to merge 5 commits into
Open
Conversation
- Add anonymous posting toggle to admin post settings page - Include internationalization support (en-US, en-GB, de) - Add comprehensive unit tests for toggle visibility and ACP behavior - Add template validation tests for proper HTML structure - Add i18n tests to ensure all language files have required keys - Fix async test timeout issue in utils.js - All tests now passing (4679 passing, 149 pending)
Pull Request Test Coverage Report for Build 18424093285Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds the admin toggle for anonymous posting and sets up everything needed for backend integration later. It includes the toggle UI, default config, i18n support, and full test coverage to make sure everything works as expected.
Changes:
Admin Settings
Added a toggle in /admin/settings/post to turn anonymous posting on/off
Uses NodeBB’s standard settings framework and Bootstrap form controls
Default is off
Includes proper form validation (data-field for auto-save)
Internationalization (i18n)
Added translation keys for “Enable Anonymous Posting” in multiple locales
Consistent key: enable-anonymous-posting
Verified translations and added i18n tests
Config Updates
Added enableAnonymousPosting: 0 to install/data/defaults.json
Matches NodeBB’s config conventions
Tested persistence and validation
Testing
Added 16 unit tests covering:
Admin panel toggle visibility
Config defaults and persistence
i18n validation
Template rendering and HTML structure
API endpoint behavior
All tests pass.
Notes
Non-breaking (feature off by default)
Ready for backend integration
Follows NodeBB settings + i18n patterns
Frontend already supports isAnonymous flag
Next Steps
Add backend logic for the toggle
Handle post creation and user permissions
Support anonymous post display and moderation