Skip to content
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
16 changes: 8 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- 5432:5432

redis:
image: redis:8.2.1
image: redis:8.2.2
ports:
- 6379:6379

Expand All @@ -43,7 +43,7 @@ jobs:
virtualenvs-create: true
virtualenvs-in-project: true

- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6
with:
python-version-file: "pyproject.toml"
cache: "poetry"
Expand Down Expand Up @@ -85,15 +85,15 @@ jobs:
MITOL_COOKIE_NAME: cookie_monster

- name: Upload coverage to CodeCov
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
with:
file: ./coverage.xml

javascript-tests:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
with:
node-version: "^22.0.0"
cache: yarn
Expand Down Expand Up @@ -142,7 +142,7 @@ jobs:
NODE_ENV: test

- name: Upload coverage to CodeCov
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
with:
file: coverage/lcov.info

Expand Down Expand Up @@ -201,7 +201,7 @@ jobs:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5

- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
with:
node-version: "^22"
cache: yarn
Expand All @@ -224,7 +224,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
with:
node-version: "^22.0.0"
cache: yarn
Expand Down Expand Up @@ -263,7 +263,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
with:
node-version: "^22.0.0"
cache: yarn
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5

- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
with:
node-version: "^22.0.0"
cache: yarn
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.45.7
--------------

