Skip to content

Contentful updates #3561

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 14 commits into from
Jan 14, 2020
5 changes: 1 addition & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,17 +175,14 @@ workflows:
branches:
only:
- develop
- hot-fix
- survey_tc
- fix-groups-updates
- sort_registrations_submissions
# This is alternate dev env for parallel testing
- "build-test":
context : org-global
filters:
branches:
only:
- develop
- feature-contentful
# This is beta env for production soft releases
- "build-prod-beta":
context : org-global
Expand Down
52 changes: 46 additions & 6 deletions docs/deployment-env.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,49 @@

There are total 4 deployment environments

| S | Environment | Backend API | Purpose | URL |
| - | ------------ | ----------- | --------------------- | -------------------------------------------- |
| 1 | Development | Development | feature/fixes testing | `https://community-app.topcoder-dev.com` |
| 2 | Test | Development | feature/fixes testing | `https://test-community-app.topcoder-dev.com`|
| 3 | Beta | Production | Smoke testing only | `https://beta-community-app.topcoder.com` |
| 4 | Production | Production | Main production | `https://www.topcoder.com` |
| S | Environment | Backend API | Purpose | URL |
| - | ------------ | ----------- | ------------------------ | -------------------------------------------- |
| 1 | Development | Development | feature/fixes testing | `https://community-app.topcoder-dev.com` |
| 2 | Test | Development | feature/fixes testing | `https://test-community-app.topcoder-dev.com`|
| 3 | QA | Development | Smoke/regression testing | `https://qa-community-app.topcoder-dev.com` |
| 4 | Beta | Production | Smoke testing only | `https://beta-community-app.topcoder.com` |
| 5 | Production | Production | Main production | `https://www.topcoder.com` |


## Deploy your branch on test environments

Deploy your branch on test and development environements by making following changes.

