diff --git a/src/components/my-career/SearchJobRole.jsx b/src/components/my-career/SearchJobRole.jsx index edf720405b..201e28227c 100644 --- a/src/components/my-career/SearchJobRole.jsx +++ b/src/components/my-career/SearchJobRole.jsx @@ -2,7 +2,7 @@ import React, { useContext, useState } from 'react'; import PropTypes from 'prop-types'; import { getConfig } from '@edx/frontend-platform/config'; import { logError } from '@edx/frontend-platform/logging'; -import { InstantSearch } from 'react-instantsearch-dom'; +import { Configure, InstantSearch } from 'react-instantsearch-dom'; import { SearchContext, deleteRefinementAction } from '@edx/frontend-enterprise-catalog-search'; import { getAuthenticatedUser } from '@edx/frontend-platform/auth'; import FacetListRefinement from '@edx/frontend-enterprise-catalog-search/FacetListRefinement'; @@ -10,7 +10,7 @@ import { camelCaseObject } from '@edx/frontend-platform/utils'; import { Button, Form, StatefulButton, } from '@edx/paragon'; -import { CURRENT_JOB_FACET } from '../skills-quiz/constants'; +import { CURRENT_JOB_FACET, JOB_FILTERS } from '../skills-quiz/constants'; import { patchProfile, fetchJobDetailsFromAlgolia } from './data/service'; import { CURRENT_JOB_PROFILE_FIELD_NAME, SAVE_BUTTON_LABELS } from './data/constants'; import { useAlgoliaSearch } from '../../utils/hooks'; @@ -90,6 +90,10 @@ const SearchJobRole = (props) => { searchClient={searchClient} >

Search for your job role

+ { const { refinements } = useContext(SearchContext); @@ -37,6 +38,7 @@ const SearchJobCard = ({ index }) => { async function fetchJobs() { setIsLoading(true); const { hits } = await index.search('', { + filters: JOB_FILTERS.JOB_SOURCE_COURSE_SKILL, facetFilters: [ jobsToFetch, ], diff --git a/src/components/skills-quiz/SkillsQuizStepper.jsx b/src/components/skills-quiz/SkillsQuizStepper.jsx index 0a1c8dee5b..f7131c344e 100644 --- a/src/components/skills-quiz/SkillsQuizStepper.jsx +++ b/src/components/skills-quiz/SkillsQuizStepper.jsx @@ -4,7 +4,7 @@ import { Button, Stepper, ModalDialog, Container, Form, Stack, } from '@edx/paragon'; import algoliasearch from 'algoliasearch/lite'; -import { InstantSearch } from 'react-instantsearch-dom'; +import { Configure, InstantSearch } from 'react-instantsearch-dom'; import { getConfig } from '@edx/frontend-platform/config'; import { SearchContext } from '@edx/frontend-enterprise-catalog-search'; import { useHistory } from 'react-router-dom'; @@ -33,6 +33,7 @@ import { STEP3, SKILLS_QUIZ_SEARCH_PAGE_MESSAGE, GOAL_DROPDOWN_DEFAULT_OPTION, + JOB_FILTERS, } from './constants'; import { SkillsContext } from './SkillsContextProvider'; import { SET_KEY_VALUE } from './data/constants'; @@ -199,6 +200,10 @@ const SkillsQuizStepper = () => { indexName={config.ALGOLIA_INDEX_NAME_JOBS} searchClient={searchClient} > +
Second, which industry describes where you work? (select one, or leave blank)
diff --git a/src/components/skills-quiz/constants.js b/src/components/skills-quiz/constants.js index da73e9430d..18094a2779 100644 --- a/src/components/skills-quiz/constants.js +++ b/src/components/skills-quiz/constants.js @@ -66,3 +66,11 @@ export const HITS_PER_PAGE = 500; export const LOADING_NO_OF_CARDS = 9; export const JOB_DESCRIPTION_DISCLAIMER = 'This job description has been created by an artificial intelligence, and should be reviewed carefully.'; + +export const JOB_SOURCE_COURSE_SKILL = 'course_skill'; +export const JOB_SOURCE_INDUSTRY = 'industry'; + +export const JOB_FILTERS = { + JOB_SOURCE_COURSE_SKILL: `job_sources:${JOB_SOURCE_COURSE_SKILL}`, + JOB_SOURCE_INDUSTRY: `job_sources:${JOB_SOURCE_INDUSTRY}`, +};