Skip to content

Commit 35dd87b

Browse files
authored
Merge pull request #89 from topcoder-platform/develop
communities on dashboard, listing refactor, groups filters
2 parents ee41a5f + 3f7f7b6 commit 35dd87b

File tree

160 files changed

+8978
-4672
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

160 files changed

+8978
-4672
lines changed

__tests__/server/renderer.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
1+
/*
12
jest.setMock('react-dom/server', {
23
renderToString: () => 'RENDER',
34
});
45
56
const renderer = require('server/renderer').default;
7+
*/
68

7-
test('should not throw errors', () => {
9+
test.skip('should not throw errors', () => {
10+
/*
811
const req = {
912
url: '/',
1013
};
1114
const res = {
1215
send: () => {},
1316
};
1417
expect(() => renderer(req, res)).not.toThrow();
18+
*/
1519
});

__tests__/shared/components/examples/__snapshots__/Content.jsx.snap

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,15 @@ exports[`Matches shallow shapshot 1`] = `
234234
Community 2
235235
</Link>
236236
</li>
237+
<li>
238+
<Link
239+
replace={false}
240+
to="/my-dashboard"
241+
>
242+
Dashboard
243+
</Link>
244+
– Dashboard page.
245+
</li>
237246
</ul>
238247
<h3>
239248
Misc Examples

__tests__/shared/index.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/*
12
import React from 'react';
23
import Rnd from 'react-test-renderer/shallow';
34
@@ -6,8 +7,10 @@ const rnd = new Rnd();
67
afterAll(() => {
78
process.env.NODE_ENV = 'test';
89
});
10+
*/
911

10-
test('Snapshot match', () => {
12+
test.skip('Snapshot match', () => {
13+
/*
1114
let App = require('shared').default;
1215
rnd.render((
1316
<App />
@@ -21,4 +24,5 @@ test('Snapshot match', () => {
2124
));
2225
expect(rnd.getRenderOutput()).toMatchSnapshot();
2326
process.env.NODE_ENV = 'test';
27+
*/
2428
});

__tests__/shared/routes/index.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1+
/*
12
import React from 'react';
23
import Renderer from 'react-test-renderer/shallow';
34
import Routes from 'routes';
5+
*/
46

5-
test('Matches shallow shapshot', () => {
7+
test.skip('Matches shallow shapshot', () => {
8+
/*
69
const renderer = new Renderer();
710
renderer.render(<Routes />);
811
expect(renderer.getRenderOutput()).toMatchSnapshot();
12+
*/
913
});

config/default.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@
5151
"ONLINE_REVIEW": "https://software.topcoder-dev.com",
5252
"STUDIO": "https://studio.topcoder-dev.com",
5353
"TCO": "https://www.topcoder.com/tco",
54+
"USER_SETTINGS": "https://lc1-user-settings-service.herokuapp.com",
5455
"WIPRO": "https://wipro.topcoder.com"
55-
}
56+
},
57+
"DOMAIN": "topcoder-dev.com",
58+
"SWIFT_PROGRAM_ID": 3445,
59+
"BLOG_LOCATION": "https://www.topcoder-dev.com/feed/"
5660
}

config/webpack/default.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ module.exports = {
3232
exclude: [
3333
/node_modules\/(?!appirio-tech.*|topcoder|tc-)/,
3434
/src\/assets\/fonts/,
35+
/src\/assets\/images\/dashboard/,
3536
],
3637
loader: 'babel-loader',
3738
options: {
@@ -54,7 +55,7 @@ module.exports = {
5455
],
5556
},
5657
}, {
57-
test: /\.(gif|jpeg|jpg|png)$/,
58+
test: /\.(gif|jpeg|jpg|png|svg)$/,
5859
include: /src\/assets\/images/,
5960
loader: 'file-loader',
6061
options: {
@@ -119,6 +120,7 @@ module.exports = {
119120
/* Some isomorphic code relies on this variable to determine, whether
120121
* it is executed client- or server-side. */
121122
FRONT_END: true,
123+
DOMAIN: "'topcoder-dev.com'",
122124
},
123125
}),
124126
],

config/webpack/development.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ module.exports = webpackMerge(defaultConfig, {
1717
exclude: [
1818
/node_modules\/(?!appirio-tech.*|topcoder|tc-)/,
1919
/src\/assets\/fonts/,
20+
/src\/assets\/images\/dashboard/,
2021
],
2122
loader: 'babel-loader',
2223
options: {

docs/how-to-add-a-new-topcoder-community.md

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ To add a new community with the name **demo**, we should follow the following pr
1010
"authorizedGroupIds": [
1111
"12345"
1212
],
13-
"challengeGroupId": "12345",
14-
"challengeFilterTag": "",
13+
"challengeFilter": {
14+
"groupIds": ["12345"]
15+
},
1516
"communityId": "demo",
1617
"communitySelector": [{
1718
"label": "Demo Community",
@@ -25,6 +26,7 @@ To add a new community with the name **demo**, we should follow the following pr
2526
"redirect": "https://ios.topcoder.com/",
2627
"value": "3"
2728
}],
29+
"groupId": "12345",
2830
"leaderboardApiUrl": "https://api.topcoder.com/v4/looks/0/run/json/",
2931
"logos": [
3032
"/themes/demo/logo_topcoder_with_name.svg"
@@ -49,10 +51,28 @@ To add a new community with the name **demo**, we should follow the following pr
4951
```
5052
Its fields serve the following purposes:
5153
- `authorizedGroupIds` - *String Array* - Optional. Array of group IDs. If specified, access to the community will be restricted only to authenticated visitors, included into, at least, one of the groups listed in this array. If undefined, community will be accessible to any visitors (including non-authenticated ones).
52-
- `challengeGroupId` - *String* - Optional. ID of the group holding challenges related to this community. If undefined, challenge listing in this community will show all public challenges.
53-
- `challengeFilterTag` - *String* - Optional. If specified, and not an empty string, only challenges having this technology tag will be shown inside the community (it acts as an additional filter after the group-based filtering).
54+
- `challengeFilter` - *Object* - Challenge filter matching challenges related to the community. This object can include any options known to the `/src/utils/challenge-listing/filter.js` module, though in many cases you want to use just one of these:
55+
```js
56+
/* Matches challenges belonging to any of the groups listed by ID. */
57+
{
58+
"groupIds": ["12345"]
59+
}
60+
61+
/* Matches challenges tagged with at least one of the tags. */
62+
{
63+
"tags": ["JavaScript"]
64+
}
65+
66+
/* Matches challenges belonging to any of the groups AND tagged with
67+
* at least one of the tags. */
68+
{
69+
"groupIds": ["12345"],
70+
"tags": ["JavaScript"]
71+
}
72+
```
5473
- `communityId` - *String* - Unique ID of this community.
5574
- `communitySelector` - *Object Array* - Specifies data for the community selection dropdown inside the community header. Each object MUST HAVE `label` and `value` string fields, and MAY HAVE `redirect` field. If `redirect` field is specified, a click on that option in the dropdown will redirect user to the specified URL.
75+
- `groupId` - *String* - This value of group ID is now used to fetch community statistics. Probably, it makes sense to use this value everywhere where `authorizedGroupIds` array is used, however, at the moment, these two are independent.
5676
- `leaderboardApiUrl` - *String* - Endpoint from where the leaderboard data should be loaded.
5777
- `logo` - *String Array* - Array of image URLs to insert as logos into the left corner of community's header.
5878
- `menuItems` - *Object Array* - Specifies options for the community navigation menu (both in the header and footer). Each object MUST HAVE `title` and `url` fields. For now, `url` field should be a relative link inside the community, within the same path segment.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,11 @@
6767
"isomorphic-fetch": "^2.2.1",
6868
"jest": "^20.0.0",
6969
"jquery": "^3.2.1",
70+
"jstimezonedetect": "^1.0.6",
7071
"le_node": "^1.7.0",
7172
"lodash": "^4.17.4",
7273
"moment": "^2.18.1",
74+
"moment-timezone": "^0.5.13",
7375
"morgan": "^1.8.1",
7476
"node-sass": "^4.5.0",
7577
"optimize-css-assets-webpack-plugin": "^2.0.0",
@@ -87,6 +89,7 @@
8789
"react-redux": "^5.0.3",
8890
"react-router-dom": "^4.0.0",
8991
"react-select": "^1.0.0-rc.3",
92+
"react-slick": "^0.14.11",
9093
"react-stickynode": "^1.3.1",
9194
"react-test-renderer": "^15.4.2",
9295
"react-waypoint": "^6.0.0",

src/assets/images/Member-06.svg

Lines changed: 39 additions & 0 deletions
Loading
Lines changed: 12 additions & 0 deletions
Loading
Lines changed: 12 additions & 0 deletions
Loading
Loading
Loading
Lines changed: 10 additions & 0 deletions
Loading
Lines changed: 10 additions & 0 deletions
Loading
493 KB
Loading
Lines changed: 18 additions & 0 deletions
Loading
Lines changed: 19 additions & 0 deletions
Loading
Lines changed: 12 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)