Skip to content

Legacy tco18 as sub-community #2041

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 6 commits into from
Mar 15, 2019
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ workflows:
filters:
branches:
only:
- hot-fixes
- develop_masterscript
- legacy-tco
# This is beta env for production soft releases
- "build-prod-beta":
context : org-global
Expand All @@ -205,4 +205,4 @@ workflows:
filters:
branches:
ignore:
- develop
- develop
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ exports[`Matches shallow shapshot 1`] = `
"clearDates": "Clear Dates",
"closeDatePicker": "Close",
"dateIsSelected": [Function],
"dateIsSelectedAsEndDate": [Function],
"dateIsSelectedAsStartDate": [Function],
"dateIsUnavailable": [Function],
"enterKey": "Enter key",
"escape": "Escape key",
Expand Down
9,289 changes: 5,421 additions & 3,868 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
"tc-accounts": "git+https://github.com/appirio-tech/accounts-app.git#dev",
"topcoder-react-lib": "^0.7.8",
"topcoder-react-ui-kit": "^0.5.10",
"topcoder-react-utils": "^0.7.8",
"topcoder-react-utils": "0.7.8",
"turndown": "^4.0.2",
"url-parse": "^1.4.1",
"uuid": "^3.3.2",
Expand Down Expand Up @@ -172,7 +172,7 @@
"style-loader": "^0.21.0",
"stylelint": "^9.3.0",
"stylelint-config-standard": "^18.2.0",
"webpack": "^4.14.0",
"webpack": "4.28.4",
"webpack-cli": "^3.0.8",
"webpack-dev-middleware": "^3.1.3",
"webpack-hot-middleware": "^2.22.2",
Expand Down
55 changes: 55 additions & 0 deletions src/assets/themes/tco18/TCO18.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions src/server/tc-communities/tco18/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"challengeFilter": {
"groupIds": [],
"or": [{
"tags": ["TCO", "TCO18"]
}]
},
"communityId": "tco18",
"communityName": "TCO18",
"groupIds": [],
"hideSearch": true,
"logos": [{
"img": "/community-app-assets/themes/tco18/TCO18.svg",
"url": "https://tco18.topcoder.com"
}],
"menuItems": [{
"navigationMenu": "2UqnNygSaor5r7xZP5Dsbc"
}],
"newsFeed": "http://www.topcoder.com/feed",
"subdomains": ["tco18"],
"description": "2018 Topcoder Open. The Ultimate Programming & Design Tournament"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
/*
Theme for Header component used in TCO sites
*/
@import '~styles/mixins';
@import './mixins';

.container {
background-color: $header-color;
box-shadow: none;
min-height: 60px;
}

.logosWrap {
.logo > img {
height: 40px;
}
}

.challengeDropdown {
@include roboto-regular;

font-size: 13px;
font-weight: 700;
line-height: 25px;
color: $tc-white;
text-transform: uppercase;

:global {
.Select-menu-outer {
padding-left: 0;
padding-right: 0;
border-radius: 0 0 6px 6px;
box-shadow: 0 2px 9px 0 rgba(38, 38, 40, 0.15);

.Select-option {
@include roboto-regular;

font-size: 13px;
font-weight: 400;
line-height: 30px;
text-transform: uppercase;
color: #47474f;
padding-left: 10px;
padding-right: 20px;

&.is-selected,
&:hover {
background-color: #dcdce0;
}
}
}
}

@include lg-to-xl {
border-left: none;
padding-left: 90px;
}
}

.menuWrap {
@include lg-to-xl {
max-width: $screen-lg;
}
}

.menuWrapOpen {
@include xs-to-md {
overflow: visible;
}
}

.userWrap {
.additionalLogos {
@include xs-to-sm {
margin: 0;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/*
Common mixins for TCO19 community
*/
@import '~styles/mixins';

$header-color: $tc-black;
2 changes: 2 additions & 0 deletions src/shared/routes/Communities/Routes.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import Veterans from './Veterans';
import Wipro from './Wipro';
import Cognitive from './Cognitive';
import IoT from './iot';
import TCO18 from './TCO18';
import TCO19 from './TCO19';
import Mobile from './Mobile';
import Zurich from './Zurich';
Expand All @@ -40,6 +41,7 @@ export default function Communities({
case 'wipro': return <Wipro base={base} meta={meta} />;
case 'cognitive': return <Cognitive base={base} member={member} meta={meta} />;
case 'iot': return <IoT base={base} meta={meta} />;
case 'tco18': return <TCO18 base={base} meta={meta} />;
case 'tco19': return <TCO19 base={base} meta={meta} />;
case 'mobile': return <Mobile base={base} meta={meta} />;
default: throw new Error('Unknown community ID!');
Expand Down
67 changes: 67 additions & 0 deletions src/shared/routes/Communities/TCO18/Routes.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/**
* Routing of TCO18 Community.
*/

import ContentfulRoute from 'components/Contentful/Route';
import Error404 from 'components/Error404';
import Header from 'containers/tc-communities/Header';
import PT from 'prop-types';
import React from 'react';
import { Route, Switch } from 'react-router-dom';

import headerTheme from 'components/tc-communities/communities/tco/themes/header.scss';

export default function TCO18({ base }) {
return (
<Route
component={({ match }) => (
<div>
<Header
baseUrl={base}
pageId={match.params.pageId || 'home'}
theme={headerTheme}
/>
<Switch>
{/* Competition Rules */}
<ContentfulRoute
path={`${base}/competition-rules`}
error404={<Error404 />}
id="7ILa27AKAXfnXvxG10YuUb"
/>
{/* Tracks */}
<ContentfulRoute
path={`${base}/tracks`}
error404={<Error404 />}
id="fPxQ2U23WkkAPTEIj4WVM"
/>
{/* Regional events */}
<ContentfulRoute
path={`${base}/regional-events`}
error404={<Error404 />}
id="3g6g5UDJXDM1qMZGH2cKY1"
/>
{/* Home route */}
<ContentfulRoute
path={base || '/'}
error404={<Error404 />}
id="5MK8iGUoAy7CTwGsJ7QtIE"
/>
<Route
component={Error404}
path={`${base}/:any`}
/>
</Switch>
</div>
)}
path={`${base}/:pageId?`}
/>
);
}

TCO18.defaultProps = {
base: '',
};

TCO18.propTypes = {
base: PT.string,
};
32 changes: 32 additions & 0 deletions src/shared/routes/Communities/TCO18/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/**
* Loader for the community's code chunks.
*/

import LoadingIndicator from 'components/LoadingIndicator';
import path from 'path';
import PT from 'prop-types';
import React from 'react';
import { AppChunk, webpack } from 'topcoder-react-utils';

export default function ChunkLoader({ base, meta }) {
return (
<AppChunk
chunkName="tco18-community/chunk"
renderClientAsync={() => import(/* webpackChunkName: "tco18-community/chunk" */ './Routes')
.then(({ default: Routes }) => (
<Routes base={base} meta={meta} />
))
}
renderPlaceholder={() => <LoadingIndicator />}
renderServer={() => {
const Routes = webpack.requireWeak(path.resolve(__dirname, './Routes'));
return <Routes base={base} meta={meta} />;
}}
/>
);
}

ChunkLoader.propTypes = {
base: PT.string.isRequired,
meta: PT.shape().isRequired,
};
2 changes: 1 addition & 1 deletion src/shared/routes/Communities/TCO19/Routes.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Routing of TCO Community.
* Routing of TCO19 Community.
*/

import _ from 'lodash';
Expand Down