Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: topcoder-platform/topcoder-react-lib
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.7.16-1
Choose a base ref
...
head repository: topcoder-platform/topcoder-react-lib
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 17,035 additions and 20,417 deletions.
  1. BIN .DS_Store
  2. +3 −3 .circleci/config.yml
  3. +1 −1 .gitignore
  4. +16 −1 README.md
  5. +103 −5 __tests__/__snapshots__/index.js.snap
  6. +2 −2 __tests__/actions/__snapshots__/challenge.js.snap
  7. +12 −0 __tests__/actions/__snapshots__/lookup.js.snap
  8. +2 −0 __tests__/actions/__snapshots__/profile.js.snap
  9. +10 −7 __tests__/actions/auth.js
  10. +4 −4 __tests__/actions/challenge.js
  11. +0 −4 __tests__/actions/profile.js
  12. +230 −50 __tests__/reducers/__snapshots__/challenge.js.snap
  13. +100 −0 __tests__/reducers/__snapshots__/lookup.js.snap
  14. +5 −2 __tests__/reducers/auth.js
  15. +9 −9 __tests__/reducers/challenge.js
  16. +6 −6 __tests__/utils/challenge/filter.js
  17. +7 −0 config/default.json
  18. +4 −0 config/development.json
  19. +7 −1 config/jest/default.js
  20. +1 −1 config/jest/setup.js
  21. +4 −0 config/production.json
  22. +9 −0 config/test.js
  23. +15 −1 config/webpack/default.js
  24. +0 −1,432 dist/dev/index.js
  25. +0 −6 dist/prod/index.js
  26. +23 −7 docs/actions.challenge.md
  27. +33 −3 docs/actions.lookup.md
  28. +3 −2 docs/actions.members.md
  29. +3 −2 docs/actions.profile.md
  30. +5 −5 docs/challenge.filter.md
  31. +4 −0 docs/index.md
  32. +29 −1 docs/reducers.challenge.md
  33. +22 −9 docs/reducers.lookup.md
  34. +4 −4 docs/services.challenges.md
  35. +14 −42 docs/services.members.md
  36. +84 −0 docs/services.submissions.md
  37. +12,649 −18,117 package-lock.json
  38. +7 −5 package.json
  39. +45 −7 src/actions/auth.js
  40. +177 −45 src/actions/challenge.js
  41. +11 −0 src/actions/groups.js
  42. +6 −0 src/actions/index.js
  43. +145 −2 src/actions/lookup.js
  44. +80 −0 src/actions/member-search.js
  45. +2 −2 src/actions/member-tasks.js
  46. +125 −20 src/actions/members.js
  47. +173 −0 src/actions/notifications.js
  48. +25 −5 src/actions/profile.js
  49. +1 −1 src/actions/smp.js
  50. +1 −1 src/actions/stats.js
  51. +35 −0 src/actions/tc-academy.js
  52. +12 −12 src/actions/terms.js
  53. +1 −1 src/index.js
  54. +25 −2 src/reducers/auth.js
  55. +158 −14 src/reducers/challenge.js
  56. +1 −1 src/reducers/direct.js
  57. +8 −0 src/reducers/groups.js
  58. +9 −1 src/reducers/index.js
  59. +211 −1 src/reducers/lookup.js
  60. +245 −0 src/reducers/member-search.js
  61. +63 −8 src/reducers/members.js
  62. +254 −0 src/reducers/notifications.js
  63. +45 −0 src/reducers/profile.js
  64. +2 −2 src/reducers/reviewOpportunity.js
  65. +63 −0 src/reducers/tc-academy.js
  66. +1 −1 src/reducers/terms.js
  67. +9 −9 src/services/__mocks__/challenges.js
  68. +12 −24 src/services/api.js
  69. +512 −235 src/services/challenges.js
  70. +68 −37 src/services/groups.js
  71. +8 −0 src/services/index.js
  72. +83 −1 src/services/lookup.js
  73. +121 −0 src/services/member-search.js
  74. +155 −86 src/services/members.js
  75. +83 −0 src/services/notifications.js
  76. +52 −3 src/services/reviewOpportunities.js
  77. +124 −0 src/services/submissions.js
  78. +37 −0 src/services/tc-academy.js
  79. +44 −55 src/services/terms.js
  80. +20 −24 src/services/user-traits.js
  81. +106 −79 src/utils/challenge/filter.js
  82. +2 −0 src/utils/index.js
  83. +18 −0 src/utils/member-search.js
  84. +168 −0 src/utils/submission.js
  85. +59 −6 src/utils/tc.js
