-
Notifications
You must be signed in to change notification settings - Fork 347
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
feat(persistence): add support for polls and poll votes #2060
Open
xsahil03x
wants to merge
58
commits into
master
Choose a base branch
from
feat/poll-persistence
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
…at/message-polls-apis
…at/polls-attachment-composer # Conflicts: # packages/stream_chat/lib/src/core/models/poll.dart # packages/stream_chat/lib/src/core/models/poll.g.dart # packages/stream_chat/lib/src/core/models/poll_option.dart # packages/stream_chat/lib/src/core/models/poll_option.g.dart # packages/stream_chat/lib/src/core/models/poll_vote.dart # packages/stream_chat/lib/src/core/models/poll_vote.g.dart # packages/stream_chat/lib/src/event_type.dart
…into feat/poll-message-widget
…eat/poll-persistence # Conflicts: # packages/stream_chat_persistence/CHANGELOG.md # packages/stream_chat_persistence/pubspec.yaml
# Conflicts: # packages/stream_chat/lib/src/core/models/poll.dart # packages/stream_chat/lib/src/core/models/poll_vote.dart # packages/stream_chat/lib/src/db/chat_persistence_client.dart # packages/stream_chat_flutter/lib/src/message_input/attachment_picker/stream_attachment_picker.dart # packages/stream_chat_flutter/lib/src/poll/creator/poll_option_reorderable_list_view.dart # packages/stream_chat_flutter/lib/src/theme/stream_chat_theme.dart # packages/stream_chat_flutter/test/src/poll/creator/poll_option_reorderable_list_view_test.dart # packages/stream_chat_flutter/test/src/poll/creator/poll_question_text_field_test.dart # packages/stream_chat_flutter/test/src/poll/creator/stream_poll_creator_dialog_test.dart # packages/stream_chat_flutter/test/src/poll/interactor/poll_add_comment_dialog_test.dart # packages/stream_chat_flutter/test/src/poll/interactor/poll_footer_test.dart # packages/stream_chat_flutter/test/src/poll/interactor/poll_header_test.dart # packages/stream_chat_flutter/test/src/poll/interactor/poll_suggest_option_dialog_test.dart # packages/stream_chat_flutter/test/src/poll/interactor/stream_poll_interactor_test.dart # packages/stream_chat_flutter/test/src/poll/stream_poll_options_dialog_test.dart # packages/stream_chat_flutter/test/src/poll/stream_poll_results_dialog_test.dart # packages/stream_chat_flutter_core/test/stream_poll_controller_test.dart # packages/stream_chat_localizations/lib/src/stream_chat_localizations_it.dart # packages/stream_chat_persistence/CHANGELOG.md # packages/stream_chat_persistence/pubspec.yaml
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2060 +/- ##
==========================================
+ Coverage 60.59% 60.81% +0.22%
==========================================
Files 356 361 +5
Lines 21846 22018 +172
==========================================
+ Hits 13237 13391 +154
- Misses 8609 8627 +18 ☔ View full report in Codecov by Sentry. |
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 pull request includes several changes to the
stream_chat
package, focusing on adding support for polls and poll votes. The most important changes include adding new methods for handling polls and poll votes, updating data access objects (DAOs) to support these new entities, and integrating these changes throughout the codebase.Poll and Poll Vote Support:
packages/stream_chat/lib/src/core/models/poll.dart
: Added@JsonValue
annotations to theVotingVisibility
enum to support serialization.packages/stream_chat/lib/src/core/models/poll_vote.dart
: Added acopyWith
method to thePollVote
class to facilitate creating modified copies of poll votes.Data Access Objects (DAOs) Updates:
packages/stream_chat_persistence/lib/src/dao/poll_dao.dart
: Created a newPollDao
class for managing poll entities, including methods for retrieving, updating, and deleting polls.packages/stream_chat_persistence/lib/src/dao/poll_vote_dao.dart
: Created a newPollVoteDao
class for managing poll vote entities, including methods for retrieving, updating, and deleting poll votes.Integration with Chat Persistence:
packages/stream_chat/lib/src/db/chat_persistence_client.dart
: Added methods to theChatPersistenceClient
class for updating and deleting polls and poll votes, and integrated these methods into the existing data handling logic. [1] [2] [3] [4] [5] [6]Testing and Converters:
packages/stream_chat_persistence/lib/src/converter/voting_visibility_converter.dart
: Added aVotingVisibilityConverter
class to handle the conversion ofVotingVisibility
enum values to and from strings for database storage.packages/stream_chat/test/src/db/chat_persistence_client_test.dart
: Updated the test persistence client and added new tests to cover the new poll and poll vote methods. [1] [2] [3] [4] [5]