Skip to content

Commit

Permalink
chore: remove all references to edu catalog (#354)
Browse files Browse the repository at this point in the history
  • Loading branch information
bcitro committed Sep 11, 2023
1 parent 06f2b3b commit 1c23eeb
Show file tree
Hide file tree
Showing 19 changed files with 13 additions and 99 deletions.
1 change: 0 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@ SEGMENT_KEY=''
SITE_NAME=null
USER_INFO_COOKIE_NAME=null
EDX_FOR_BUSINESS_TITLE=''
EDX_FOR_ONLINE_EDU_TITLE=''
EDX_ENTERPRISE_ALACARTE_TITLE=''
13 changes: 6 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ To run this project locally:

1. Clone this repository

2. From repository root folder, run:
2. From repository root folder, run:

``npm install``

Note: locally this app will default to open edX branding, so colors and formatting might look a little different than what will be deployed. To combat this, you can optionally run:

``npm install --save @edx/brand@npm:@edx/brand-edx.org``

3. This project requires Algolia developer keys. Once you have them, make the following local modifications to the ``.env.development`` file and replace the keys:
Expand All @@ -45,13 +45,12 @@ To run this project locally:
.. code-block::
EDX_FOR_BUSINESS_TITLE='' # default = 'Business'
EDX_FOR_ONLINE_EDU_TITLE='' # default = 'Education'
EDX_ENTERPRISE_ALACARTE_TITLE='' # default = 'A la carte'
5. From repository root folder, run:

``npm start``

to start your local server at `http://localhost:8735 <http://localhost:8735>`_.

**Helpful Testing Commands**
Expand Down
1 change: 0 additions & 1 deletion src/components/app/tests/App.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ mockWindowLocations();
const mockConfig = () => ({
HUBSPOT_MARKETING_URL: 'http://bobsdooremporium.com',
EDX_FOR_BUSINESS_TITLE: 'ayylmao',
EDX_FOR_ONLINE_EDU_TITLE: 'foo',
EDX_ENTERPRISE_ALACARTE_TITLE: 'baz',
});

Expand Down
11 changes: 4 additions & 7 deletions src/components/catalogInfoModal/CatalogInfoModal.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,23 +94,20 @@ describe('Course info modal works as expected', () => {
const defaultPropsCopy = {};
Object.assign(defaultPropsCopy, courseTypeModalProps);

const educationQueryTitle = 'test-business-query-title';
process.env.EDX_FOR_ONLINE_EDU_TITLE = educationQueryTitle;
const businessQueryTitle = 'test-business-query-title';
process.env.EDX_FOR_BUSINESS_TITLE = businessQueryTitle;
defaultPropsCopy.selectedCourse.courseAssociatedCatalogs = [
educationQueryTitle,
businessQueryTitle,
];

render(
<IntlProvider locale="en">
<CatalogInfoModal {...defaultPropsCopy} />
</IntlProvider>,
);
expect(
screen.queryByText('Included in education catalog'),
).toBeInTheDocument();
expect(
screen.queryByText('Included in business catalog'),
).not.toBeInTheDocument();
).toBeInTheDocument();
});
test('Renders Course info modal with no catalogs', () => {
const defaultPropsCopy = {};
Expand Down
1 change: 0 additions & 1 deletion src/components/catalogPage/CatalogPage.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ jest.mock('react-instantsearch-dom', () => ({
const mockConfig = () => ({
HUBSPOT_MARKETING_URL: 'http://bobsdooremporium.com',
EDX_FOR_BUSINESS_TITLE: 'ayylmao',
EDX_FOR_ONLINE_EDU_TITLE: 'foo',
EDX_ENTERPRISE_ALACARTE_TITLE: 'baz',
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,6 @@ const messages = defineMessages({
defaultMessage: 'Business',
description: 'Badge text for the `Business` catalog badge.',
},
'catalogSearchResults.educationBadge': {
id: 'catalogSearchResults.educationBadge',
defaultMessage: 'Education',
description: 'Badge text for the `Education` catalog badge.',
},
'catalogSearchResults.popularCourses': {
id: 'catalogSearchResults.popularCourses',
defaultMessage: 'Popular Courses',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ const SearchDataWrapper = ({

const mockConfig = () => ({
EDX_FOR_BUSINESS_TITLE: 'ayylmao',
EDX_FOR_ONLINE_EDU_TITLE: 'foo',
EDX_ENTERPRISE_ALACARTE_TITLE: 'baz',
FEATURE_CARD_VIEW_ENABLED: 'True',
});
Expand Down Expand Up @@ -237,7 +236,6 @@ describe('Main Catalogs view works as expected', () => {

test('all courses rendered when search results available', async () => {
process.env.EDX_FOR_BUSINESS_TITLE = 'ayylmao';
process.env.EDX_FOR_ONLINE_EDU_TITLE = 'foo';
process.env.EDX_ENTERPRISE_ALACARTE_TITLE = 'baz';
render(
<SearchDataWrapper>
Expand Down Expand Up @@ -442,7 +440,6 @@ describe('Main Catalogs view works as expected', () => {
});
test('exec ed search results text and card price', async () => {
process.env.EDX_FOR_BUSINESS_TITLE = 'ayylmao';
process.env.EDX_FOR_ONLINE_EDU_TITLE = 'foo';
process.env.EDX_ENTERPRISE_ALACARTE_TITLE = 'baz';
renderWithRouter(
<SearchDataWrapper>
Expand All @@ -466,7 +463,6 @@ describe('Main Catalogs view works as expected', () => {
});
test('all programs rendered when search results available', () => {
process.env.EDX_FOR_BUSINESS_TITLE = 'ayylmao';
process.env.EDX_FOR_ONLINE_EDU_TITLE = 'foo';
process.env.EDX_ENTERPRISE_ALACARTE_TITLE = 'baz';

renderWithRouter(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,6 @@ const CatalogBadges = ({ row }) => {
{intl.formatMessage(messages['catalogSearchResults.businessBadge'])}
</Badge>
)}
{row.original.enterprise_catalog_query_titles.includes(
process.env.EDX_FOR_ONLINE_EDU_TITLE,
) && (
<Badge variant="light" className="padded-catalog">
{intl.formatMessage(messages['catalogSearchResults.educationBadge'])}
</Badge>
)}
</div>
);
};
Expand Down
12 changes: 0 additions & 12 deletions src/components/catalogSelectionDeck/CatalogSelectionDeck.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,6 @@ const CatalogSelectionDeck = ({ intl, title, hide }) => {
<li>{intl.formatMessage(messages['catalogSelectionDeck.bullet3'])}</li>
</ul>
</SelectableBox>
<SelectableBox value={config.EDX_FOR_ONLINE_EDU_TITLE} inputHidden={false} type="radio" aria-label="education select">
<Badge variant="light">
{intl.formatMessage(messages['catalogSelectionDeck.edxForOnlineEdu.badge'])}
</Badge>
<h3>{intl.formatMessage(messages['catalogSelectionDeck.edxForOnlineEdu.label'])}</h3>
<p>{intl.formatMessage(messages['catalogSelectionDeck.labelDetail'])}</p>
<ul className="catalog-list">
<li>{intl.formatMessage(messages['catalogSelectionDeck.bullet1'])}</li>
<li>{intl.formatMessage(messages['catalogSelectionDeck.bullet2'])}</li>
<li>{intl.formatMessage(messages['catalogSelectionDeck.bullet3'])}</li>
</ul>
</SelectableBox>
</SelectableBox.Set>
</Container>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,25 @@ const messages = defineMessages({
defaultMessage: 'Business subscription',
description: 'label for checkbox for filtering results',
},
'catalogSelectionDeck.edxForOnlineEdu.badge': {
id: 'catalogSelectionDeck.edxForOnlineEdu.badge',
defaultMessage: 'For educational institutions',
description: 'badge for catalog',
},
'catalogSelectionDeck.edxForOnlineEdu.label': {
id: 'catalogSelectionDeck.edxForOnlineEdu.label',
defaultMessage: 'Education subscription',
description: 'label for checkbox for filtering results',
},
'catalogSelectionDeck.labelDetail': {
id: 'catalogSelectionDeck.edxForOnlineEdu.labelDetail',
defaultMessage: 'Single, per learner price',
description: 'secondary label for checkbox for filtering results',
},
'catalogSelectionDeck.bullet1': {
id: 'catalogSelectionDeck.edxForOnlineEdu.bullet1',
id: 'catalogSelectionDeck.edxForBusiness.bullet1',
defaultMessage:
'Unlimited access to 1,000+ courses',
description: 'description of filter',
},
'catalogSelectionDeck.bullet2': {
id: 'catalogSelectionDeck.edxForOnlineEdu.bullet2',
id: 'catalogSelectionDeck.edxForBusiness.bullet2',
defaultMessage:
'Professional certificates and select programs',
description: 'description of filter',
},
'catalogSelectionDeck.bullet3': {
id: 'catalogSelectionDeck.edxForOnlineEdu.bullet3',
id: 'catalogSelectionDeck.edxForBusiness.bullet3',
defaultMessage:
'Self-paced courses',
description: 'description of filter',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ jest.mock('@edx/frontend-platform/config', () => ({
...jest.requireActual('@edx/frontend-platform/config'),
getConfig: jest.fn(() => ({
EDX_FOR_BUSINESS_TITLE: 'ayylmao',
EDX_FOR_ONLINE_EDU_TITLE: 'foo',
EDX_ENTERPRISE_ALACARTE_TITLE: 'baz',
})),
}));
Expand Down Expand Up @@ -51,7 +50,6 @@ describe('CatalogSelectionDeck', () => {
expect(screen.getByText(label)).toBeInTheDocument();
Object.keys(messages).forEach((key) => {
// Note: we just pick out the first match for this basic test because some messages appear more than once
// e.g. both cards for Education and Business have some identical text.
expect(
screen.getAllByText(messages[key].defaultMessage, {
normalizer: getDefaultNormalizer({
Expand Down
7 changes: 0 additions & 7 deletions src/components/courseCard/CourseCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,6 @@ const CourseCard = ({
{intl.formatMessage(messages['courseCard.businessBadge'])}
</Badge>
)}
{enterprise_catalog_query_titles?.includes(
process.env.EDX_FOR_ONLINE_EDU_TITLE,
) && (
<Badge variant="light" className="padded-catalog">
{intl.formatMessage(messages['courseCard.educationBadge'])}
</Badge>
)}
</div>
</Card.Section>
</Card>
Expand Down
5 changes: 0 additions & 5 deletions src/components/courseCard/CourseCard.messages.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ const messages = defineMessages({
defaultMessage: 'Business',
description: 'Badge text for the `Business` catalog badge.',
},
'courseCard.educationBadge': {
id: 'courseCard.educationBadge',
defaultMessage: 'Education',
description: 'Badge text for the `Education` catalog badge.',
},
'courseCard.priceNotAvailable': {
id: 'courseCard.priceNotAvailable',
defaultMessage: ' Not Available',
Expand Down
2 changes: 0 additions & 2 deletions src/components/courseCard/CourseCard.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ const execEdProps = {
describe('Course card works as expected', () => {
test('card renders as expected', () => {
process.env.EDX_FOR_BUSINESS_TITLE = 'ayylmao';
process.env.EDX_FOR_ONLINE_EDU_TITLE = 'foo';
process.env.EDX_ENTERPRISE_ALACARTE_TITLE = 'baz';
render(
<IntlProvider locale="en">
Expand All @@ -72,7 +71,6 @@ describe('Course card works as expected', () => {
});
test('exec ed card renders correct price from entitlement', async () => {
process.env.EDX_FOR_BUSINESS_TITLE = 'ayylmao';
process.env.EDX_FOR_ONLINE_EDU_TITLE = 'foo';
process.env.EDX_ENTERPRISE_ALACARTE_TITLE = 'baz';
render(
<IntlProvider locale="en">
Expand Down
8 changes: 0 additions & 8 deletions src/components/programCard/ProgramCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ const ProgramCard = ({ intl, onClick, original }) => {
const businessCatalogRequested = enterprise_catalog_query_titles?.includes(
process.env.EDX_FOR_BUSINESS_TITLE,
);
const eduCatalogRequested = enterprise_catalog_query_titles?.includes(
process.env.EDX_FOR_ONLINE_EDU_TITLE,
);
const imageSrc = card_image_url || defaultCardHeader;

return (
Expand Down Expand Up @@ -78,11 +75,6 @@ const ProgramCard = ({ intl, onClick, original }) => {
{intl.formatMessage(messages['ProgramCard.businessBadge'])}
</Badge>
)}
{eduCatalogRequested && (
<Badge className="padded-catalog" variant="light">
{intl.formatMessage(messages['ProgramCard.educationBadge'])}
</Badge>
)}
</div>
</Card.Section>
</Card>
Expand Down
5 changes: 0 additions & 5 deletions src/components/programCard/ProgramCard.messages.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ const messages = defineMessages({
defaultMessage: 'Business',
description: 'Badge text for the `Business` catalog badge.',
},
'ProgramCard.educationBadge': {
id: 'ProgramCard.educationBadge',
defaultMessage: 'Education',
description: 'Badge text for the `Education` catalog badge.',
},
'ProgramCard.priceNotAvailable': {
id: 'ProgramCard.priceNotAvailable',
defaultMessage: ' Not Available',
Expand Down
2 changes: 0 additions & 2 deletions src/components/programCard/ProgramCard.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import ProgramCard from './ProgramCard';

const mockConfig = () => ({
EDX_FOR_BUSINESS_TITLE: 'ayylmao',
EDX_FOR_ONLINE_EDU_TITLE: 'foo',
EDX_ENTERPRISE_ALACARTE_TITLE: 'baz',
FEATURE_CARD_VIEW_ENABLED: 'True',
});
Expand Down Expand Up @@ -35,7 +34,6 @@ const defaultProps = {
describe('Program card works as expected', () => {
test('card renders as expected', () => {
process.env.EDX_FOR_BUSINESS_TITLE = 'ayylmao';
process.env.EDX_FOR_ONLINE_EDU_TITLE = 'foo';
process.env.EDX_ENTERPRISE_ALACARTE_TITLE = 'baz';
render(
<IntlProvider locale="en">
Expand Down
1 change: 0 additions & 1 deletion src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ initialize({
ALGOLIA_INDEX_NAME: process.env.ALGOLIA_INDEX_NAME || null,
HUBSPOT_MARKETING_URL: process.env.HUBSPOT_MARKETING_URL || null,
EDX_FOR_BUSINESS_TITLE: process.env.EDX_FOR_BUSINESS_TITLE || null,
EDX_FOR_ONLINE_EDU_TITLE: process.env.EDX_FOR_ONLINE_EDU_TITLE || null,
EDX_ENTERPRISE_ALACARTE_TITLE:
process.env.EDX_ENTERPRISE_ALACARTE_TITLE || null,
FEATURE_CARD_VIEW_ENABLED:
Expand Down
9 changes: 0 additions & 9 deletions src/utils/catalogUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,9 @@ function checkSubscriptions(courseAssociatedCatalogs) {
const inBusiness = courseAssociatedCatalogs.includes(
process.env.EDX_FOR_BUSINESS_TITLE,
);
const inEducation = courseAssociatedCatalogs.includes(
process.env.EDX_FOR_ONLINE_EDU_TITLE,
);
if (inBusiness && inEducation) {
return 'Included in education and business catalog';
}
if (inBusiness) {
return 'Included in business catalog';
}
if (inEducation) {
return 'Included in education catalog';
}
return false;
}

Expand Down

0 comments on commit 1c23eeb

Please sign in to comment.