Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add support for fetching challenge statistics#324

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
luizrrodrigues merged 12 commits intodevelopfrommm-dashboard
Dec 13, 2021
Merged
Show file tree
Hide file tree
Changes fromall 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
2 changes: 1 addition & 1 deletion.circleci/config.yml
View file
Open in desktop
Original file line numberDiff line numberDiff 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: 2 additions & 0 deletions__tests__/__snapshots__/index.js.snap
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,6 +12,8 @@ Object {
"challenge": Object {
"dropCheckpoints": [Function],
"dropResults": [Function],
"fetchChallengeStatisticsDone": [Function],
"fetchChallengeStatisticsInit": [Function],
"fetchCheckpointsDone": [Function],
"fetchCheckpointsInit": [Function],
"getActiveChallengesCountDone": [Function],
Expand Down
36 changes: 36 additions & 0 deletions__tests__/reducers/__snapshots__/challenge.js.snap
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,6 +15,7 @@ Object {
"registering": false,
"results": null,
"resultsLoadedForChallengeId": "",
"statisticsData": null,
"submissionInformation": null,
"unregistering": false,
"updatingChallengeUuid": "",
Expand All@@ -40,6 +41,7 @@ Object {
"registering": false,
"results": null,
"resultsLoadedForChallengeId": "",
"statisticsData": null,
"submissionInformation": null,
"unregistering": false,
"updatingChallengeUuid": "",
Expand All@@ -65,6 +67,7 @@ Object {
"registering": false,
"results": null,
"resultsLoadedForChallengeId": "",
"statisticsData": null,
"submissionInformation": null,
"unregistering": false,
"updatingChallengeUuid": "",
Expand All@@ -87,6 +90,7 @@ Object {
"registering": false,
"results": null,
"resultsLoadedForChallengeId": "",
"statisticsData": null,
"submissionInformation": null,
"unregistering": false,
"updatingChallengeUuid": "",
Expand DownExpand Up@@ -118,6 +122,7 @@ Object {
"registering": false,
"results": null,
"resultsLoadedForChallengeId": "",
"statisticsData": null,
"submissionInformation": null,
"unregistering": false,
"updatingChallengeUuid": "",
Expand DownExpand Up@@ -151,6 +156,7 @@ Object {
"registering": false,
"results": null,
"resultsLoadedForChallengeId": "",
"statisticsData": null,
"submissionInformation": null,
"unregistering": false,
"updatingChallengeUuid": "",
Expand DownExpand Up@@ -182,6 +188,7 @@ Object {
"registering": false,
"results": null,
"resultsLoadedForChallengeId": "",
"statisticsData": null,
"submissionInformation": null,
"unregistering": false,
"updatingChallengeUuid": "",
Expand DownExpand Up@@ -211,6 +218,7 @@ Object {
"registering": false,
"results": null,
"resultsLoadedForChallengeId": "",
"statisticsData": null,
"submissionInformation": null,
"unregistering": false,
"updatingChallengeUuid": "",
Expand DownExpand Up@@ -243,6 +251,7 @@ Object {
"registering": false,
"results": null,
"resultsLoadedForChallengeId": "",
"statisticsData": null,
"submissionInformation": null,
"unregistering": false,
"updatingChallengeUuid": "",
Expand DownExpand Up@@ -276,6 +285,7 @@ Object {
"registering": false,
"results": null,
"resultsLoadedForChallengeId": "",
"statisticsData": null,
"submissionInformation": null,
"unregistering": false,
"updatingChallengeUuid": "",
Expand DownExpand Up@@ -309,6 +319,7 @@ Object {
"registering": false,
"results": null,
"resultsLoadedForChallengeId": "",
"statisticsData": null,
"submissionInformation": null,
"unregistering": false,
"updatingChallengeUuid": "",
Expand DownExpand Up@@ -342,6 +353,7 @@ Object {
"registering": false,
"results": null,
"resultsLoadedForChallengeId": "",
"statisticsData": null,
"submissionInformation": null,
"unregistering": false,
"updatingChallengeUuid": "",
Expand DownExpand Up@@ -375,6 +387,7 @@ Object {
"registering": false,
"results": null,
"resultsLoadedForChallengeId": "",
"statisticsData": null,
"submissionInformation": null,
"unregistering": false,
"updatingChallengeUuid": "",
Expand DownExpand Up@@ -406,6 +419,7 @@ Object {
"registering": false,
"results": null,
"resultsLoadedForChallengeId": "",
"statisticsData": null,
"submissionInformation": null,
"unregistering": false,
"updatingChallengeUuid": "",
Expand DownExpand Up@@ -439,6 +453,7 @@ Object {
"registering": false,
"results": null,
"resultsLoadedForChallengeId": "",
"statisticsData": null,
"submissionInformation": null,
"unregistering": false,
"updatingChallengeUuid": "",
Expand DownExpand Up@@ -470,6 +485,7 @@ Object {
"registering": false,
"results": null,
"resultsLoadedForChallengeId": "",
"statisticsData": null,
"submissionInformation": null,
"unregistering": false,
"updatingChallengeUuid": "",
Expand DownExpand Up@@ -499,6 +515,7 @@ Object {
"registering": false,
"results": null,
"resultsLoadedForChallengeId": "",
"statisticsData": null,
"submissionInformation": null,
"unregistering": false,
"updatingChallengeUuid": "",
Expand DownExpand Up@@ -531,6 +548,7 @@ Object {
"registering": false,
"results": null,
"resultsLoadedForChallengeId": "",
"statisticsData": null,
"submissionInformation": null,
"unregistering": false,
"updatingChallengeUuid": "",
Expand All@@ -552,6 +570,7 @@ Object {
"registering": false,
"results": null,
"resultsLoadedForChallengeId": "",
"statisticsData": null,
"submissionInformation": null,
"unregistering": false,
"updatingChallengeUuid": "",
Expand All@@ -577,6 +596,7 @@ Object {
"registering": false,
"results": null,
"resultsLoadedForChallengeId": "",
"statisticsData": null,
"submissionInformation": null,
"unregistering": false,
"updatingChallengeUuid": "",
Expand All@@ -602,6 +622,7 @@ Object {
"registering": false,
"results": null,
"resultsLoadedForChallengeId": "",
"statisticsData": null,
"submissionInformation": null,
"unregistering": false,
"updatingChallengeUuid": "",
Expand All@@ -624,6 +645,7 @@ Object {
"registering": false,
"results": null,
"resultsLoadedForChallengeId": "",
"statisticsData": null,
"submissionInformation": null,
"unregistering": false,
"updatingChallengeUuid": "",
Expand DownExpand Up@@ -655,6 +677,7 @@ Object {
"registering": false,
"results": null,
"resultsLoadedForChallengeId": "",
"statisticsData": null,
"submissionInformation": null,
"unregistering": false,
"updatingChallengeUuid": "",
Expand DownExpand Up@@ -688,6 +711,7 @@ Object {
"registering": false,
"results": null,
"resultsLoadedForChallengeId": "",
"statisticsData": null,
"submissionInformation": null,
"unregistering": false,
"updatingChallengeUuid": "",
Expand DownExpand Up@@ -719,6 +743,7 @@ Object {
"registering": false,
"results": null,
"resultsLoadedForChallengeId": "",
"statisticsData": null,
"submissionInformation": null,
"unregistering": false,
"updatingChallengeUuid": "",
Expand DownExpand Up@@ -748,6 +773,7 @@ Object {
"registering": false,
"results": null,
"resultsLoadedForChallengeId": "",
"statisticsData": null,
"submissionInformation": null,
"unregistering": false,
"updatingChallengeUuid": "",
Expand DownExpand Up@@ -780,6 +806,7 @@ Object {
"registering": false,
"results": null,
"resultsLoadedForChallengeId": "",
"statisticsData": null,
"submissionInformation": null,
"unregistering": false,
"updatingChallengeUuid": "",
Expand All@@ -801,6 +828,7 @@ Object {
"registering": false,
"results": null,
"resultsLoadedForChallengeId": "",
"statisticsData": null,
"submissionInformation": null,
"unregistering": false,
"updatingChallengeUuid": "",
Expand All@@ -826,6 +854,7 @@ Object {
"registering": false,
"results": null,
"resultsLoadedForChallengeId": "",
"statisticsData": null,
"submissionInformation": null,
"unregistering": false,
"updatingChallengeUuid": "",
Expand All@@ -851,6 +880,7 @@ Object {
"registering": false,
"results": null,
"resultsLoadedForChallengeId": "",
"statisticsData": null,
"submissionInformation": null,
"unregistering": false,
"updatingChallengeUuid": "",
Expand All@@ -873,6 +903,7 @@ Object {
"registering": false,
"results": null,
"resultsLoadedForChallengeId": "",
"statisticsData": null,
"submissionInformation": null,
"unregistering": false,
"updatingChallengeUuid": "",
Expand DownExpand Up@@ -904,6 +935,7 @@ Object {
"registering": false,
"results": null,
"resultsLoadedForChallengeId": "",
"statisticsData": null,
"submissionInformation": null,
"unregistering": false,
"updatingChallengeUuid": "",
Expand DownExpand Up@@ -937,6 +969,7 @@ Object {
"registering": false,
"results": null,
"resultsLoadedForChallengeId": "",
"statisticsData": null,
"submissionInformation": null,
"unregistering": false,
"updatingChallengeUuid": "",
Expand DownExpand Up@@ -968,6 +1001,7 @@ Object {
"registering": false,
"results": null,
"resultsLoadedForChallengeId": "",
"statisticsData": null,
"submissionInformation": null,
"unregistering": false,
"updatingChallengeUuid": "",
Expand DownExpand Up@@ -997,6 +1031,7 @@ Object {
"registering": false,
"results": null,
"resultsLoadedForChallengeId": "",
"statisticsData": null,
"submissionInformation": null,
"unregistering": false,
"updatingChallengeUuid": "",
Expand DownExpand Up@@ -1029,6 +1064,7 @@ Object {
"registering": false,
"results": null,
"resultsLoadedForChallengeId": "",
"statisticsData": null,
"submissionInformation": null,
"unregistering": false,
"updatingChallengeUuid": "",
Expand Down
2 changes: 1 addition & 1 deletionpackage.json
View file
Open in desktop
Original file line numberDiff line numberDiff 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.2.2",
"version": "1000.28.6",
"dependencies": {
"auth0-js": "^6.8.4",
"config": "^3.2.0",
Expand Down
21 changes: 21 additions & 0 deletionssrc/actions/challenge.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -392,6 +392,25 @@ function getSubmissionInformationDone(challengeId, submissionId, tokenV3) {
});
}

/**
* @static
* @desc Creates an action that signals beginning of fetching challenge statistics
* @return {Action}
*/
function fetchChallengeStatisticsInit() {}

/**
* @static
* @desc Creates an action that gets challenge statistics from the backend.
* @param {String} challengeId The challenge id
* @param {String} tokenV3 Topcoder auth token v3.
* @return {Action}
*/
function fetchChallengeStatisticsDone(challengeId, tokenV3) {
const challengeService = getChallengesService(tokenV3);
return challengeService.getChallengeStatistics(challengeId);
}

export default createActions({
CHALLENGE: {
DROP_CHECKPOINTS: dropCheckpoints,
Expand All@@ -417,5 +436,7 @@ export default createActions({
GET_MM_SUBMISSIONS_DONE: getMMSubmissionsDone,
GET_SUBMISSION_INFORMATION_INIT: getSubmissionInformationInit,
GET_SUBMISSION_INFORMATION_DONE: getSubmissionInformationDone,
FETCH_CHALLENGE_STATISTICS_INIT: fetchChallengeStatisticsInit,
FETCH_CHALLENGE_STATISTICS_DONE: fetchChallengeStatisticsDone,
},
});
23 changes: 23 additions & 0 deletionssrc/reducers/challenge.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -368,6 +368,26 @@ function onGetSubmissionInformationDone(state, action) {
};
}

/**
* Handles CHALLENGE/GET_CHALLENGE_STATISTICS_DONE action.
* @param {Object} state Previous state.
* @param {Object} action Action.
*/
function onFetchChallengeStatisticsDone(state, action) {
if (action.error) {
logger.error('Failed to get challenge statistics', action.payload);
return {
...state,
statisticsData: null,
};
}

return {
...state,
statisticsData: action.payload,
};
}

/**
* Creates a new Challenge reducer with the specified initial state.
* @param {Object} initialState Optional. Initial state.
Expand DownExpand Up@@ -411,6 +431,8 @@ function create(initialState) {
[a.getActiveChallengesCountDone]: onGetActiveChallengesCountDone,
[a.getSubmissionInformationInit]: onGetSubmissionInformationInit,
[a.getSubmissionInformationDone]: onGetSubmissionInformationDone,
[a.fetchChallengeStatisticsInit]: state => state,
[a.fetchChallengeStatisticsDone]: onFetchChallengeStatisticsDone,
}, _.defaults(initialState, {
details: null,
loadingCheckpoints: false,
Expand All@@ -427,6 +449,7 @@ function create(initialState) {
updatingChallengeUuid: '',
mmSubmissions: [],
submissionInformation: null,
statisticsData: null,
}));
}

Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp