Skip to content

Commit b9c0511

Browse files
committed
Init Comecast
1 parent bdcbd19 commit b9c0511

File tree

8 files changed

+235
-0
lines changed

8 files changed

+235
-0
lines changed

config/custom-environment-variables.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,13 @@ module.exports = {
6363
PREVIEW_API_KEY: 'CONTENTFUL_EDU_PREVIEW_API_KEY',
6464
},
6565
},
66+
comcast: {
67+
SPACE_ID: 'CONTENTFUL_COMCAST_SPACE_ID',
68+
master: {
69+
CDN_API_KEY: 'CONTENTFUL_COMCAST_CDN_API_KEY',
70+
PREVIEW_API_KEY: 'CONTENTFUL_COMCAST_PREVIEW_API_KEY',
71+
},
72+
},
6673
},
6774

6875
MAILCHIMP: {

config/default.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,13 @@ module.exports = {
213213
PREVIEW_API_KEY: '',
214214
},
215215
},
216+
comcast: {
217+
SPACE_ID: '',
218+
master: {
219+
CDN_API_KEY: '',
220+
PREVIEW_API_KEY: '',
221+
},
222+
},
216223
},
217224

218225
MAILCHIMP: {
Loading
Lines changed: 29 additions & 0 deletions
Loading
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"authorizedGroupIds": [
3+
"20000867"
4+
],
5+
"challengeFilter": {
6+
"groupIds": ["20000867"],
7+
"or": [{
8+
"tags": ["Comcast"]
9+
}]
10+
},
11+
"communityId": "comcast",
12+
"communityName": "Comcast Community",
13+
"groupIds": ["20000867"],
14+
"hideSearch": true,
15+
"logos": [{
16+
"img": "/community-app-assets/themes/comcast/corporate_Official-Comcast-Logo.png",
17+
"url": "https://www.comcast.com"
18+
}, {
19+
"img": "/community-app-assets/themes/comcast/logo_topcoder_with_name.svg",
20+
"url": "https://www.topcoder.com"
21+
}],
22+
"footerText": "© Copyright Topcoder, 2020",
23+
"menuItems": [
24+
{
25+
"title": "Home",
26+
"url": "/"
27+
}, {
28+
"title": "Explore",
29+
"url": "/explore"
30+
}, {
31+
"title": "Work",
32+
"url": "/work"
33+
}, {
34+
"title": "Learn",
35+
"url": "https://www.topcoder.com/thrive"
36+
}, {
37+
"title": "Give Back",
38+
"url": "/give-back"
39+
}
40+
],
41+
"newsFeed": "https://www.topcoder.com/feed",
42+
"subdomains": ["comcast"],
43+
"description": "Comcast community.",
44+
"image":"wipro.jpg",
45+
"accessDeniedPage": {
46+
"viewportId": "1Ti0R9nk1uH0nLjmxTvjzo",
47+
"spaceName": "comcast"
48+
}
49+
}
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
/**
2+
* Routing of Wipro Community.
3+
*/
4+
5+
import ChallengeDetails from 'routes/ChallengeDetails';
6+
import ChallengeListing from 'routes/Communities/ChallengeListing';
7+
import Error404 from 'components/Error404';
8+
import Footer from 'components/tc-communities/communities/cs/Footer';
9+
import Header from 'containers/tc-communities/Header';
10+
import PT from 'prop-types';
11+
import React from 'react';
12+
import Submission from 'routes/Submission';
13+
import SubmissionManagement from 'routes/SubmissionManagement';
14+
import TermsDetail from 'routes/TermsDetail';
15+
import Profile from 'routes/Profile';
16+
import ProfileStats from 'routes/ProfileStats';
17+
import Settings from 'routes/Settings';
18+
import theme from 'components/tc-communities/communities/cs/theme';
19+
import { ThemeProvider } from 'react-css-super-themr';
20+
import { Route, Switch } from 'react-router-dom';
21+
import ContentfulRoute from 'components/Contentful/Route';
22+
23+
export default function CS({ base, meta }) {
24+
return (
25+
<Route
26+
component={({ match }) => (
27+
<ThemeProvider theme={theme}>
28+
<div>
29+
<Header
30+
baseUrl={base}
31+
pageId={match.params.pageId || 'home'}
32+
/>
33+
<Switch>
34+
<Route
35+
component={() => ChallengeListing({
36+
challengesUrl: `${base}/challenges`,
37+
listingOnly: true,
38+
meta,
39+
newChallengeDetails: true,
40+
})}
41+
exact
42+
path={`${base}/work`}
43+
/>
44+
<Route
45+
component={routeProps => ChallengeDetails({
46+
...routeProps,
47+
challengesUrl: `${base}/challenges`,
48+
communityId: meta.communityId,
49+
})}
50+
exact
51+
path={`${base}/work/:challengeId(\\d{8}|\\d{5})`}
52+
/>
53+
<Route
54+
component={routeProps => Submission({
55+
...routeProps,
56+
challengesUrl: `${base}/challenges`,
57+
})}
58+
exact
59+
path={`${base}/work/:challengeId(\\d{8}|\\d{5})/submit`}
60+
/>
61+
<Route
62+
component={routeProps => SubmissionManagement({
63+
...routeProps,
64+
challengesUrl: `${base}/challenges`,
65+
})}
66+
exact
67+
path={`${base}/work/:challengeId(\\d{8}|\\d{5})/my-submissions`}
68+
/>
69+
<Route
70+
component={TermsDetail}
71+
exact
72+
path={`${base}/work/terms/detail/:termId`}
73+
/>
74+
<Route
75+
render={props => <Profile {...props} meta={meta} />}
76+
exact
77+
path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})`}
78+
/>
79+
<Route
80+
render={props => <ProfileStats {...props} meta={meta} />}
81+
exact
82+
path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})/details`}
83+
/>
84+
<Route
85+
component={() => <Settings base={`${base}/settings`} />}
86+
path={`${base}/settings`}
87+
/>
88+
<ContentfulRoute
89+
baseUrl={base}
90+
error404={<Error404 />}
91+
id="4IwQmbAv9qgW4vEiIHjahD"
92+
spaceName="comcast"
93+
/>
94+
</Switch>
95+
<Footer />
96+
</div>
97+
</ThemeProvider>
98+
)}
99+
path={`${base}/:pageId?`}
100+
/>
101+
);
102+
}
103+
104+
CS.defaultProps = {
105+
base: '',
106+
};
107+
108+
CS.propTypes = {
109+
base: PT.string,
110+
meta: PT.shape().isRequired,
111+
};
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/**
2+
* Loader for the community's code chunks.
3+
*/
4+
5+
import LoadingIndicator from 'components/LoadingIndicator';
6+
import path from 'path';
7+
import PT from 'prop-types';
8+
import React from 'react';
9+
import { AppChunk, webpack } from 'topcoder-react-utils';
10+
11+
export default function ChunkLoader({ base, meta }) {
12+
return (
13+
<AppChunk
14+
chunkName="cs-community/chunk"
15+
renderClientAsync={() => import(/* webpackChunkName: "comcast-community/chunk" */ './Routes')
16+
.then(({ default: Routes }) => <Routes base={base} meta={meta} />)
17+
}
18+
renderPlaceholder={() => <LoadingIndicator />}
19+
renderServer={() => {
20+
const Routes = webpack.requireWeak(path.resolve(__dirname, './Routes'));
21+
return <Routes base={base} meta={meta} />;
22+
}}
23+
/>
24+
);
25+
}
26+
27+
ChunkLoader.propTypes = {
28+
base: PT.string.isRequired,
29+
meta: PT.shape().isRequired,
30+
};

src/shared/routes/Communities/Routes.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import tco19 from './TCO19';
3939
import tco20 from './TCO20';
4040
import Mobile from './Mobile';
4141
import Zurich from './Zurich';
42+
import Comcast from './Comcast';
4243

4344
const TCOs = {
4445
tco01,
@@ -81,6 +82,7 @@ export default function Communities({
8182
case 'cognitive': return <Cognitive base={base} member={member} meta={meta} />;
8283
case 'iot': return <IoT base={base} meta={meta} />;
8384
case 'mobile': return <Mobile base={base} meta={meta} />;
85+
case 'comcast': return <Comcast base={base} meta={meta} />;
8486
default:
8587
// to avoid listing all TCOs we use defaut switch with a check
8688
if (TCOs[communityId]) {

0 commit comments

Comments
 (0)