diff --git a/.env b/.env index 0119e67a..f960c950 100644 --- a/.env +++ b/.env @@ -19,5 +19,5 @@ REFRESH_ACCESS_TOKEN_ENDPOINT=null SEGMENT_KEY='' SITE_NAME=null USER_INFO_COOKIE_NAME=null -EDX_FOR_BUSINESS_TITLE='' +EDX_FOR_SUBSCRIPTION_TITLE='' EDX_ENTERPRISE_ALACARTE_TITLE='' diff --git a/.env.development b/.env.development index 723a5199..69c6cbe2 100644 --- a/.env.development +++ b/.env.development @@ -25,8 +25,7 @@ ALGOLIA_SEARCH_API_KEY='' ALGOLIA_INDEX_NAME='' AUTHN_MINIMAL_HEADER=true MINIMAL_HEADER=true -EDX_FOR_BUSINESS_TITLE='' -EDX_FOR_ONLINE_EDU_TITLE='' +EDX_FOR_SUBSCRIPTION_TITLE='' EDX_ENTERPRISE_ALACARTE_TITLE='' FEATURE_LANGUAGE_FACET=true HOTJAR_APP_ID='' diff --git a/README.rst b/README.rst index cdab068b..5cfb02fc 100644 --- a/README.rst +++ b/README.rst @@ -44,7 +44,7 @@ To run this project locally: .. code-block:: - EDX_FOR_BUSINESS_TITLE='' # default = 'Business' + EDX_FOR_SUBSCRIPTION_TITLE='' # default = 'Subscription' EDX_ENTERPRISE_ALACARTE_TITLE='' # default = 'A la carte' 5. From repository root folder, run: diff --git a/jest.config.js b/jest.config.js index 13e9f1bd..34868956 100644 --- a/jest.config.js +++ b/jest.config.js @@ -2,5 +2,5 @@ const { createConfig } = require('@edx/frontend-build'); module.exports = createConfig('jest', { setupFiles: ['/src/setupTest.js'], - coveragePathIgnorePatterns: ['src/setupTest.js', 'src/i18n', 'src/components/aiCuration'], + coveragePathIgnorePatterns: ['src/setupTest.js', 'src/i18n', 'src/components/aiCuration', 'src/index.jsx'], }); diff --git a/src/components/app/tests/App.test.jsx b/src/components/app/tests/App.test.jsx index ac5a52de..ac5b08bc 100644 --- a/src/components/app/tests/App.test.jsx +++ b/src/components/app/tests/App.test.jsx @@ -25,7 +25,7 @@ mockWindowLocations(); const mockConfig = () => ({ HUBSPOT_MARKETING_URL: 'http://bobsdooremporium.com', - EDX_FOR_BUSINESS_TITLE: 'ayylmao', + EDX_FOR_SUBSCRIPTION_TITLE: 'ayylmao', EDX_ENTERPRISE_ALACARTE_TITLE: 'baz', }); diff --git a/src/components/catalogInfoModal/CatalogInfoModal.test.jsx b/src/components/catalogInfoModal/CatalogInfoModal.test.jsx index ae1ba9ce..66bd9154 100644 --- a/src/components/catalogInfoModal/CatalogInfoModal.test.jsx +++ b/src/components/catalogInfoModal/CatalogInfoModal.test.jsx @@ -99,7 +99,7 @@ describe('Course info modal works as expected', () => { Object.assign(defaultPropsCopy, courseTypeModalProps); const businessQueryTitle = 'test-business-query-title'; - process.env.EDX_FOR_BUSINESS_TITLE = businessQueryTitle; + process.env.EDX_FOR_SUBSCRIPTION_TITLE = businessQueryTitle; defaultPropsCopy.selectedCourse.courseAssociatedCatalogs = [ businessQueryTitle, ]; @@ -119,7 +119,7 @@ describe('Course info modal works as expected', () => { Object.assign(defaultPropsCopy, courseTypeModalProps); const businessQueryTitle = 'test-business-query-title'; - process.env.EDX_FOR_BUSINESS_TITLE = businessQueryTitle; + process.env.EDX_FOR_SUBSCRIPTION_TITLE = businessQueryTitle; defaultPropsCopy.selectedCourse.courseAssociatedCatalogs = [ businessQueryTitle, ]; diff --git a/src/components/catalogPage/CatalogPage.test.jsx b/src/components/catalogPage/CatalogPage.test.jsx index 58e9f4b9..3c85c502 100644 --- a/src/components/catalogPage/CatalogPage.test.jsx +++ b/src/components/catalogPage/CatalogPage.test.jsx @@ -19,7 +19,7 @@ jest.mock('react-instantsearch-dom', () => ({ // Thus we're mocking the config here. const mockConfig = () => ({ HUBSPOT_MARKETING_URL: 'http://bobsdooremporium.com', - EDX_FOR_BUSINESS_TITLE: 'ayylmao', + EDX_FOR_SUBSCRIPTION_TITLE: 'ayylmao', EDX_ENTERPRISE_ALACARTE_TITLE: 'baz', }); diff --git a/src/components/catalogSearchResults/CatalogSearchResults.messages.js b/src/components/catalogSearchResults/CatalogSearchResults.messages.js index 4943916a..d6e36ee3 100644 --- a/src/components/catalogSearchResults/CatalogSearchResults.messages.js +++ b/src/components/catalogSearchResults/CatalogSearchResults.messages.js @@ -55,11 +55,6 @@ const messages = defineMessages({ defaultMessage: 'A la carte', description: 'Badge text for the `A La Carte` catalog badge.', }, - 'catalogSearchResults.businessBadge': { - id: 'catalogSearchResults.businessBadge', - defaultMessage: 'Business', - description: 'Badge text for the `Business` catalog badge.', - }, 'catalogSearchResults.subscriptionBadge': { id: 'catalogSearchResults.subscriptionBadge', defaultMessage: 'Subscription', diff --git a/src/components/catalogSearchResults/CatalogSearchResults.test.jsx b/src/components/catalogSearchResults/CatalogSearchResults.test.jsx index 6f5967ce..6737090b 100644 --- a/src/components/catalogSearchResults/CatalogSearchResults.test.jsx +++ b/src/components/catalogSearchResults/CatalogSearchResults.test.jsx @@ -45,7 +45,7 @@ const SearchDataWrapper = ({ ); const mockConfig = () => ({ - EDX_FOR_BUSINESS_TITLE: 'ayylmao', + EDX_FOR_SUBSCRIPTION_TITLE: 'ayylmao', EDX_ENTERPRISE_ALACARTE_TITLE: 'baz', FEATURE_CARD_VIEW_ENABLED: 'True', }); @@ -237,7 +237,7 @@ 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_SUBSCRIPTION_TITLE = 'ayylmao'; process.env.EDX_ENTERPRISE_ALACARTE_TITLE = 'baz'; render( @@ -265,7 +265,7 @@ describe('Main Catalogs view works as expected', () => { expect(screen.queryByText('Subscription')).toBeInTheDocument(); }); test('all courses rendered when search results available', async () => { - process.env.EDX_FOR_BUSINESS_TITLE = 'ayylmao'; + process.env.EDX_FOR_SUBSCRIPTION_TITLE = 'ayylmao'; process.env.EDX_ENTERPRISE_ALACARTE_TITLE = 'baz'; features.CONSOLIDATE_SUBS_CATALOG = false; render( @@ -461,7 +461,7 @@ describe('Main Catalogs view works as expected', () => { expect(screen.queryByText('About this course')).toBeInTheDocument(); }); test('exec ed search results text and card price', async () => { - process.env.EDX_FOR_BUSINESS_TITLE = 'ayylmao'; + process.env.EDX_FOR_SUBSCRIPTION_TITLE = 'ayylmao'; process.env.EDX_ENTERPRISE_ALACARTE_TITLE = 'baz'; renderWithRouter( @@ -484,7 +484,7 @@ describe('Main Catalogs view works as expected', () => { expect(screen.queryByText('$100')).toBeInTheDocument(); }); test('all programs rendered when search results available', () => { - process.env.EDX_FOR_BUSINESS_TITLE = 'ayylmao'; + process.env.EDX_FOR_SUBSCRIPTION_TITLE = 'ayylmao'; process.env.EDX_ENTERPRISE_ALACARTE_TITLE = 'baz'; renderWithRouter( diff --git a/src/components/catalogSearchResults/associatedComponents/catalogBadges/CatalogBadges.jsx b/src/components/catalogSearchResults/associatedComponents/catalogBadges/CatalogBadges.jsx index 4613c1ed..0e1bc3c8 100644 --- a/src/components/catalogSearchResults/associatedComponents/catalogBadges/CatalogBadges.jsx +++ b/src/components/catalogSearchResults/associatedComponents/catalogBadges/CatalogBadges.jsx @@ -17,7 +17,7 @@ const CatalogBadges = ({ row }) => { )} {row.original.enterprise_catalog_query_titles.includes( - process.env.EDX_FOR_BUSINESS_TITLE, + process.env.EDX_FOR_SUBSCRIPTION_TITLE, ) && ( {intl.formatMessage(messages['catalogSearchResults.subscriptionBadge'])} diff --git a/src/components/catalogSelectionDeck/CatalogSelectionDeck.jsx b/src/components/catalogSelectionDeck/CatalogSelectionDeck.jsx index 234435f3..58f0ddfc 100644 --- a/src/components/catalogSelectionDeck/CatalogSelectionDeck.jsx +++ b/src/components/catalogSelectionDeck/CatalogSelectionDeck.jsx @@ -52,7 +52,7 @@ const CatalogSelectionDeck = ({ intl, title, hide }) => { - +