- Do not overwrite existing canvas content (#2581)
- chore(deps): update codecov/codecov-action action to v5.5.1 (#2580)
- chore(deps): update nginx docker tag to v1.29.2 (#2579)
- chore(deps): update actions/setup-python action to v6 (#2577)
- chore(deps): update actions/setup-node action to v5 (#2576)
- chore(deps): update redis docker tag to v8.2.2 (#2566)
- Expose version of frontend (#2575)
- Sort runs by start_date (#2567)
- rename attach/[code] url to enrollmentcode/[code] (#2570)
- One-click enrollment via org dashboard card titles (#2569)
- truncate csv files in tutor problems api (#2568)
- csv problem files (#2560)
- add "just in time" dialog (#2530)
- Program Page basic layout (#2556)
- Fix qdrant payload schema type and add mechanism to keep types in sync (#2553)

Version 0.45.4 (Released October 02, 2025)
--------------

Expand Down
2 changes: 1 addition & 1 deletion docker-compose.services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ services:
redis:
profiles:
- backend
image: redis:8.2.1
image: redis:8.2.2
healthcheck:
test: ["CMD", "redis-cli", "ping", "|", "grep", "PONG"]
interval: 3s
Expand Down
1 change: 1 addition & 0 deletions env/frontend.env
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ NEXT_PUBLIC_LEARN_AI_RECOMMENDATION_ENDPOINT=https://api-learn-ai-qa.ol.mit.edu/
NEXT_PUBLIC_LEARN_AI_SYLLABUS_ENDPOINT=https://api-learn-ai-qa.ol.mit.edu/http/syllabus_agent/

NEXT_PUBLIC_MITX_ONLINE_BASE_URL=${MITX_ONLINE_BASE_URL}
NEXT_PUBLIC_VERSION="local-dev"
2 changes: 1 addition & 1 deletion frontends/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"ol-test-utilities": "0.0.0"
},
"dependencies": {
"@mitodl/mitxonline-api-axios": "^2025.9.26",
"@mitodl/mitxonline-api-axios": "^2025.9.30",
"@tanstack/react-query": "^5.66.0",
"axios": "^1.12.2"
}
Expand Down
3 changes: 3 additions & 0 deletions frontends/api/src/mitxonline/clients.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
UsersApi,
ProgramEnrollmentsApi,
PagesApi,
CountriesApi,
} from "@mitodl/mitxonline-api-axios/v2"
import axios from "axios"

Expand All @@ -25,6 +26,7 @@ const BASE_PATH =
process.env.NEXT_PUBLIC_MITX_ONLINE_BASE_URL?.replace(/\/+$/, "") ?? ""

const usersApi = new UsersApi(undefined, BASE_PATH, axiosInstance)
const countriesApi = new CountriesApi(undefined, BASE_PATH, axiosInstance)
const b2bApi = new B2bApi(undefined, BASE_PATH, axiosInstance)
const programsApi = new ProgramsApi(undefined, BASE_PATH, axiosInstance)
const programCollectionsApi = new ProgramCollectionsApi(
Expand Down Expand Up @@ -63,6 +65,7 @@ const pagesApi = new PagesApi(undefined, BASE_PATH, axiosInstance)

export {
usersApi,
countriesApi,
b2bApi,
courseRunEnrollmentsApi,
programEnrollmentsApi,
Expand Down
20 changes: 17 additions & 3 deletions frontends/api/src/mitxonline/hooks/pages/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,37 @@ import { pagesApi } from "../../clients"

const pagesKeys = {
root: ["mitxonline", "pages"],
coursePageDetail: (readableId: string) => [
coursePages: (readableId: string) => [
...pagesKeys.root,
"course_detail",
readableId,
],
programPages: (readableId: string) => [
...pagesKeys.root,
"program_detail",
readableId,
],
}

const pagesQueries = {
courseDetail: (readableId: string) =>
coursePages: (readableId: string) =>
queryOptions({
queryKey: pagesKeys.coursePageDetail(readableId),
queryKey: pagesKeys.coursePages(readableId),
queryFn: async () => {
return pagesApi
.pagesfieldstypecmsCoursePageRetrieve({ readable_id: readableId })
.then((res) => res.data)
},
}),
programPages: (readableId: string) =>
queryOptions({
queryKey: pagesKeys.programPages(readableId),
queryFn: async () => {
return pagesApi
.pagesfieldstypecmsProgramPageRetrieve({ readable_id: readableId })
.then((res) => res.data)
},
}),
}

export { pagesQueries, pagesKeys }
64 changes: 52 additions & 12 deletions frontends/api/src/mitxonline/hooks/user/index.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,58 @@
import { useQuery } from "@tanstack/react-query"
import { usersApi } from "../../clients"
import {
queryOptions,
useMutation,
useQuery,
useQueryClient,
} from "@tanstack/react-query"
import { countriesApi, usersApi } from "../../clients"
import type { User } from "@mitodl/mitxonline-api-axios/v2"
import { UsersApiUsersMePartialUpdateRequest } from "@mitodl/mitxonline-api-axios/v2"

const useMitxOnlineCurrentUser = (opts: { enabled?: boolean } = {}) =>
useQuery({
queryKey: ["mitxonline", "currentUser"],
queryFn: async (): Promise<User> => {
const response = await usersApi.usersCurrentUserRetrieve()
return {
...response.data,
}
const userKeys = {
root: ["mitxonline", "users"] as const,
me: () => [...userKeys.root, "me"] as const,
countries: () => ["mitxonline", "countries"] as const,
}

const queries = {
me: () =>
queryOptions({
queryKey: userKeys.me(),
queryFn: async () => {
const response = await usersApi.usersMeRetrieve()
return response.data
},
}),
countries: () =>
queryOptions({
queryKey: userKeys.countries(),
queryFn: async () => {
const response = await countriesApi.countriesList()
return response.data
},
}),
}

/**
* @deprecated Prefer direct use of queries.me()
*/
const useMitxOnlineUserMe = (opts: { enabled?: boolean } = {}) =>
useQuery({ ...queries.me(), ...opts })

const useUpdateUserMutation = () => {
const queryClient = useQueryClient()
return useMutation({
mutationFn: (opts: UsersApiUsersMePartialUpdateRequest) =>
usersApi.usersMePartialUpdate(opts),
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: userKeys.me() })
},
...opts,
})
}

export { useMitxOnlineCurrentUser }
export {
queries as mitxUserQueries,
useMitxOnlineUserMe,
useUpdateUserMutation,
}
export type { User as MitxOnlineUser }
Loading
Loading