diff --git a/.circleci/config.yml b/.circleci/config.yml index 0e161844..e8eac28e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -28,7 +28,7 @@ jobs: - attach_workspace: at: . - run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc - - run: npm publish + - run: npm publish --tag test-release # dont change anything workflows: version: 2 diff --git a/package.json b/package.json index ba920e0d..5602136d 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "lint:js": "./node_modules/.bin/eslint --ext .js,.jsx .", "test": "npm run lint && npm run jest" }, - "version": "1.1.3", + "version": "1.1.4", "dependencies": { "auth0-js": "^6.8.4", "config": "^3.2.0", diff --git a/src/services/challenges.js b/src/services/challenges.js index 8d9268cf..bd11afed 100644 --- a/src/services/challenges.js +++ b/src/services/challenges.js @@ -174,7 +174,8 @@ class ChallengesService { filter, ) => { let res = {}; - if (_.some(filter.frontFilter.tracks, val => val)) { + if (_.some(filter.frontFilter.tracks, val => val) + && !_.isEqual(filter.frontFilter.types, [])) { const query = getFilterUrl(filter.backendFilter, filter.frontFilter); const url = `${endpoint}?${query}`; res = await this.private.apiV5.get(url).then(checkErrorV5); diff --git a/src/utils/challenge/filter.js b/src/utils/challenge/filter.js index 0728dc15..ea86826d 100644 --- a/src/utils/challenge/filter.js +++ b/src/utils/challenge/filter.js @@ -106,8 +106,8 @@ function filterByRegistrationOpen(challenge, state) { * @return {Boolean} True if opp satifies the filter */ function filterByReviewOpportunityType(opp, state) { - if (!state.reviewOpportunityType) return true; - return opp.type === state.reviewOpportunityType; + if (state.reviewOpportunityTypes.length === 0) return false; + return state.reviewOpportunityTypes.includes(opp.type); } function filterByStartDate(challenge, state) { @@ -158,10 +158,10 @@ function filterByEvents(challenge, state) { } function filterByText(challenge, state) { - if (!state.name) return true; + if (!state.search) return true; const str = `${challenge.name} ${challenge.tags} ${challenge.platforms} ${challenge.tags}` .toLowerCase(); - return str.includes(state.name.toLowerCase()); + return str.includes(state.search.toLowerCase()); } function filterByTrack(challenge, state) { @@ -447,14 +447,16 @@ export function setEndDate(state, date) { /** * Clones the state and sets the review opportunity type. * @param {Object} state - * @param {Array} reviewOpportunityType Possible values found in utils/tc REVIEW_OPPORTUNITY_TYPES + * @param {Array} reviewOpportunityTypes Possible values found in utils/tc REVIEW_OPPORTUNITY_TYPES * @return {Object} */ -export function setReviewOpportunityType(state, reviewOpportunityType) { - if (reviewOpportunityType) return { ...state, reviewOpportunityType }; - if (!state.reviewOpportunityType) return state; +export function setReviewOpportunityType(state, reviewOpportunityTypes) { + if (reviewOpportunityTypes && reviewOpportunityTypes.length) { + return { ...state, reviewOpportunityTypes }; + } + if (!state.reviewOpportunityTypes) return state; const res = _.clone(state); - delete res.reviewOpportunityType; + delete res.reviewOpportunityTypes; return res; }