Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(release): publish new versions #368

Merged
merged 2 commits into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions packages/catalog-search/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,22 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [5.5.0](https://github.com/openedx/frontend-enterprise/compare/@edx/[email protected]...@edx/[email protected]) (2024-01-02)


### Features

* allow Paragon v21 in catalog-search ([#356](https://github.com/openedx/frontend-enterprise/issues/356)) ([75005f5](https://github.com/openedx/frontend-enterprise/commit/75005f5e27304e3147fc141ef5dc1bc6ac64a834))
* removing free/all filter ([#359](https://github.com/openedx/frontend-enterprise/issues/359)) ([f187fbd](https://github.com/openedx/frontend-enterprise/commit/f187fbd89eb8c6b490b8a0fafb7f192ed9dcf24c))


### Bug Fixes

* bump frontend-platform ([#363](https://github.com/openedx/frontend-enterprise/issues/363)) ([1413ef2](https://github.com/openedx/frontend-enterprise/commit/1413ef21a1736d572bddb770352f33d505242bef))
* remove pathways from customers search ([ad9d2a5](https://github.com/openedx/frontend-enterprise/commit/ad9d2a5a5a5b63a62d3a6c1f119e2547c113da63))



## [5.4.0](https://github.com/openedx/frontend-enterprise/compare/@edx/[email protected]...@edx/[email protected]) (2023-10-17)


Expand Down
4 changes: 2 additions & 2 deletions packages/catalog-search/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@edx/frontend-enterprise-catalog-search",
"version": "5.4.0",
"version": "5.5.0",
"description": "Components related to Enterprise catalog search.",
"repository": {
"type": "git",
Expand Down Expand Up @@ -37,7 +37,7 @@
},
"sideEffects": false,
"dependencies": {
"@edx/frontend-enterprise-utils": "^4.0.4",
"@edx/frontend-enterprise-utils": "^4.0.5",
"classnames": "2.2.5",
"lodash.debounce": "4.0.8",
"prop-types": "15.7.2"
Expand Down
15 changes: 13 additions & 2 deletions packages/catalog-search/src/LearningTypeRadioFacet.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { useContext } from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import { Dropdown, Input } from '@edx/paragon';
import { SearchContext } from './SearchContext';
Expand All @@ -8,7 +9,7 @@ import {
import { features } from './config';
import { LEARNING_TYPE_COURSE, LEARNING_TYPE_PROGRAM, LEARNING_TYPE_PATHWAY } from './data/constants';

const LearningTypeRadioFacet = () => {
const LearningTypeRadioFacet = ({ enablePathways }) => {
const { refinements, dispatch } = useContext(SearchContext);
// only bold the dropdown title if the learning type is Course or Program
const typeCourseSelected = refinements.content_type && refinements.content_type.includes(LEARNING_TYPE_COURSE);
Expand Down Expand Up @@ -72,7 +73,9 @@ const LearningTypeRadioFacet = () => {
</span>
</Dropdown.Item>
{
features.ENABlE_PATHWAYS && (
// the first check is a global feature flag and the second is a check to see if
// the individual customer itself has enabled pathways
features.ENABlE_PATHWAYS && enablePathways && (
<Dropdown.Item as="label" className="mb-0 py-3 d-flex align-items-center">
<Input
type="radio"
Expand All @@ -93,4 +96,12 @@ const LearningTypeRadioFacet = () => {
);
};

LearningTypeRadioFacet.defaultProps = {
enablePathways: null,
};

LearningTypeRadioFacet.propTypes = {
enablePathways: PropTypes.bool,
};

export default LearningTypeRadioFacet;
6 changes: 4 additions & 2 deletions packages/catalog-search/src/SearchFilters.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import LearningTypeRadioFacet from './LearningTypeRadioFacet';

export const FREE_ALL_TITLE = 'Free / All';

const SearchFilters = ({ variant }) => {
const SearchFilters = ({ variant, enablePathways }) => {
const { refinements, searchFacetFilters } = useContext(SearchContext);

const searchFacets = useMemo(
Expand Down Expand Up @@ -48,7 +48,7 @@ const SearchFilters = ({ variant }) => {
return (
<>
{filtersFromRefinements}
{features.LEARNING_TYPE_FACET && (<LearningTypeRadioFacet />)}
{features.LEARNING_TYPE_FACET && (<LearningTypeRadioFacet enablePathways={enablePathways} />)}
</>
);
},
Expand Down Expand Up @@ -76,10 +76,12 @@ const SearchFilters = ({ variant }) => {

SearchFilters.defaultProps = {
variant: STYLE_VARIANTS.inverse,
enablePathways: null,
};

SearchFilters.propTypes = {
variant: PropTypes.oneOf([STYLE_VARIANTS.default, STYLE_VARIANTS.inverse]),
enablePathways: PropTypes.bool,
};

export default SearchFilters;
10 changes: 6 additions & 4 deletions packages/catalog-search/src/SearchHeader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const SearchHeader = ({
index,
filters,
suggestionSubmitOverride,
enterpriseConfig: { slug },
enterpriseConfig: { slug, enablePathways },
disableSuggestionRedirect,
}) => {
const { refinements } = useContext(SearchContext);
Expand Down Expand Up @@ -64,7 +64,7 @@ const SearchHeader = ({
className={classNames('fe__searchbox-col', { 'fe__searchbox-col--default': variant === STYLE_VARIANTS.default })}
xs={12}
>
<SearchFilters className="mb-3" variant={variant} />
<SearchFilters className="mb-3" variant={variant} enablePathways={enablePathways} />
</Col>
</Row>
</Container>
Expand All @@ -78,7 +78,7 @@ SearchHeader.defaultProps = {
headerTitle: undefined,
hideTitle: false,
filters: '',
enterpriseConfig: { slug: undefined },
enterpriseConfig: { slug: undefined, enablePathways: undefined },
suggestionSubmitOverride: undefined,
disableSuggestionRedirect: false,
index: undefined,
Expand All @@ -91,7 +91,9 @@ SearchHeader.propTypes = {
hideTitle: PropTypes.bool,
index: PropTypes.shape({ search: PropTypes.func.isRequired }),
filters: PropTypes.string,
enterpriseConfig: PropTypes.shape({ slug: PropTypes.string }),
enterpriseConfig: PropTypes.shape(
{ slug: PropTypes.string, enablePathways: PropTypes.bool },
),
suggestionSubmitOverride: PropTypes.func,
disableSuggestionRedirect: PropTypes.bool,
};
Expand Down
24 changes: 18 additions & 6 deletions packages/catalog-search/src/tests/LearningTypeRadioFacet.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ describe('<LearningTypeRadioFacet />', () => {
});

test('LearningTypeRadioFacet is rendered and isnt bold initially', () => {
renderWithSearchContext(<LearningTypeRadioFacet />);
renderWithSearchContext(<LearningTypeRadioFacet enablePathways />);
expect(screen.getByText('Learning Type')).toBeInTheDocument();
expect(screen.getByText('Learning Type').classList.contains('font-weight-bold')).toBeFalsy();
});

test('LearningTypeRadioFacet displays all the options', async () => {
renderWithSearchContext(<LearningTypeRadioFacet />);
renderWithSearchContext(<LearningTypeRadioFacet enablePathways />);
expect(screen.getByText('Learning Type')).toBeInTheDocument();
fireEvent.click(screen.getByText('Learning Type'));
await waitFor(() => {
Expand All @@ -39,8 +39,20 @@ describe('<LearningTypeRadioFacet />', () => {
});
});

test('LearningTypeRadioFacet doesnt display pathways if false', async () => {
renderWithSearchContext(<LearningTypeRadioFacet enablePathways={false} />);
expect(screen.getByText('Learning Type')).toBeInTheDocument();
fireEvent.click(screen.getByText('Learning Type'));
await waitFor(() => {
expect(screen.getByText('Any')).toBeInTheDocument();
expect(screen.getByText('Courses')).toBeInTheDocument();
expect(screen.getByText('Programs')).toBeInTheDocument();
expect(screen.queryByText('Pathways')).not.toBeInTheDocument();
});
});

test('LearningTypeRadioFacet isnt bold when content type Any is selected', async () => {
renderWithSearchContext(<LearningTypeRadioFacet />);
renderWithSearchContext(<LearningTypeRadioFacet enablePathways />);
expect(screen.getByText('Learning Type')).toBeInTheDocument();
fireEvent.click(screen.getByText('Learning Type'));
await waitFor(() => {
Expand All @@ -50,7 +62,7 @@ describe('<LearningTypeRadioFacet />', () => {
});

test('LearningTypeRadioFacet is bold content type Courses is selected', async () => {
renderWithSearchContext(<LearningTypeRadioFacet />);
renderWithSearchContext(<LearningTypeRadioFacet enablePathways />);
expect(screen.getByText('Learning Type')).toBeInTheDocument();
fireEvent.click(screen.getByText('Learning Type'));
fireEvent.click(screen.getByTestId('learning-type-courses'));
Expand All @@ -61,7 +73,7 @@ describe('<LearningTypeRadioFacet />', () => {
});

test('LearningTypeRadioFacet is bold content type Courses is selected', async () => {
renderWithSearchContext(<LearningTypeRadioFacet />);
renderWithSearchContext(<LearningTypeRadioFacet enablePathways />);
expect(screen.getByText('Learning Type')).toBeInTheDocument();
fireEvent.click(screen.getByText('Learning Type'));
fireEvent.click(screen.getByTestId('learning-type-programs'));
Expand All @@ -72,7 +84,7 @@ describe('<LearningTypeRadioFacet />', () => {
});

test('LearningTypeRadioFacet is bold content type Courses is selected', async () => {
renderWithSearchContext(<LearningTypeRadioFacet />);
renderWithSearchContext(<LearningTypeRadioFacet enablePathways />);
expect(screen.getByText('Learning Type')).toBeInTheDocument();
fireEvent.click(screen.getByText('Learning Type'));
fireEvent.click(screen.getByTestId('learning-type-pathways'));
Expand Down
9 changes: 9 additions & 0 deletions packages/logistration/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [4.0.5](https://github.com/openedx/frontend-enterprise/compare/@edx/[email protected]...@edx/[email protected]) (2024-01-02)


### Bug Fixes

* bump frontend-platform ([#363](https://github.com/openedx/frontend-enterprise/issues/363)) ([1413ef2](https://github.com/openedx/frontend-enterprise/commit/1413ef21a1736d572bddb770352f33d505242bef))



## [4.0.4](https://github.com/openedx/frontend-enterprise/compare/@edx/[email protected]...@edx/[email protected]) (2023-10-17)


Expand Down
4 changes: 2 additions & 2 deletions packages/logistration/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@edx/frontend-enterprise-logistration",
"version": "4.0.4",
"version": "4.0.5",
"description": "Enterprise-specific component(s) to ensure enterprise users are redirected to branded enterprise logistration flow.",
"repository": {
"type": "git",
Expand Down Expand Up @@ -37,7 +37,7 @@
},
"sideEffects": false,
"dependencies": {
"@edx/frontend-enterprise-utils": "^4.0.4",
"@edx/frontend-enterprise-utils": "^4.0.5",
"prop-types": "15.7.2"
},
"devDependencies": {
Expand Down
9 changes: 9 additions & 0 deletions packages/utils/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [4.0.5](https://github.com/openedx/frontend-enterprise/compare/@edx/[email protected]...@edx/[email protected]) (2024-01-02)


### Bug Fixes

* bump frontend-platform ([#363](https://github.com/openedx/frontend-enterprise/issues/363)) ([1413ef2](https://github.com/openedx/frontend-enterprise/commit/1413ef21a1736d572bddb770352f33d505242bef))



## [4.0.4](https://github.com/openedx/frontend-enterprise/compare/@edx/[email protected]...@edx/[email protected]) (2023-10-17)


Expand Down
2 changes: 1 addition & 1 deletion packages/utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@edx/frontend-enterprise-utils",
"version": "4.0.4",
"version": "4.0.5",
"description": "Utils and other miscellaneous enterprise things.",
"repository": {
"type": "git",
Expand Down
Loading