Binary file removed .DS_Store
Binary file not shown.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -15,8 +15,8 @@ jobs:
key: node-modules-{{ checksum "package-lock.json" }}
paths:
- node_modules
- run: npm test
- run: npm run build
- run: npm test
- persist_to_workspace:
root: .
paths:
@@ -29,7 +29,7 @@ jobs:
at: .
- run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
- run: npm publish

# dont change anything
workflows:
version: 2
build:
@@ -45,4 +45,4 @@ workflows:
tags:
only: /v[0-9]+(\.[0-9]+)*(-[0-9]+)?/
requires:
- test
- test
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
__coverage__
.build-info
.sass-cache
#dist
dist
node_modules
_auto_doc_
.vscode
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -6,6 +6,21 @@

The [Topcoder](https://www.topcoder.com) lib for internal ReactJS projects.

### Before create a Test Release

Add `--tag test-release` to link 31 in `.circleci/config.yml`
```
- run: npm publish --tag test-release
```

### Configuration for AV-Scan scorer review type ID

Change the property in `AV_SCAN_SCORER_REVIEW_TYPE_ID` in config.

### Configuration for AV-Scan scorer review type ID

Change the property in `PROVISIONAL_SCORING_COMPLETED_REVIEW_TYPE_ID` in config.

### Development
```shell
# Install dependencies
@@ -15,7 +30,7 @@ npm install
npm test
npm run build

# Go to other project which depends on the topcoder-react-lib, config its package.json so
# Go to other project which depends on the topcoder-react-lib, config its package.json so
# that the 'topcoder-react-lib' points to the local foler path of topcoder-react-lib:
#
# "dependencies": {
108 changes: 103 additions & 5 deletions __tests__/__snapshots__/index.js.snap
Original file line number Diff line number Diff line change
@@ -4,19 +4,26 @@ exports[`Library interface test 1`] = `
Object {
"actions": Object {
"auth": Object {
"getAuthenticatedMemberGroups": [Function],
"loadProfile": [Function],
"setTcTokenV2": [Function],
"setTcTokenV3": [Function],
},
"challenge": Object {
"dropCheckpoints": [Function],
"dropResults": [Function],
"fetchChallengeStatisticsDone": [Function],
"fetchChallengeStatisticsInit": [Function],
"fetchCheckpointsDone": [Function],
"fetchCheckpointsInit": [Function],
"getActiveChallengesCountDone": [Function],
"getActiveChallengesCountInit": [Function],
"getDetailsDone": [Function],
"getDetailsInit": [Function],
"getMmSubmissionsDone": [Function],
"getMmSubmissionsInit": [Function],
"getSubmissionInformationDone": [Function],
"getSubmissionInformationInit": [Function],
"getSubmissionsDone": [Function],
"getSubmissionsInit": [Function],
"loadResultsDone": [Function],
@@ -49,15 +56,39 @@ Object {
"dropGroups": [Function],
"getGroupsDone": [Function],
"getGroupsInit": [Function],
"getMemberGroups": [Function],
},
"looker": Object {
"getLookerDone": [Function],
},
"lookup": Object {
"getAllCountriesDone": [Function],
"getAllCountriesInit": [Function],
"getCountriesDone": [Function],
"getCountriesInit": [Function],
"getManufacturersDone": [Function],
"getManufacturersInit": [Function],
"getModelsDone": [Function],
"getModelsInit": [Function],
"getOsesDone": [Function],
"getOsesInit": [Function],
"getReviewTypesDone": [Function],
"getReviewTypesInit": [Function],
"getSkillTagsDone": [Function],
"getSkillTagsInit": [Function],
"getTypesDone": [Function],
"getTypesInit": [Function],
},
"memberSearch": Object {
"checkIfSearchTermIsATag": [Function],
"clearMemberSearch": [Function],
"loadMoreUsernames": [Function],
"memberSearchSuccess": [Function],
"resetSearchTerm": [Function],
"setSearchTag": [Function],
"setSearchTerm": [Function],
"topMemberSearchSuccess": [Function],
"usernameSearchSuccess": [Function],
},
"memberTasks": Object {
"dropAll": [Function],
@@ -84,9 +115,23 @@ Object {
"getSubtrackChallengesInit": [Function],
"getUserMarathonDone": [Function],
"getUserMarathonInit": [Function],
"getUserResourcesDone": [Function],
"getUserResourcesInit": [Function],
"getUserSrmDone": [Function],
"getUserSrmInit": [Function],
},
"notifications": Object {
"dismissChallengeNotificationsDone": [Function],
"dismissChallengeNotificationsInit": [Function],
"getNotificationsDone": [Function],
"getNotificationsInit": [Function],
"markAllNotificationAsReadDone": [Function],
"markAllNotificationAsReadInit": [Function],
"markAllNotificationAsSeenDone": [Function],
"markAllNotificationAsSeenInit": [Function],
"markNotificationAsReadDone": [Function],
"markNotificationAsReadInit": [Function],
},
"profile": Object {
"addSkillDone": [Function],
"addSkillInit": [Function],
@@ -129,7 +174,9 @@ Object {
"updatePasswordDone": [Function],
"updatePasswordInit": [Function],
"updateProfileDone": [Function],
"updateProfileDoneV5": [Function],
"updateProfileInit": [Function],
"updateProfileInitV5": [Function],
"uploadPhotoDone": [Function],
"uploadPhotoInit": [Function],
"verifyMemberNewEmailDone": [Function],
@@ -159,6 +206,10 @@ Object {
"getCommunityStatsDone": [Function],
"getCommunityStatsInit": [Function],
},
"tcAcademy": Object {
"getTcaCertificationsDone": [Function],
"getTcaCertificationsInit": [Function],
},
"terms": Object {
"agreeTermDone": [Function],
"agreeTermInit": [Function],
@@ -184,9 +235,9 @@ Object {
"setEndDate": [Function],
"setReviewOpportunityType": [Function],
"setStartDate": [Function],
"setSubtracks": [Function],
"setTags": [Function],
"setText": [Function],
"setTypes": [Function],
},
},
"errors": Object {
@@ -232,13 +283,16 @@ Object {
"groups": [Function],
"looker": [Function],
"lookup": [Function],
"memberSearch": [Function],
"memberTasks": [Function],
"members": [Function],
"mySubmissionsManagement": [Function],
"notifications": [Function],
"profile": [Function],
"reviewOpportunity": [Function],
"settings": [Function],
"stats": [Function],
"tcAcademy": [Function],
"terms": [Function],
},
"services": Object {
@@ -248,6 +302,7 @@ Object {
"getApiV2": [Function],
"getApiV3": [Function],
"getApiV4": [Function],
"getApiV5": [Function],
"getTcM2mToken": [Function],
},
"billing": Object {
@@ -259,9 +314,9 @@ Object {
"SUBMISSION_END_DATE": "submissionEndDate",
},
"default": undefined,
"getFilterUrl": [Function],
"getService": [Function],
"normalizeChallenge": [Function],
"normalizeChallengeDetails": [Function],
},
"communities": Object {
"default": undefined,
@@ -283,13 +338,30 @@ Object {
"default": undefined,
"getService": [Function],
},
"memberSearch": Object {
"default": undefined,
"getService": [Function],
},
"members": Object {
"default": undefined,
"getService": [Function],
},
"notifications": Object {
"default": undefined,
"getService": [Function],
},
"reviewOpportunities": Object {
"default": undefined,
"getReviewOpportunitiesService": [Function],
"normalizeChallenges": [Function],
},
"submissions": Object {
"default": undefined,
"getService": [Function],
},
"tcAcademy": Object {
"default": undefined,
"getService": [Function],
},
"terms": Object {
"default": undefined,
@@ -308,11 +380,36 @@ Object {
"getService": [Function],
},
},
"submission": Object {
"default": undefined,
"getFinalScore": [Function],
"getProvisionalScore": [Function],
"processMMSubmissions": [Function],
},
"tc": Object {
"CHALLENGE_STATUS": Object {
"ACTIVE": "Active",
"CANCELLED": "Cancelled",
"COMPLETED": "Completed",
"DRAFT": "Draft",
},
"COMPETITION_TRACKS": Object {
"DATA_SCIENCE": "data_science",
"DESIGN": "design",
"DEVELOP": "develop",
"DES": "Design",
"DEV": "Development",
"DS": "Data Science",
"QA": "Quality Assurance",
},
"OLD_COMPETITION_TRACKS": Object {
"DATA_SCIENCE": "DATA_SCIENCE",
"DESIGN": "DESIGN",
"DEVELOP": "DEVELOP",
"QA": "QA",
},
"OLD_SUBTRACKS": Object {
"BUG_HUNT": "BUG_HUNT",
"TESTING_COMPETITION": "TESTING_COMPETITION",
"TEST_SCENARIOS": "TEST_SCENARIOS",
"TEST_SUITES": "TEST_SUITES",
},
"REVIEW_OPPORTUNITY_TYPES": Object {
"Contest Review": "Review",
@@ -321,6 +418,7 @@ Object {
},
"getApiResponsePayload": [Function],
"getLookerApiResponsePayload": [Function],
"handleApiResponse": [Function],
},
"time": Object {
"default": undefined,
4 changes: 2 additions & 2 deletions __tests__/actions/__snapshots__/challenge.js.snap
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

exports[`challenge.fetchChallengeInit 1`] = `
Object {
"payload": "12345",
"payload": "123456789",
"type": "CHALLENGE/GET_DETAILS_INIT",
}
`;
@@ -16,7 +16,7 @@ Object {

exports[`challenge.fetchSubmissionsInit 1`] = `
Object {
"payload": "12345",
"payload": "123456789",
"type": "CHALLENGE/GET_SUBMISSIONS_INIT",
}
`;
12 changes: 12 additions & 0 deletions __tests__/actions/__snapshots__/lookup.js.snap
Original file line number Diff line number Diff line change
@@ -3,10 +3,22 @@
exports[`Module exports 1`] = `
Object {
"lookup": Object {
"getAllCountriesDone": [Function],
"getAllCountriesInit": [Function],
"getCountriesDone": [Function],
"getCountriesInit": [Function],
"getManufacturersDone": [Function],
"getManufacturersInit": [Function],
"getModelsDone": [Function],
"getModelsInit": [Function],
"getOsesDone": [Function],
"getOsesInit": [Function],
"getReviewTypesDone": [Function],
"getReviewTypesInit": [Function],
"getSkillTagsDone": [Function],
"getSkillTagsInit": [Function],
"getTypesDone": [Function],
"getTypesInit": [Function],
},
}
`;
2 changes: 2 additions & 0 deletions __tests__/actions/__snapshots__/profile.js.snap
Original file line number Diff line number Diff line change
@@ -44,7 +44,9 @@ Object {
"updatePasswordDone": [Function],
"updatePasswordInit": [Function],
"updateProfileDone": [Function],
"updateProfileDoneV5": [Function],
"updateProfileInit": [Function],
"updateProfileInitV5": [Function],
"uploadPhotoDone": [Function],
"uploadPhotoInit": [Function],
"verifyMemberNewEmailDone": [Function],
17 changes: 10 additions & 7 deletions __tests__/actions/auth.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
const MOCK_GROUPS_REQ_URL = 'https://api.topcoder-dev.com/v3/groups?memberId=12345&membershipType=user';
const MOCK_PROFILE_REQ_URL = 'https://api.topcoder-dev.com/v3/members/username12345';
const MOCK_GROUPS_REQ_URL = 'https://api.topcoder-dev.com/v5/groups?memberId=12345&membershipType=user';
const MOCK_PROFILE_REQ_URL = 'https://api.topcoder-dev.com/v5/members/username12345';

jest.mock('isomorphic-fetch', () => jest.fn(url => Promise.resolve({
ok: true,
json: () => {
let content;
switch (url) {
case MOCK_GROUPS_REQ_URL: content = ['Group1', 'Group2']; break;
case MOCK_PROFILE_REQ_URL: content = { userId: 12345 }; break;
case MOCK_GROUPS_REQ_URL:
content = ['Group1', 'Group2'];
break;
case MOCK_PROFILE_REQ_URL:
content = Promise.resolve({ userId: 12345 });
break;
default: throw new Error('Unexpected URL!');
}
return {
result: { content, status: 200 },
};
return content;
},
})));

Loading