Skip to content

Commit

Permalink
feat: facet course search results by title
Browse files Browse the repository at this point in the history
Facet on the title of the program instead of the type of the program. ENT-4365
  • Loading branch information
iloveagent57 committed Apr 13, 2021
1 parent ed7716e commit ed659b4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/constants.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const FEATURE_ENROLL_WITH_CODES = 'ENROLL_WITH_CODES';
const FEATURE_LANGUAGE_FACET = 'LANGUAGE_FACET';
const FEATURE_PROGRAM_TITLES_FACET = 'PROGRAM_TITLES_FACET';

const ENTERPRISE_ADMIN = 'enterprise_admin';
const ENTERPRISE_CATALOG_ADMIN = 'enterprise_catalog_admin';
Expand All @@ -14,6 +15,7 @@ const STYLE_VARIANTS = {
export {
FEATURE_ENROLL_WITH_CODES,
FEATURE_LANGUAGE_FACET,
FEATURE_PROGRAM_TITLES_FACET,
ENTERPRISE_ADMIN,
ENTERPRISE_CATALOG_ADMIN,
ENTERPRISE_LEARNER,
Expand Down
4 changes: 4 additions & 0 deletions src/course-search/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import qs from 'query-string';
import {
FEATURE_ENROLL_WITH_CODES,
FEATURE_LANGUAGE_FACET,
FEATURE_PROGRAM_TITLES_FACET,
} from '../../constants';

const hasFeatureFlagEnabled = (featureFlag) => {
Expand All @@ -13,6 +14,9 @@ const hasFeatureFlagEnabled = (featureFlag) => {
const features = {
ENROLL_WITH_CODES: process.env.FEATURE_ENROLL_WITH_CODES || hasFeatureFlagEnabled(FEATURE_ENROLL_WITH_CODES),
LANGUAGE_FACET: process.env.FEATURE_LANGUAGE_FACET || hasFeatureFlagEnabled(FEATURE_LANGUAGE_FACET),
PROGRAM_TITLES_FACET: (
process.env.FEATURE_PROGRAM_TITLES_FACET || hasFeatureFlagEnabled(FEATURE_PROGRAM_TITLES_FACET)
),
};

// eslint-disable-next-line import/prefer-default-export
Expand Down
3 changes: 2 additions & 1 deletion src/course-search/data/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ export const SEARCH_FACET_FILTERS = [
isSortedAlphabetical: true,
},
{
attribute: 'programs',
attribute: (features.PROGRAM_TITLES_FACET ? 'program_titles' : 'programs'),
title: 'Program',
isSortedAlphabetical: true,
},
{
attribute: 'level_type',
Expand Down

0 comments on commit ed659b4

Please sign in to comment.