Skip to content

Feature/recommender sync develop #303

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

Merged
merged 22 commits into from
Mar 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
3ba0130
poc-recommender-sub-2
dedywahyudi Jan 27, 2021
9abad2e
Test Release - POC Recommender Submission 2
luizrrodrigues Jan 27, 2021
6681ad3
final fixes
nursoltan-s Jan 28, 2021
fe7ea5a
Merge pull request #296 from nursoltan-s/poc-recommender-nursoltan-s
dedywahyudi Jan 28, 2021
7b24787
fix sort by descending best score
nursoltan-s Jan 29, 2021
c6ed0f4
Merge pull request #297 from nursoltan-s/poc-recommender-nursoltan-s-1
dedywahyudi Jan 29, 2021
19aa7b0
Test Release - POC Recommender Sub 2 - Final Fixes
luizrrodrigues Jan 29, 2021
0f99535
change on json data
nursoltan-s Jan 29, 2021
3ef277e
Merge pull request #298 from nursoltan-s/nurka
dedywahyudi Jan 30, 2021
bfc370a
bug fixes
nursoltan-s Jan 30, 2021
3579710
Merge pull request #299 from nursoltan-s/nurka-2
dedywahyudi Jan 30, 2021
c5a7697
Test Release - POC Recommender Sub 2 - FF2
luizrrodrigues Jan 31, 2021
9228fd3
integrate recommendation challenges with api
nursoltan-s Feb 17, 2021
127c845
Merge pull request #300 from nursoltan-s/nursoltan/final-fixes
dedywahyudi Feb 17, 2021
a677ae6
Test Release - POC Recommender Sub 2 - FF3
luizrrodrigues Feb 18, 2021
d1936c3
fix recommender api pagination
nursoltan-s Feb 24, 2021
aea29d9
resolve merge conflict
nursoltan-s Feb 24, 2021
f8e98c2
fix cors issue
nursoltan-s Feb 24, 2021
d8efc2a
Merge pull request #302 from nursoltan-s/recommender-final-fix-api
dedywahyudi Feb 24, 2021
5669e36
Test Release - POC Recommender Sub 2 - FF4
luizrrodrigues Feb 24, 2021
8ffa5d1
Recommender sync with develop
luizrrodrigues Feb 27, 2021
5f27361
Recommender - Smoke Testing
luizrrodrigues Mar 1, 2021
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
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"lint:js": "./node_modules/.bin/eslint --ext .js,.jsx .",
"test": "npm run lint && npm run jest"
},
"version": "1.1.6",
"version": "1000.27.8",
"dependencies": {
"auth0-js": "^6.8.4",
"config": "^3.2.0",
Expand Down
38 changes: 38 additions & 0 deletions src/services/challenges.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ class ChallengesService {
totalCount: res.headers ? res.headers.get('x-total') : 0,
meta: {
allChallengesCount: res.headers ? res.headers.get('x-total') : 0,
allRecommendedChallengesCount: 0,
myChallengesCount: 0,
ongoingChallengesCount: 0,
openChallengesCount: 0,
Expand Down Expand Up @@ -527,6 +528,43 @@ class ChallengesService {
});
}

/**
* Gets challenges.
* @param {Object} filters Optional.
* @param {Object} params Optional.
* @param {String} handle user handle
* @return {Promise} Resolves to the api response.
*/
async getRecommendedChallenges(filter, handle) {
filter.frontFilter.per_page = filter.frontFilter.perPage;
delete filter.frontFilter.perPage;

const query = getFilterUrl(filter.backendFilter, filter.frontFilter);

let res = {};
let totalCount = 0;
if (_.some(filter.frontFilter.tracks, val => val)
&& !_.isEqual(filter.frontFilter.types, [])) {
const url = `/recommender-api/${handle}?${query}`;
res = await this.private.apiV5.get(url).then(checkErrorV5);
totalCount = res.headers.get('x-total') || 0;
}

const challenges = res.result ? res.result.filter(ch => ch.jaccard_index > 0) : [];
return {
challenges,
totalCount,
meta: {
allChallengesCount: totalCount,
allRecommendedChallengesCount: 0,
myChallengesCount: 0,
ongoingChallengesCount: 0,
openChallengesCount: 0,
totalCount,
},
};
}

/**
* Gets SRM matches.
* @param {Object} params
Expand Down