Skip to content

Contentful updates (TCO19 press release) #3217

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 18 commits into from
Aug 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
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ workflows:
filters:
branches:
only:
- develop-from-master-23may
- develop
- hot-fixes-4
# This is alternate dev env for parallel testing
- "build-test":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ exports[`Matches shallow shapshot 1`] = `
wrapper={[Function]}
/>
<img
alt=""
src="https://www.topcoder.com"
style={
Object {
Expand Down
1 change: 1 addition & 0 deletions src/server/tc-communities/tco20/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"tags": ["TCO", "TCO20"]
},
"communityId": "tco20",
"hidden": true,
"communityName": "TCO20",
"groupIds": [],
"hideSearch": true,
Expand Down
2 changes: 1 addition & 1 deletion src/shared/components/Contentful/BlogPost/BlogPost.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ function BlogPost({
{
heroImage ? (
<div className={theme.image}>
<img alt="" src={heroImage.file.url} />
<img alt={blogPost.title} src={heroImage.file.url} />
</div>
) : null
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function BlogListView({
heroImage ? (
<div className={theme.imageWrapper}>
<Link to={readMoreLink}>
<img alt="" src={heroImage.file.url} />
<img alt={blogPost.title} src={heroImage.file.url} />
</Link>
</div>
) : null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function ContentBlock({
{
background ? (
<div className={theme.image}>
<img alt="" src={background.file.url} />
<img alt={contentBlock.alt || contentBlock.name} src={background.file.url} />
</div>
) : null
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,16 @@
}

a {
color: #0d61bf !important;
color: #0d61bf;
text-decoration: underline;

&:visited {
color: #8231a9 !important;
color: #8231a9;
}

&:hover {
text-decoration: none;
color: #0d61bf;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

.container {
width: 100%;

:global {
.slider-control-bottomcenter {
z-index: 999999;
}
}
}

.singleContent {
Expand Down
2 changes: 1 addition & 1 deletion src/shared/components/Contentful/Image/Image.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export class ImageInner extends React.Component {
)}
<img
src={imageUrl}
alt=""
alt={image.alt || image.name}
style={imgStyle}
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export function MemberCardInner({
>
{ imageUrl && (
<div className={theme.imageWrapper}>
<img src={imageUrl} alt="profile" />
<img src={imageUrl} alt={`${memberName}'s profile`} />
</div>
)}
<div className={theme.info}>
Expand Down
102 changes: 87 additions & 15 deletions src/shared/components/Contentful/Menu/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import PT from 'prop-types';
import React from 'react';
import { removeTrailingSlash } from 'utils/url';
import { isActive, target } from 'utils/contentful';
import { isomorphy } from 'topcoder-react-utils';

import NavMenu from './Menu';

Expand All @@ -18,6 +19,7 @@ const THEMES = {
Default: require('./themes/default.scss'),
'TCO19 - Header Menu': require('./themes/tco19-header.scss'),
'TCO19 - Footer Menu': require('./themes/tco19-footer.scss'),
'TCO20 - Footer Menu': require('./themes/tco20-footer.scss'),
};
/* eslint-enable global-require */

