Counter badges for dashboard filter tabs #31
Merged
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.
In this PR
This PR adds counter badges to the filter tabs in the Dashboard.
Beta users had repeatedly reported that a project they had joined did not appear in their dashboard. This is (almost certainly) confusion over the tab filtering, caused by bad UX.
With this PR, joining a project will affect the counter value instantly. Badges are also in a "disabled" style while the count is 0. This means that a first-time user will see both a change in the counter value, as a well as a change in the color shade, which should provide slightly better feedback.
Additional note: unlike admin users, normal (Professor/Student) users do not have an 'All Projects' filter setting! It was also commented by a beta user that this would be desirable. I removed the tab briefly before the beta test, because it's default behavior was to list all projects that SELECT query returned from the DB.
This was fine for an Org Admin (who should see everything in the system). But not for a professor, who should not see projects they can't enter (but only "Mine" + "Shared" combined). This view is now made easier by @lwjameson recent RPC function. I will add this to the UI in a separate PR.