-
Notifications
You must be signed in to change notification settings - Fork 0
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
Update team statistics on drag and drop model change #11
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "active" team in a student is still not updated when dragged to a new project correctly. If a student is moved back an froth between two projects the team updates, but in the wrong way -> on drop, the team is updated to the team it got removed from
Is this PR ready to review? |
Yes I think so. |
v2 of Dragula came with some breaking changes, one of which was that the [dragulaModel] directive no longer mutates the array that you provide it but instead returns a shallow copy of the result, to actually change/update the array (for example a team) a simple switch to the two-way binding alternative [(dragulaModel)] can be used.
Now dragging a person from one team to another or to the unassigned person pool automagically updates the team statistics (I love frontend frameworks!), so the team size and priority distribution show the correct values, and any unsatisfied constraints are highlighted in red.
What changed: Dragging and dropping a person from one team to another to manually modify the allocation now correctly updates the model to reflect a person's new team
Why the change: Without the model update manual changes don't persist -> CSV export (for example) doesn't correctly reflect the teams persons were assigned in final allocation
Testing steps: Import & load example data -> Drag and drop a student from one team to another -> Export team allocation data and check whether the column specifying the person's team matches the team the person was dragged into