Skip to content

feat: Add admin toggle for anonymous posting#24

Open
avalonsueiro wants to merge 5 commits into
CMU-313:mainfrom
avalonsueiro:main
Open

feat: Add admin toggle for anonymous posting#24
avalonsueiro wants to merge 5 commits into
CMU-313:mainfrom
avalonsueiro:main

Conversation

@avalonsueiro
Copy link
Copy Markdown

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

Avalon Sueiro and others added 5 commits September 26, 2025 17:35
- 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)
@coveralls
Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 18424093285

Warning: 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

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.009%) to 77.764%

Files with Coverage Reduction New Missed Lines %
src/controllers/admin/info.js 2 71.76%
Totals Coverage Status
Change from base Build 18423854227: -0.009%
Covered Lines: 24583
Relevant Lines: 29715

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants