From 634a92c347412c58d2b50aba34f2f0917f7c8a13 Mon Sep 17 00:00:00 2001 From: Matt Bertrand Date: Wed, 18 Sep 2024 15:55:43 -0400 Subject: [PATCH] Remove learning_format, use delivery for search filter/facet --- app.json | 4 + frontends/api/src/generated/v0/api.ts | 78 ++-- frontends/api/src/generated/v1/api.ts | 401 +---------------- .../api/src/test-utils/factories/user.ts | 2 +- frontends/mit-learn/package.json | 2 +- frontends/mit-learn/src/common/profile.tsx | 23 +- .../ChannelDetails/ChannelDetails.tsx | 16 +- .../pages/ChannelPage/ChannelSearch.test.tsx | 2 +- .../src/pages/ChannelPage/ChannelSearch.tsx | 6 +- .../pages/DashboardPage/Dashboard.test.tsx | 15 +- .../pages/DashboardPage/ProfileEditForm.tsx | 8 +- .../src/pages/DashboardPage/carousels.ts | 10 +- .../OnboardingPage/OnboardingPage.test.tsx | 4 +- .../pages/OnboardingPage/OnboardingPage.tsx | 10 +- .../src/pages/SearchPage/SearchPage.test.tsx | 2 +- .../src/pages/SearchPage/SearchPage.tsx | 4 +- .../LearningResourceListCard.tsx | 2 +- learning_resources/constants.py | 11 +- learning_resources/etl/constants.py | 16 +- learning_resources/etl/loaders.py | 6 +- learning_resources/etl/loaders_test.py | 42 +- learning_resources/etl/ocw.py | 8 +- learning_resources/etl/ocw_test.py | 1 + learning_resources/etl/prolearn.py | 16 +- learning_resources/etl/prolearn_test.py | 47 +- learning_resources/etl/sloan.py | 1 - learning_resources/etl/sloan_test.py | 4 +- learning_resources/etl/utils.py | 10 +- learning_resources/etl/utils_test.py | 14 +- learning_resources/etl/xpro.py | 2 - learning_resources/etl/xpro_test.py | 3 - learning_resources/factories.py | 2 - learning_resources/filters.py | 14 +- learning_resources/filters_test.py | 33 -- .../0043_learningresource_format.py | 4 +- .../0044_rename_learningresource_format.py | 4 +- .../migrations/0049_alter_learning_format.py | 6 +- ...remove_learningresource_learning_format.py | 16 + .../0067_ocw_delivery_online_only.py | 34 ++ learning_resources/models.py | 10 - learning_resources/serializers.py | 19 - learning_resources/serializers_test.py | 5 - learning_resources_search/constants.py | 8 - learning_resources_search/serializers.py | 11 - learning_resources_search/serializers_test.py | 33 -- load_testing/locustfile.py | 2 +- main/settings_course_etl.py | 1 + openapi/specs/v0.yaml | 45 +- openapi/specs/v1.yaml | 408 ------------------ profiles/factories.py | 2 +- profiles/forms.py | 2 +- .../0033_alter_profile_learning_format.py | 36 ++ profiles/models.py | 9 +- profiles/serializers.py | 10 +- profiles/serializers_test.py | 18 +- profiles/views_test.py | 12 +- yarn.lock | 20 +- 57 files changed, 333 insertions(+), 1201 deletions(-) create mode 100644 learning_resources/migrations/0066_remove_learningresource_learning_format.py create mode 100644 learning_resources/migrations/0067_ocw_delivery_online_only.py create mode 100644 profiles/migrations/0033_alter_profile_learning_format.py diff --git a/app.json b/app.json index fa40538047..e47e0e6f8e 100644 --- a/app.json +++ b/app.json @@ -441,6 +441,10 @@ "description": "bucket for ocw-next storage data", "required": false }, + "OCW_OFFLINE_DELIVERY": { + "description": "Enable offline delivery of OCW courses", + "required": false + }, "PGBOUNCER_DEFAULT_POOL_SIZE": { "value": "50" }, diff --git a/frontends/api/src/generated/v0/api.ts b/frontends/api/src/generated/v0/api.ts index eab427e399..a8ecc603ce 100644 --- a/frontends/api/src/generated/v0/api.ts +++ b/frontends/api/src/generated/v0/api.ts @@ -567,6 +567,40 @@ export const CurrentEducationEnum = { export type CurrentEducationEnum = (typeof CurrentEducationEnum)[keyof typeof CurrentEducationEnum] +/** + * * `online` - Online * `hybrid` - Hybrid * `in_person` - In-Person * `offline` - Offline + * @export + * @enum {string} + */ + +export const DeliveryEnumDescriptions = { + online: "Online", + hybrid: "Hybrid", + in_person: "In-Person", + offline: "Offline", +} as const + +export const DeliveryEnum = { + /** + * Online + */ + Online: "online", + /** + * Hybrid + */ + Hybrid: "hybrid", + /** + * In-Person + */ + InPerson: "in_person", + /** + * Offline + */ + Offline: "offline", +} as const + +export type DeliveryEnum = (typeof DeliveryEnum)[keyof typeof DeliveryEnum] + /** * Serializer for Channel model of type department * @export @@ -1048,36 +1082,6 @@ export const GoalsEnum = { export type GoalsEnum = (typeof GoalsEnum)[keyof typeof GoalsEnum] -/** - * * `online` - Online * `hybrid` - Hybrid * `in_person` - In-Person - * @export - * @enum {string} - */ - -export const LearningFormatEnumDescriptions = { - online: "Online", - hybrid: "Hybrid", - in_person: "In-Person", -} as const - -export const LearningFormatEnum = { - /** - * Online - */ - Online: "online", - /** - * Hybrid - */ - Hybrid: "hybrid", - /** - * In-Person - */ - InPerson: "in_person", -} as const - -export type LearningFormatEnum = - (typeof LearningFormatEnum)[keyof typeof LearningFormatEnum] - /** * Serializer for a minimal preview of Learning Paths * @export @@ -1679,10 +1683,10 @@ export interface PatchedProfileRequest { time_commitment?: PatchedProfileRequestTimeCommitment /** * - * @type {Array} + * @type {Array} * @memberof PatchedProfileRequest */ - learning_format?: Array + delivery?: Array } /** * @type PatchedProfileRequestCertificateDesired @@ -1915,7 +1919,7 @@ export interface PreferencesSearch { * @type {Array} * @memberof PreferencesSearch */ - learning_format?: Array + delivery?: Array } /** * Serializer for Profile @@ -2033,10 +2037,10 @@ export interface Profile { time_commitment?: PatchedProfileRequestTimeCommitment /** * - * @type {Array} + * @type {Array} * @memberof Profile */ - learning_format?: Array + delivery?: Array /** * * @type {PreferencesSearch} @@ -2136,10 +2140,10 @@ export interface ProfileRequest { time_commitment?: PatchedProfileRequestTimeCommitment /** * - * @type {Array} + * @type {Array} * @memberof ProfileRequest */ - learning_format?: Array + delivery?: Array } /** * Serializer for Program Certificates diff --git a/frontends/api/src/generated/v1/api.ts b/frontends/api/src/generated/v1/api.ts index 82a3d03585..983db187e9 100644 --- a/frontends/api/src/generated/v1/api.ts +++ b/frontends/api/src/generated/v1/api.ts @@ -40,7 +40,7 @@ import { } from "./base" /** - * * `resource_type` - resource_type * `certification` - certification * `certification_type` - certification_type * `offered_by` - offered_by * `platform` - platform * `topic` - topic * `department` - department * `level` - level * `course_feature` - course_feature * `professional` - professional * `free` - free * `learning_format` - learning_format * `delivery` - delivery * `resource_category` - resource_category + * * `resource_type` - resource_type * `certification` - certification * `certification_type` - certification_type * `offered_by` - offered_by * `platform` - platform * `topic` - topic * `department` - department * `level` - level * `course_feature` - course_feature * `professional` - professional * `free` - free * `delivery` - delivery * `resource_category` - resource_category * @export * @enum {string} */ @@ -57,7 +57,6 @@ export const AggregationsEnumDescriptions = { course_feature: "course_feature", professional: "professional", free: "free", - learning_format: "learning_format", delivery: "delivery", resource_category: "resource_category", } as const @@ -107,10 +106,6 @@ export const AggregationsEnum = { * free */ Free: "free", - /** - * learning_format - */ - LearningFormat: "learning_format", /** * delivery */ @@ -673,12 +668,6 @@ export interface CourseResource { * @memberof CourseResource */ views: number - /** - * - * @type {Array} - * @memberof CourseResource - */ - learning_format: Array /** * * @type {Array} @@ -855,35 +844,6 @@ export const CourseResourceDeliveryInnerCodeEnum = { export type CourseResourceDeliveryInnerCodeEnum = (typeof CourseResourceDeliveryInnerCodeEnum)[keyof typeof CourseResourceDeliveryInnerCodeEnum] -/** - * - * @export - * @interface CourseResourceLearningFormatInner - */ -export interface CourseResourceLearningFormatInner { - /** - * - * @type {string} - * @memberof CourseResourceLearningFormatInner - */ - code: CourseResourceLearningFormatInnerCodeEnum - /** - * - * @type {string} - * @memberof CourseResourceLearningFormatInner - */ - name: string -} - -export const CourseResourceLearningFormatInnerCodeEnum = { - Online: "online", - Hybrid: "hybrid", - InPerson: "in_person", -} as const - -export type CourseResourceLearningFormatInnerCodeEnum = - (typeof CourseResourceLearningFormatInnerCodeEnum)[keyof typeof CourseResourceLearningFormatInnerCodeEnum] - /** * Serializer for course resources * @export @@ -1227,36 +1187,6 @@ export const DepartmentEnum = { export type DepartmentEnum = (typeof DepartmentEnum)[keyof typeof DepartmentEnum] -/** - * * `online` - Online * `hybrid` - Hybrid * `in_person` - In person - * @export - * @enum {string} - */ - -export const LearningFormatEnumDescriptions = { - online: "Online", - hybrid: "Hybrid", - in_person: "In person", -} as const - -export const LearningFormatEnum = { - /** - * Online - */ - Online: "online", - /** - * Hybrid - */ - Hybrid: "hybrid", - /** - * In person - */ - InPerson: "in_person", -} as const - -export type LearningFormatEnum = - (typeof LearningFormatEnum)[keyof typeof LearningFormatEnum] - /** * Serializer for the LearningPath model * @export @@ -1428,12 +1358,6 @@ export interface LearningPathResource { * @memberof LearningPathResource */ views: number - /** - * - * @type {Array} - * @memberof LearningPathResource - */ - learning_format: Array /** * * @type {Array} @@ -3714,12 +3638,6 @@ export interface PercolateQuerySubscriptionRequestRequest { * @memberof PercolateQuerySubscriptionRequestRequest */ aggregations?: Array - /** - * The format(s) in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person - * @type {Array} - * @memberof PercolateQuerySubscriptionRequestRequest - */ - learning_format?: Array /** * The delivery options in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline * @type {Array} @@ -4113,12 +4031,6 @@ export interface PodcastEpisodeResource { * @memberof PodcastEpisodeResource */ views: number - /** - * - * @type {Array} - * @memberof PodcastEpisodeResource - */ - learning_format: Array /** * * @type {Array} @@ -4465,12 +4377,6 @@ export interface PodcastResource { * @memberof PodcastResource */ views: number - /** - * - * @type {Array} - * @memberof PodcastResource - */ - learning_format: Array /** * * @type {Array} @@ -5037,12 +4943,6 @@ export interface ProgramResource { * @memberof ProgramResource */ views: number - /** - * - * @type {Array} - * @memberof ProgramResource - */ - learning_format: Array /** * * @type {Array} @@ -5868,12 +5768,6 @@ export interface VideoPlaylistResource { * @memberof VideoPlaylistResource */ views: number - /** - * - * @type {Array} - * @memberof VideoPlaylistResource - */ - learning_format: Array /** * * @type {Array} @@ -6208,12 +6102,6 @@ export interface VideoResource { * @memberof VideoResource */ views: number - /** - * - * @type {Array} - * @memberof VideoResource - */ - learning_format: Array /** * * @type {Array} @@ -8564,7 +8452,6 @@ export const CoursesApiAxiosParamCreator = function ( * @param {Array>} [delivery] The delivery of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline * @param {Array} [department] The department that offers learning resources * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies * @param {boolean} [free] The course/program is offered for free - * @param {Array>} [learning_format] The learning format of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * @param {Array} [level] The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory * @param {number} [limit] Number of results to return per page. * @param {Array} [offered_by] The organization that offers a learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education @@ -8586,7 +8473,6 @@ export const CoursesApiAxiosParamCreator = function ( delivery?: Array>, department?: Array, free?: boolean, - learning_format?: Array>, level?: Array, limit?: number, offered_by?: Array, @@ -8642,10 +8528,6 @@ export const CoursesApiAxiosParamCreator = function ( localVarQueryParameter["free"] = free } - if (learning_format) { - localVarQueryParameter["learning_format"] = learning_format - } - if (level) { localVarQueryParameter["level"] = level } @@ -8857,7 +8739,6 @@ export const CoursesApiFp = function (configuration?: Configuration) { * @param {Array>} [delivery] The delivery of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline * @param {Array} [department] The department that offers learning resources * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies * @param {boolean} [free] The course/program is offered for free - * @param {Array>} [learning_format] The learning format of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * @param {Array} [level] The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory * @param {number} [limit] Number of results to return per page. * @param {Array} [offered_by] The organization that offers a learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education @@ -8879,7 +8760,6 @@ export const CoursesApiFp = function (configuration?: Configuration) { delivery?: Array>, department?: Array, free?: boolean, - learning_format?: Array>, level?: Array, limit?: number, offered_by?: Array, @@ -8905,7 +8785,6 @@ export const CoursesApiFp = function (configuration?: Configuration) { delivery, department, free, - learning_format, level, limit, offered_by, @@ -9035,7 +8914,6 @@ export const CoursesApiFactory = function ( requestParameters.delivery, requestParameters.department, requestParameters.free, - requestParameters.learning_format, requestParameters.level, requestParameters.limit, requestParameters.offered_by, @@ -9201,13 +9079,6 @@ export interface CoursesApiCoursesListRequest { */ readonly free?: boolean - /** - * The learning format of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person - * @type {Array>} - * @memberof CoursesApiCoursesList - */ - readonly learning_format?: Array> - /** * The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory * @type {Array<'advanced' | 'graduate' | 'high_school' | 'intermediate' | 'introductory' | 'noncredit' | 'undergraduate'>} @@ -9375,7 +9246,6 @@ export class CoursesApi extends BaseAPI { requestParameters.delivery, requestParameters.department, requestParameters.free, - requestParameters.learning_format, requestParameters.level, requestParameters.limit, requestParameters.offered_by, @@ -9943,7 +9813,6 @@ export const FeaturedApiAxiosParamCreator = function ( * @param {Array>} [delivery] The delivery of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline * @param {Array} [department] The department that offers learning resources * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies * @param {boolean} [free] The course/program is offered for free - * @param {Array>} [learning_format] The learning format of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * @param {Array} [level] The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory * @param {number} [limit] Number of results to return per page. * @param {Array} [offered_by] The organization that offers a learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education @@ -9965,7 +9834,6 @@ export const FeaturedApiAxiosParamCreator = function ( delivery?: Array>, department?: Array, free?: boolean, - learning_format?: Array>, level?: Array, limit?: number, offered_by?: Array, @@ -10021,10 +9889,6 @@ export const FeaturedApiAxiosParamCreator = function ( localVarQueryParameter["free"] = free } - if (learning_format) { - localVarQueryParameter["learning_format"] = learning_format - } - if (level) { localVarQueryParameter["level"] = level } @@ -10150,7 +10014,6 @@ export const FeaturedApiFp = function (configuration?: Configuration) { * @param {Array>} [delivery] The delivery of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline * @param {Array} [department] The department that offers learning resources * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies * @param {boolean} [free] The course/program is offered for free - * @param {Array>} [learning_format] The learning format of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * @param {Array} [level] The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory * @param {number} [limit] Number of results to return per page. * @param {Array} [offered_by] The organization that offers a learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education @@ -10172,7 +10035,6 @@ export const FeaturedApiFp = function (configuration?: Configuration) { delivery?: Array>, department?: Array, free?: boolean, - learning_format?: Array>, level?: Array, limit?: number, offered_by?: Array, @@ -10198,7 +10060,6 @@ export const FeaturedApiFp = function (configuration?: Configuration) { delivery, department, free, - learning_format, level, limit, offered_by, @@ -10285,7 +10146,6 @@ export const FeaturedApiFactory = function ( requestParameters.delivery, requestParameters.department, requestParameters.free, - requestParameters.learning_format, requestParameters.level, requestParameters.limit, requestParameters.offered_by, @@ -10367,13 +10227,6 @@ export interface FeaturedApiFeaturedListRequest { */ readonly free?: boolean - /** - * The learning format of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person - * @type {Array>} - * @memberof FeaturedApiFeaturedList - */ - readonly learning_format?: Array> - /** * The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory * @type {Array<'advanced' | 'graduate' | 'high_school' | 'intermediate' | 'introductory' | 'noncredit' | 'undergraduate'>} @@ -10493,7 +10346,6 @@ export class FeaturedApi extends BaseAPI { requestParameters.delivery, requestParameters.department, requestParameters.free, - requestParameters.learning_format, requestParameters.level, requestParameters.limit, requestParameters.offered_by, @@ -11050,7 +10902,6 @@ export const LearningResourcesApiAxiosParamCreator = function ( * @param {Array>} [delivery] The delivery of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline * @param {Array} [department] The department that offers learning resources * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies * @param {boolean} [free] The course/program is offered for free - * @param {Array>} [learning_format] The learning format of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * @param {Array} [level] The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory * @param {number} [limit] Number of results to return per page. * @param {Array} [offered_by] The organization that offers a learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education @@ -11072,7 +10923,6 @@ export const LearningResourcesApiAxiosParamCreator = function ( delivery?: Array>, department?: Array, free?: boolean, - learning_format?: Array>, level?: Array, limit?: number, offered_by?: Array, @@ -11128,10 +10978,6 @@ export const LearningResourcesApiAxiosParamCreator = function ( localVarQueryParameter["free"] = free } - if (learning_format) { - localVarQueryParameter["learning_format"] = learning_format - } - if (level) { localVarQueryParameter["level"] = level } @@ -11528,7 +11374,6 @@ export const LearningResourcesApiFp = function (configuration?: Configuration) { * @param {Array>} [delivery] The delivery of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline * @param {Array} [department] The department that offers learning resources * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies * @param {boolean} [free] The course/program is offered for free - * @param {Array>} [learning_format] The learning format of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * @param {Array} [level] The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory * @param {number} [limit] Number of results to return per page. * @param {Array} [offered_by] The organization that offers a learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education @@ -11550,7 +11395,6 @@ export const LearningResourcesApiFp = function (configuration?: Configuration) { delivery?: Array>, department?: Array, free?: boolean, - learning_format?: Array>, level?: Array, limit?: number, offered_by?: Array, @@ -11577,7 +11421,6 @@ export const LearningResourcesApiFp = function (configuration?: Configuration) { delivery, department, free, - learning_format, level, limit, offered_by, @@ -11812,7 +11655,6 @@ export const LearningResourcesApiFactory = function ( requestParameters.delivery, requestParameters.department, requestParameters.free, - requestParameters.learning_format, requestParameters.level, requestParameters.limit, requestParameters.offered_by, @@ -12082,13 +11924,6 @@ export interface LearningResourcesApiLearningResourcesListRequest { */ readonly free?: boolean - /** - * The learning format of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person - * @type {Array>} - * @memberof LearningResourcesApiLearningResourcesList - */ - readonly learning_format?: Array> - /** * The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory * @type {Array<'advanced' | 'graduate' | 'high_school' | 'intermediate' | 'introductory' | 'noncredit' | 'undergraduate'>} @@ -12350,7 +12185,6 @@ export class LearningResourcesApi extends BaseAPI { requestParameters.delivery, requestParameters.department, requestParameters.free, - requestParameters.learning_format, requestParameters.level, requestParameters.limit, requestParameters.offered_by, @@ -12629,7 +12463,6 @@ export const LearningResourcesSearchApiAxiosParamCreator = function ( * @param {boolean | null} [dev_mode] If true return raw open search results with score explanations * @param {boolean | null} [free] * @param {Array} [id] The id value for the learning resource - * @param {Array} [learning_format] The format(s) in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * @param {Array} [level] * @param {number} [limit] Number of results to return per page * @param {number | null} [max_incompleteness_penalty] Maximum score penalty for incomplete OCW courses in percent. An OCW course with completeness = 0 will have this score penalty. Partially complete courses have a linear penalty proportional to the degree of incompleteness. Only affects results if there is a search term. @@ -12659,7 +12492,6 @@ export const LearningResourcesSearchApiAxiosParamCreator = function ( dev_mode?: boolean | null, free?: boolean | null, id?: Array, - learning_format?: Array, level?: Array, limit?: number, max_incompleteness_penalty?: number | null, @@ -12730,10 +12562,6 @@ export const LearningResourcesSearchApiAxiosParamCreator = function ( localVarQueryParameter["id"] = id } - if (learning_format) { - localVarQueryParameter["learning_format"] = learning_format - } - if (level) { localVarQueryParameter["level"] = level } @@ -12838,7 +12666,6 @@ export const LearningResourcesSearchApiFp = function ( * @param {boolean | null} [dev_mode] If true return raw open search results with score explanations * @param {boolean | null} [free] * @param {Array} [id] The id value for the learning resource - * @param {Array} [learning_format] The format(s) in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * @param {Array} [level] * @param {number} [limit] Number of results to return per page * @param {number | null} [max_incompleteness_penalty] Maximum score penalty for incomplete OCW courses in percent. An OCW course with completeness = 0 will have this score penalty. Partially complete courses have a linear penalty proportional to the degree of incompleteness. Only affects results if there is a search term. @@ -12868,7 +12695,6 @@ export const LearningResourcesSearchApiFp = function ( dev_mode?: boolean | null, free?: boolean | null, id?: Array, - learning_format?: Array, level?: Array, limit?: number, max_incompleteness_penalty?: number | null, @@ -12903,7 +12729,6 @@ export const LearningResourcesSearchApiFp = function ( dev_mode, free, id, - learning_format, level, limit, max_incompleteness_penalty, @@ -12971,7 +12796,6 @@ export const LearningResourcesSearchApiFactory = function ( requestParameters.dev_mode, requestParameters.free, requestParameters.id, - requestParameters.learning_format, requestParameters.level, requestParameters.limit, requestParameters.max_incompleteness_penalty, @@ -13003,7 +12827,7 @@ export const LearningResourcesSearchApiFactory = function ( export interface LearningResourcesSearchApiLearningResourcesSearchRetrieveRequest { /** * Show resource counts by category - * @type {Array<'resource_type' | 'certification' | 'certification_type' | 'offered_by' | 'platform' | 'topic' | 'department' | 'level' | 'course_feature' | 'professional' | 'free' | 'learning_format' | 'delivery' | 'resource_category'>} + * @type {Array<'resource_type' | 'certification' | 'certification_type' | 'offered_by' | 'platform' | 'topic' | 'department' | 'level' | 'course_feature' | 'professional' | 'free' | 'delivery' | 'resource_category'>} * @memberof LearningResourcesSearchApiLearningResourcesSearchRetrieve */ readonly aggregations?: Array @@ -13064,13 +12888,6 @@ export interface LearningResourcesSearchApiLearningResourcesSearchRetrieveReques */ readonly id?: Array - /** - * The format(s) in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person - * @type {Array<'online' | 'hybrid' | 'in_person'>} - * @memberof LearningResourcesSearchApiLearningResourcesSearchRetrieve - */ - readonly learning_format?: Array - /** * * @type {Array<'undergraduate' | 'graduate' | 'high_school' | 'noncredit' | 'advanced' | 'intermediate' | 'introductory'>} @@ -13214,7 +13031,6 @@ export class LearningResourcesSearchApi extends BaseAPI { requestParameters.dev_mode, requestParameters.free, requestParameters.id, - requestParameters.learning_format, requestParameters.level, requestParameters.limit, requestParameters.max_incompleteness_penalty, @@ -13252,7 +13068,6 @@ export const LearningResourcesSearchRetrieveAggregationsEnum = { CourseFeature: "course_feature", Professional: "professional", Free: "free", - LearningFormat: "learning_format", Delivery: "delivery", ResourceCategory: "resource_category", } as const @@ -13327,16 +13142,6 @@ export type LearningResourcesSearchRetrieveDepartmentEnum = /** * @export */ -export const LearningResourcesSearchRetrieveLearningFormatEnum = { - Online: "online", - Hybrid: "hybrid", - InPerson: "in_person", -} as const -export type LearningResourcesSearchRetrieveLearningFormatEnum = - (typeof LearningResourcesSearchRetrieveLearningFormatEnum)[keyof typeof LearningResourcesSearchRetrieveLearningFormatEnum] -/** - * @export - */ export const LearningResourcesSearchRetrieveLevelEnum = { Undergraduate: "undergraduate", Graduate: "graduate", @@ -13463,7 +13268,6 @@ export const LearningResourcesUserSubscriptionApiAxiosParamCreator = function ( * @param {boolean | null} [dev_mode] If true return raw open search results with score explanations * @param {boolean | null} [free] * @param {Array} [id] The id value for the learning resource - * @param {Array} [learning_format] The format(s) in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * @param {Array} [level] * @param {number} [limit] Number of results to return per page * @param {number | null} [max_incompleteness_penalty] Maximum score penalty for incomplete OCW courses in percent. An OCW course with completeness = 0 will have this score penalty. Partially complete courses have a linear penalty proportional to the degree of incompleteness. Only affects results if there is a search term. @@ -13494,7 +13298,6 @@ export const LearningResourcesUserSubscriptionApiAxiosParamCreator = function ( dev_mode?: boolean | null, free?: boolean | null, id?: Array, - learning_format?: Array, level?: Array, limit?: number, max_incompleteness_penalty?: number | null, @@ -13566,10 +13369,6 @@ export const LearningResourcesUserSubscriptionApiAxiosParamCreator = function ( localVarQueryParameter["id"] = id } - if (learning_format) { - localVarQueryParameter["learning_format"] = learning_format - } - if (level) { localVarQueryParameter["level"] = level } @@ -13665,7 +13464,6 @@ export const LearningResourcesUserSubscriptionApiAxiosParamCreator = function ( * @param {boolean | null} [dev_mode] If true return raw open search results with score explanations * @param {boolean | null} [free] * @param {Array} [id] The id value for the learning resource - * @param {Array} [learning_format] The format(s) in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * @param {Array} [level] * @param {number} [limit] Number of results to return per page * @param {number | null} [max_incompleteness_penalty] Maximum score penalty for incomplete OCW courses in percent. An OCW course with completeness = 0 will have this score penalty. Partially complete courses have a linear penalty proportional to the degree of incompleteness. Only affects results if there is a search term. @@ -13695,7 +13493,6 @@ export const LearningResourcesUserSubscriptionApiAxiosParamCreator = function ( dev_mode?: boolean | null, free?: boolean | null, id?: Array, - learning_format?: Array, level?: Array, limit?: number, max_incompleteness_penalty?: number | null, @@ -13766,10 +13563,6 @@ export const LearningResourcesUserSubscriptionApiAxiosParamCreator = function ( localVarQueryParameter["id"] = id } - if (learning_format) { - localVarQueryParameter["learning_format"] = learning_format - } - if (level) { localVarQueryParameter["level"] = level } @@ -13861,7 +13654,6 @@ export const LearningResourcesUserSubscriptionApiAxiosParamCreator = function ( * @param {boolean | null} [dev_mode] If true return raw open search results with score explanations * @param {boolean | null} [free] * @param {Array} [id] The id value for the learning resource - * @param {Array} [learning_format] The format(s) in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * @param {Array} [level] * @param {number} [limit] Number of results to return per page * @param {number | null} [max_incompleteness_penalty] Maximum score penalty for incomplete OCW courses in percent. An OCW course with completeness = 0 will have this score penalty. Partially complete courses have a linear penalty proportional to the degree of incompleteness. Only affects results if there is a search term. @@ -13893,7 +13685,6 @@ export const LearningResourcesUserSubscriptionApiAxiosParamCreator = function ( dev_mode?: boolean | null, free?: boolean | null, id?: Array, - learning_format?: Array, level?: Array, limit?: number, max_incompleteness_penalty?: number | null, @@ -13966,10 +13757,6 @@ export const LearningResourcesUserSubscriptionApiAxiosParamCreator = function ( localVarQueryParameter["id"] = id } - if (learning_format) { - localVarQueryParameter["learning_format"] = learning_format - } - if (level) { localVarQueryParameter["level"] = level } @@ -14136,7 +13923,6 @@ export const LearningResourcesUserSubscriptionApiFp = function ( * @param {boolean | null} [dev_mode] If true return raw open search results with score explanations * @param {boolean | null} [free] * @param {Array} [id] The id value for the learning resource - * @param {Array} [learning_format] The format(s) in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * @param {Array} [level] * @param {number} [limit] Number of results to return per page * @param {number | null} [max_incompleteness_penalty] Maximum score penalty for incomplete OCW courses in percent. An OCW course with completeness = 0 will have this score penalty. Partially complete courses have a linear penalty proportional to the degree of incompleteness. Only affects results if there is a search term. @@ -14167,7 +13953,6 @@ export const LearningResourcesUserSubscriptionApiFp = function ( dev_mode?: boolean | null, free?: boolean | null, id?: Array, - learning_format?: Array, level?: Array, limit?: number, max_incompleteness_penalty?: number | null, @@ -14203,7 +13988,6 @@ export const LearningResourcesUserSubscriptionApiFp = function ( dev_mode, free, id, - learning_format, level, limit, max_incompleteness_penalty, @@ -14248,7 +14032,6 @@ export const LearningResourcesUserSubscriptionApiFp = function ( * @param {boolean | null} [dev_mode] If true return raw open search results with score explanations * @param {boolean | null} [free] * @param {Array} [id] The id value for the learning resource - * @param {Array} [learning_format] The format(s) in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * @param {Array} [level] * @param {number} [limit] Number of results to return per page * @param {number | null} [max_incompleteness_penalty] Maximum score penalty for incomplete OCW courses in percent. An OCW course with completeness = 0 will have this score penalty. Partially complete courses have a linear penalty proportional to the degree of incompleteness. Only affects results if there is a search term. @@ -14278,7 +14061,6 @@ export const LearningResourcesUserSubscriptionApiFp = function ( dev_mode?: boolean | null, free?: boolean | null, id?: Array, - learning_format?: Array, level?: Array, limit?: number, max_incompleteness_penalty?: number | null, @@ -14313,7 +14095,6 @@ export const LearningResourcesUserSubscriptionApiFp = function ( dev_mode, free, id, - learning_format, level, limit, max_incompleteness_penalty, @@ -14357,7 +14138,6 @@ export const LearningResourcesUserSubscriptionApiFp = function ( * @param {boolean | null} [dev_mode] If true return raw open search results with score explanations * @param {boolean | null} [free] * @param {Array} [id] The id value for the learning resource - * @param {Array} [learning_format] The format(s) in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * @param {Array} [level] * @param {number} [limit] Number of results to return per page * @param {number | null} [max_incompleteness_penalty] Maximum score penalty for incomplete OCW courses in percent. An OCW course with completeness = 0 will have this score penalty. Partially complete courses have a linear penalty proportional to the degree of incompleteness. Only affects results if there is a search term. @@ -14389,7 +14169,6 @@ export const LearningResourcesUserSubscriptionApiFp = function ( dev_mode?: boolean | null, free?: boolean | null, id?: Array, - learning_format?: Array, level?: Array, limit?: number, max_incompleteness_penalty?: number | null, @@ -14423,7 +14202,6 @@ export const LearningResourcesUserSubscriptionApiFp = function ( dev_mode, free, id, - learning_format, level, limit, max_incompleteness_penalty, @@ -14524,7 +14302,6 @@ export const LearningResourcesUserSubscriptionApiFactory = function ( requestParameters.dev_mode, requestParameters.free, requestParameters.id, - requestParameters.learning_format, requestParameters.level, requestParameters.limit, requestParameters.max_incompleteness_penalty, @@ -14568,7 +14345,6 @@ export const LearningResourcesUserSubscriptionApiFactory = function ( requestParameters.dev_mode, requestParameters.free, requestParameters.id, - requestParameters.learning_format, requestParameters.level, requestParameters.limit, requestParameters.max_incompleteness_penalty, @@ -14611,7 +14387,6 @@ export const LearningResourcesUserSubscriptionApiFactory = function ( requestParameters.dev_mode, requestParameters.free, requestParameters.id, - requestParameters.learning_format, requestParameters.level, requestParameters.limit, requestParameters.max_incompleteness_penalty, @@ -14663,7 +14438,7 @@ export const LearningResourcesUserSubscriptionApiFactory = function ( export interface LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionCheckListRequest { /** * Show resource counts by category - * @type {Array<'resource_type' | 'certification' | 'certification_type' | 'offered_by' | 'platform' | 'topic' | 'department' | 'level' | 'course_feature' | 'professional' | 'free' | 'learning_format' | 'delivery' | 'resource_category'>} + * @type {Array<'resource_type' | 'certification' | 'certification_type' | 'offered_by' | 'platform' | 'topic' | 'department' | 'level' | 'course_feature' | 'professional' | 'free' | 'delivery' | 'resource_category'>} * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionCheckList */ readonly aggregations?: Array @@ -14724,13 +14499,6 @@ export interface LearningResourcesUserSubscriptionApiLearningResourcesUserSubscr */ readonly id?: Array - /** - * The format(s) in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person - * @type {Array<'online' | 'hybrid' | 'in_person'>} - * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionCheckList - */ - readonly learning_format?: Array - /** * * @type {Array<'undergraduate' | 'graduate' | 'high_school' | 'noncredit' | 'advanced' | 'intermediate' | 'introductory'>} @@ -14859,7 +14627,7 @@ export interface LearningResourcesUserSubscriptionApiLearningResourcesUserSubscr export interface LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionListRequest { /** * Show resource counts by category - * @type {Array<'resource_type' | 'certification' | 'certification_type' | 'offered_by' | 'platform' | 'topic' | 'department' | 'level' | 'course_feature' | 'professional' | 'free' | 'learning_format' | 'delivery' | 'resource_category'>} + * @type {Array<'resource_type' | 'certification' | 'certification_type' | 'offered_by' | 'platform' | 'topic' | 'department' | 'level' | 'course_feature' | 'professional' | 'free' | 'delivery' | 'resource_category'>} * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionList */ readonly aggregations?: Array @@ -14920,13 +14688,6 @@ export interface LearningResourcesUserSubscriptionApiLearningResourcesUserSubscr */ readonly id?: Array - /** - * The format(s) in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person - * @type {Array<'online' | 'hybrid' | 'in_person'>} - * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionList - */ - readonly learning_format?: Array - /** * * @type {Array<'undergraduate' | 'graduate' | 'high_school' | 'noncredit' | 'advanced' | 'intermediate' | 'introductory'>} @@ -15048,7 +14809,7 @@ export interface LearningResourcesUserSubscriptionApiLearningResourcesUserSubscr export interface LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionSubscribeCreateRequest { /** * Show resource counts by category - * @type {Array<'resource_type' | 'certification' | 'certification_type' | 'offered_by' | 'platform' | 'topic' | 'department' | 'level' | 'course_feature' | 'professional' | 'free' | 'learning_format' | 'delivery' | 'resource_category'>} + * @type {Array<'resource_type' | 'certification' | 'certification_type' | 'offered_by' | 'platform' | 'topic' | 'department' | 'level' | 'course_feature' | 'professional' | 'free' | 'delivery' | 'resource_category'>} * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionSubscribeCreate */ readonly aggregations?: Array @@ -15109,13 +14870,6 @@ export interface LearningResourcesUserSubscriptionApiLearningResourcesUserSubscr */ readonly id?: Array - /** - * The format(s) in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person - * @type {Array<'online' | 'hybrid' | 'in_person'>} - * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionSubscribeCreate - */ - readonly learning_format?: Array - /** * * @type {Array<'undergraduate' | 'graduate' | 'high_school' | 'noncredit' | 'advanced' | 'intermediate' | 'introductory'>} @@ -15287,7 +15041,6 @@ export class LearningResourcesUserSubscriptionApi extends BaseAPI { requestParameters.dev_mode, requestParameters.free, requestParameters.id, - requestParameters.learning_format, requestParameters.level, requestParameters.limit, requestParameters.max_incompleteness_penalty, @@ -15333,7 +15086,6 @@ export class LearningResourcesUserSubscriptionApi extends BaseAPI { requestParameters.dev_mode, requestParameters.free, requestParameters.id, - requestParameters.learning_format, requestParameters.level, requestParameters.limit, requestParameters.max_incompleteness_penalty, @@ -15378,7 +15130,6 @@ export class LearningResourcesUserSubscriptionApi extends BaseAPI { requestParameters.dev_mode, requestParameters.free, requestParameters.id, - requestParameters.learning_format, requestParameters.level, requestParameters.limit, requestParameters.max_incompleteness_penalty, @@ -15438,7 +15189,6 @@ export const LearningResourcesUserSubscriptionCheckListAggregationsEnum = { CourseFeature: "course_feature", Professional: "professional", Free: "free", - LearningFormat: "learning_format", Delivery: "delivery", ResourceCategory: "resource_category", } as const @@ -15513,16 +15263,6 @@ export type LearningResourcesUserSubscriptionCheckListDepartmentEnum = /** * @export */ -export const LearningResourcesUserSubscriptionCheckListLearningFormatEnum = { - Online: "online", - Hybrid: "hybrid", - InPerson: "in_person", -} as const -export type LearningResourcesUserSubscriptionCheckListLearningFormatEnum = - (typeof LearningResourcesUserSubscriptionCheckListLearningFormatEnum)[keyof typeof LearningResourcesUserSubscriptionCheckListLearningFormatEnum] -/** - * @export - */ export const LearningResourcesUserSubscriptionCheckListLevelEnum = { Undergraduate: "undergraduate", Graduate: "graduate", @@ -15652,7 +15392,6 @@ export const LearningResourcesUserSubscriptionListAggregationsEnum = { CourseFeature: "course_feature", Professional: "professional", Free: "free", - LearningFormat: "learning_format", Delivery: "delivery", ResourceCategory: "resource_category", } as const @@ -15727,16 +15466,6 @@ export type LearningResourcesUserSubscriptionListDepartmentEnum = /** * @export */ -export const LearningResourcesUserSubscriptionListLearningFormatEnum = { - Online: "online", - Hybrid: "hybrid", - InPerson: "in_person", -} as const -export type LearningResourcesUserSubscriptionListLearningFormatEnum = - (typeof LearningResourcesUserSubscriptionListLearningFormatEnum)[keyof typeof LearningResourcesUserSubscriptionListLearningFormatEnum] -/** - * @export - */ export const LearningResourcesUserSubscriptionListLevelEnum = { Undergraduate: "undergraduate", Graduate: "graduate", @@ -15858,7 +15587,6 @@ export const LearningResourcesUserSubscriptionSubscribeCreateAggregationsEnum = CourseFeature: "course_feature", Professional: "professional", Free: "free", - LearningFormat: "learning_format", Delivery: "delivery", ResourceCategory: "resource_category", } as const @@ -15934,17 +15662,6 @@ export type LearningResourcesUserSubscriptionSubscribeCreateDepartmentEnum = /** * @export */ -export const LearningResourcesUserSubscriptionSubscribeCreateLearningFormatEnum = - { - Online: "online", - Hybrid: "hybrid", - InPerson: "in_person", - } as const -export type LearningResourcesUserSubscriptionSubscribeCreateLearningFormatEnum = - (typeof LearningResourcesUserSubscriptionSubscribeCreateLearningFormatEnum)[keyof typeof LearningResourcesUserSubscriptionSubscribeCreateLearningFormatEnum] -/** - * @export - */ export const LearningResourcesUserSubscriptionSubscribeCreateLevelEnum = { Undergraduate: "undergraduate", Graduate: "graduate", @@ -16493,7 +16210,6 @@ export const LearningpathsApiAxiosParamCreator = function ( * @param {Array>} [delivery] The delivery of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline * @param {Array} [department] The department that offers learning resources * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies * @param {boolean} [free] The course/program is offered for free - * @param {Array>} [learning_format] The learning format of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * @param {Array} [level] The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory * @param {number} [limit] Number of results to return per page. * @param {Array} [offered_by] The organization that offers a learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education @@ -16515,7 +16231,6 @@ export const LearningpathsApiAxiosParamCreator = function ( delivery?: Array>, department?: Array, free?: boolean, - learning_format?: Array>, level?: Array, limit?: number, offered_by?: Array, @@ -16571,10 +16286,6 @@ export const LearningpathsApiAxiosParamCreator = function ( localVarQueryParameter["free"] = free } - if (learning_format) { - localVarQueryParameter["learning_format"] = learning_format - } - if (level) { localVarQueryParameter["level"] = level } @@ -17003,7 +16714,6 @@ export const LearningpathsApiFp = function (configuration?: Configuration) { * @param {Array>} [delivery] The delivery of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline * @param {Array} [department] The department that offers learning resources * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies * @param {boolean} [free] The course/program is offered for free - * @param {Array>} [learning_format] The learning format of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * @param {Array} [level] The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory * @param {number} [limit] Number of results to return per page. * @param {Array} [offered_by] The organization that offers a learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education @@ -17025,7 +16735,6 @@ export const LearningpathsApiFp = function (configuration?: Configuration) { delivery?: Array>, department?: Array, free?: boolean, - learning_format?: Array>, level?: Array, limit?: number, offered_by?: Array, @@ -17052,7 +16761,6 @@ export const LearningpathsApiFp = function (configuration?: Configuration) { delivery, department, free, - learning_format, level, limit, offered_by, @@ -17307,7 +17015,6 @@ export const LearningpathsApiFactory = function ( requestParameters.delivery, requestParameters.department, requestParameters.free, - requestParameters.learning_format, requestParameters.level, requestParameters.limit, requestParameters.offered_by, @@ -17562,13 +17269,6 @@ export interface LearningpathsApiLearningpathsListRequest { */ readonly free?: boolean - /** - * The learning format of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person - * @type {Array>} - * @memberof LearningpathsApiLearningpathsList - */ - readonly learning_format?: Array> - /** * The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory * @type {Array<'advanced' | 'graduate' | 'high_school' | 'intermediate' | 'introductory' | 'noncredit' | 'undergraduate'>} @@ -17853,7 +17553,6 @@ export class LearningpathsApi extends BaseAPI { requestParameters.delivery, requestParameters.department, requestParameters.free, - requestParameters.learning_format, requestParameters.level, requestParameters.limit, requestParameters.offered_by, @@ -18702,7 +18401,6 @@ export const PodcastEpisodesApiAxiosParamCreator = function ( * @param {Array>} [delivery] The delivery of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline * @param {Array} [department] The department that offers learning resources * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies * @param {boolean} [free] The course/program is offered for free - * @param {Array>} [learning_format] The learning format of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * @param {Array} [level] The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory * @param {number} [limit] Number of results to return per page. * @param {Array} [offered_by] The organization that offers a learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education @@ -18724,7 +18422,6 @@ export const PodcastEpisodesApiAxiosParamCreator = function ( delivery?: Array>, department?: Array, free?: boolean, - learning_format?: Array>, level?: Array, limit?: number, offered_by?: Array, @@ -18780,10 +18477,6 @@ export const PodcastEpisodesApiAxiosParamCreator = function ( localVarQueryParameter["free"] = free } - if (learning_format) { - localVarQueryParameter["learning_format"] = learning_format - } - if (level) { localVarQueryParameter["level"] = level } @@ -18910,7 +18603,6 @@ export const PodcastEpisodesApiFp = function (configuration?: Configuration) { * @param {Array>} [delivery] The delivery of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline * @param {Array} [department] The department that offers learning resources * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies * @param {boolean} [free] The course/program is offered for free - * @param {Array>} [learning_format] The learning format of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * @param {Array} [level] The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory * @param {number} [limit] Number of results to return per page. * @param {Array} [offered_by] The organization that offers a learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education @@ -18932,7 +18624,6 @@ export const PodcastEpisodesApiFp = function (configuration?: Configuration) { delivery?: Array>, department?: Array, free?: boolean, - learning_format?: Array>, level?: Array, limit?: number, offered_by?: Array, @@ -18959,7 +18650,6 @@ export const PodcastEpisodesApiFp = function (configuration?: Configuration) { delivery, department, free, - learning_format, level, limit, offered_by, @@ -19049,7 +18739,6 @@ export const PodcastEpisodesApiFactory = function ( requestParameters.delivery, requestParameters.department, requestParameters.free, - requestParameters.learning_format, requestParameters.level, requestParameters.limit, requestParameters.offered_by, @@ -19131,13 +18820,6 @@ export interface PodcastEpisodesApiPodcastEpisodesListRequest { */ readonly free?: boolean - /** - * The learning format of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person - * @type {Array>} - * @memberof PodcastEpisodesApiPodcastEpisodesList - */ - readonly learning_format?: Array> - /** * The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory * @type {Array<'advanced' | 'graduate' | 'high_school' | 'intermediate' | 'introductory' | 'noncredit' | 'undergraduate'>} @@ -19257,7 +18939,6 @@ export class PodcastEpisodesApi extends BaseAPI { requestParameters.delivery, requestParameters.department, requestParameters.free, - requestParameters.learning_format, requestParameters.level, requestParameters.limit, requestParameters.offered_by, @@ -19598,7 +19279,6 @@ export const PodcastsApiAxiosParamCreator = function ( * @param {Array>} [delivery] The delivery of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline * @param {Array} [department] The department that offers learning resources * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies * @param {boolean} [free] The course/program is offered for free - * @param {Array>} [learning_format] The learning format of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * @param {Array} [level] The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory * @param {number} [limit] Number of results to return per page. * @param {Array} [offered_by] The organization that offers a learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education @@ -19620,7 +19300,6 @@ export const PodcastsApiAxiosParamCreator = function ( delivery?: Array>, department?: Array, free?: boolean, - learning_format?: Array>, level?: Array, limit?: number, offered_by?: Array, @@ -19676,10 +19355,6 @@ export const PodcastsApiAxiosParamCreator = function ( localVarQueryParameter["free"] = free } - if (learning_format) { - localVarQueryParameter["learning_format"] = learning_format - } - if (level) { localVarQueryParameter["level"] = level } @@ -19881,7 +19556,6 @@ export const PodcastsApiFp = function (configuration?: Configuration) { * @param {Array>} [delivery] The delivery of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline * @param {Array} [department] The department that offers learning resources * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies * @param {boolean} [free] The course/program is offered for free - * @param {Array>} [learning_format] The learning format of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * @param {Array} [level] The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory * @param {number} [limit] Number of results to return per page. * @param {Array} [offered_by] The organization that offers a learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education @@ -19903,7 +19577,6 @@ export const PodcastsApiFp = function (configuration?: Configuration) { delivery?: Array>, department?: Array, free?: boolean, - learning_format?: Array>, level?: Array, limit?: number, offered_by?: Array, @@ -19929,7 +19602,6 @@ export const PodcastsApiFp = function (configuration?: Configuration) { delivery, department, free, - learning_format, level, limit, offered_by, @@ -20056,7 +19728,6 @@ export const PodcastsApiFactory = function ( requestParameters.delivery, requestParameters.department, requestParameters.free, - requestParameters.learning_format, requestParameters.level, requestParameters.limit, requestParameters.offered_by, @@ -20194,13 +19865,6 @@ export interface PodcastsApiPodcastsListRequest { */ readonly free?: boolean - /** - * The learning format of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person - * @type {Array>} - * @memberof PodcastsApiPodcastsList - */ - readonly learning_format?: Array> - /** * The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory * @type {Array<'advanced' | 'graduate' | 'high_school' | 'intermediate' | 'introductory' | 'noncredit' | 'undergraduate'>} @@ -20364,7 +20028,6 @@ export class PodcastsApi extends BaseAPI { requestParameters.delivery, requestParameters.department, requestParameters.free, - requestParameters.learning_format, requestParameters.level, requestParameters.limit, requestParameters.offered_by, @@ -20739,7 +20402,6 @@ export const ProgramsApiAxiosParamCreator = function ( * @param {Array>} [delivery] The delivery of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline * @param {Array} [department] The department that offers learning resources * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies * @param {boolean} [free] The course/program is offered for free - * @param {Array>} [learning_format] The learning format of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * @param {Array} [level] The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory * @param {number} [limit] Number of results to return per page. * @param {Array} [offered_by] The organization that offers a learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education @@ -20761,7 +20423,6 @@ export const ProgramsApiAxiosParamCreator = function ( delivery?: Array>, department?: Array, free?: boolean, - learning_format?: Array>, level?: Array, limit?: number, offered_by?: Array, @@ -20817,10 +20478,6 @@ export const ProgramsApiAxiosParamCreator = function ( localVarQueryParameter["free"] = free } - if (learning_format) { - localVarQueryParameter["learning_format"] = learning_format - } - if (level) { localVarQueryParameter["level"] = level } @@ -20946,7 +20603,6 @@ export const ProgramsApiFp = function (configuration?: Configuration) { * @param {Array>} [delivery] The delivery of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline * @param {Array} [department] The department that offers learning resources * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies * @param {boolean} [free] The course/program is offered for free - * @param {Array>} [learning_format] The learning format of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * @param {Array} [level] The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory * @param {number} [limit] Number of results to return per page. * @param {Array} [offered_by] The organization that offers a learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education @@ -20968,7 +20624,6 @@ export const ProgramsApiFp = function (configuration?: Configuration) { delivery?: Array>, department?: Array, free?: boolean, - learning_format?: Array>, level?: Array, limit?: number, offered_by?: Array, @@ -20994,7 +20649,6 @@ export const ProgramsApiFp = function (configuration?: Configuration) { delivery, department, free, - learning_format, level, limit, offered_by, @@ -21081,7 +20735,6 @@ export const ProgramsApiFactory = function ( requestParameters.delivery, requestParameters.department, requestParameters.free, - requestParameters.learning_format, requestParameters.level, requestParameters.limit, requestParameters.offered_by, @@ -21163,13 +20816,6 @@ export interface ProgramsApiProgramsListRequest { */ readonly free?: boolean - /** - * The learning format of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person - * @type {Array>} - * @memberof ProgramsApiProgramsList - */ - readonly learning_format?: Array> - /** * The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory * @type {Array<'advanced' | 'graduate' | 'high_school' | 'intermediate' | 'introductory' | 'noncredit' | 'undergraduate'>} @@ -21289,7 +20935,6 @@ export class ProgramsApi extends BaseAPI { requestParameters.delivery, requestParameters.department, requestParameters.free, - requestParameters.learning_format, requestParameters.level, requestParameters.limit, requestParameters.offered_by, @@ -23777,7 +23422,6 @@ export const VideoPlaylistsApiAxiosParamCreator = function ( * @param {Array>} [delivery] The delivery of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline * @param {Array} [department] The department that offers learning resources * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies * @param {boolean} [free] The course/program is offered for free - * @param {Array>} [learning_format] The learning format of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * @param {Array} [level] The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory * @param {number} [limit] Number of results to return per page. * @param {Array} [offered_by] The organization that offers a learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education @@ -23799,7 +23443,6 @@ export const VideoPlaylistsApiAxiosParamCreator = function ( delivery?: Array>, department?: Array, free?: boolean, - learning_format?: Array>, level?: Array, limit?: number, offered_by?: Array, @@ -23855,10 +23498,6 @@ export const VideoPlaylistsApiAxiosParamCreator = function ( localVarQueryParameter["free"] = free } - if (learning_format) { - localVarQueryParameter["learning_format"] = learning_format - } - if (level) { localVarQueryParameter["level"] = level } @@ -24064,7 +23703,6 @@ export const VideoPlaylistsApiFp = function (configuration?: Configuration) { * @param {Array>} [delivery] The delivery of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline * @param {Array} [department] The department that offers learning resources * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies * @param {boolean} [free] The course/program is offered for free - * @param {Array>} [learning_format] The learning format of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * @param {Array} [level] The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory * @param {number} [limit] Number of results to return per page. * @param {Array} [offered_by] The organization that offers a learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education @@ -24086,7 +23724,6 @@ export const VideoPlaylistsApiFp = function (configuration?: Configuration) { delivery?: Array>, department?: Array, free?: boolean, - learning_format?: Array>, level?: Array, limit?: number, offered_by?: Array, @@ -24113,7 +23750,6 @@ export const VideoPlaylistsApiFp = function (configuration?: Configuration) { delivery, department, free, - learning_format, level, limit, offered_by, @@ -24241,7 +23877,6 @@ export const VideoPlaylistsApiFactory = function ( requestParameters.delivery, requestParameters.department, requestParameters.free, - requestParameters.learning_format, requestParameters.level, requestParameters.limit, requestParameters.offered_by, @@ -24379,13 +24014,6 @@ export interface VideoPlaylistsApiVideoPlaylistsListRequest { */ readonly free?: boolean - /** - * The learning format of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person - * @type {Array>} - * @memberof VideoPlaylistsApiVideoPlaylistsList - */ - readonly learning_format?: Array> - /** * The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory * @type {Array<'advanced' | 'graduate' | 'high_school' | 'intermediate' | 'introductory' | 'noncredit' | 'undergraduate'>} @@ -24549,7 +24177,6 @@ export class VideoPlaylistsApi extends BaseAPI { requestParameters.delivery, requestParameters.department, requestParameters.free, - requestParameters.learning_format, requestParameters.level, requestParameters.limit, requestParameters.offered_by, @@ -24765,7 +24392,6 @@ export const VideosApiAxiosParamCreator = function ( * @param {Array>} [delivery] The delivery of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline * @param {Array} [department] The department that offers learning resources * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies * @param {boolean} [free] The course/program is offered for free - * @param {Array>} [learning_format] The learning format of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * @param {Array} [level] The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory * @param {number} [limit] Number of results to return per page. * @param {Array} [offered_by] The organization that offers a learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education @@ -24787,7 +24413,6 @@ export const VideosApiAxiosParamCreator = function ( delivery?: Array>, department?: Array, free?: boolean, - learning_format?: Array>, level?: Array, limit?: number, offered_by?: Array, @@ -24843,10 +24468,6 @@ export const VideosApiAxiosParamCreator = function ( localVarQueryParameter["free"] = free } - if (learning_format) { - localVarQueryParameter["learning_format"] = learning_format - } - if (level) { localVarQueryParameter["level"] = level } @@ -24972,7 +24593,6 @@ export const VideosApiFp = function (configuration?: Configuration) { * @param {Array>} [delivery] The delivery of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline * @param {Array} [department] The department that offers learning resources * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies * @param {boolean} [free] The course/program is offered for free - * @param {Array>} [learning_format] The learning format of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * @param {Array} [level] The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory * @param {number} [limit] Number of results to return per page. * @param {Array} [offered_by] The organization that offers a learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education @@ -24994,7 +24614,6 @@ export const VideosApiFp = function (configuration?: Configuration) { delivery?: Array>, department?: Array, free?: boolean, - learning_format?: Array>, level?: Array, limit?: number, offered_by?: Array, @@ -25020,7 +24639,6 @@ export const VideosApiFp = function (configuration?: Configuration) { delivery, department, free, - learning_format, level, limit, offered_by, @@ -25106,7 +24724,6 @@ export const VideosApiFactory = function ( requestParameters.delivery, requestParameters.department, requestParameters.free, - requestParameters.learning_format, requestParameters.level, requestParameters.limit, requestParameters.offered_by, @@ -25188,13 +24805,6 @@ export interface VideosApiVideosListRequest { */ readonly free?: boolean - /** - * The learning format of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person - * @type {Array>} - * @memberof VideosApiVideosList - */ - readonly learning_format?: Array> - /** * The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory * @type {Array<'advanced' | 'graduate' | 'high_school' | 'intermediate' | 'introductory' | 'noncredit' | 'undergraduate'>} @@ -25314,7 +24924,6 @@ export class VideosApi extends BaseAPI { requestParameters.delivery, requestParameters.department, requestParameters.free, - requestParameters.learning_format, requestParameters.level, requestParameters.limit, requestParameters.offered_by, diff --git a/frontends/api/src/test-utils/factories/user.ts b/frontends/api/src/test-utils/factories/user.ts index d8defb2296..189ab2bf98 100644 --- a/frontends/api/src/test-utils/factories/user.ts +++ b/frontends/api/src/test-utils/factories/user.ts @@ -16,7 +16,7 @@ const profile: PartialFactory = (overrides = {}): Profile => ({ goals: [], current_education: "", time_commitment: "", - learning_format: [], + delivery: [], certificate_desired: "", preference_search_filters: {}, ...overrides, diff --git a/frontends/mit-learn/package.json b/frontends/mit-learn/package.json index 236f204e06..a7b8cdd440 100644 --- a/frontends/mit-learn/package.json +++ b/frontends/mit-learn/package.json @@ -59,7 +59,7 @@ }, "dependencies": { "@ebay/nice-modal-react": "^1.2.13", - "@mitodl/course-search-utils": "^3.1.5", + "@mitodl/course-search-utils": "^3.1.6", "@remixicon/react": "^4.2.0", "@sentry/react": "^7.57.0", "@tanstack/react-query": "^4.36.1", diff --git a/frontends/mit-learn/src/common/profile.tsx b/frontends/mit-learn/src/common/profile.tsx index bc2d3ea2cf..96dc5bbd81 100644 --- a/frontends/mit-learn/src/common/profile.tsx +++ b/frontends/mit-learn/src/common/profile.tsx @@ -7,18 +7,19 @@ import { CurrentEducationEnumDescriptions, GoalsEnum, GoalsEnumDescriptions, - LearningFormatEnum, - LearningFormatEnumDescriptions, + DeliveryEnum, + DeliveryEnumDescriptions, } from "api/v0" import { SimpleSelectOption } from "ol-components" -const LEARNING_FORMAT_CHOICES = [ - LearningFormatEnum.Online, - LearningFormatEnum.InPerson, - LearningFormatEnum.Hybrid, +const DELIVERY_CHOICES = [ + DeliveryEnum.Online, + DeliveryEnum.InPerson, + DeliveryEnum.Hybrid, + DeliveryEnum.Offline, ].map((value) => ({ value, - label: LearningFormatEnumDescriptions[value], + label: DeliveryEnumDescriptions[value], })) const GOALS_CHOICES = [ @@ -71,15 +72,13 @@ const ProfileSchema = yup.object().shape({ current_education: yup .string() .oneOf(EDUCATION_LEVEL_OPTIONS.map((choice) => choice.value)), - learning_format: yup + delivery: yup .array() - .of( - yup.string().oneOf(LEARNING_FORMAT_CHOICES.map((choice) => choice.value)), - ), + .of(yup.string().oneOf(DELIVERY_CHOICES.map((choice) => choice.value))), }) export { - LEARNING_FORMAT_CHOICES, + DELIVERY_CHOICES, GOALS_CHOICES, EDUCATION_LEVEL_OPTIONS, CERTIFICATE_CHOICES, diff --git a/frontends/mit-learn/src/page-components/ChannelDetails/ChannelDetails.tsx b/frontends/mit-learn/src/page-components/ChannelDetails/ChannelDetails.tsx index 24d9a46a0d..54e6bc1707 100644 --- a/frontends/mit-learn/src/page-components/ChannelDetails/ChannelDetails.tsx +++ b/frontends/mit-learn/src/page-components/ChannelDetails/ChannelDetails.tsx @@ -9,18 +9,8 @@ type ChannelDetailsProps = { } const FACETS_BY_CHANNEL_TYPE: Record = { - [ChannelTypeEnum.Topic]: [ - "free", - "department", - "offered_by", - "learning_format", - ], - [ChannelTypeEnum.Department]: [ - "free", - "topic", - "offered_by", - "learning_format", - ], + [ChannelTypeEnum.Topic]: ["free", "department", "offered_by", "delivery"], + [ChannelTypeEnum.Department]: ["free", "topic", "offered_by", "delivery"], [ChannelTypeEnum.Unit]: [ "offerings", "audience", @@ -125,7 +115,7 @@ const getFacetManifest = (channelType: ChannelTypeEnum) => { order: 0, }, { - name: "learning_format", + name: "delivery", title: "Format", order: 0, labelFunction: (key: string) => diff --git a/frontends/mit-learn/src/pages/ChannelPage/ChannelSearch.test.tsx b/frontends/mit-learn/src/pages/ChannelPage/ChannelSearch.test.tsx index 3a3f87409c..8063466e3e 100644 --- a/frontends/mit-learn/src/pages/ChannelPage/ChannelSearch.test.tsx +++ b/frontends/mit-learn/src/pages/ChannelPage/ChannelSearch.test.tsx @@ -230,7 +230,7 @@ describe("ChannelSearch", () => { platform: [{ key: "ocw", doc_count: 100 }], offered_by: [{ key: "ocw", doc_count: 100 }], certification: [{ key: "true", doc_count: 100 }], - learning_format: [{ key: "online", doc_count: 100 }], + delivery: [{ key: "online", doc_count: 100 }], certification_type: [{ key: "micromasters", doc_count: 100 }], }, suggestions: [], diff --git a/frontends/mit-learn/src/pages/ChannelPage/ChannelSearch.tsx b/frontends/mit-learn/src/pages/ChannelPage/ChannelSearch.tsx index 3e77db3e06..4b32b3c7ee 100644 --- a/frontends/mit-learn/src/pages/ChannelPage/ChannelSearch.tsx +++ b/frontends/mit-learn/src/pages/ChannelPage/ChannelSearch.tsx @@ -39,7 +39,7 @@ const FACETS_BY_CHANNEL_TYPE: Record = { "free", "resource_type", "certification_type", - "learning_format", + "delivery", "offered_by", "department", ], @@ -48,7 +48,7 @@ const FACETS_BY_CHANNEL_TYPE: Record = { "resource_type", "certification_type", "topic", - "learning_format", + "delivery", "offered_by", ], [ChannelTypeEnum.Unit]: [ @@ -56,7 +56,7 @@ const FACETS_BY_CHANNEL_TYPE: Record = { "resource_type", "topic", "certification_type", - "learning_format", + "delivery", "department", ], [ChannelTypeEnum.Pathway]: [], diff --git a/frontends/mit-learn/src/pages/DashboardPage/Dashboard.test.tsx b/frontends/mit-learn/src/pages/DashboardPage/Dashboard.test.tsx index 7b6be94998..d1c1efdbe6 100644 --- a/frontends/mit-learn/src/pages/DashboardPage/Dashboard.test.tsx +++ b/frontends/mit-learn/src/pages/DashboardPage/Dashboard.test.tsx @@ -16,7 +16,7 @@ import { faker } from "@faker-js/faker/locale/en" import { CourseResource, LearningResource, - LearningResourcesSearchRetrieveLearningFormatEnum, + LearningResourcesSearchRetrieveDeliveryEnum, } from "api" import { ControlledPromise } from "ol-test-utilities" import React from "react" @@ -48,20 +48,21 @@ describe("DashboardPage", () => { .topics({ count: 3 }) .results.map((topic) => topic.name), certification: faker.helpers.arrayElement([true, false]), - learning_format: faker.helpers.arrayElements([ + delivery: faker.helpers.arrayElements([ "online", "in-person", "hybrid", + "offline", ]), }, }) const certification: boolean | undefined = profile?.preference_search_filters.certification const topics = profile?.preference_search_filters.topic - const learningFormat = Object.values( - LearningResourcesSearchRetrieveLearningFormatEnum, + const delivery = Object.values( + LearningResourcesSearchRetrieveDeliveryEnum, ).filter((format) => - profile?.preference_search_filters.learning_format?.includes(format), + profile?.preference_search_filters.delivery?.includes(format), ) const topPicks = factories.learningResources.courses({ count: 10 }) @@ -71,7 +72,7 @@ describe("DashboardPage", () => { factories.learningResources.topic({ name: topic }), ) course.certification = certification || false - course.learning_format = learningFormat.map((format) => + course.delivery = delivery.map((format) => format ? { code: format, name: format } : { code: "online", name: "Online" }, @@ -115,7 +116,7 @@ describe("DashboardPage", () => { expect.stringContaining( urls.search.resources({ certification: certification, - learning_format: learningFormat, + delivery: delivery, limit: 12, resource_type: ["course"], sortby: "-views", diff --git a/frontends/mit-learn/src/pages/DashboardPage/ProfileEditForm.tsx b/frontends/mit-learn/src/pages/DashboardPage/ProfileEditForm.tsx index 0de49b5a09..eefdbe2f66 100644 --- a/frontends/mit-learn/src/pages/DashboardPage/ProfileEditForm.tsx +++ b/frontends/mit-learn/src/pages/DashboardPage/ProfileEditForm.tsx @@ -17,7 +17,7 @@ import { CERTIFICATE_CHOICES, EDUCATION_LEVEL_OPTIONS, GOALS_CHOICES, - LEARNING_FORMAT_CHOICES, + DELIVERY_CHOICES, ProfileSchema, } from "@/common/profile" import { useUserMe } from "api/hooks/user" @@ -158,10 +158,10 @@ const ProfileEditForm: React.FC = ({ profile }) => { onChange={formik.handleChange} /> diff --git a/frontends/mit-learn/src/pages/DashboardPage/carousels.ts b/frontends/mit-learn/src/pages/DashboardPage/carousels.ts index 6079e9a231..719dbff38e 100644 --- a/frontends/mit-learn/src/pages/DashboardPage/carousels.ts +++ b/frontends/mit-learn/src/pages/DashboardPage/carousels.ts @@ -1,5 +1,5 @@ import type { ResourceCarouselProps } from "@/page-components/ResourceCarousel/ResourceCarousel" -import { LearningResourcesSearchRetrieveLearningFormatEnum } from "api" +import { LearningResourcesSearchRetrieveDeliveryEnum } from "api" import { Profile } from "api/v0" type TopPicksCarouselConfigProps = ( @@ -12,10 +12,10 @@ const TopPicksCarouselConfig: TopPicksCarouselConfigProps = ( const certification: boolean | undefined = profile?.preference_search_filters.certification const topics = profile?.preference_search_filters.topic - const learningFormat = Object.values( - LearningResourcesSearchRetrieveLearningFormatEnum, + const delivery = Object.values( + LearningResourcesSearchRetrieveDeliveryEnum, ).filter((format) => - profile?.preference_search_filters.learning_format?.includes(format), + profile?.preference_search_filters.delivery?.includes(format), ) return [ { @@ -28,7 +28,7 @@ const TopPicksCarouselConfig: TopPicksCarouselConfigProps = ( limit: 12, certification: certification, topic: topics, - learning_format: learningFormat, + delivery: delivery, sortby: "-views", }, }, diff --git a/frontends/mit-learn/src/pages/OnboardingPage/OnboardingPage.test.tsx b/frontends/mit-learn/src/pages/OnboardingPage/OnboardingPage.test.tsx index d6dd7b0650..cc40f6ca71 100644 --- a/frontends/mit-learn/src/pages/OnboardingPage/OnboardingPage.test.tsx +++ b/frontends/mit-learn/src/pages/OnboardingPage/OnboardingPage.test.tsx @@ -13,7 +13,7 @@ import { urls } from "api/test-utils" import * as factories from "api/test-utils/factories" import { GoalsEnum, - LearningFormatEnum, + DeliveryEnum, CurrentEducationEnum, CertificateDesiredEnum, type Profile, @@ -35,7 +35,7 @@ const STEPS_DATA: Partial[] = [ current_education: CurrentEducationEnum.SecondaryHighSchool, }, { - learning_format: [LearningFormatEnum.Hybrid], + delivery: [DeliveryEnum.Hybrid], }, ] diff --git a/frontends/mit-learn/src/pages/OnboardingPage/OnboardingPage.tsx b/frontends/mit-learn/src/pages/OnboardingPage/OnboardingPage.tsx index c960e251bb..8ff211063c 100644 --- a/frontends/mit-learn/src/pages/OnboardingPage/OnboardingPage.tsx +++ b/frontends/mit-learn/src/pages/OnboardingPage/OnboardingPage.tsx @@ -29,7 +29,7 @@ import { CERTIFICATE_CHOICES, EDUCATION_LEVEL_OPTIONS, GOALS_CHOICES, - LEARNING_FORMAT_CHOICES, + DELIVERY_CHOICES, ProfileSchema, } from "@/common/profile" import MetaTags from "@/page-components/MetaTags/MetaTags" @@ -266,10 +266,10 @@ const OnboardingPage: React.FC = () => { onChange={formik.handleChange} /> , - + @@ -279,7 +279,7 @@ const OnboardingPage: React.FC = () => { Select all that apply: } - values={formik.values.learning_format} + values={formik.values.delivery} onChange={formik.handleChange} /> , diff --git a/frontends/mit-learn/src/pages/SearchPage/SearchPage.test.tsx b/frontends/mit-learn/src/pages/SearchPage/SearchPage.test.tsx index 60ed902b1f..4a5fae0258 100644 --- a/frontends/mit-learn/src/pages/SearchPage/SearchPage.test.tsx +++ b/frontends/mit-learn/src/pages/SearchPage/SearchPage.test.tsx @@ -116,9 +116,9 @@ describe("SearchPage", () => { const apiSearchParams = getLastApiSearchParams() expect(apiSearchParams.getAll("aggregations").sort()).toEqual([ "certification_type", + "delivery", "department", "free", - "learning_format", "offered_by", "professional", "resource_category", diff --git a/frontends/mit-learn/src/pages/SearchPage/SearchPage.tsx b/frontends/mit-learn/src/pages/SearchPage/SearchPage.tsx index 5531aa0b61..3b8c3830cd 100644 --- a/frontends/mit-learn/src/pages/SearchPage/SearchPage.tsx +++ b/frontends/mit-learn/src/pages/SearchPage/SearchPage.tsx @@ -110,7 +110,7 @@ export const getFacetManifest = ( preserveItems: true, }, { - name: "learning_format", + name: "delivery", title: "Format", type: "static", expandedOnLoad: true, @@ -150,7 +150,7 @@ export const getFacetManifest = ( const facetNames = [ "resource_type", "certification_type", - "learning_format", + "delivery", "department", "topic", "offered_by", diff --git a/frontends/ol-components/src/components/LearningResourceCard/LearningResourceListCard.tsx b/frontends/ol-components/src/components/LearningResourceCard/LearningResourceListCard.tsx index 0cc4bccc67..9b7517edf0 100644 --- a/frontends/ol-components/src/components/LearningResourceCard/LearningResourceListCard.tsx +++ b/frontends/ol-components/src/components/LearningResourceCard/LearningResourceListCard.tsx @@ -171,7 +171,7 @@ export const StartDate: React.FC<{ resource: LearningResource }> = ({ } export const Format = ({ resource }: { resource: LearningResource }) => { - const format = resource.learning_format?.[0]?.name + const format = resource.delivery?.[0]?.name if (!format) return null return (
diff --git a/learning_resources/constants.py b/learning_resources/constants.py index bdc28960b7..cdc609d824 100644 --- a/learning_resources/constants.py +++ b/learning_resources/constants.py @@ -269,18 +269,9 @@ class LevelType(ExtendedEnum): introductory = "Introductory" -class LearningResourceFormat(ExtendedEnum): - """Enum for resource learning format""" - - online = "Online" - hybrid = "Hybrid" - in_person = "In person" - - class LearningResourceDelivery(ExtendedEnum): """ - Enum for resource delivery methods. This - will eventually replace LearningResourceFormat + Enum for resource delivery methods. """ online = "Online" diff --git a/learning_resources/etl/constants.py b/learning_resources/etl/constants.py index 5942e5c46c..319f85f245 100644 --- a/learning_resources/etl/constants.py +++ b/learning_resources/etl/constants.py @@ -9,7 +9,7 @@ from django.conf import settings from named_enum import ExtendedEnum -from learning_resources.constants import LearningResourceFormat +from learning_resources.constants import LearningResourceDelivery # A custom UA so that operators of OpenEdx will know who is pinging their service COMMON_HEADERS = { @@ -76,14 +76,14 @@ class CourseNumberType(Enum): ] -RESOURCE_FORMAT_MAPPING = { - None: LearningResourceFormat.online.name, - "": LearningResourceFormat.online.name, - "Blended": LearningResourceFormat.hybrid.name, - "In Person": LearningResourceFormat.in_person.name, +RESOURCE_DELIVERY_MAPPING = { + None: LearningResourceDelivery.online.name, + "": LearningResourceDelivery.online.name, + "Blended": LearningResourceDelivery.hybrid.name, + "In Person": LearningResourceDelivery.in_person.name, **{ - value: LearningResourceFormat(value).name - for value in LearningResourceFormat.values() + value: LearningResourceDelivery(value).name + for value in LearningResourceDelivery.values() }, } diff --git a/learning_resources/etl/loaders.py b/learning_resources/etl/loaders.py index c360535aa1..be472cce26 100644 --- a/learning_resources/etl/loaders.py +++ b/learning_resources/etl/loaders.py @@ -6,7 +6,7 @@ from django.db import transaction from learning_resources.constants import ( - LearningResourceFormat, + LearningResourceDelivery, LearningResourceRelationTypes, LearningResourceType, PlatformType, @@ -405,7 +405,7 @@ def load_course( course_data = resource_data.pop("course", None) department_data = resource_data.pop("departments", []) content_tags_data = resource_data.pop("content_tags", []) - resource_data.setdefault("learning_format", [LearningResourceFormat.online.name]) + resource_data.setdefault("delivery", [LearningResourceDelivery.online.name]) runs_data = resource_data.get("runs", []) with transaction.atomic(): @@ -524,7 +524,7 @@ def load_program( offered_by_data = program_data.pop("offered_by", None) departments_data = program_data.pop("departments", None) image_data = program_data.pop("image", None) - program_data.setdefault("learning_format", [LearningResourceFormat.online.name]) + program_data.setdefault("delivery", [LearningResourceDelivery.online.name]) runs_data = program_data.get("runs", []) course_resources = [] diff --git a/learning_resources/etl/loaders_test.py b/learning_resources/etl/loaders_test.py index a33adec777..6a57a47261 100644 --- a/learning_resources/etl/loaders_test.py +++ b/learning_resources/etl/loaders_test.py @@ -12,7 +12,7 @@ from learning_resources.constants import ( Availability, - LearningResourceFormat, + LearningResourceDelivery, LearningResourceRelationTypes, LearningResourceType, OfferedBy, @@ -90,7 +90,7 @@ "departments", "content_tags", "resources", - "learning_format", + "delivery", ) @@ -145,16 +145,14 @@ def learning_resource_offeror(): @pytest.mark.parametrize("is_published", [True, False]) @pytest.mark.parametrize("courses_exist", [True, False]) @pytest.mark.parametrize("has_retired_course", [True, False]) -@pytest.mark.parametrize( - "resource_format", [LearningResourceFormat.in_person.name, None] -) +@pytest.mark.parametrize("delivery", [LearningResourceDelivery.in_person.name, None]) def test_load_program( # noqa: PLR0913 mock_upsert_tasks, program_exists, is_published, courses_exist, has_retired_course, - resource_format, + delivery, ): """Test that load_program loads the program""" platform = LearningResourcePlatformFactory.create() @@ -205,7 +203,7 @@ def test_load_program( # noqa: PLR0913 "end_date": "2017-06-20T00:00:00Z", } - format_data = {"learning_format": [resource_format]} if resource_format else {} + delivery_data = {"delivery": [delivery]} if delivery else {} result = load_program( { "platform": platform.code, @@ -225,7 +223,7 @@ def test_load_program( # noqa: PLR0913 } for course in courses ], - **format_data, + **delivery_data, }, [], [], @@ -236,12 +234,8 @@ def test_load_program( # noqa: PLR0913 # assert we got a program back and that each course is in a program assert isinstance(result, LearningResource) - assert result.learning_format == ( - [ - resource_format - if resource_format is not None - else LearningResourceFormat.online.name - ] + assert result.delivery == ( + [delivery if delivery is not None else LearningResourceDelivery.online.name] ) assert result.professional is False assert result.children.count() == len(courses) @@ -303,7 +297,7 @@ def test_load_program_bad_platform(mocker): @pytest.mark.parametrize("is_published", [True, False]) @pytest.mark.parametrize("is_run_published", [True, False]) @pytest.mark.parametrize("blocklisted", [True, False]) -@pytest.mark.parametrize("resource_format", [LearningResourceFormat.hybrid.name, None]) +@pytest.mark.parametrize("delivery", [LearningResourceDelivery.hybrid.name, None]) @pytest.mark.parametrize("has_upcoming_run", [True, False]) @pytest.mark.parametrize("has_departments", [True, False]) def test_load_course( # noqa: PLR0913,PLR0912,PLR0915 @@ -312,7 +306,7 @@ def test_load_course( # noqa: PLR0913,PLR0912,PLR0915 is_published, is_run_published, blocklisted, - resource_format, + delivery, has_upcoming_run, has_departments, ): @@ -360,7 +354,7 @@ def test_load_course( # noqa: PLR0913,PLR0912,PLR0915 departments = [department.department_id] else: departments = [] - format_data = {"learning_format": [resource_format]} if resource_format else {} + delivery_data = {"delivery": [delivery]} if delivery else {} props = { "readable_id": learning_resource.readable_id, "platform": platform.code, @@ -371,7 +365,7 @@ def test_load_course( # noqa: PLR0913,PLR0912,PLR0915 "url": learning_resource.url, "published": is_published, "departments": departments, - **format_data, + **delivery_data, } if is_run_published: @@ -438,12 +432,8 @@ def test_load_course( # noqa: PLR0913,PLR0912,PLR0915 # assert we got a course back assert isinstance(result, LearningResource) - assert result.learning_format == ( - [ - resource_format - if resource_format is not None - else LearningResourceFormat.online.name - ] + assert result.delivery == ( + [delivery if delivery is not None else LearningResourceDelivery.online.name] ) if departments == []: @@ -452,7 +442,7 @@ def test_load_course( # noqa: PLR0913,PLR0912,PLR0915 assert result.departments.count() == 1 assert result.departments.first().department_id == departments[0] - props.pop("learning_format") + props.pop("delivery") for key, value in props.items(): assert getattr(result, key) == value, f"Property {key} should equal {value}" @@ -991,7 +981,7 @@ def test_load_podcasts(learning_resource_offeror, podcast_platform): for result in results: assert isinstance(result, LearningResource) - assert result.learning_format == [LearningResourceFormat.online.name] + assert result.delivery == [LearningResourceDelivery.online.name] assert result.resource_type == LearningResourceType.podcast.name assert result.platform.code == PlatformType.podcast.name assert result.children.count() > 0 diff --git a/learning_resources/etl/ocw.py b/learning_resources/etl/ocw.py index 59a8b8dd9a..f11310b8e2 100644 --- a/learning_resources/etl/ocw.py +++ b/learning_resources/etl/ocw.py @@ -34,7 +34,11 @@ transform_levels, transform_topics, ) -from learning_resources.models import ContentFile, LearningResource, default_delivery +from learning_resources.models import ( + ContentFile, + LearningResource, + default_delivery, +) from learning_resources.utils import ( get_s3_object_and_read, parse_instructors, @@ -60,7 +64,7 @@ def parse_delivery(course_data: dict) -> list[str]: list[str]: The delivery method(s) """ delivery = default_delivery() - if not course_data.get("hide_download"): + if settings.OCW_OFFLINE_DELIVERY and not course_data.get("hide_download"): delivery.append(LearningResourceDelivery.offline.name) return delivery diff --git a/learning_resources/etl/ocw_test.py b/learning_resources/etl/ocw_test.py index 39cecd7a4e..5d2ba82828 100644 --- a/learning_resources/etl/ocw_test.py +++ b/learning_resources/etl/ocw_test.py @@ -212,6 +212,7 @@ def test_transform_course( # noqa: PLR0913 ): """transform_course should return expected data""" settings.OCW_BASE_URL = "http://test.edu/" + settings.OCW_OFFLINE_DELIVERY = True with Path.open( Path(__file__).parent.parent.parent / "test_json/courses/16-01-unified-engineering-i-ii-iii-iv-fall-2005-spring-2006" diff --git a/learning_resources/etl/prolearn.py b/learning_resources/etl/prolearn.py index 063ff6123f..de00d3b9d3 100644 --- a/learning_resources/etl/prolearn.py +++ b/learning_resources/etl/prolearn.py @@ -177,19 +177,16 @@ def parse_url(document: dict) -> str: return course_link or document["course_application_url"] or prolearn_link -def update_format(unique_resource: dict, resource_format: list[str]): +def update_delivery(unique_resource: dict, delivery: list[str]): """ - Merge the formats for multiple instances of the same resource. + Merge the delivery values for multiple instances of the same resource. Args: unique_resource: previously transformed resource w/a unique url resource_data: another resource with the same url """ - unique_resource["learning_format"] = sorted( - set(unique_resource["learning_format"] + resource_format) - ) - unique_resource["delivery"] = unique_resource["learning_format"] + unique_resource["delivery"] = sorted(set(unique_resource["delivery"] + delivery)) def extract_data(course_or_program: str) -> list[dict]: @@ -266,7 +263,7 @@ def transform_programs(programs: list[dict]) -> list[dict]: "professional": True, "certification": True, "certification_type": CertificationType.professional.name, - "learning_format": transform_delivery(program["format_name"]), + "delivery": transform_delivery(program["format_name"]), "runs": runs, "topics": parse_topic(program, offered_by.code) if offered_by else None, "courses": [ @@ -292,7 +289,7 @@ def transform_programs(programs: list[dict]) -> list[dict]: unique_program = unique_programs.setdefault( transformed_program["url"], transformed_program ) - update_format(unique_program, transformed_program["learning_format"]) + update_delivery(unique_program, transformed_program["delivery"]) unique_programs[transformed_program["url"]] = unique_program return list(unique_programs.values()) @@ -358,7 +355,6 @@ def _transform_course( "course": { "course_numbers": [], }, - "learning_format": transform_delivery(course["format_name"]), "delivery": transform_delivery(course["format_name"]), "published": True, "topics": parse_topic(course, offered_by.code) if offered_by else None, @@ -389,6 +385,6 @@ def transform_courses(courses: list[dict]) -> list[dict]: unique_course = unique_courses.setdefault( transformed_course["url"], transformed_course ) - update_format(unique_course, transformed_course["learning_format"]) + update_delivery(unique_course, transformed_course["delivery"]) unique_courses[transformed_course["url"]] = unique_course return list(unique_courses.values()) diff --git a/learning_resources/etl/prolearn_test.py b/learning_resources/etl/prolearn_test.py index a2f9619ac3..00eb8fc267 100644 --- a/learning_resources/etl/prolearn_test.py +++ b/learning_resources/etl/prolearn_test.py @@ -10,7 +10,7 @@ from learning_resources.constants import ( Availability, CertificationType, - LearningResourceFormat, + LearningResourceDelivery, OfferedBy, PlatformType, ) @@ -30,7 +30,7 @@ parse_topic, transform_courses, transform_programs, - update_format, + update_delivery, ) from learning_resources.etl.utils import transform_delivery from learning_resources.factories import ( @@ -157,7 +157,6 @@ def test_prolearn_transform_programs(mock_csail_programs_data): else None, "etl_source": ETLSource.prolearn.name, "professional": True, - "learning_format": transform_delivery(program["format_name"]), "delivery": transform_delivery(program["format_name"]), "certification": True, "certification_type": CertificationType.professional.name, @@ -229,7 +228,6 @@ def test_prolearn_transform_courses(mock_mitpe_courses_data): "professional": True, "certification": True, "certification_type": CertificationType.professional.name, - "learning_format": transform_delivery(course["format_name"]), "delivery": transform_delivery(course["format_name"]), "topics": parse_topic(course, "mitpe"), "url": course["course_link"] @@ -369,39 +367,44 @@ def test_parse_image(featured_image_url, expected_url): @pytest.mark.parametrize( - ("old_format", "new_format", "expected_format"), + ("old_delivery", "new_delivery", "expected_delivery"), [ ( - [LearningResourceFormat.online.name], - [LearningResourceFormat.online.name], - [LearningResourceFormat.online.name], + [LearningResourceDelivery.online.name], + [LearningResourceDelivery.online.name], + [LearningResourceDelivery.online.name], ), ( - [LearningResourceFormat.online.name], - [LearningResourceFormat.hybrid.name], - [LearningResourceFormat.online.name, LearningResourceFormat.hybrid.name], + [LearningResourceDelivery.online.name], + [LearningResourceDelivery.hybrid.name], + [ + LearningResourceDelivery.online.name, + LearningResourceDelivery.hybrid.name, + ], ), ( [ - LearningResourceFormat.online.name, - LearningResourceFormat.in_person.name, + LearningResourceDelivery.online.name, + LearningResourceDelivery.in_person.name, + ], + [ + LearningResourceDelivery.hybrid.name, + LearningResourceDelivery.offline.name, ], - [LearningResourceFormat.hybrid.name], - list(LearningResourceFormat.names()), + list(LearningResourceDelivery.names()), ), ], ) -def test_update_format( - mock_mitpe_courses_data, old_format, new_format, expected_format +def test_update_delivery( + mock_mitpe_courses_data, old_delivery, new_delivery, expected_delivery ): - """update_format should combine old format and new format appropriately""" + """update_delivery should combine old delivery and new delivery appropriately""" first_course = transform_courses( mock_mitpe_courses_data["data"]["searchAPISearch"]["documents"] )[0] - first_course["learning_format"] = old_format - update_format(first_course, new_format) - assert first_course["learning_format"] == sorted(expected_format) - assert first_course["delivery"] == sorted(expected_format) + first_course["delivery"] = old_delivery + update_delivery(first_course, new_delivery) + assert first_course["delivery"] == sorted(expected_delivery) @pytest.mark.parametrize("sloan_api_enabled", [True, False]) diff --git a/learning_resources/etl/sloan.py b/learning_resources/etl/sloan.py index 496a155a75..3697c5690d 100644 --- a/learning_resources/etl/sloan.py +++ b/learning_resources/etl/sloan.py @@ -218,7 +218,6 @@ def transform_course(course_data: dict, runs_data: dict) -> dict: "certification_type": CertificationType.professional.name, "professional": True, "published": True, - "learning_format": format_delivery, "delivery": format_delivery, "topics": parse_topics(course_data["Topics"]), "course": { diff --git a/learning_resources/etl/sloan_test.py b/learning_resources/etl/sloan_test.py index 72a65bf91e..9cb6a6cfa6 100644 --- a/learning_resources/etl/sloan_test.py +++ b/learning_resources/etl/sloan_test.py @@ -141,10 +141,9 @@ def test_transform_course(mock_sloan_courses_data, mock_sloan_runs_data): assert transformed["runs"] == [ transform_run(run, course_data) for run in course_runs_data ] - assert transformed["learning_format"] == list( + assert transformed["delivery"] == list( {transform_delivery(run["Delivery"])[0] for run in course_runs_data} ) - assert transformed["delivery"] == transformed["learning_format"] assert transformed["runs"][0]["availability"] == parse_availability( course_runs_data[0] ) @@ -167,7 +166,6 @@ def test_transform_course(mock_sloan_courses_data, mock_sloan_runs_data): "certification_type", "professional", "published", - "learning_format", "delivery", "topics", "course", diff --git a/learning_resources/etl/utils.py b/learning_resources/etl/utils.py index e8e59a37bf..8db5a08d20 100644 --- a/learning_resources/etl/utils.py +++ b/learning_resources/etl/utils.py @@ -31,13 +31,13 @@ CONTENT_TYPE_VIDEO, DEPARTMENTS, VALID_TEXT_FILE_TYPES, - LearningResourceFormat, + LearningResourceDelivery, LevelType, OfferedBy, RunStatus, ) from learning_resources.etl.constants import ( - RESOURCE_FORMAT_MAPPING, + RESOURCE_DELIVERY_MAPPING, CourseNumberType, ETLSource, ) @@ -699,10 +699,10 @@ def transform_delivery(resource_delivery: str) -> list[str]: """ try: - return [RESOURCE_FORMAT_MAPPING[resource_delivery]] + return [RESOURCE_DELIVERY_MAPPING[resource_delivery]] except KeyError: - log.exception("Invalid format %s", resource_delivery) - return [LearningResourceFormat.online.name] + log.exception("Invalid delivery %s", resource_delivery) + return [LearningResourceDelivery.online.name] def parse_certification(offeror, runs_data): diff --git a/learning_resources/etl/utils_test.py b/learning_resources/etl/utils_test.py index ab4bd3fa43..94ec8f8500 100644 --- a/learning_resources/etl/utils_test.py +++ b/learning_resources/etl/utils_test.py @@ -13,7 +13,7 @@ from learning_resources.constants import ( CONTENT_TYPE_FILE, CONTENT_TYPE_VERTICAL, - LearningResourceFormat, + LearningResourceDelivery, LearningResourceType, OfferedBy, PlatformType, @@ -363,10 +363,10 @@ def test_most_common_topics(): @pytest.mark.parametrize( ("original", "expected"), [ - (None, LearningResourceFormat.online.name), - (LearningResourceFormat.online.value, LearningResourceFormat.online.name), - ("Blended", LearningResourceFormat.hybrid.name), - ("In person", LearningResourceFormat.in_person.name), + (None, LearningResourceDelivery.online.name), + (LearningResourceDelivery.online.value, LearningResourceDelivery.online.name), + ("Blended", LearningResourceDelivery.hybrid.name), + ("In person", LearningResourceDelivery.in_person.name), ], ) def test_parse_format(original, expected): @@ -378,9 +378,9 @@ def test_parse_bad_format(mocker): """An exception log should be called for invalid formats""" mock_log = mocker.patch("learning_resources.etl.utils.log.exception") assert utils.transform_delivery("bad_format") == [ - LearningResourceFormat.online.name + LearningResourceDelivery.online.name ] - mock_log.assert_called_once_with("Invalid format %s", "bad_format") + mock_log.assert_called_once_with("Invalid delivery %s", "bad_format") @pytest.mark.parametrize( diff --git a/learning_resources/etl/xpro.py b/learning_resources/etl/xpro.py index 2393d2e703..2dc7f08214 100644 --- a/learning_resources/etl/xpro.py +++ b/learning_resources/etl/xpro.py @@ -148,7 +148,6 @@ def _transform_learning_resource_course(course): _transform_run(course_run, course) for course_run in course["courseruns"] ], "resource_type": LearningResourceType.course.name, - "learning_format": transform_delivery(course.get("format")), "delivery": transform_delivery(course.get("format")), "course": { "course_numbers": generate_course_numbers_json( @@ -195,7 +194,6 @@ def transform_programs(programs): "topics": parse_topics(program), "platform": XPRO_PLATFORM_TRANSFORM.get(program["platform"], None), "resource_type": LearningResourceType.program.name, - "learning_format": transform_delivery(program.get("format")), "delivery": transform_delivery(program.get("format")), "runs": [ { diff --git a/learning_resources/etl/xpro_test.py b/learning_resources/etl/xpro_test.py index 2013deeb51..0f1954a5c2 100644 --- a/learning_resources/etl/xpro_test.py +++ b/learning_resources/etl/xpro_test.py @@ -110,7 +110,6 @@ def test_xpro_transform_programs(mock_xpro_programs_data): "topics": parse_topics(program_data), "platform": PlatformType.xpro.name, "resource_type": LearningResourceType.program.name, - "learning_format": transform_delivery(program_data.get("format")), "delivery": transform_delivery(program_data.get("format")), "continuing_ed_credits": program_data.get("credits"), "runs": [ @@ -144,7 +143,6 @@ def test_xpro_transform_programs(mock_xpro_programs_data): "description": course_data["description"], "url": course_data.get("url", None), "offered_by": xpro.OFFERED_BY, - "learning_format": transform_delivery(course_data.get("format")), "delivery": transform_delivery(course_data.get("format")), "professional": True, "published": any( @@ -219,7 +217,6 @@ def test_xpro_transform_courses(mock_xpro_courses_data): "description": course_data["description"], "url": course_data.get("url"), "offered_by": xpro.OFFERED_BY, - "learning_format": transform_delivery(course_data.get("format")), "delivery": transform_delivery(course_data.get("format")), "published": any( course_run.get("current_price", None) diff --git a/learning_resources/factories.py b/learning_resources/factories.py index 33008e8f14..a3996cf0fc 100644 --- a/learning_resources/factories.py +++ b/learning_resources/factories.py @@ -15,7 +15,6 @@ DEPARTMENTS, Availability, LearningResourceDelivery, - LearningResourceFormat, LevelType, PlatformType, ) @@ -215,7 +214,6 @@ class LearningResourceFactory(DjangoModelFactory): topics = factory.PostGeneration(_post_gen_topics) content_tags = factory.PostGeneration(_post_gen_tags) published = True - learning_format = factory.List(random.choices(LearningResourceFormat.names())) # noqa: S311 delivery = factory.List(random.choices(LearningResourceDelivery.names())) # noqa: S311 professional = factory.LazyAttribute( lambda o: o.resource_type diff --git a/learning_resources/filters.py b/learning_resources/filters.py index bf876a682a..0fad5eb53e 100644 --- a/learning_resources/filters.py +++ b/learning_resources/filters.py @@ -17,7 +17,6 @@ RESOURCE_CATEGORY_VALUES, CertificationType, LearningResourceDelivery, - LearningResourceFormat, LearningResourceType, LevelType, OfferedBy, @@ -104,12 +103,6 @@ class LearningResourceFilter(FilterSet): ), ) - learning_format = MultipleChoiceFilter( - label="The learning format of course/program resources", - method="filter_format", - choices=LearningResourceFormat.as_list(), - ) - delivery = MultipleChoiceFilter( label="The delivery of course/program resources", method="filter_delivery", @@ -194,13 +187,8 @@ def filter_sortby(self, queryset, _, value): return queryset.order_by(sort_param) - def filter_format(self, queryset, _, value): - """Format Filter for learning resources""" - values = [[LearningResourceFormat[val].name] for val in value] - return multi_or_filter(queryset, "learning_format__contains", values) - def filter_delivery(self, queryset, _, value): - """Format Filter for learning resources""" + """Delivery Filter for learning resources""" values = [[LearningResourceDelivery[val].name] for val in value] return multi_or_filter(queryset, "delivery__contains", values) diff --git a/learning_resources/filters_test.py b/learning_resources/filters_test.py index 4fabb6a398..a71b880106 100644 --- a/learning_resources/filters_test.py +++ b/learning_resources/filters_test.py @@ -10,7 +10,6 @@ LEARNING_RESOURCE_SORTBY_OPTIONS, CertificationType, LearningResourceDelivery, - LearningResourceFormat, LearningResourceType, LevelType, OfferedBy, @@ -484,38 +483,6 @@ def test_learning_resource_filter_level(client): assert len(results) == 2 -def test_learning_resource_filter_formats(mock_courses, client): - """Test that the learning_format filter works""" - LearningResource.objects.filter(id=mock_courses.ocw_course.id).update( - learning_format=[LearningResourceFormat.online.name] - ) - LearningResource.objects.filter(id=mock_courses.mitx_course.id).update( - learning_format=[ - LearningResourceFormat.online.name, - LearningResourceFormat.hybrid.name, - ] - ) - LearningResource.objects.filter(id=mock_courses.mitpe_course.id).update( - learning_format=[ - LearningResourceFormat.hybrid.name, - LearningResourceFormat.in_person.name, - ] - ) - - results = client.get( - f"{RESOURCE_API_URL}?learning_format={LearningResourceFormat.in_person.name}" - ).json()["results"] - assert len(results) == 1 - assert results[0]["id"] == mock_courses.mitpe_course.id - - multiformats_filter = f"learning_format={LearningResourceFormat.in_person.name}&learning_format={LearningResourceFormat.hybrid.name}" - results = client.get(f"{RESOURCE_API_URL}?{multiformats_filter}").json()["results"] - assert len(results) == 2 - assert sorted([result["readable_id"] for result in results]) == sorted( - [mock_courses.mitx_course.readable_id, mock_courses.mitpe_course.readable_id] - ) - - def test_learning_resource_filter_delivery(mock_courses, client): """Test that the delivery filter works""" LearningResource.objects.filter(id=mock_courses.ocw_course.id).update( diff --git a/learning_resources/migrations/0043_learningresource_format.py b/learning_resources/migrations/0043_learningresource_format.py index 7eb5f8a503..1c0f797c29 100644 --- a/learning_resources/migrations/0043_learningresource_format.py +++ b/learning_resources/migrations/0043_learningresource_format.py @@ -3,7 +3,7 @@ import django.contrib.postgres.fields from django.db import migrations, models -from learning_resources.constants import LearningResourceFormat, LearningResourceType +from learning_resources.constants import LearningResourceDelivery, LearningResourceType def populate_format(apps, schema_editor): @@ -16,7 +16,7 @@ def populate_format(apps, schema_editor): LearningResourceType.program.name, LearningResourceType.course.name, ) - ).update(format=[LearningResourceFormat.online.value]) + ).update(format=[LearningResourceDelivery.online.value]) class Migration(migrations.Migration): diff --git a/learning_resources/migrations/0044_rename_learningresource_format.py b/learning_resources/migrations/0044_rename_learningresource_format.py index 520dcb4eb4..935d327518 100644 --- a/learning_resources/migrations/0044_rename_learningresource_format.py +++ b/learning_resources/migrations/0044_rename_learningresource_format.py @@ -3,7 +3,7 @@ import django.contrib.postgres.fields from django.db import migrations, models -from learning_resources.constants import LearningResourceFormat, LearningResourceType +from learning_resources.constants import LearningResourceDelivery, LearningResourceType def populate_learning_format(apps, schema_editor): @@ -16,7 +16,7 @@ def populate_learning_format(apps, schema_editor): LearningResourceType.program.name, LearningResourceType.course.name, ) - ).update(learning_format=[LearningResourceFormat.online.name]) + ).update(learning_format=[LearningResourceDelivery.online.name]) class Migration(migrations.Migration): diff --git a/learning_resources/migrations/0049_alter_learning_format.py b/learning_resources/migrations/0049_alter_learning_format.py index 69e41fed9a..b175cafe01 100644 --- a/learning_resources/migrations/0049_alter_learning_format.py +++ b/learning_resources/migrations/0049_alter_learning_format.py @@ -6,7 +6,7 @@ from learning_resources.constants import ( LearningResourceType, ) -from learning_resources.models import default_learning_format +from learning_resources.models import default_delivery def populate_video_podcast_format(apps, schema_editor): @@ -19,7 +19,7 @@ def populate_video_podcast_format(apps, schema_editor): LearningResourceType.course.name, LearningResourceType.program.name, ] - ).update(learning_format=default_learning_format()) + ).update(learning_format=default_delivery()) class Migration(migrations.Migration): @@ -33,7 +33,7 @@ class Migration(migrations.Migration): name="learning_format", field=django.contrib.postgres.fields.ArrayField( base_field=models.CharField(db_index=True, max_length=24), - default=default_learning_format, + default=default_delivery, size=None, ), ), diff --git a/learning_resources/migrations/0066_remove_learningresource_learning_format.py b/learning_resources/migrations/0066_remove_learningresource_learning_format.py new file mode 100644 index 0000000000..bc1e18027a --- /dev/null +++ b/learning_resources/migrations/0066_remove_learningresource_learning_format.py @@ -0,0 +1,16 @@ +# Generated by Django 4.2.16 on 2024-09-16 18:18 + +from django.db import migrations + + +class Migration(migrations.Migration): + dependencies = [ + ("learning_resources", "0065_learningresourcerun_availability"), + ] + + operations = [ + migrations.RemoveField( + model_name="learningresource", + name="learning_format", + ), + ] diff --git a/learning_resources/migrations/0067_ocw_delivery_online_only.py b/learning_resources/migrations/0067_ocw_delivery_online_only.py new file mode 100644 index 0000000000..927b89ebf7 --- /dev/null +++ b/learning_resources/migrations/0067_ocw_delivery_online_only.py @@ -0,0 +1,34 @@ +from django.db import migrations + +from learning_resources.constants import LearningResourceDelivery + + +def remove_offline_delivery(apps, schema_editor): + """ + Remove offline delivery from courses and runs + """ + offline = LearningResourceDelivery.offline.name + online = LearningResourceDelivery.online.name + LearningResource = apps.get_model("learning_resources", "LearningResource") + LearningResourceRun = apps.get_model("learning_resources", "LearningResource") + LearningResource.objects.filter(delivery__icontains=offline).update( + delivery=[online] + ) + LearningResourceRun.objects.filter(delivery__icontains=offline).update( + delivery=[online] + ) + + +class Migration(migrations.Migration): + dependencies = [ + ( + "learning_resources", + "0066_remove_learningresource_learning_format", + ), + ] + + operations = [ + migrations.RunPython( + remove_offline_delivery, reverse_code=migrations.RunPython.noop + ), + ] diff --git a/learning_resources/models.py b/learning_resources/models.py index 5ddc558948..069214b7a6 100644 --- a/learning_resources/models.py +++ b/learning_resources/models.py @@ -17,7 +17,6 @@ Availability, CertificationType, LearningResourceDelivery, - LearningResourceFormat, LearningResourceRelationTypes, LearningResourceType, PrivacyLevel, @@ -25,11 +24,6 @@ from main.models import TimestampedModel, TimestampedModelQuerySet -def default_learning_format(): - """Return the default learning_format as a list""" - return [LearningResourceFormat.online.name] - - def default_delivery(): """Return the default delivery as a list""" return [LearningResourceDelivery.online.name] @@ -384,10 +378,6 @@ class LearningResource(TimestampedModel): image = models.ForeignKey( LearningResourceImage, null=True, blank=True, on_delete=models.deletion.SET_NULL ) - learning_format = ArrayField( - models.CharField(max_length=24, db_index=True), - default=default_learning_format, - ) platform = models.ForeignKey( LearningResourcePlatform, null=True, diff --git a/learning_resources/serializers.py b/learning_resources/serializers.py index 667e639d56..64b76380eb 100644 --- a/learning_resources/serializers.py +++ b/learning_resources/serializers.py @@ -16,7 +16,6 @@ LEARNING_MATERIAL_RESOURCE_CATEGORY, CertificationType, LearningResourceDelivery, - LearningResourceFormat, LearningResourceType, LevelType, ) @@ -222,21 +221,6 @@ def to_representation(self, value): return {"code": value, "name": LevelType[value].value} -@extend_schema_field( - { - "type": "object", - "properties": { - "code": {"enum": LearningResourceFormat.names()}, - "name": {"type": "string"}, - }, - "required": ["code", "name"], - } -) -class LearningResourceFormatSerializer(serializers.Field): - def to_representation(self, value): - return {"code": value, "name": LearningResourceFormat[value].value} - - @extend_schema_field( { "type": "object", @@ -426,9 +410,6 @@ class LearningResourceBaseSerializer(serializers.ModelSerializer, WriteableTopic ) user_list_parents = MicroUserListRelationshipSerializer(many=True, read_only=True) views = serializers.IntegerField(source="views_count", read_only=True) - learning_format = serializers.ListField( - child=LearningResourceFormatSerializer(), read_only=True - ) delivery = serializers.ListField( child=LearningResourceDeliverySerializer(), read_only=True ) diff --git a/learning_resources/serializers_test.py b/learning_resources/serializers_test.py index 0e8457841d..3ca30f06dc 100644 --- a/learning_resources/serializers_test.py +++ b/learning_resources/serializers_test.py @@ -13,7 +13,6 @@ LEARNING_MATERIAL_RESOURCE_CATEGORY, CertificationType, LearningResourceDelivery, - LearningResourceFormat, LearningResourceRelationTypes, LearningResourceType, PlatformType, @@ -259,10 +258,6 @@ def test_learning_resource_serializer( # noqa: PLR0913 ], detail_key: detail_serializer_cls(instance=getattr(resource, detail_key)).data, "views": resource.views.count(), - "learning_format": [ - {"code": lr_format, "name": LearningResourceFormat[lr_format].value} - for lr_format in resource.learning_format - ], "delivery": [ {"code": lr_delivery, "name": LearningResourceDelivery[lr_delivery].value} for lr_delivery in resource.delivery diff --git a/learning_resources_search/constants.py b/learning_resources_search/constants.py index 4b2220d150..b0b1d53051 100644 --- a/learning_resources_search/constants.py +++ b/learning_resources_search/constants.py @@ -75,7 +75,6 @@ class FilterConfig: "department": FilterConfig("departments.department_id"), "platform": FilterConfig("platform.code"), "offered_by": FilterConfig("offered_by.code"), - "learning_format": FilterConfig("learning_format.code"), "delivery": FilterConfig("delivery.code"), "resource_category": FilterConfig("resource_category"), } @@ -115,13 +114,6 @@ class FilterConfig: }, "free": {"type": "boolean"}, "is_learning_material": {"type": "boolean"}, - "learning_format": { - "type": "nested", - "properties": { - "code": {"type": "keyword"}, - "name": {"type": "keyword"}, - }, - }, "delivery": { "type": "nested", "properties": { diff --git a/learning_resources_search/serializers.py b/learning_resources_search/serializers.py index 070e5163cd..54225e29fa 100644 --- a/learning_resources_search/serializers.py +++ b/learning_resources_search/serializers.py @@ -21,7 +21,6 @@ RESOURCE_CATEGORY_VALUES, CertificationType, LearningResourceDelivery, - LearningResourceFormat, LearningResourceRelationTypes, LearningResourceType, LevelType, @@ -239,7 +238,6 @@ def to_representation(self, obj): "course_feature", "professional", "free", - "learning_format", "delivery", "resource_category", ] @@ -382,15 +380,6 @@ class LearningResourcesSearchRequestSerializer(SearchRequestSerializer): help_text="Show resource counts by category", child=serializers.ChoiceField(choices=LEARNING_RESOURCE_AGGREGATIONS), ) - learning_format_choices = LearningResourceFormat.as_list() - learning_format = serializers.ListField( - required=False, - child=serializers.ChoiceField(choices=learning_format_choices), - help_text=( - f"The format(s) in which the learning resource is offered \ - \n\n{build_choice_description_list(learning_format_choices)}" - ), - ) delivery_choices = LearningResourceDelivery.as_list() delivery = serializers.ListField( required=False, diff --git a/learning_resources_search/serializers_test.py b/learning_resources_search/serializers_test.py index f80a482c0f..92eddbe150 100644 --- a/learning_resources_search/serializers_test.py +++ b/learning_resources_search/serializers_test.py @@ -74,12 +74,6 @@ "offered_by": "MIT xPRO", "course_feature": [], "department": None, - "learning_format": [ - { - "code": "online", - "name": "Online", - } - ], "delivery": [ { "code": "online", @@ -228,12 +222,6 @@ "offered_by": "MIT xPRO", "course_feature": [], "department": None, - "learning_format": [ - { - "code": "online", - "name": "Online", - } - ], "delivery": [ { "code": "online", @@ -366,12 +354,6 @@ }, "id": 7363, "departments": [], - "learning_format": [ - { - "code": "online", - "name": "Online", - } - ], "delivery": [ { "code": "online", @@ -474,14 +456,6 @@ "buckets": [{"key": 0, "key_as_string": "false", "doc_count": 1}], }, }, - "learning_format": { - "doc_count": 1, - "learning_format": { - "doc_count_error_upper_bound": 0, - "sum_other_doc_count": 0, - "buckets": [{"key": 0, "key_as_string": "online", "doc_count": 1}], - }, - }, "delivery": { "doc_count": 1, "delivery": { @@ -553,12 +527,6 @@ }, "id": 7363, "departments": [], - "learning_format": [ - { - "code": "online", - "name": "Online", - } - ], "delivery": [ { "code": "online", @@ -592,7 +560,6 @@ "professional": [{"key": "false", "doc_count": 1}], "certification": [{"key": "false", "doc_count": 1}], "free": [{"key": "false", "doc_count": 1}], - "learning_format": [{"key": "online", "doc_count": 1}], "delivery": [ {"key": "online", "doc_count": 1}, {"key": "offline", "doc_count": 1}, diff --git a/load_testing/locustfile.py b/load_testing/locustfile.py index a712a8909f..f2965404a3 100644 --- a/load_testing/locustfile.py +++ b/load_testing/locustfile.py @@ -78,7 +78,7 @@ def _query(self, *, page: int = 0, filters: dict | None = None): "aggregations": [ "resource_type", "certification_type", - "learning_format", + "delivery", "department", "topic", "offered_by", diff --git a/main/settings_course_etl.py b/main/settings_course_etl.py index 48a75dc93a..519a241683 100644 --- a/main/settings_course_etl.py +++ b/main/settings_course_etl.py @@ -23,6 +23,7 @@ OCW_ITERATOR_CHUNK_SIZE = get_int("OCW_ITERATOR_CHUNK_SIZE", 1000) OCW_SKIP_CONTENT_FILES = get_bool("OCW_SKIP_CONTENT_FILES", default=False) OCW_WEBHOOK_KEY = get_string("OCW_WEBHOOK_KEY", None) +OCW_OFFLINE_DELIVERY = get_bool("OCW_OFFLINE_DELIVERY", default=False) MAX_S3_GET_ITERATIONS = get_int("MAX_S3_GET_ITERATIONS", 3) diff --git a/openapi/specs/v0.yaml b/openapi/specs/v0.yaml index 6067f0d6f2..5bde16164e 100644 --- a/openapi/specs/v0.yaml +++ b/openapi/specs/v0.yaml @@ -1232,6 +1232,23 @@ components: - Junior secondary/junior high/middle school - No formal education - Other education + DeliveryEnum: + enum: + - online + - hybrid + - in_person + - offline + type: string + description: |- + * `online` - Online + * `hybrid` - Hybrid + * `in_person` - In-Person + * `offline` - Offline + x-enum-descriptions: + - Online + - Hybrid + - In-Person + - Offline DepartmentChannel: type: object description: Serializer for Channel model of type department @@ -1522,20 +1539,6 @@ components: - Academic Boost - Career Growth - Lifelong Learning - LearningFormatEnum: - enum: - - online - - hybrid - - in_person - type: string - description: |- - * `online` - Online - * `hybrid` - Hybrid - * `in_person` - In-Person - x-enum-descriptions: - - Online - - Hybrid - - In-Person LearningPathPreview: type: object description: Serializer for a minimal preview of Learning Paths @@ -1944,10 +1947,10 @@ components: oneOf: - $ref: '#/components/schemas/TimeCommitmentEnum' - $ref: '#/components/schemas/BlankEnum' - learning_format: + delivery: type: array items: - $ref: '#/components/schemas/LearningFormatEnum' + $ref: '#/components/schemas/DeliveryEnum' PatchedUserRequest: type: object description: Serializer for User @@ -2083,7 +2086,7 @@ components: type: array items: type: string - learning_format: + delivery: type: array items: type: string @@ -2164,10 +2167,10 @@ components: oneOf: - $ref: '#/components/schemas/TimeCommitmentEnum' - $ref: '#/components/schemas/BlankEnum' - learning_format: + delivery: type: array items: - $ref: '#/components/schemas/LearningFormatEnum' + $ref: '#/components/schemas/DeliveryEnum' preference_search_filters: allOf: - $ref: '#/components/schemas/PreferencesSearch' @@ -2239,10 +2242,10 @@ components: oneOf: - $ref: '#/components/schemas/TimeCommitmentEnum' - $ref: '#/components/schemas/BlankEnum' - learning_format: + delivery: type: array items: - $ref: '#/components/schemas/LearningFormatEnum' + $ref: '#/components/schemas/DeliveryEnum' ProgramCertificate: type: object description: Serializer for Program Certificates diff --git a/openapi/specs/v1.yaml b/openapi/specs/v1.yaml index 2b555d5369..af4d7a9bbf 100644 --- a/openapi/specs/v1.yaml +++ b/openapi/specs/v1.yaml @@ -682,27 +682,6 @@ paths: schema: type: boolean description: The course/program is offered for free - - in: query - name: learning_format - schema: - type: array - items: - type: array - items: - type: string - maxLength: 24 - enum: - - hybrid - - in_person - - online - description: |- - The learning format of course/program resources - - * `online` - Online - * `hybrid` - Hybrid - * `in_person` - In person - explode: true - style: form - in: query name: level schema: @@ -1314,27 +1293,6 @@ paths: schema: type: boolean description: The course/program is offered for free - - in: query - name: learning_format - schema: - type: array - items: - type: array - items: - type: string - maxLength: 24 - enum: - - hybrid - - in_person - - online - description: |- - The learning format of course/program resources - - * `online` - Online - * `hybrid` - Hybrid - * `in_person` - In person - explode: true - style: form - in: query name: level schema: @@ -1739,27 +1697,6 @@ paths: schema: type: boolean description: The course/program is offered for free - - in: query - name: learning_format - schema: - type: array - items: - type: array - items: - type: string - maxLength: 24 - enum: - - hybrid - - in_person - - online - description: |- - The learning format of course/program resources - - * `online` - Online - * `hybrid` - Hybrid - * `in_person` - In person - explode: true - style: form - in: query name: level schema: @@ -2332,7 +2269,6 @@ paths: - course_feature - professional - free - - learning_format - delivery - resource_category type: string @@ -2348,7 +2284,6 @@ paths: * `course_feature` - course_feature * `professional` - professional * `free` - free - * `learning_format` - learning_format * `delivery` - delivery * `resource_category` - resource_category description: Show resource counts by category @@ -2523,23 +2458,6 @@ paths: items: type: integer description: The id value for the learning resource - - in: query - name: learning_format - schema: - type: array - items: - enum: - - online - - hybrid - - in_person - type: string - description: |- - * `online` - Online - * `hybrid` - Hybrid - * `in_person` - In person - description: "The format(s) in which the learning resource is offered \ - \ \n\n* `online` - Online\n* `hybrid` - Hybrid\n* `in_person` -\ - \ In person" - in: query name: level schema: @@ -2834,7 +2752,6 @@ paths: - course_feature - professional - free - - learning_format - delivery - resource_category type: string @@ -2850,7 +2767,6 @@ paths: * `course_feature` - course_feature * `professional` - professional * `free` - free - * `learning_format` - learning_format * `delivery` - delivery * `resource_category` - resource_category description: Show resource counts by category @@ -3025,23 +2941,6 @@ paths: items: type: integer description: The id value for the learning resource - - in: query - name: learning_format - schema: - type: array - items: - enum: - - online - - hybrid - - in_person - type: string - description: |- - * `online` - Online - * `hybrid` - Hybrid - * `in_person` - In person - description: "The format(s) in which the learning resource is offered \ - \ \n\n* `online` - Online\n* `hybrid` - Hybrid\n* `in_person` -\ - \ In person" - in: query name: level schema: @@ -3361,7 +3260,6 @@ paths: - course_feature - professional - free - - learning_format - delivery - resource_category type: string @@ -3377,7 +3275,6 @@ paths: * `course_feature` - course_feature * `professional` - professional * `free` - free - * `learning_format` - learning_format * `delivery` - delivery * `resource_category` - resource_category description: Show resource counts by category @@ -3552,23 +3449,6 @@ paths: items: type: integer description: The id value for the learning resource - - in: query - name: learning_format - schema: - type: array - items: - enum: - - online - - hybrid - - in_person - type: string - description: |- - * `online` - Online - * `hybrid` - Hybrid - * `in_person` - In person - description: "The format(s) in which the learning resource is offered \ - \ \n\n* `online` - Online\n* `hybrid` - Hybrid\n* `in_person` -\ - \ In person" - in: query name: level schema: @@ -3879,7 +3759,6 @@ paths: - course_feature - professional - free - - learning_format - delivery - resource_category type: string @@ -3895,7 +3774,6 @@ paths: * `course_feature` - course_feature * `professional` - professional * `free` - free - * `learning_format` - learning_format * `delivery` - delivery * `resource_category` - resource_category description: Show resource counts by category @@ -4070,23 +3948,6 @@ paths: items: type: integer description: The id value for the learning resource - - in: query - name: learning_format - schema: - type: array - items: - enum: - - online - - hybrid - - in_person - type: string - description: |- - * `online` - Online - * `hybrid` - Hybrid - * `in_person` - In person - description: "The format(s) in which the learning resource is offered \ - \ \n\n* `online` - Online\n* `hybrid` - Hybrid\n* `in_person` -\ - \ In person" - in: query name: level schema: @@ -4545,27 +4406,6 @@ paths: schema: type: boolean description: The course/program is offered for free - - in: query - name: learning_format - schema: - type: array - items: - type: array - items: - type: string - maxLength: 24 - enum: - - hybrid - - in_person - - online - description: |- - The learning format of course/program resources - - * `online` - Online - * `hybrid` - Hybrid - * `in_person` - In person - explode: true - style: form - in: query name: level schema: @@ -5294,27 +5134,6 @@ paths: schema: type: boolean description: The course/program is offered for free - - in: query - name: learning_format - schema: - type: array - items: - type: array - items: - type: string - maxLength: 24 - enum: - - hybrid - - in_person - - online - description: |- - The learning format of course/program resources - - * `online` - Online - * `hybrid` - Hybrid - * `in_person` - In person - explode: true - style: form - in: query name: level schema: @@ -5719,27 +5538,6 @@ paths: schema: type: boolean description: The course/program is offered for free - - in: query - name: learning_format - schema: - type: array - items: - type: array - items: - type: string - maxLength: 24 - enum: - - hybrid - - in_person - - online - description: |- - The learning format of course/program resources - - * `online` - Online - * `hybrid` - Hybrid - * `in_person` - In person - explode: true - style: form - in: query name: level schema: @@ -6231,27 +6029,6 @@ paths: schema: type: boolean description: The course/program is offered for free - - in: query - name: learning_format - schema: - type: array - items: - type: array - items: - type: string - maxLength: 24 - enum: - - hybrid - - in_person - - online - description: |- - The learning format of course/program resources - - * `online` - Online - * `hybrid` - Hybrid - * `in_person` - In person - explode: true - style: form - in: query name: level schema: @@ -7046,27 +6823,6 @@ paths: schema: type: boolean description: The course/program is offered for free - - in: query - name: learning_format - schema: - type: array - items: - type: array - items: - type: string - maxLength: 24 - enum: - - hybrid - - in_person - - online - description: |- - The learning format of course/program resources - - * `online` - Online - * `hybrid` - Hybrid - * `in_person` - In person - explode: true - style: form - in: query name: level schema: @@ -7537,27 +7293,6 @@ paths: schema: type: boolean description: The course/program is offered for free - - in: query - name: learning_format - schema: - type: array - items: - type: array - items: - type: string - maxLength: 24 - enum: - - hybrid - - in_person - - online - description: |- - The learning format of course/program resources - - * `online` - Online - * `hybrid` - Hybrid - * `in_person` - In person - explode: true - style: form - in: query name: level schema: @@ -7815,7 +7550,6 @@ components: - course_feature - professional - free - - learning_format - delivery - resource_category type: string @@ -7831,7 +7565,6 @@ components: * `course_feature` - course_feature * `professional` - professional * `free` - free - * `learning_format` - learning_format * `delivery` - delivery * `resource_category` - resource_category x-enum-descriptions: @@ -7846,7 +7579,6 @@ components: - course_feature - professional - free - - learning_format - delivery - resource_category Article: @@ -8211,22 +7943,6 @@ components: views: type: integer readOnly: true - learning_format: - type: array - items: - type: object - properties: - code: - enum: - - online - - hybrid - - in_person - name: - type: string - required: - - code - - name - readOnly: true delivery: type: array items: @@ -8322,7 +8038,6 @@ components: - free - id - image - - learning_format - learning_path_parents - offered_by - platform @@ -8535,20 +8250,6 @@ components: - Special Programs - Science, Technology, and Society - Women's and Gender Studies - LearningFormatEnum: - enum: - - online - - hybrid - - in_person - type: string - description: |- - * `online` - Online - * `hybrid` - Hybrid - * `in_person` - In person - x-enum-descriptions: - - Online - - Hybrid - - In person LearningPath: type: object description: Serializer for the LearningPath model @@ -8684,22 +8385,6 @@ components: views: type: integer readOnly: true - learning_format: - type: array - items: - type: object - properties: - code: - enum: - - online - - hybrid - - in_person - name: - type: string - required: - - code - - name - readOnly: true delivery: type: array items: @@ -8793,7 +8478,6 @@ components: - free - id - image - - learning_format - learning_path - learning_path_parents - offered_by @@ -10422,13 +10106,6 @@ components: items: $ref: '#/components/schemas/AggregationsEnum' description: Show resource counts by category - learning_format: - type: array - items: - $ref: '#/components/schemas/LearningFormatEnum' - description: "The format(s) in which the learning resource is offered \ - \ \n\n* `online` - Online\n* `hybrid` - Hybrid\n* `in_person`\ - \ - In person" delivery: type: array items: @@ -10718,22 +10395,6 @@ components: views: type: integer readOnly: true - learning_format: - type: array - items: - type: object - properties: - code: - enum: - - online - - hybrid - - in_person - name: - type: string - required: - - code - - name - readOnly: true delivery: type: array items: @@ -10828,7 +10489,6 @@ components: - free - id - image - - learning_format - learning_path_parents - offered_by - platform @@ -11017,22 +10677,6 @@ components: views: type: integer readOnly: true - learning_format: - type: array - items: - type: object - properties: - code: - enum: - - online - - hybrid - - in_person - name: - type: string - required: - - code - - name - readOnly: true delivery: type: array items: @@ -11127,7 +10771,6 @@ components: - free - id - image - - learning_format - learning_path_parents - offered_by - platform @@ -11446,22 +11089,6 @@ components: views: type: integer readOnly: true - learning_format: - type: array - items: - type: object - properties: - code: - enum: - - online - - hybrid - - in_person - name: - type: string - required: - - code - - name - readOnly: true delivery: type: array items: @@ -11556,7 +11183,6 @@ components: - free - id - image - - learning_format - learning_path_parents - offered_by - platform @@ -12017,22 +11643,6 @@ components: views: type: integer readOnly: true - learning_format: - type: array - items: - type: object - properties: - code: - enum: - - online - - hybrid - - in_person - name: - type: string - required: - - code - - name - readOnly: true delivery: type: array items: @@ -12127,7 +11737,6 @@ components: - free - id - image - - learning_format - learning_path_parents - offered_by - platform @@ -12302,22 +11911,6 @@ components: views: type: integer readOnly: true - learning_format: - type: array - items: - type: object - properties: - code: - enum: - - online - - hybrid - - in_person - name: - type: string - required: - - code - - name - readOnly: true delivery: type: array items: @@ -12412,7 +12005,6 @@ components: - free - id - image - - learning_format - learning_path_parents - offered_by - platform diff --git a/profiles/factories.py b/profiles/factories.py index b0e7a89064..502cd599f5 100644 --- a/profiles/factories.py +++ b/profiles/factories.py @@ -44,7 +44,7 @@ class ProfileFactory(DjangoModelFactory): location = Faker("location") - learning_format = [key for key, _ in Profile.LearningResourceFormat.choices] + delivery = [key for key, _ in Profile.LearningResourceDelivery.choices] certificate_desired = FuzzyChoice( [Profile.CertificateDesired.YES.value, Profile.CertificateDesired.NO.value] ) diff --git a/profiles/forms.py b/profiles/forms.py index 9d7c7352eb..601b62b35f 100644 --- a/profiles/forms.py +++ b/profiles/forms.py @@ -29,5 +29,5 @@ class Meta: "certificate_desired", "current_education", "time_commitment", - "learning_format", + "delivery", ] diff --git a/profiles/migrations/0033_alter_profile_learning_format.py b/profiles/migrations/0033_alter_profile_learning_format.py new file mode 100644 index 0000000000..8917849607 --- /dev/null +++ b/profiles/migrations/0033_alter_profile_learning_format.py @@ -0,0 +1,36 @@ +# Generated by Django 4.2.16 on 2024-09-16 17:47 + +import django.contrib.postgres.fields +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("profiles", "0032_alter_profile_current_education"), + ] + + operations = [ + migrations.AlterField( + model_name="profile", + name="learning_format", + field=django.contrib.postgres.fields.ArrayField( + base_field=models.CharField( + choices=[ + ("online", "Online"), + ("hybrid", "Hybrid"), + ("in_person", "In-Person"), + ("offline", "Offline"), + ], + max_length=50, + ), + blank=True, + default=list, + size=None, + ), + ), + migrations.RenameField( + model_name="profile", + old_name="learning_format", + new_name="delivery", + ), + ] diff --git a/profiles/models.py b/profiles/models.py index 3b109e6ee5..42433db07b 100644 --- a/profiles/models.py +++ b/profiles/models.py @@ -108,12 +108,13 @@ class TimeCommitment(models.TextChoices): TWENTY_TO_THIRTY_HOURS = "20-to-30-hours", "20-30 hours/week" THIRTY_PLUS_HOURS = "30-plus-hours", "30+ hours/week" - class LearningResourceFormat(models.TextChoices): - """User learning format choices""" + class LearningResourceDelivery(models.TextChoices): + """User learning resource delivery choices""" ONLINE = "online", "Online" HYBRID = "hybrid", "Hybrid" IN_PERSON = "in_person", "In-Person" + OFFLINE = "offline", "Offline" user = models.OneToOneField(settings.AUTH_USER_MODEL, on_delete=models.CASCADE) @@ -168,8 +169,8 @@ class LearningResourceFormat(models.TextChoices): time_commitment = models.CharField( max_length=50, choices=TimeCommitment.choices, blank=True, default="" ) - learning_format = ArrayField( - models.CharField(max_length=50, choices=LearningResourceFormat.choices), + delivery = ArrayField( + models.CharField(max_length=50, choices=LearningResourceDelivery.choices), default=list, blank=True, ) diff --git a/profiles/serializers.py b/profiles/serializers.py index 9f71f2156c..27315bd0a6 100644 --- a/profiles/serializers.py +++ b/profiles/serializers.py @@ -75,9 +75,7 @@ class PreferencesSearchSerializer(serializers.Serializer): certification = serializers.BooleanField(required=False) topic = serializers.ListField(child=serializers.CharField(), required=False) - learning_format = serializers.ListField( - child=serializers.CharField(), required=False - ) + delivery = serializers.ListField(child=serializers.CharField(), required=False) class ProfileSerializer(serializers.ModelSerializer): @@ -123,8 +121,8 @@ def get_preference_search_filters(self, obj) -> dict: ) if obj.topic_interests and obj.topic_interests.count() > 0: filters["topic"] = obj.topic_interests.values_list("name", flat=True) - if obj.learning_format: - filters["learning_format"] = obj.learning_format + if obj.delivery: + filters["delivery"] = obj.delivery return PreferencesSearchSerializer(instance=filters).data def validate_location(self, location): @@ -187,7 +185,7 @@ class Meta: "current_education", "certificate_desired", "time_commitment", - "learning_format", + "delivery", "preference_search_filters", ) read_only_fields = ( diff --git a/profiles/serializers_test.py b/profiles/serializers_test.py index aa825374c8..bcd433640d 100644 --- a/profiles/serializers_test.py +++ b/profiles/serializers_test.py @@ -27,7 +27,7 @@ b"\x01\x0a\x00\x01\x00\x2c\x00\x00\x00\x00\x01\x00\x01\x00\x00\x02" b"\x02\x4c\x01\x00\x3b" ) -lr_format_keys = [key for key, _ in Profile.LearningResourceFormat.choices] +lr_delivery_keys = [key for key, _ in Profile.LearningResourceDelivery.choices] def test_serialize_user(user): @@ -83,7 +83,7 @@ def test_serialize_create_user(db, mocker): "current_education": user.profile.current_education, "certificate_desired": user.profile.certificate_desired, "time_commitment": user.profile.time_commitment, - "learning_format": user.profile.learning_format, + "delivery": user.profile.delivery, } ) assert UserSerializer(instance=user).data == { @@ -195,7 +195,7 @@ def test_location_validation(user, data, is_valid): ("bio", "bio_value"), ("headline", "headline_value"), ("location", {"value": "Hobbiton, The Shire, Middle-Earth"}), - ("learning_format", lr_format_keys), + ("delivery", lr_delivery_keys), ("certificate_desired", Profile.CertificateDesired.YES.value), ], ) @@ -223,7 +223,7 @@ def test_update_profile(mocker, user, key, value): "bio", "headline", "location", - "learning_format", + "delivery", "certificate_desired", "topic_interests", ): @@ -247,14 +247,14 @@ def test_update_profile(mocker, user, key, value): ], ) @pytest.mark.parametrize("topics", [["Biology", "Chemistry"], []]) -@pytest.mark.parametrize("lr_format", [lr_format_keys, []]) +@pytest.mark.parametrize("lr_delivery", [lr_delivery_keys, []]) def test_serialize_profile_preference_search_filters( - user, cert_desired, cert_filter, topics, lr_format + user, cert_desired, cert_filter, topics, lr_delivery ): """Tests that the ProfileSerializer includes search filters when an option is set via the context""" profile = user.profile profile.certificate_desired = cert_desired - profile.learning_format = lr_format + profile.delivery = lr_delivery if topics: profile.topic_interests.set( [LearningResourceTopicFactory.create(name=topic) for topic in topics] @@ -264,8 +264,8 @@ def test_serialize_profile_preference_search_filters( search_filters = ProfileSerializer(profile).data["preference_search_filters"] assert search_filters.get("certification", None) == cert_filter assert search_filters.get("topic", None) == (topics if topics else None) - assert search_filters.get("learning_format", None) == ( - lr_format if lr_format else None + assert search_filters.get("delivery", None) == ( + lr_delivery if lr_delivery else None ) diff --git a/profiles/views_test.py b/profiles/views_test.py index a1a4513b3e..4192c2ee84 100644 --- a/profiles/views_test.py +++ b/profiles/views_test.py @@ -9,7 +9,7 @@ from django.urls import reverse from rest_framework import status -from learning_resources.constants import LearningResourceFormat +from learning_resources.constants import LearningResourceDelivery from learning_resources.factories import LearningResourceTopicFactory from learning_resources.serializers import LearningResourceTopicSerializer from learning_resources_search.serializers_test import get_request_object @@ -135,9 +135,9 @@ def test_get_profile(logged_in, user, user_client): "current_education": profile.current_education, "certificate_desired": profile.certificate_desired, "time_commitment": profile.time_commitment, - "learning_format": profile.learning_format, + "delivery": profile.delivery, "preference_search_filters": { - "learning_format": profile.learning_format, + "delivery": profile.delivery, "certification": ( profile.certificate_desired == Profile.CertificateDesired.YES.value ), @@ -296,10 +296,10 @@ def test_patch_topic_interests(client, logged_in_profile): Profile.TimeCommitment.ZERO_TO_FIVE_HOURS, ), ( - "learning_format", + "delivery", [], - [LearningResourceFormat.hybrid.name], - [LearningResourceFormat.hybrid.name], + [LearningResourceDelivery.hybrid.name], + [LearningResourceDelivery.hybrid.name], ), ], ) diff --git a/yarn.lock b/yarn.lock index 1e89b14af4..7fa390a739 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3384,11 +3384,11 @@ __metadata: languageName: node linkType: hard -"@mitodl/course-search-utils@npm:^3.1.5": - version: 3.1.5 - resolution: "@mitodl/course-search-utils@npm:3.1.5" +"@mitodl/course-search-utils@npm:^3.1.6": + version: 3.1.6 + resolution: "@mitodl/course-search-utils@npm:3.1.6" dependencies: - "@mitodl/open-api-axios": "npm:^2024.8.21" + "@mitodl/open-api-axios": "npm:^2024.9.16" axios: "npm:^1.6.7" fuse.js: "npm:^7.0.0" query-string: "npm:^6.13.1" @@ -3405,17 +3405,17 @@ __metadata: optional: true react-router: optional: true - checksum: 10/de39fd0db986e66c658b40365916e51cc7696a6f538a9a07543032f3a4ce0eed8279253aaf8201c193896e0bb2e2cc9b9da7314f9b1f65942e85cde940b0763c + checksum: 10/eb25dbbd9c399692264aa6309cf8c7522553ecf8e233fb22267e9d77aab78683d167ec5a6909a682e476b09e65d7ce27a81985540af944376eb47c859973adb0 languageName: node linkType: hard -"@mitodl/open-api-axios@npm:^2024.8.21": - version: 2024.8.21 - resolution: "@mitodl/open-api-axios@npm:2024.8.21" +"@mitodl/open-api-axios@npm:^2024.9.16": + version: 2024.9.16 + resolution: "@mitodl/open-api-axios@npm:2024.9.16" dependencies: "@types/node": "npm:^20.11.19" axios: "npm:^1.6.5" - checksum: 10/2b21a51e3358f07f43a8a0da4c2981bf7cf82403d7f93eb6d8e97248d1ddfaaa425301e8f7cc9dd7048534f1585cc49af97ab250910b07e74f035a172894965d + checksum: 10/ff40f62d087e3168e1d9ba0887cc41d3db4d2eb868e43317feb18510cf1f7d9b535d32acd478b9dd1bacfee8ea7e4967d2ed84499f5bf431317c614555f19416 languageName: node linkType: hard @@ -14779,7 +14779,7 @@ __metadata: "@emotion/react": "npm:^11.11.1" "@emotion/styled": "npm:^11.11.0" "@faker-js/faker": "npm:^8.0.0" - "@mitodl/course-search-utils": "npm:^3.1.5" + "@mitodl/course-search-utils": "npm:^3.1.6" "@pmmmwh/react-refresh-webpack-plugin": "npm:^0.5.11" "@remixicon/react": "npm:^4.2.0" "@sentry/react": "npm:^7.57.0"