Expand Down Expand Up @@ -65,23 +67,93 @@ function MenuItemsLoader(props) {
</div>
);
}
if (menuItem.fields.childRoutes && menuItem.fields.excludeFromNavigationMenus !== true && isActive(baseUrl, menuItem, 'childRoutes')) {
return (
<div className={themeToUse.submenu} key={menuItem.sys.id}>
<MenuItemsLoader
menuId={menuItem.sys.id}
ids={_.map(menuItem.fields.childRoutes, 'sys.id')}
if (menuItem.fields.childRoutes && menuItem.fields.excludeFromNavigationMenus !== true) {
if (menuItem.fields.url && menuItem.fields.url !== '/' && isActive(baseUrl, menuItem, 'childRoutes')) {
return (
<div className={themeToUse.submenu} key={menuItem.sys.id}>
<MenuItemsLoader
menuId={menuItem.sys.id}
ids={_.map(menuItem.fields.childRoutes, 'sys.id')}
preview={preview}
themeName={themeName}
theme={themeToUse}
baseUrl={target(baseUrl, menuItem)}
parentBaseUrl={baseUrl}
parentItems={_.values(data.entries.items)}
activeParentItem={menuItem}
level={level + 1}
/>
</div>
);
}
if (!menuItem.fields.url || menuItem.fields.url === '/') {
// need to load the submenu to see if it matches for the location
// this is special case when we have sub menus under root "/"" path
// all other cases are covered by above rule.

// get the current location 1st
let location = '';
if (isomorphy.isClientSide()) {
location = window.location.pathname;
location = location.toLowerCase();
location = _.replace(location, '/__community__/tco19', '');
} else {
// TODO: should probably get the current URL from the web framework
}
// When we are at home/root just load the menu directly
if (!location || location === '/') {
return (
<div className={themeToUse.submenu} key={menuItem.sys.id}>
<MenuItemsLoader
menuId={menuItem.sys.id}
ids={_.map(menuItem.fields.childRoutes, 'sys.id')}
preview={preview}
themeName={themeName}
theme={themeToUse}
baseUrl={target(baseUrl, menuItem)}
parentBaseUrl={baseUrl}
parentItems={_.values(data.entries.items)}
activeParentItem={menuItem}
level={level + 1}
/>
</div>
);
}
// In all other cases we need to load the menu items
// to check if some matches against location path
return (
<ContentfulLoader
entryIds={_.map(menuItem.fields.childRoutes, 'sys.id')}
preview={preview}
themeName={themeName}
theme={themeToUse}
baseUrl={target(baseUrl, menuItem)}
parentBaseUrl={baseUrl}
parentItems={_.values(data.entries.items)}
activeParentItem={menuItem}
level={level + 1}
spaceName={spaceName}
environment={environment}
key={menuItem.sys.id}
render={(childRoutesData) => {
const links = _.values(childRoutesData.entries.items).map(childItem => `/${childItem.fields.url}`);
if (links.some(link => location.startsWith(link))) {
return (
<div className={themeToUse.submenu} key={menuItem.sys.id}>
<MenuItemsLoader
menuId={menuItem.sys.id}
ids={_.map(menuItem.fields.childRoutes, 'sys.id')}
preview={preview}
themeName={themeName}
theme={themeToUse}
baseUrl={target(baseUrl, menuItem)}
parentBaseUrl={baseUrl}
parentItems={_.values(data.entries.items)}
activeParentItem={menuItem}
level={level + 1}
/>
</div>
);
}
return null;
}}
renderPlaceholder={LoadingIndicator}
/>
</div>
);
);
}
}
return null;
}));
Expand Down
4 changes: 4 additions & 0 deletions src/shared/components/Contentful/Menu/themes/default.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
.outerContainer {
width: 100%;

@include lg {
padding-left: 30px;
}

.menuContainer {
display: flex;
width: 100%;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
width: 100%;
background-color: $tc-black;

@include lg {
padding-left: 30px;
}

.menuContainer {
display: flex;
width: 100%;
Expand Down
60 changes: 60 additions & 0 deletions src/shared/components/Contentful/Menu/themes/tco20-footer.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
@import '~styles/mixins';

.outerContainer {
@include xs-to-sm {
margin-bottom: 1em !important;
margin-left: 35px;
}

.title {
color: #fff;
font-size: 16px;
font-weight: 700;
line-height: 25px;
text-align: left;
text-transform: uppercase;
margin-bottom: 5px;
}

.menuContainer {
display: flex;
align-items: left;

.container {
display: flex;
flex-direction: column;
list-style-type: none;
text-align: left;
padding: 0;
}
}

a.menuItemLink {
text-decoration: none;
padding: 0;

@include roboto-regular;

color: #fff;
font-size: 14px;
font-weight: 400;
line-height: 21px;
}
}

.submenu {
display: none;

.outerContainer {
margin-left: 1em;
}

.menuContainer {
display: flex;
align-items: left;

.container {
flex-direction: column !important;
}
}
}
1 change: 1 addition & 0 deletions src/shared/components/buttons/outline/tco/tco07.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
font-size: 15px !important;
font-weight: 500 !important;
background-color: #ee9e0b !important;
text-decoration: none !important;

&:hover {
background-image: none !important;
Expand Down
1 change: 1 addition & 0 deletions src/shared/components/buttons/outline/tco/tco09.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
font-weight: 500 !important;
background-color: #5f9ab4 !important;
text-transform: uppercase !important;
text-decoration: none !important;

&:hover {
background-image: none !important;
Expand Down
1 change: 1 addition & 0 deletions src/shared/components/buttons/outline/tco/tco10.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
font-size: 15px !important;
font-weight: 500 !important;
background-color: #006dea !important;
text-decoration: none !important;

&:hover {
background-image: none !important;
Expand Down
1 change: 1 addition & 0 deletions src/shared/components/buttons/outline/tco/tco11.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
font-size: 15px !important;
font-weight: 500 !important;
background-color: #00566b !important;
text-decoration: none !important;

&:hover {
background-image: none !important;
Expand Down
1 change: 1 addition & 0 deletions src/shared/components/buttons/outline/tco/tco12.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
font-size: 15px !important;
font-weight: 500 !important;
background-color: #ff8300 !important;
text-decoration: none !important;

&:hover {
background-image: none !important;
Expand Down
1 change: 1 addition & 0 deletions src/shared/components/buttons/outline/tco/tco13.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
font-weight: 500 !important;
background-color: #0e477a !important;
text-transform: uppercase !important;
text-decoration: none !important;

&:hover {
background-image: none !important;
Expand Down
1 change: 1 addition & 0 deletions src/shared/components/buttons/outline/tco/tco14.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
font-weight: 500 !important;
background-color: #43abe4 !important;
text-transform: uppercase !important;
text-decoration: none !important;

&:hover {
background-image: none !important;
Expand Down
1 change: 1 addition & 0 deletions src/shared/components/buttons/outline/tco/tco16.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
font-size: 15px !important;
font-weight: 500 !important;
background-color: #ff6000 !important;
text-decoration: none !important;

&:hover {
background-image: none !important;
Expand Down
1 change: 1 addition & 0 deletions src/shared/components/buttons/outline/tco/tco18.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
color: #fafafb !important;
font-size: 15px !important;
font-weight: 500 !important;
text-decoration: none !important;
}
1 change: 1 addition & 0 deletions src/shared/components/buttons/outline/tco/tco19-lg.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ $tco-disabled-background: #e9e9e9;
background-color: $tco-disabled-background !important;
border-radius: 20px !important;
border: none !important;
text-decoration: none !important;
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ $tco-disabled-background: #e9e9e9;
border-radius: 20px !important;
border: none !important;
color: $tc-white !important;
text-decoration: none !important;
}
1 change: 1 addition & 0 deletions src/shared/components/buttons/outline/tco/tco19-sec.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ $tco-disabled-background: #e9e9e9;
border-radius: 15px !important;
border: none !important;
color: $tc-white !important;
text-decoration: none !important;
}
Loading