1. Please do communicate on slack (#community-app channel) before you do that as other might be using the environemnt of testing.
2. Checkout the intended branch
3. Got to `.circleci/config.yml` and add [your-branch] under desired environement, please dont change anything under production workflow. Add branch to only one workflow.

```
workflows:
version: 2
build:
jobs:
# Development builds are executed on "new-develop" branch only.
- "build-dev":
context : org-global
filters:
branches:
only:
- develop
- [your-branch]
# This is alternate dev env for parallel testing
- "build-test":
context : org-global
filters:
branches:
only:
- develop
# This is beta env for production soft releases
- "build-prod-beta":
context : org-global
filters:
branches:
only:
- develop
```
4. Commit the changes
Binary file modified src/assets/images/img-Topcoder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 7 additions & 10 deletions src/assets/images/new-arrow-left.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 7 additions & 10 deletions src/assets/images/new-arrow-right.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: 4 additions & 18 deletions src/server/tc-communities/zurich/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,10 @@
"url": "https://www.topcoder.com"
}],
"footerText": "© Copyright Topcoder, 2019",
"menuItems": [
{
"title": "Home",
"url": "/"
}, {
"title": "How it works",
"url": "/learn"
}, {
"title": "Catalog",
"url": "/catalog"
}, {
"title": "FAQ",
"url": "/faq"
}, {
"title": "Challenges",
"url": "/challenges?communityId=zurich"
}
],
"menuItems": [{
"navigationMenu": "2rUBPkaTK3UInCz4h7GOZG",
"spaceName": "zurich"
}],
"hideSearch": true,
"newsFeed": "http://www.topcoder.com/feed",
"subdomains": ["zurich", "community-zurich"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class ContentSlider extends Component {
onKeyPress={previousSlide}
role="button"
tabIndex={0}
className={theme.control}
className={theme.controlLeft}
>
<ArrowPrev />
</a>
Expand All @@ -74,7 +74,7 @@ class ContentSlider extends Component {
onKeyPress={nextSlide}
role="button"
tabIndex={0}
className={theme.control}
className={theme.controlRight}
>
<ArrowNext />
</a>
Expand Down Expand Up @@ -109,7 +109,8 @@ ContentSlider.propTypes = {
theme: PT.shape({
container: PT.string,
content: PT.string,
control: PT.string,
controlLeft: PT.string,
controlRight: PT.string,
multiContent: PT.any,
singleContent: PT.any,
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,18 @@
width: 100%;
}

.control {
.controlLeft,
.controlRight {
border: 0;
color: white;
cursor: pointer;
display: flex;
}

.controlLeft {
margin-left: 25px;
}

.controlRight {
margin-right: 25px;
}
58 changes: 22 additions & 36 deletions src/shared/containers/Contentful/MenuLoader/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,56 +78,42 @@ class MenuLoaderContainer extends React.Component {
// eslint-disable-next-line global-require
const { TopNav, LoginNav } = require('navigation-component');
const logoToUse = !_.isEmpty(menuLogo) ? <img src={menuLogo.fields.file.url} alt="menu logo" /> : <Logo />;
const comboMenu = _.clone(config.HEADER_MENU);
comboMenu[1].subMenu = _.clone(menu[0].subMenu);
let normalizedProfile = auth.profile && _.clone(auth.profile);
if (auth.profile) {
normalizedProfile.photoURL = (_.has(auth.profile, 'photoURL') && auth.profile.photoURL !== null)
? `${config.CDN.PUBLIC}/avatar/${encodeURIComponent(auth.profile.photoURL)}?size=32` : '';
} else {
normalizedProfile = null;
}
return (
<div>
<TopNav
menu={menu}
logo={logoToUse}
currentLevel1Id={activeLevel1Id}
onChangeLevel1Id={this.handleChangeLevel1Id}
path={path}
openMore={openMore}
setOpenMore={this.handleChangeOpenMore}
loggedIn={!_.isEmpty(auth.profile)}
// profileHandle={auth.profile ? auth.profile.handle : ''}
menu={comboMenu}
rightMenu={(
<LoginNav
loggedIn={!_.isEmpty(auth.profile)}
notificationButtonState="none"
notifications={[]}
accountMenu={[
{
title: 'Settings',
href: '/settings/profile',
},
{ separator: true },
{
title: 'Help',
href: config.URL.HELP,
},
{
title: 'About Topcoder',
href: `${config.URL.BASE}/about/`,
},
{
title: 'Log Out',
href: `${config.URL.BASE}/logout`,
},
]}
accountMenu={config.ACCOUNT_MENU}
switchText={config.ACCOUNT_MENU_SWITCH_TEXT}
onSwitch={this.handleSwitchMenu}
onMenuOpen={this.handleCloseOpenMore}
showNotification={false}
profile={{
...auth.profile,
roles: auth.user ? auth.user.roles : [],
}}
authURLs={{
href: `${config.URL.AUTH}/member/registration?utm_source=community-app-main`,
location: `${config.URL.AUTH}/member?retUrl=%S&utm_source=community-app-main`,
}}
profile={normalizedProfile}
authURLs={config.HEADER_AUTH_URLS}
/>
)}
logo={logoToUse}
theme={config.HEADER_MENU_THEME}
currentLevel1Id={activeLevel1Id}
onChangeLevel1Id={this.handleChangeLevel1Id}
path={path}
openMore={openMore}
setOpenMore={this.handleChangeOpenMore}
loggedIn={!_.isEmpty(auth.profile)}
profileHandle={auth.profile ? auth.profile.handle : ''}
/>
</div>
);
Expand Down
21 changes: 12 additions & 9 deletions src/shared/routes/Communities/Zurich/Routes.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { connect } from 'react-redux';
import Error404 from 'components/Error404';
import FAQ from 'components/tc-communities/communities/zurich/FAQ';
import Footer from 'components/tc-communities/communities/zurich/Footer';
import Header from 'containers/tc-communities/Header';
import Home from 'containers/tc-communities/zurich/Home';
import Learn from 'components/tc-communities/communities/zurich/Learn';
import ContentfulRoute from 'components/Contentful/Route';
Expand All @@ -22,8 +21,8 @@ import React from 'react';
import theme from 'components/tc-communities/communities/zurich/theme';
import { ThemeProvider } from 'react-css-super-themr';
import { Route, Switch, Redirect } from 'react-router-dom';
import { config } from 'topcoder-react-utils';
import Viewport from 'components/Contentful/Viewport';
import ContentfulMenu from 'components/Contentful/Menu';

function Zurich({ base, meta, userGroups }) {
// Only members of `Requestor`|`Approver` gropus
Expand Down Expand Up @@ -65,15 +64,19 @@ function Zurich({ base, meta, userGroups }) {
path={`${base}/forbidden`}
/>
<Route
component={({ match }) => (
component={() => (
<ThemeProvider theme={theme}>
<div>
<Header
baseUrl={base}
pageId={match.params.pageId || 'home'}
hideJoinNow
logoutRedirect={config.URL.COMMUNITIES.ZURICH}
/>
{
meta.menuItems ? (
<ContentfulMenu
id={meta.menuItems[0].navigationMenu}
spaceName={meta.menuItems[0].spaceName}
environment={meta.menuItems[0].environment}
baseUrl={base}
/>
) : null
}
<Switch>
<Route
component={() => ChallengeListing({
Expand Down