-
Notifications
You must be signed in to change notification settings - Fork 3
Filled vs Unfilled Bookmarks #1180
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
Conversation
2176fdf to
ab5fa74
Compare
396dc93 to
7563f6c
Compare
| response.data.resource, | ||
| queryClient.setQueriesData<PaginatedLearningResourceList>( | ||
| learningResources.featured({}).queryKey, | ||
| (old) => updateListParentsOnAdd(response.data, old), |
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.
Regarding updateListParentsOnAdd and updateListParentsOnDestroy :
- The featured carousel on the homepage is populated by an API that has an intentionally randomized order.
- In general throughout the app, when data might change, we tell react query "invalidate the cached data" and it re-fetches.
- Adding the featured courses to a userlist changes their data (it affects `resource.user_list_parents). However, if we invalidate the cache and refetch new, updated data, then the carousel order will change, which is strange.
- you can see this behavior on RC / Prod, but the bookmarks won't fill / unfill, so it's less noticeable that position has changed.
- So instead of invalidating the cache and refetching the data, we manually update the data on the frontend.
We only do this for userlists, not for learnignpaths, because...
- changing a resource's learningpath membershould can change whether it is a featured course or not, so we really do need to refetch the data.
|
@abeglova One thing to keep in mind is that normal users only have a single icon—the list icon is only visible to staff. But even for normal users, this exacerbates the overlap issue more than it should. I'll adjust a bit. E.g.,
|
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.
This works fantastic generally and looks great! Some small fixes are needed for smaller mobile screens.
Good point that the issue is mostly for just admins, not normal users
|
@abeglova I've tweaked the button positioning to account for button paddings. The cards should look good at 375px with one button, and may look good with 2 buttons depending on date length.
|
abeglova
left a comment
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.
lgtm
|
pre-commit.ci run |
|
Since github says this is mergable, and pre-commit just says
I'm going to merge this. |




What are the relevant tickets?
https://github.com/mitodl/hq/issues/4712
Description (What does it do?)
Makes userlist bookmark and learningpath icon filled vs unfilled based on membership in at least 1 list.
Screenshots (if appropriate):
Cards

List Cards

List Cards, Mobile

How can this be tested?