Skip to content
Open
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
156 changes: 151 additions & 5 deletions package-lock.json

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

6 changes: 3 additions & 3 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": "4.6.0",
"version": "4.7.1",
"description": "Components related to Enterprise catalog search.",
"repository": {
"type": "git",
Expand Down Expand Up @@ -46,7 +46,7 @@
"@edx/browserslist-config": "1.1.0",
"@edx/frontend-build": "12.7.0",
"@edx/frontend-platform": "4.6.0",
"@edx/paragon": "20.45.0",
"@edx/paragon": "21.1.6",
"@testing-library/jest-dom": "5.11.6",
"@testing-library/react": "12.1.4",
"@testing-library/react-hooks": "3.4.2",
Expand All @@ -59,7 +59,7 @@
},
"peerDependencies": {
"@edx/frontend-platform": "^4.0.1",
"@edx/paragon": "^19.15.0 || ^20.0.0",
"@edx/paragon": "^19.15.0 || ^20.0.0 || ^21.0.0",
"react": "^16.12.0 || ^17.0.0",
"react-dom": "^16.12.0 || ^17.0.0",
"react-instantsearch-dom": "^6.8.3",
Expand Down
26 changes: 1 addition & 25 deletions packages/catalog-search/src/SearchFilters.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ import PropTypes from 'prop-types';
import { breakpoints, MediaQuery } from '@edx/paragon';

import FacetListRefinement from './FacetListRefinement';
import FacetListBase from './FacetListBase';
import CurrentRefinements from './CurrentRefinements';

import MobileFilterMenu from './MobileFilterMenu';

import { SHOW_ALL_NAME, STYLE_VARIANTS } from './data/constants';
import { STYLE_VARIANTS } from './data/constants';
import { sortItemsByLabelAsc } from './data/utils';

import { SearchContext } from './SearchContext';
Expand All @@ -20,18 +19,6 @@ export const FREE_ALL_TITLE = 'Free / All';

const SearchFilters = ({ variant }) => {
const { refinements, searchFacetFilters } = useContext(SearchContext);
const freeAllItems = useMemo(() => [
{
label: 'Free to me',
// flip the 1 to 0 or vice versa using boolean logic
// eslint-disable-next-line no-bitwise
value: refinements[SHOW_ALL_NAME] ^ 1,
},
{
label: 'All courses',
value: refinements[SHOW_ALL_NAME],
},
], [refinements[SHOW_ALL_NAME]]);

const searchFacets = useMemo(
() => {
Expand Down Expand Up @@ -60,17 +47,6 @@ const SearchFilters = ({ variant }) => {
));
return (
<>
{features.ENROLL_WITH_CODES && (
<FacetListBase
attribute={SHOW_ALL_NAME}
facetValueType="bool"
isBold
items={freeAllItems}
key={SHOW_ALL_NAME}
title={FREE_ALL_TITLE}
variant={variant}
/>
)}
{filtersFromRefinements}
{features.LEARNING_TYPE_FACET && (<LearningTypeRadioFacet />)}
</>
Expand Down