Skip to content

Release 0.26.2 #1890

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

Merged
merged 17 commits into from
Dec 10, 2024
Merged
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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
MITOL_COOKIE_NAME: cookie_monster

- name: Upload coverage to CodeCov
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
uses: codecov/codecov-action@7f8b4b4bde536c465e797be725718b88c5d95e0e # v5.1.1
with:
file: ./coverage.xml

Expand Down Expand Up @@ -138,7 +138,7 @@ jobs:
NODE_ENV: test

- name: Upload coverage to CodeCov
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
uses: codecov/codecov-action@7f8b4b4bde536c465e797be725718b88c5d95e0e # v5.1.1
with:
file: coverage/lcov.info

Expand Down
19 changes: 19 additions & 0 deletions RELEASE.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
Release Notes
=============

Version 0.26.2
--------------

- add a trailing slash to non contentfile OCW resources (#1877)
- Update codecov/codecov-action action to v5.1.1 (#1883)
- Update Node.js to v22.12.0 (#1882)
- Update nginx Docker tag to v1.27.3 (#1881)
- Update dependency ruff to v0.8.2 (#1880)
- Update dependency Django to v4.2.17 [SECURITY] (#1879)
- specify non-free course for differing prices test (#1878)
- Server render search results (search and channel pages) (#1836)
- Server render homepage and listing pages. Client-only drawer navigation. (#1872)
- fix price comparison in differing runs table (#1876)
- OpenAI embeddings for vector search (#1869)
- Simplify Theme (#1870)
- Add parent id to podcast api (#1857)
- Fix edx file import (#1867)
- Update codecov/codecov-action action to v5 (#1855)

Version 0.26.1 (Released December 09, 2024)
--------------

Expand Down
2 changes: 1 addition & 1 deletion docker-compose.apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ services:
profiles:
- frontend
working_dir: /src
image: node:22.11
image: node:22.12
entrypoint: ["/bin/sh", "-c"]
command:
- |
Expand Down
6 changes: 6 additions & 0 deletions frontends/api/src/generated/v0/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3197,6 +3197,12 @@ export interface PodcastEpisode {
* @memberof PodcastEpisode
*/
id: number
/**
* Get the podcast id(s) the episode belongs to
* @type {Array<string>}
* @memberof PodcastEpisode
*/
podcasts: Array<string>
/**
*
* @type {string}
Expand Down
19 changes: 15 additions & 4 deletions frontends/api/src/generated/v1/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -473,15 +473,16 @@ export interface ContentFileSearchResponseMetadataAggregationsValueInner {
doc_count: number
}
/**
* * `page` - page * `file` - file * `vertical` - vertical
* * `page` - page * `file` - file * `video` - video * `pdf` - pdf
* @export
* @enum {string}
*/

export const ContentTypeEnumDescriptions = {
page: "page",
file: "file",
vertical: "vertical",
video: "video",
pdf: "pdf",
} as const

export const ContentTypeEnum = {
Expand All @@ -494,9 +495,13 @@ export const ContentTypeEnum = {
*/
File: "file",
/**
* vertical
* video
*/
Video: "video",
/**
* pdf
*/
Vertical: "vertical",
Pdf: "pdf",
} as const

export type ContentTypeEnum =
Expand Down Expand Up @@ -4135,6 +4140,12 @@ export interface PodcastEpisode {
* @memberof PodcastEpisode
*/
id: number
/**
* Get the podcast id(s) the episode belongs to
* @type {Array<string>}
* @memberof PodcastEpisode
*/
podcasts: Array<string>
/**
*
* @type {string}
Expand Down
2 changes: 1 addition & 1 deletion frontends/api/src/hooks/channels/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,5 @@ export {
useChannelsList,
useChannelPartialUpdate,
useChannelCounts,
channels as channelsKeyFactory,
channels,
}
2 changes: 1 addition & 1 deletion frontends/api/src/hooks/learningResources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,5 +150,5 @@ export {
useSchoolsList,
useSimilarLearningResources,
useVectorSimilarLearningResources,
learningResources as learningResourcesKeyFactory,
learningResources,
}
2 changes: 1 addition & 1 deletion frontends/api/src/hooks/newsEvents/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ export {
useNewsEventsList,
useNewsEventsDetail,
NewsEventsListFeedTypeEnum,
newsEvents as newsEventsKeyFactory,
newsEvents,
}
6 changes: 1 addition & 5 deletions frontends/api/src/hooks/testimonials/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,4 @@ const useTestimonialDetail = (id: number | undefined) => {
})
}

export {
useTestimonialDetail,
useTestimonialList,
testimonials as testimonialsKeyFactory,
}
export { useTestimonialDetail, useTestimonialList, testimonials }
18 changes: 13 additions & 5 deletions frontends/api/src/ssr/prefetch.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
import { QueryClient, dehydrate } from "@tanstack/react-query"
import type { Query } from "@tanstack/react-query"

// Utility to avoid repetition in server components
export const prefetch = async (queries: (Query | unknown)[]) => {
const queryClient = new QueryClient()
/* Utility to avoid repetition in server components
* Optionally pass the queryClient returned from a previous prefetch
* where queries are dependent on previous results
*/
export const prefetch = async (
queries: (Query | unknown)[],
queryClient?: QueryClient,
) => {
queryClient = queryClient || new QueryClient()

await Promise.all(
queries.map((query) => queryClient.prefetchQuery(query as Query)),
queries
.filter(Boolean)
.map((query) => queryClient.prefetchQuery(query as Query)),
)

return dehydrate(queryClient)
return { dehydratedState: dehydrate(queryClient), queryClient }
}
12 changes: 6 additions & 6 deletions frontends/api/src/ssr/usePrefetchWarnings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { usePrefetchWarnings } from "./usePrefetchWarnings"
import { setupReactQueryTest } from "../hooks/test-utils"
import { urls, factories, setMockResponse } from "../test-utils"
import {
learningResourcesKeyFactory,
learningResources,
useLearningResourcesDetail,
} from "../hooks/learningResources"

Expand Down Expand Up @@ -45,7 +45,7 @@ describe("SSR prefetch warnings", () => {
expect.objectContaining({
disabled: false,
initialStatus: "loading",
key: learningResourcesKeyFactory.detail(1).queryKey,
key: learningResources.detail(1).queryKey,
observerCount: 1,
}),
],
Expand All @@ -65,7 +65,7 @@ describe("SSR prefetch warnings", () => {
wrapper,
initialProps: {
queryClient,
exemptions: [learningResourcesKeyFactory.detail(1).queryKey],
exemptions: [learningResources.detail(1).queryKey],
},
})

Expand All @@ -83,7 +83,7 @@ describe("SSR prefetch warnings", () => {
const { unmount } = renderHook(
() =>
useQuery({
...learningResourcesKeyFactory.detail(1),
...learningResources.detail(1),
initialData: data,
}),
{ wrapper },
Expand All @@ -105,9 +105,9 @@ describe("SSR prefetch warnings", () => {
[
{
disabled: false,
hash: JSON.stringify(learningResourcesKeyFactory.detail(1).queryKey),
hash: JSON.stringify(learningResources.detail(1).queryKey),
initialStatus: "success",
key: learningResourcesKeyFactory.detail(1).queryKey,
key: learningResources.detail(1).queryKey,
observerCount: 0,
status: "success",
},
Expand Down
1 change: 1 addition & 0 deletions frontends/api/src/test-utils/factories/channels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ const _channelShared = (): Partial<Omit<Channel, "channel_type">> => {
key: faker.lorem.slug(),
value: faker.lorem.slug(),
}),
channel_url: `${faker.internet.url({ appendSlash: false })}${faker.system.directoryPath()}`,
}
}

Expand Down
3 changes: 3 additions & 0 deletions frontends/api/src/test-utils/urls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import type {
NewsEventsApiNewsEventsListRequest,
TestimonialsApi,
ChannelsApi,
} from "../generated/v0"
import type {
LearningResourcesApi as LRApi,
Expand Down Expand Up @@ -186,6 +187,8 @@ const channels = {
details: (channelType: string, name: string) =>
`${API_BASE_URL}/api/v0/channels/type/${channelType}/${name}/`,
patch: (id: number) => `${API_BASE_URL}/api/v0/channels/${id}/`,
list: (params?: Paramsv0<ChannelsApi, "channelsList">) =>
`${API_BASE_URL}/api/v0/channels/${query(params)}`,
}

const widgetLists = {
Expand Down
2 changes: 1 addition & 1 deletion frontends/main/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"dependencies": {
"@ebay/nice-modal-react": "^1.2.13",
"@emotion/cache": "^11.13.1",
"@mitodl/course-search-utils": "^3.3.1",
"@mitodl/course-search-utils": "3.3.2",
"@next/bundle-analyzer": "^14.2.15",
"@remixicon/react": "^4.2.0",
"@sentry/nextjs": "^8.36.0",
Expand Down
25 changes: 6 additions & 19 deletions frontends/main/src/app-pages/ChannelPage/ChannelPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,9 @@ import { useParams } from "next/navigation"
import { ChannelPageTemplate } from "./ChannelPageTemplate"
import { useChannelDetail } from "api/hooks/channels"
import ChannelSearch from "./ChannelSearch"
import type {
Facets,
FacetKey,
BooleanFacets,
} from "@mitodl/course-search-utils"
import { ChannelTypeEnum } from "api/v0"
import { Typography } from "ol-components"
import { getConstantSearchParams } from "./searchRequests"

type RouteParams = {
channelType: ChannelTypeEnum
Expand All @@ -22,20 +18,11 @@ type RouteParams = {
const ChannelPage: React.FC = () => {
const { channelType, name } = useParams<RouteParams>()
const channelQuery = useChannelDetail(String(channelType), String(name))
const searchParams: Facets & BooleanFacets = {}
const publicDescription = channelQuery.data?.public_description

if (channelQuery.data?.search_filter) {
const urlParams = new URLSearchParams(channelQuery.data.search_filter)
for (const [key, value] of urlParams.entries()) {
const paramEntry = searchParams[key as FacetKey]
if (paramEntry !== undefined) {
paramEntry.push(value)
} else {
searchParams[key as FacetKey] = [value]
}
}
}
const channelSearchFilter = channelQuery.data?.search_filter

const searchParams = getConstantSearchParams(channelSearchFilter)

return (
name &&
Expand All @@ -46,9 +33,9 @@ const ChannelPage: React.FC = () => {
{publicDescription && (
<Typography variant="body1">{publicDescription}</Typography>
)}
{channelQuery.data?.search_filter && (
{channelSearchFilter && (
<ChannelSearch
channelTitle={channelQuery.data.title}
channelTitle={channelQuery.data!.title}
constantSearchParams={searchParams}
channelType={channelType}
/>
Expand Down
Loading
Loading