Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions RELEASE.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
Release Notes
=============

Version 0.66.0
--------------

- filter server-side, remove video count (#3287)
- fix fallback when no language is selected (#3286)
- set s-maxage via NEXT_CACHE_S_MAXAGE_SECONDS (#3280)
- fix: assert run.title in DashboardCard heading test (#3282)
- fix: adjust duration position and remove institution label from the video series page and change the title of video and playlist on drawer (#3270)
- qdrant: Automatically compute optimizer settings (#3273)

Version 0.65.6 (Released May 04, 2026)
--------------

Expand Down
11 changes: 0 additions & 11 deletions frontends/api/src/hooks/learningResources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,16 +193,6 @@ const useSimilarLearningResources = (
})
}

const useVectorSimilarLearningResources = (
id: number,
opts?: { enabled?: boolean },
) => {
return useQuery({
...learningResourceQueries.vectorSimilar(id),
...opts,
})
}

const useInfiniteLearningResourceItems = (
id: number,
params: Omit<ItemsListRequest, "offset">,
Expand All @@ -229,7 +219,6 @@ export {
usePlatformsList,
useSchoolsList,
useSimilarLearningResources,
useVectorSimilarLearningResources,
useInfiniteLearningResourceItems,
learningResourceQueries,
offerorQueries,
Expand Down
16 changes: 9 additions & 7 deletions frontends/api/src/hooks/learningResources/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import type {
LearningResourcesApiLearningResourcesSummaryListRequest as LearningResourcesSummaryListRequest,
PaginatedLearningResourceRelationshipList,
VideoPlaylistResource,
LearningResourcesApiLearningResourcesVectorSimilarListRequest,
} from "../../generated/v1"
import type { VectorLearningResourcesSearchApiVectorLearningResourcesSearchRetrieveRequest as VectorLearningResourcesSearchRetrieveRequest } from "../../generated/v0"
import { infiniteQueryOptions, queryOptions } from "@tanstack/react-query"
Expand Down Expand Up @@ -54,10 +55,9 @@ const learningResourceKeys = {
detailsRoot: () => [...learningResourceKeys.root, "detail"],
detail: (id: number) => [...learningResourceKeys.detailsRoot(), id],
similar: (id: number) => [...learningResourceKeys.detail(id), "similar"],
vectorSimilar: (id: number) => [
...learningResourceKeys.detail(id),
"vector_similar",
],
vectorSimilar: (
params: LearningResourcesApiLearningResourcesVectorSimilarListRequest,
) => [...learningResourceKeys.detail(params.id), "vector_similar", params],
itemsRoot: (id: number) => [...learningResourceKeys.detail(id), "items"],
items: (id: number, params: ItemsListRequest) => [
...learningResourceKeys.itemsRoot(id),
Expand Down Expand Up @@ -174,12 +174,14 @@ const learningResourceQueries = {
.learningResourcesSimilarList({ id })
.then((res) => res.data),
}),
vectorSimilar: (id: number) =>
vectorSimilar: (
params: LearningResourcesApiLearningResourcesVectorSimilarListRequest,
) =>
queryOptions({
queryKey: learningResourceKeys.vectorSimilar(id),
queryKey: learningResourceKeys.vectorSimilar(params),
queryFn: () =>
learningResourcesApi
.learningResourcesVectorSimilarList({ id })
.learningResourcesVectorSimilarList(params)
.then((res) => res.data),
}),
list: (params: LearningResourcesListRequest) =>
Expand Down
10 changes: 6 additions & 4 deletions frontends/main/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ const NEXT_PUBLIC_OPTIMIZE_IMAGES = Boolean(
)
const IS_LOCAL_DEV = process.env.NODE_ENV === "development"

const NEXT_CACHE_S_MAXAGE_SECONDS =
process.env.NEXT_CACHE_S_MAXAGE_SECONDS || "1800"
const PAGE_CACHE_CONTROL = `s-maxage=${NEXT_CACHE_S_MAXAGE_SECONDS}, stale-if-error=86400, stale-while-revalidate=86400`

const processFeatureFlags = () => {
const featureFlagPrefix =
process.env.NEXT_PUBLIC_POSTHOG_FEATURE_PREFIX || "FEATURE_"
Expand Down Expand Up @@ -69,8 +73,7 @@ const nextConfig = {
headers: [
{
key: "Cache-Control",
value:
"s-maxage=1800, stale-if-error=86400, stale-while-revalidate=86400",
value: PAGE_CACHE_CONTROL,
},
],
},
Expand All @@ -86,8 +89,7 @@ const nextConfig = {
headers: [
{
key: "Cache-Control",
value:
"s-maxage=1800, stale-if-error=86400, stale-while-revalidate=86400",
value: PAGE_CACHE_CONTROL,
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ describe.each([
})
expect(courseLink).toHaveAttribute("href", coursewareUrl)
expect(
within(card).getByRole("heading", { name: course.title, level: 3 }),
within(card).getByRole("heading", { name: courseRun.title, level: 3 }),
).toBeInTheDocument()
})

Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react"
import { Typography, styled, theme } from "ol-components"
import { styled } from "ol-components"
import VideoContainer from "./VideoContainer"
import type { VideoResource } from "api/v1"
import { VideoCard, VideoCardSkeleton } from "./VideoCard"
Expand All @@ -18,22 +18,6 @@ const StyledContainer = styled(VideoContainer)(({ theme }) => ({
borderTop: `1px solid ${theme.custom.colors.lightGray2}`,
}))

const CollectionHeader = styled.div(({ theme }) => ({
display: "flex",
justifyContent: "space-between",
alignItems: "center",
margin: "32px 0 8px 0",
[theme.breakpoints.down("sm")]: {
margin: "24px 0 0 0",
},
}))

const CollectionTitle = styled(Typography)({
...theme.typography.body1,
fontWeight: theme.typography.fontWeightMedium,
color: theme.custom.colors.black,
})

const VideoCardList = styled.div(({ theme }) => ({
display: "flex",
flexDirection: "column",
Expand Down Expand Up @@ -61,10 +45,6 @@ const VideoCollection: React.FC<VideoCollectionProps> = ({
return (
<CollectionSection>
<StyledContainer>
<CollectionHeader>
<CollectionTitle>{videos.length} Videos</CollectionTitle>
</CollectionHeader>

<VideoCardList>
{isLoading
? Array.from({ length: 4 }).map((_, i) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ const VideoPlaylistCollectionPage: React.FC<
)

const { data: similarData, isLoading: similarLoading } = useQuery({
...learningResourceQueries.vectorSimilar(playlistId),
select: (data) =>
data.filter(
(resource) => resource.resource_type === ResourceTypeEnum.VideoPlaylist,
),
...learningResourceQueries.vectorSimilar({
id: playlistId,
limit: 6,
resource_type: [ResourceTypeEnum.VideoPlaylist],
}),
})

if (!showVideoPlaylistPage) {
Expand All @@ -88,7 +88,6 @@ const VideoPlaylistCollectionPage: React.FC<
(item): item is VideoResource =>
item.resource_type === VideoResourceResourceTypeEnum.Video,
)
const collectionVideos = videos.slice(1)
const playlistType = isOcwPlaylist(playlist)

const totalVideos = videos.length
Expand Down Expand Up @@ -128,7 +127,7 @@ const VideoPlaylistCollectionPage: React.FC<
) : null}
{!playlistType && (
<VideoCollection
videos={collectionVideos}
videos={videos.slice(1)} // 0th video is featured prominently
isLoading={isLoading}
getHref={getVideoHref}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,15 @@ export const VideoTitle = styled.h1(({ theme }) => ({
...theme.typography.h2,
fontWeight: theme.typography.fontWeightBold,
color: theme.custom.colors.black,
margin: "0 0 40px",
margin: "0 0 16px",
"&:focus": { outline: "none" },
fontSize: "44px",
fontStyle: "normal",
lineHeight: "120%",
letterSpacing: "-0.88px",
[theme.breakpoints.down("sm")]: {
...theme.typography.h3,
margin: "0 0 14px",
margin: "0 0 8px",
letterSpacing: "inherit",
},
}))
Expand Down Expand Up @@ -297,8 +297,9 @@ export const MetaInstructorLine = styled.div(({ theme }) => ({
export const StyledDuration = styled.div(({ theme }) => ({
...theme.typography.body2,
color: theme.custom.colors.silverGrayDark,
margin: "0 0 40px",
[theme.breakpoints.down("sm")]: {
marginTop: "4px",
margin: "0 0 16px",
},
}))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,34 +134,6 @@ describe("VideoSeriesDetailPage", () => {
name: "Introduction to Machine Learning",
})
})

test("renders the institution label from the video department", async () => {
const video = makeVideo({
departments: [
factories.learningResources.department({
department_id: "eecs",
name: "Electrical Engineering and Computer Science",
}),
],
})
renderPage({ video })

await screen.findByText("ELECTRICAL ENGINEERING AND COMPUTER SCIENCE")
})

test("renders the institution label from offered_by when no department", async () => {
const playlist = makePlaylist({
offered_by: {
code: "ocw",
name: "MIT OpenCourseWare",
channel_url: null,
},
})
const video = makeVideo({ departments: [] })
renderPage({ video, playlistId: playlist.id, playlistData: playlist })

await screen.findByText("MIT OPENCOURSEWARE")
})
})

describe("breadcrumbs", () => {
Expand Down Expand Up @@ -391,42 +363,6 @@ describe("VideoSeriesDetailPage", () => {
})
})

describe("topic chips", () => {
test("renders topic chip links for each topic", async () => {
const video = makeVideo({
topics: [
{ id: 1, name: "Machine Learning", parent: 10, channel_url: null },
{ id: 2, name: "Statistics", parent: 11, channel_url: null },
],
})
renderPage({ video })

const mlChip = await screen.findByRole("link", {
name: "Machine Learning",
})
const statsChip = screen.getByRole("link", { name: "Statistics" })
expect(mlChip).toHaveAttribute("href", "/search?topic=Machine%20Learning")
expect(statsChip).toHaveAttribute("href", "/search?topic=Statistics")
})

test("renders the Video Series heading when topics are present", async () => {
const video = makeVideo({
topics: [{ id: 1, name: "Robotics", parent: 5, channel_url: null }],
})
renderPage({ video })

await screen.findByText("Video Series")
})

test("does not render the Video Series section when there are no topics", async () => {
const video = makeVideo({ topics: [] })
renderPage({ video })

await screen.findByRole("heading", { name: video.title })
expect(screen.queryByText("Video Series")).not.toBeInTheDocument()
})
})

describe("video player", () => {
test("renders the video player when a streaming URL is present", async () => {
const video = makeVideo({
Expand Down
Loading
Loading