-
Notifications
You must be signed in to change notification settings - Fork 3
similar resources carousel #1835
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
8927df5
to
8a1d565
Compare
`${API_BASE_URL}/api/v1/learning_resources/${params.id}/similar/`, | ||
vectorSimilar: ( | ||
params: Params<LRApi, "learningResourcesVectorSimilarList">, | ||
) => `${API_BASE_URL}/api/v1/learning_resources/${params.id}/vector_similar/`, |
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.
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.
@sovsey What do you think?
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.
Let's update so it evenly pages.
@@ -65,6 +66,7 @@ const DrawerContent: React.FC<{ | |||
closeDrawer: () => void | |||
}> = ({ resourceId, closeDrawer }) => { | |||
const resource = useLearningResourcesDetail(Number(resourceId)) | |||
// const similarResources = useSimilarLearningResources(Number(resourceId)) |
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.
stray comment
@@ -80,6 +80,7 @@ const IconContainer = styled.span({ | |||
[theme.breakpoints.down("sm")]: { | |||
display: "none", | |||
}, | |||
zIndex: -1, |
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.
why is this needed?
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.
I added this due to an issue with some elements of the drawer ending up "on top" of the sticky header in the drawer when you scroll down. I changed the approach here and instead set zIndex: 1
on the header itself.
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.
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.
I realize this seems somewhat unrelated, but now that the carousels will be in there scrolling will actually happen in the drawer and these issues made themselves apparent, so I'd like to get this fixed as part of adding the carousels.
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.
sounds good. just wanted to make sure it was something intentional and not left behind from previous testing.
…ces query and add to v2 drawer
… them below the header, raise the header itself
eb9d233
to
e1d5119
Compare
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.
* reconfigure API endpoints to not be paginated, support similar resources query and add to v2 drawer * style the carousel * retrieve not list * set anonymous read only permission on new endpoints * put the api endpoints back the way they were * fix js tests * make carousels optional * more styling work * flex grow the carousel section * add vector based similar learning resources carousel * use correct type * add tests * adjust carousel section mobile padding * instead of setting z index on other elements within the drawer to get them below the header, raise the header itself * remove stray comment
What are the relevant tickets?
Closes https://github.com/mitodl/hq/issues/5878
Description (What does it do?)
This PR adds two
ResourceCarousel
s to the new learning resource drawer based on the new "similar resources" APi endpoints. Both the opensearch and vector based results are displayed below the resource information.Screenshots (if appropriate):
How can this be tested?
lr_drawer_v2
flagdrawerV2
to betrue
inLearningResourceDrawer.tsx
mit-learn
docker compose exec web python manage.py generate_embeddings --skip-contentfiles --recreate-collections --all