From 5c19a5c98ead2304e7c8769a069b1647a7281fe6 Mon Sep 17 00:00:00 2001 From: zawan-ila <87228907+zawan-ila@users.noreply.github.com> Date: Thu, 6 Feb 2025 16:35:02 +0500 Subject: [PATCH] chore: remove bootcamps (#996) --- .../CollapsibleCourseRun.test.jsx.snap | 6 +-- .../Header/__snapshots__/Header.test.jsx.snap | 48 ------------------- src/components/Header/index.jsx | 3 -- src/data/constants/index.js | 2 - src/helpText.jsx | 2 +- src/setupTest.js | 8 ---- src/utils/index.js | 4 +- src/utils/utils.test.js | 27 +---------- 8 files changed, 8 insertions(+), 92 deletions(-) diff --git a/src/components/EditCoursePage/__snapshots__/CollapsibleCourseRun.test.jsx.snap b/src/components/EditCoursePage/__snapshots__/CollapsibleCourseRun.test.jsx.snap index 88e1a775b..7df37797b 100644 --- a/src/components/EditCoursePage/__snapshots__/CollapsibleCourseRun.test.jsx.snap +++ b/src/components/EditCoursePage/__snapshots__/CollapsibleCourseRun.test.jsx.snap @@ -103,7 +103,7 @@ exports[`Collapsible Course Run renders correctly restriction type field for ext helpText={

- The identifier for a product variant. This is used to link a course run to a product variant for external LOBs (i.e; ExecEd & Bootcamps). + The identifier for a product variant. This is used to link a course run to a product variant for external LOBs (e.g; ExecEd).

} @@ -771,7 +771,7 @@ exports[`Collapsible Course Run renders correctly restriction type field for ext helpText={

- The identifier for a product variant. This is used to link a course run to a product variant for external LOBs (i.e; ExecEd & Bootcamps). + The identifier for a product variant. This is used to link a course run to a product variant for external LOBs (e.g; ExecEd).

} @@ -1439,7 +1439,7 @@ exports[`Collapsible Course Run renders correctly variant_id field for external helpText={

- The identifier for a product variant. This is used to link a course run to a product variant for external LOBs (i.e; ExecEd & Bootcamps). + The identifier for a product variant. This is used to link a course run to a product variant for external LOBs (e.g; ExecEd).

} diff --git a/src/components/Header/__snapshots__/Header.test.jsx.snap b/src/components/Header/__snapshots__/Header.test.jsx.snap index 36e5ba25f..76452b460 100644 --- a/src/components/Header/__snapshots__/Header.test.jsx.snap +++ b/src/components/Header/__snapshots__/Header.test.jsx.snap @@ -69,22 +69,6 @@ exports[`Header renders the correct header 1`] = ` -
- - - Bootcamps - - -
@@ -309,22 +293,6 @@ exports[`Header renders the header correctly when toggling is allowed, and dark
-
- - - Bootcamps - - -
@@ -549,22 +517,6 @@ exports[`Header renders the header correctly when users pass a querystring param
-
- - - Bootcamps - - -
diff --git a/src/components/Header/index.jsx b/src/components/Header/index.jsx index 5c3d9fc98..a992724e8 100644 --- a/src/components/Header/index.jsx +++ b/src/components/Header/index.jsx @@ -44,9 +44,6 @@ const Header = ({ darkModeOn, toggleDarkMode }) => {
Executive Education
-
- Bootcamps -
{allowDarkModeToggle && ( diff --git a/src/data/constants/index.js b/src/data/constants/index.js index c156645d3..574a8ab26 100644 --- a/src/data/constants/index.js +++ b/src/data/constants/index.js @@ -21,7 +21,6 @@ const FORMAT_DATE_MATCHER = /20\d{2}-(0\d{1}|1[0-2])-([0-2]\d{1}|3[0-1])/; const NORMALIZE_DATE_MATCHER = /20\d{2}\/(0\d{1}|1[0-2])\/([0-2]\d{1}|3[0-1])/; const EXECUTIVE_EDUCATION_SLUG = 'executive-education-2u'; -const BOOTCAMP_SLUG = 'bootcamp-2u'; const COURSE_URL_SLUG_PATTERN_OLD = '^[a-z0-9_]+(?:-[a-z0-9_]+)*$'; const COURSE_URL_SLUG_PATTERN_NEW = '^learn/[a-z0-9_]+(?:-?[a-z0-9_]+)*/[a-z0-9_]+(?:-?[a-z0-9_]+)*$'; @@ -62,7 +61,6 @@ export { COURSE_EXEMPT_FIELDS, COURSE_RUN_NON_EXEMPT_FIELDS, EXECUTIVE_EDUCATION_SLUG, - BOOTCAMP_SLUG, COURSE_URL_SLUG_PATTERN, COURSE_URL_SLUG_PATTERN_NEW, COURSE_URL_SLUG_PATTERN_OLD, diff --git a/src/helpText.jsx b/src/helpText.jsx index 3760d87e8..76ec0bc63 100644 --- a/src/helpText.jsx +++ b/src/helpText.jsx @@ -25,7 +25,7 @@ const courseRunVariantIdHelp = (

The identifier for a product variant. This is used to link a course run to a product variant for external LOBs - (i.e; ExecEd & Bootcamps). + (e.g; ExecEd).

); diff --git a/src/setupTest.js b/src/setupTest.js index 700cf3398..78cbf9059 100644 --- a/src/setupTest.js +++ b/src/setupTest.js @@ -17,10 +17,6 @@ process.env.COURSE_URL_SLUGS_PATTERN = `{ "default": { "slug_format": "^learn/[a-z0-9_]+(?:-?[a-z0-9_]+)*/[a-z0-9_]+(?:-?[a-z0-9_]+)*$|^[a-z0-9_]+(?:-[a-z0-9_]+)*$", "error_msg": "Course URL slug contains lowercase letters, numbers, underscores, and dashes only and must be in the format or learn//-." - }, - "bootcamp-2u": { - "slug_format": "^boot-camps/[a-z0-9_]+(?:-?[a-z0-9_]+)*/[a-z0-9_]+(?:-?[a-z0-9_]+)*$|^[a-z0-9_]+(?:-[a-z0-9_]+)*$", - "error_msg": "Course URL slug contains lowercase letters, numbers, underscores, and dashes only and must be in the format or boot-camps//-." } }, "external-source": { @@ -31,10 +27,6 @@ process.env.COURSE_URL_SLUGS_PATTERN = `{ "executive-education-2u": { "slug_format": "^executive-education/[a-z0-9_]+(?:-?[a-z0-9_]+)*$|^[a-z0-9_]+(?:-[a-z0-9_]+)*$", "error_msg": "Course URL slug contains lowercase letters, numbers, underscores, and dashes only and must be in the format or executive-education/-." - }, - "bootcamp-2u": { - "slug_format": "^boot-camps/[a-z0-9_]+(?:-?[a-z0-9_]+)*/[a-z0-9_]+(?:-?[a-z0-9_]+)*$|^[a-z0-9_]+(?:-[a-z0-9_]+)*$", - "error_msg": "Course URL slug contains lowercase letters, numbers, underscores, and dashes only and must be in the format or boot-camps//-." } } }`; diff --git a/src/utils/index.js b/src/utils/index.js index 862207c71..cbddc78e9 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -5,7 +5,7 @@ import qs from 'query-string'; import { COURSE_EXEMPT_FIELDS, COURSE_RUN_NON_EXEMPT_FIELDS, COURSE_URL_SLUG_PATTERN_OLD, - MASTERS_TRACK, COURSE_URL_SLUG_VALIDATION_MESSAGE, EXECUTIVE_EDUCATION_SLUG, BOOTCAMP_SLUG, + MASTERS_TRACK, COURSE_URL_SLUG_VALIDATION_MESSAGE, EXECUTIVE_EDUCATION_SLUG, RESTRICTION_TYPE_OPTIONS as restrictionTypeOptions, } from '../data/constants'; import DiscoveryDataApiService from '../data/services/DiscoveryDataApiService'; @@ -220,7 +220,7 @@ const isPristine = (initialValues, currentFormValues, runKey) => { }; const isExternalCourse = (productSource, courseType) => ( - productSource !== DEFAULT_PRODUCT_SOURCE && [EXECUTIVE_EDUCATION_SLUG, BOOTCAMP_SLUG].includes(courseType) + productSource !== DEFAULT_PRODUCT_SOURCE && [EXECUTIVE_EDUCATION_SLUG].includes(courseType) ); const parseOptions = inChoices => inChoices.map(choice => ({ label: choice.display_name, value: choice.value })); diff --git a/src/utils/utils.test.js b/src/utils/utils.test.js index 3a1ddf3ac..c7c59d63b 100644 --- a/src/utils/utils.test.js +++ b/src/utils/utils.test.js @@ -1,5 +1,5 @@ import * as utils from '.'; -import { BOOTCAMP_SLUG, COURSE_URL_SLUG_PATTERN_OLD, EXECUTIVE_EDUCATION_SLUG } from '../data/constants'; +import { COURSE_URL_SLUG_PATTERN_OLD, EXECUTIVE_EDUCATION_SLUG } from '../data/constants'; import { DEFAULT_PRODUCT_SOURCE } from '../data/constants/productSourceOptions'; const initialRuns = [ @@ -129,38 +129,15 @@ describe('getCourseUrlSlugPattern', () => { }); }, ); - - it( - 'returns the old course url slug pattern when courseType is bootcamp and updatedSlugFlag is false', - () => { - expect( - utils.getCourseUrlSlugPattern(false, 'external-source', BOOTCAMP_SLUG), - ).toEqual({ - slug_format: COURSE_URL_SLUG_PATTERN_OLD, - error_msg: 'Course URL slug contains lowercase letters, numbers, underscores, and dashes only.', - }); - }, - ); - - it( - 'returns the bootcamp subdirectory slug pattern when courseType is bootcamp and updatedSlugFlag is true', - () => { - expect( - utils.getCourseUrlSlugPattern(true, 'external-source', BOOTCAMP_SLUG), - ).toEqual(JSON.parse(COURSE_URL_SLUGS_PATTERN)['external-source'][BOOTCAMP_SLUG]); - }, - ); }); describe('isExternalCourse', () => { - const EXTERNAL_COURSE_TYPES = [EXECUTIVE_EDUCATION_SLUG, BOOTCAMP_SLUG]; + const EXTERNAL_COURSE_TYPES = [EXECUTIVE_EDUCATION_SLUG]; it('returns true if the product source is other than edx and course type is in EXTERNAL_COURSE_TYPES', () => { expect(utils.isExternalCourse('external-source', EXTERNAL_COURSE_TYPES[0])).toBe(true); - expect(utils.isExternalCourse('external-source', EXTERNAL_COURSE_TYPES[1])).toBe(true); }); it('returns false if the product source has a default value', () => { expect(utils.isExternalCourse(DEFAULT_PRODUCT_SOURCE, EXTERNAL_COURSE_TYPES[0])).toBe(false); - expect(utils.isExternalCourse(DEFAULT_PRODUCT_SOURCE, EXTERNAL_COURSE_TYPES[1])).toBe(false); }); it( 'returns false if the product source does not have a default value and course type is not in EXTERNAL_COURSE_TYPES',