Skip to content
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

Merged
merged 6 commits into from
May 2, 2023

Conversation

Ayedrian
Copy link
Contributor

@Ayedrian Ayedrian commented Apr 20, 2023

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

@Ayedrian Ayedrian requested review from Mtze and weinhuber April 20, 2023 06:57
@Ayedrian Ayedrian changed the title Update dragulaModel directive to use two-way data binding Update team statistics on drag and drop model change Apr 20, 2023
@Ayedrian Ayedrian added the bug Something isn't working label Apr 20, 2023
@Ayedrian Ayedrian linked an issue Apr 20, 2023 that may be closed by this pull request
Copy link
Member

@Mtze Mtze left a 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

@Mtze
Copy link
Member

Mtze commented Apr 27, 2023

Is this PR ready to review?

@Ayedrian
Copy link
Contributor Author

Is this PR ready to review?

Yes I think so.

@Ayedrian Ayedrian added the ready to review Indicate that reviewer should have a look label Apr 27, 2023
@Ayedrian Ayedrian requested a review from Mtze April 27, 2023 20:49
@Mtze Mtze merged commit 9dd2804 into develop May 2, 2023
@Mtze Mtze deleted the feature/update-statistics-on-drag-drop branch May 2, 2023 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working prio:critical ready to review Indicate that reviewer should have a look
Projects
None yet
2 participants