Open
Conversation
added 23 commits
January 28, 2018 12:01
…s being saved. Extract method for uniq, filter and map.
…f the modal window.
… a part of logic from this.state to mobX store (votesStore)
…most of the logic from components to voteStore. Add support of categories and comment to socket and store and components.
…ed one method into small several
… components into small ones. Changed logic (user can't vote now if he haven't choosen category)
…xtracted exact component for comments. Added function to votesStore which defines list of comments
…e new topic than edit categories in it. Fixed bug when you choose topic without categories (app crashed).
…is logic is about defining logins and count of votes in each category for candidate.
Contributor
Author
UPGRADELike I said there was a fat logic on the client side, so I've migrated it from client to the server. Now every client doesn't calculate information by each candidate about logins in each categories and count of votes in each category. It does server and it does calculations only once and then send it to all clients via socket. So client just receives info, calculate minimal things he needs, and render it. Added sorting: |
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.

According to technical task I've developed Categories.
I'm going to show how the result looks like.
Here is a text-area on creating/edit page. It is readonly for editing, because it causes problems if we edit it. Also I think it is not logical to edit it. It is better to create a new one with desired categories.
If we don't type categories then voting is on original way:
The switcher for information about all categories:
Comments are displayed by popover:
Behavior of the modal window:
I've tried to save structure of files as possible, but I've splited several components into small ones.
I think the most dangerous part of my work is in votesStore because there is some fat logic and I don't know is it ok or not. May be it would be better to remove it from client and pass to server. I think it's up to you.