{intl.formatMessage(messages['catalogSelectionDeck.edxSubscription.label'])}

{intl.formatMessage(messages['catalogSelectionDeck.labelDetail'])}

    diff --git a/src/components/catalogSelectionDeck/CatalogSelectionDeck.messages.js b/src/components/catalogSelectionDeck/CatalogSelectionDeck.messages.js index a20fdef1..70cc8c89 100644 --- a/src/components/catalogSelectionDeck/CatalogSelectionDeck.messages.js +++ b/src/components/catalogSelectionDeck/CatalogSelectionDeck.messages.js @@ -1,36 +1,11 @@ import { defineMessages } from '@edx/frontend-platform/i18n'; const messages = defineMessages({ - 'catalogSelectionDeck.edxForBusiness.badge': { - id: 'catalogSelectionDeck.edxForBusiness.badge', - defaultMessage: 'For businesses', - description: 'badge for catalog', - }, - 'catalogSelectionDeck.edxForBusiness.label': { - id: 'catalogSelectionDeck.edxForBusiness.label', - defaultMessage: 'Business subscription', - description: 'label for checkbox for filtering results', - }, - 'catalogSelectionDeck.edxSubscription.badge': { - id: 'catalogSelectionDeck.edxSubscription.badge', - defaultMessage: 'For all organizations', - description: 'badge for catalog', - }, 'catalogSelectionDeck.edxSubscription.label': { id: 'catalogSelectionDeck.edxSubscription.label', defaultMessage: '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', diff --git a/src/components/catalogSelectionDeck/CatalogSelectionDeck.test.jsx b/src/components/catalogSelectionDeck/CatalogSelectionDeck.test.jsx index 8226ddb2..35255cb0 100644 --- a/src/components/catalogSelectionDeck/CatalogSelectionDeck.test.jsx +++ b/src/components/catalogSelectionDeck/CatalogSelectionDeck.test.jsx @@ -19,7 +19,7 @@ const label = 'fefifofum'; jest.mock('@edx/frontend-platform/config', () => ({ ...jest.requireActual('@edx/frontend-platform/config'), getConfig: jest.fn(() => ({ - EDX_FOR_BUSINESS_TITLE: 'ayylmao', + EDX_FOR_SUBSCRIPTION_TITLE: 'ayylmao', EDX_ENTERPRISE_ALACARTE_TITLE: 'baz', })), })); diff --git a/src/components/courseCard/CourseCard.jsx b/src/components/courseCard/CourseCard.jsx index 45f6f6cb..8a17a2ad 100644 --- a/src/components/courseCard/CourseCard.jsx +++ b/src/components/courseCard/CourseCard.jsx @@ -68,7 +68,7 @@ const CourseCard = ({ )} {enterprise_catalog_query_titles?.includes( - process.env.EDX_FOR_BUSINESS_TITLE, + process.env.EDX_FOR_SUBSCRIPTION_TITLE, ) && ( { features.CONSOLIDATE_SUBS_CATALOG = true; }); test('card renders as expected', () => { - process.env.EDX_FOR_BUSINESS_TITLE = 'ayylmao'; + process.env.EDX_FOR_SUBSCRIPTION_TITLE = 'ayylmao'; process.env.EDX_ENTERPRISE_ALACARTE_TITLE = 'baz'; render( @@ -64,7 +64,7 @@ describe('Course card works as expected', () => { expect(screen.queryByText('Subscription')).toBeInTheDocument(); }); test('card renders as expected with business subs', () => { - process.env.EDX_FOR_BUSINESS_TITLE = 'ayylmao'; + process.env.EDX_FOR_SUBSCRIPTION_TITLE = 'ayylmao'; process.env.EDX_ENTERPRISE_ALACARTE_TITLE = 'baz'; features.CONSOLIDATE_SUBS_CATALOG = false; render( @@ -90,7 +90,7 @@ describe('Course card works as expected', () => { await expect(screen.getByAltText(imageAltText).src).not.toBeUndefined; }); test('exec ed card renders correct price from entitlement', async () => { - process.env.EDX_FOR_BUSINESS_TITLE = 'ayylmao'; + process.env.EDX_FOR_SUBSCRIPTION_TITLE = 'ayylmao'; process.env.EDX_ENTERPRISE_ALACARTE_TITLE = 'baz'; render( diff --git a/src/components/programCard/ProgramCard.jsx b/src/components/programCard/ProgramCard.jsx index 91fdcc42..081a9902 100644 --- a/src/components/programCard/ProgramCard.jsx +++ b/src/components/programCard/ProgramCard.jsx @@ -26,7 +26,7 @@ const ProgramCard = ({ intl, onClick, original }) => { process.env.EDX_ENTERPRISE_ALACARTE_TITLE, ); const businessCatalogRequested = enterprise_catalog_query_titles?.includes( - process.env.EDX_FOR_BUSINESS_TITLE, + process.env.EDX_FOR_SUBSCRIPTION_TITLE, ); const imageSrc = card_image_url || defaultCardHeader; diff --git a/src/components/programCard/ProgramCard.messages.jsx b/src/components/programCard/ProgramCard.messages.jsx index 571b75e4..f97e8f05 100644 --- a/src/components/programCard/ProgramCard.messages.jsx +++ b/src/components/programCard/ProgramCard.messages.jsx @@ -11,11 +11,6 @@ const messages = defineMessages({ defaultMessage: 'A la carte', description: 'Badge text for the `A La Carte` catalog badge.', }, - 'ProgramCard.businessBadge': { - id: 'ProgramCard.businessBadge', - defaultMessage: 'Business', - description: 'Badge text for the `Business` catalog badge.', - }, 'ProgramCard.subscriptionBadge': { id: 'ProgramCard.subscriptionBadge', defaultMessage: 'Subscription', diff --git a/src/components/programCard/ProgramCard.test.jsx b/src/components/programCard/ProgramCard.test.jsx index 464b7b50..37512298 100644 --- a/src/components/programCard/ProgramCard.test.jsx +++ b/src/components/programCard/ProgramCard.test.jsx @@ -6,7 +6,7 @@ import { IntlProvider } from '@edx/frontend-platform/i18n'; import ProgramCard from './ProgramCard'; const mockConfig = () => ({ - EDX_FOR_BUSINESS_TITLE: 'ayylmao', + EDX_FOR_SUBSCRIPTION_TITLE: 'ayylmao', EDX_ENTERPRISE_ALACARTE_TITLE: 'baz', FEATURE_CARD_VIEW_ENABLED: 'True', }); @@ -33,7 +33,7 @@ const defaultProps = { describe('Program card works as expected', () => { test('card renders as expected', () => { - process.env.EDX_FOR_BUSINESS_TITLE = 'ayylmao'; + process.env.EDX_FOR_SUBSCRIPTION_TITLE = 'ayylmao'; process.env.EDX_ENTERPRISE_ALACARTE_TITLE = 'baz'; render( diff --git a/src/index.jsx b/src/index.jsx index 65856ea8..8f174025 100644 --- a/src/index.jsx +++ b/src/index.jsx @@ -41,7 +41,7 @@ initialize({ ALGOLIA_SEARCH_API_KEY: process.env.ALGOLIA_SEARCH_API_KEY || null, 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_SUBSCRIPTION_TITLE: process.env.EDX_FOR_SUBSCRIPTION_TITLE || null, EDX_ENTERPRISE_ALACARTE_TITLE: process.env.EDX_ENTERPRISE_ALACARTE_TITLE || null, FEATURE_CARD_VIEW_ENABLED: diff --git a/src/utils/catalogUtils.js b/src/utils/catalogUtils.js index 3fee2234..6460fff5 100644 --- a/src/utils/catalogUtils.js +++ b/src/utils/catalogUtils.js @@ -5,7 +5,7 @@ const nowDate = new Date(Date.now()); function checkSubscriptions(courseAssociatedCatalogs) { const inSubscription = courseAssociatedCatalogs.includes( - process.env.EDX_FOR_BUSINESS_TITLE, + process.env.EDX_FOR_SUBSCRIPTION_TITLE, ); if (inSubscription) { return 'Included in subscription catalog';