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
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ repos:
- ".*/generated/"
additional_dependencies: ["gibberish-detector"]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.6.5"
rev: "v0.6.6"
hooks:
- id: ruff-format
- id: ruff
Expand Down
16 changes: 16 additions & 0 deletions RELEASE.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
Release Notes
=============

Version 0.19.3 (Released September 23, 2024)
--------------

- Make search mode defaults settable env variables (#1590)
- follow/unfollow popover (#1589)
- Fix extract_openedx_data and backpopulate_mit_edx_data commands to work with course/program datafiles (#1587)

Version 0.19.2 (Released September 23, 2024)
--------------

- Codespace opensearch service fix (#1582)
- Remove learning_format, use delivery for search filter/facet (#1567)
- Signup popover owns url (#1576)
- [pre-commit.ci] pre-commit autoupdate (#1541)
- Remove an unused dependency (#1571)

Version 0.19.1 (Released September 18, 2024)
--------------

Expand Down
20 changes: 20 additions & 0 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,26 @@
"description": "The domain to set the CSRF cookie on",
"required": false
},
"DEFAULT_SEARCH_MODE": {
"description": "Default search mode for the search API and frontend",
"required": false
},
"DEFAULT_SEARCH_SLOP": {
"description": "Default slop value for the search API and frontend. Only used for phrase queries.",
"required": false
},
"DEFAULT_SEARCH_STALENESS_PENALTY": {
"description": "Default staleness penalty value for the search API and frontend",
"required": false
},
"DEFAULT_SEARCH_MINIMUM_SCORE_CUTOFF": {
"description": "Default minimum score cutoff value for the search API and frontend",
"required": false
},
"DEFAULT_SEARCH_MAX_INCOMPLETENESS_PENALTY": {
"description": "Default max incompleteness penalty value for the search API and frontend",
"required": false
},
"EDX_API_ACCESS_TOKEN_URL": {
"description": "URL to retrieve a MITx access token",
"required": false
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.codespaces.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ services:
file: docker-compose.apps.yml
service: web
env_file: env/codespaces.env
depends_on:
- opensearch-node-mitopen-1

watch:
extends:
Expand Down
6 changes: 6 additions & 0 deletions env/frontend.env
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,9 @@ NEXT_PUBLIC_MITOL_SUPPORT_EMAIL=${MITOL_SUPPORT_EMAIL}

NEXT_PUBLIC_SITE_NAME="MIT Learn"
NEXT_PUBLIC_MITOL_AXIOS_WITH_CREDENTIALS=true

NEXT_PUBLIC_DEFAULT_SEARCH_MODE=phrase
NEXT_PUBLIC_DEFAULT_SEARCH_SLOP=6
NEXT_PUBLIC_DEFAULT_SEARCH_STALENESS_PENALTY=2.5
NEXT_PUBLIC_DEFAULT_SEARCH_MINIMUM_SCORE_CUTOFF=0
NEXT_PUBLIC_DEFAULT_SEARCH_MAX_INCOMPLETENESS_PENALTY=90
152 changes: 152 additions & 0 deletions frontends/api/src/generated/v1/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,18 @@ export interface CourseResource {
* @memberof CourseResource
*/
resource_category: string
/**
*
* @type {Array<CourseResourceFormatInner>}
* @memberof CourseResource
*/
format: Array<CourseResourceFormatInner>
/**
*
* @type {Array<CourseResourcePaceInner>}
* @memberof CourseResource
*/
pace: Array<CourseResourcePaceInner>
/**
*
* @type {CourseResourceResourceTypeEnum}
Expand Down Expand Up @@ -844,6 +856,62 @@ export const CourseResourceDeliveryInnerCodeEnum = {
export type CourseResourceDeliveryInnerCodeEnum =
(typeof CourseResourceDeliveryInnerCodeEnum)[keyof typeof CourseResourceDeliveryInnerCodeEnum]

/**
*
* @export
* @interface CourseResourceFormatInner
*/
export interface CourseResourceFormatInner {
/**
*
* @type {string}
* @memberof CourseResourceFormatInner
*/
code: CourseResourceFormatInnerCodeEnum
/**
*
* @type {string}
* @memberof CourseResourceFormatInner
*/
name: string
}

export const CourseResourceFormatInnerCodeEnum = {
Synchronous: "synchronous",
Asynchronous: "asynchronous",
} as const

export type CourseResourceFormatInnerCodeEnum =
(typeof CourseResourceFormatInnerCodeEnum)[keyof typeof CourseResourceFormatInnerCodeEnum]

/**
*
* @export
* @interface CourseResourcePaceInner
*/
export interface CourseResourcePaceInner {
/**
*
* @type {string}
* @memberof CourseResourcePaceInner
*/
code: CourseResourcePaceInnerCodeEnum
/**
*
* @type {string}
* @memberof CourseResourcePaceInner
*/
name: string
}

export const CourseResourcePaceInnerCodeEnum = {
SelfPaced: "self_paced",
InstructorPaced: "instructor_paced",
} as const

export type CourseResourcePaceInnerCodeEnum =
(typeof CourseResourcePaceInnerCodeEnum)[keyof typeof CourseResourcePaceInnerCodeEnum]

/**
* Serializer for course resources
* @export
Expand Down Expand Up @@ -1376,6 +1444,18 @@ export interface LearningPathResource {
* @memberof LearningPathResource
*/
resource_category: string
/**
*
* @type {Array<CourseResourceFormatInner>}
* @memberof LearningPathResource
*/
format: Array<CourseResourceFormatInner>
/**
*
* @type {Array<CourseResourcePaceInner>}
* @memberof LearningPathResource
*/
pace: Array<CourseResourcePaceInner>
/**
*
* @type {LearningPathResourceResourceTypeEnum}
Expand Down Expand Up @@ -2100,6 +2180,18 @@ export interface LearningResourceRun {
* @memberof LearningResourceRun
*/
delivery: Array<CourseResourceDeliveryInner>
/**
*
* @type {Array<CourseResourceFormatInner>}
* @memberof LearningResourceRun
*/
format: Array<CourseResourceFormatInner>
/**
*
* @type {Array<CourseResourcePaceInner>}
* @memberof LearningResourceRun
*/
pace: Array<CourseResourcePaceInner>
/**
*
* @type {string}
Expand Down Expand Up @@ -4049,6 +4141,18 @@ export interface PodcastEpisodeResource {
* @memberof PodcastEpisodeResource
*/
resource_category: string
/**
*
* @type {Array<CourseResourceFormatInner>}
* @memberof PodcastEpisodeResource
*/
format: Array<CourseResourceFormatInner>
/**
*
* @type {Array<CourseResourcePaceInner>}
* @memberof PodcastEpisodeResource
*/
pace: Array<CourseResourcePaceInner>
/**
*
* @type {PodcastEpisodeResourceResourceTypeEnum}
Expand Down Expand Up @@ -4395,6 +4499,18 @@ export interface PodcastResource {
* @memberof PodcastResource
*/
resource_category: string
/**
*
* @type {Array<CourseResourceFormatInner>}
* @memberof PodcastResource
*/
format: Array<CourseResourceFormatInner>
/**
*
* @type {Array<CourseResourcePaceInner>}
* @memberof PodcastResource
*/
pace: Array<CourseResourcePaceInner>
/**
*
* @type {PodcastResourceResourceTypeEnum}
Expand Down Expand Up @@ -4961,6 +5077,18 @@ export interface ProgramResource {
* @memberof ProgramResource
*/
resource_category: string
/**
*
* @type {Array<CourseResourceFormatInner>}
* @memberof ProgramResource
*/
format: Array<CourseResourceFormatInner>
/**
*
* @type {Array<CourseResourcePaceInner>}
* @memberof ProgramResource
*/
pace: Array<CourseResourcePaceInner>
/**
*
* @type {ProgramResourceResourceTypeEnum}
Expand Down Expand Up @@ -5786,6 +5914,18 @@ export interface VideoPlaylistResource {
* @memberof VideoPlaylistResource
*/
resource_category: string
/**
*
* @type {Array<CourseResourceFormatInner>}
* @memberof VideoPlaylistResource
*/
format: Array<CourseResourceFormatInner>
/**
*
* @type {Array<CourseResourcePaceInner>}
* @memberof VideoPlaylistResource
*/
pace: Array<CourseResourcePaceInner>
/**
*
* @type {VideoPlaylistResourceResourceTypeEnum}
Expand Down Expand Up @@ -6120,6 +6260,18 @@ export interface VideoResource {
* @memberof VideoResource
*/
resource_category: string
/**
*
* @type {Array<CourseResourceFormatInner>}
* @memberof VideoResource
*/
format: Array<CourseResourceFormatInner>
/**
*
* @type {Array<CourseResourcePaceInner>}
* @memberof VideoResource
*/
pace: Array<CourseResourcePaceInner>
/**
*
* @type {VideoResourceResourceTypeEnum}
Expand Down
18 changes: 18 additions & 0 deletions frontends/api/src/test-utils/factories/learningResources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ import type {
import {
AvailabilityEnum,
DeliveryEnum,
CourseResourcePaceInnerCodeEnum,
CourseResourceFormatInnerCodeEnum,
ResourceTypeEnum,
LearningResourceRunLevelInnerCodeEnum,
PlatformEnum,
Expand Down Expand Up @@ -186,6 +188,22 @@ const learningResourceRun: Factory<LearningResourceRun> = (overrides = {}) => {
name: uniqueEnforcerWords.enforce(() => faker.lorem.words()),
},
],
pace: [
{
code: faker.helpers.arrayElement(
Object.values(CourseResourcePaceInnerCodeEnum),
),
name: uniqueEnforcerWords.enforce(() => faker.lorem.words()),
},
],
format: [
{
code: faker.helpers.arrayElement(
Object.values(CourseResourceFormatInnerCodeEnum),
),
name: uniqueEnforcerWords.enforce(() => faker.lorem.words()),
},
],
level: [
{
code: faker.helpers.arrayElement(
Expand Down
6 changes: 6 additions & 0 deletions frontends/main/Dockerfile.web
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ ENV NEXT_PUBLIC_MITOL_AXIOS_WITH_CREDENTIALS=$NEXT_PUBLIC_MITOL_AXIOS_WITH_CREDE
ARG NEXT_PUBLIC_CSRF_COOKIE_NAME
ENV NEXT_PUBLIC_CSRF_COOKIE_NAME=$NEXT_PUBLIC_CSRF_COOKIE_NAME

ENV NEXT_PUBLIC_DEFAULT_SEARCH_MODE="phrase"
ENV NEXT_PUBLIC_DEFAULT_SEARCH_SLOP="6"
ENV NEXT_PUBLIC_DEFAULT_SEARCH_STALENESS_PENALTY="2.5"
ENV NEXT_PUBLIC_DEFAULT_SEARCH_MINIMUM_SCORE_CUTOFF="0"
ENV NEXT_PUBLIC_DEFAULT_SEARCH_MAX_INCOMPLETENESS_PENALTY="90"

RUN yarn build

EXPOSE 3000
Expand Down
17 changes: 0 additions & 17 deletions frontends/main/jest.config.ts

This file was deleted.

Loading