Implemented the basics for voting#130
Merged
david-poindexter merged 5 commits intoDNNCommunity:developfrom Feb 10, 2026
Merged
Conversation
Added REST API for UserVoice module settings (get/update, admin-only), including new SettingsController, UserVoiceSettings model, and repository interface/implementation. Integrated settings into DI and request context. Added integration tests for settings API and improved test infrastructure. Enhanced coverage reporting with combined badges and updated README. Refactored idea deletion validation logic and added related unit test. Increased code coverage and applied code quality improvements, including ExcludeFromCodeCoverage attributes and DI updates. Cleaned up namespaces and using statements.
Introduced UserVote entity and repository for user voting. Updated database schema and migration to include UserVotes table. Added unique index and foreign key for votes. Extended Idea entity with UserVotes collection. Implemented repository methods to add/remove votes, prevent duplicates. Added unit tests for voting logic and updated existing tests. Updated project and migration resource files for new schema.
- Introduced IVotingService and VotingService for upvoting, removing votes, and retrieving user vote stats - Added VoteDto, VoteDtoWithContext, and VoteStatsViewModel - Implemented UpvoteDtoValidator to enforce voting rules (vote limits, idea existence) - Registered new services and validators in DI container - Extended IUserVoteRepository with CountVotesForUserAsync - Updated ModelValidation.resx and LocalizationViewModel for vote limit messages - Enhanced TypeScript client for new settings and localization fields - Added unit tests for voting service and validator; improved test data setup - Updated coverage history to reflect new code and tests - All changes are backward compatible and additive
Implemented voting functionality with new VotingController REST endpoints for stats, upvoting, and vote removal. Added TypeScript client support and DTOs. Updated idea view models to include vote counts. Added integration tests for voting endpoints. Removed unused localization and refactored related code.
Backend now tracks if user has voted for each idea (`IsVotedByUser`). Frontend displays real vote counts, voting status, and allows upvoting/withdrawing votes. Added progress bar and localized label for remaining votes. Updated unit tests, CSS, DI registration, and documentation. Improved code coverage.
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.

Closes #125