-
Notifications
You must be signed in to change notification settings - Fork 82
Add dropdown to sort completed demons on stats viewers #211
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
Add dropdown to sort completed demons on stats viewers #211
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #211 +/- ##
==========================================
- Coverage 30.41% 30.34% -0.07%
==========================================
Files 114 114
Lines 8019 8037 +18
==========================================
Hits 2439 2439
- Misses 5580 5598 +18 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Mhh, yeah, sorry, suggesting cookies was wrong of me, I meant local storage 😭 I meant localstorage. The tabbed pane stuff (e.g. what allows you to select tabs in the user area and restores your selects tab after reloading) in pointercrate-core-pages/static/js/modules/tab.js already does something like this. |
Let's do it for both, the initialization of the dropdown can be moved into the stats viewer base class, and from there it can probably even re-trigger the abstract population routine. I also still think that when its set to "by difficulty", it shouldn't populate everything into the same list, but rather use separate lists for main/extended/legacy demons. fwiw, |
|
oh 😭 i guess i didn't need to modify |
62df64c to
be0d5b7
Compare
954c66f to
84535d7
Compare
…sition Cookie fix Rename to_cookie to to_value Move from use of cookies to localStorage Add sorting options to nation stats viewer Added ability to have multiple sections within one StatsViewerRow List demons differently when sorting by position in individual stats viewer Replaced unnecessary use of formatDemon Modified UI Fix stats containers not being hidden properly Implemented sectioned lists to nation stats viewer from stadust: * eliminate `Vec` from `StatsViewerRow` again * dont use jQuery for hiding/showing html elements * ui: pre-create both alphabetical and position sorted demons Always populate eagerly both the stats viewer divs for alphebatical demon sorting and position sorting, so that the dropdown selection only needs to show/hide some divs instead of creating a bunch of UI.
84535d7 to
6f5dec4
Compare




An implementation of #208, adds a dropdown which allows the user to choose between two sorting options
The selected value is saved in cookies, where the default value of the
simple_dropdownis set to the cookie value.In the Javascript (only in the
IndividualStatsViewerclass), the code that populates the stats containers is moved from theonReceivefunction to its ownpopulateStatsContainersfunction, so the stats containers can be repopulated without sending another requestCurrently, it's only implemented in the individual stats viewer, but I could see this feature being nice to have in the nation stats viewer as well so I'm open to making changes
I'm not entirely sure if handling all of the cookie stuff in the backend is the greatest idea, my second thought would be to just modify the dropdown's selected value to the cookie value (or maybe just a value in
localStorage) once it's initialized in the JS, but I'm not quite sureLicense Acceptance
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.