Skip to content

Commit 734942b

Browse files
authored
Contentful updates (TCO19 press release) (#3217)
Contentful updates (TCO19 press release)
2 parents 18ae676 + 2c3a745 commit 734942b

File tree

28 files changed

+195
-26
lines changed

28 files changed

+195
-26
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ workflows:
174174
filters:
175175
branches:
176176
only:
177-
- develop-from-master-23may
177+
- develop
178178
- hot-fixes-4
179179
# This is alternate dev env for parallel testing
180180
- "build-test":

__tests__/shared/components/Contentful/Image/__snapshots__/Image.jsx.snap

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ exports[`Matches shallow shapshot 1`] = `
2222
wrapper={[Function]}
2323
/>
2424
<img
25-
alt=""
2625
src="https://www.topcoder.com"
2726
style={
2827
Object {

src/server/tc-communities/tco20/metadata.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"tags": ["TCO", "TCO20"]
44
},
55
"communityId": "tco20",
6+
"hidden": true,
67
"communityName": "TCO20",
78
"groupIds": [],
89
"hideSearch": true,

src/shared/components/Contentful/BlogPost/BlogPost.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ function BlogPost({
7575
{
7676
heroImage ? (
7777
<div className={theme.image}>
78-
<img alt="" src={heroImage.file.url} />
78+
<img alt={blogPost.title} src={heroImage.file.url} />
7979
</div>
8080
) : null
8181
}

src/shared/components/Contentful/BlogPost/ListView/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function BlogListView({
2525
heroImage ? (
2626
<div className={theme.imageWrapper}>
2727
<Link to={readMoreLink}>
28-
<img alt="" src={heroImage.file.url} />
28+
<img alt={blogPost.title} src={heroImage.file.url} />
2929
</Link>
3030
</div>
3131
) : null

src/shared/components/Contentful/ContentBlock/ContentBlock.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ function ContentBlock({
3838
{
3939
background ? (
4040
<div className={theme.image}>
41-
<img alt="" src={background.file.url} />
41+
<img alt={contentBlock.alt || contentBlock.name} src={background.file.url} />
4242
</div>
4343
) : null
4444
}

src/shared/components/Contentful/ContentBlock/themes/general.scss

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,16 @@
8686
}
8787

8888
a {
89-
color: #0d61bf !important;
89+
color: #0d61bf;
9090
text-decoration: underline;
9191

9292
&:visited {
93-
color: #8231a9 !important;
93+
color: #8231a9;
94+
}
95+
96+
&:hover {
97+
text-decoration: none;
98+
color: #0d61bf;
9499
}
95100
}
96101

src/shared/components/Contentful/ContentSlider/themes/default.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
.container {
44
width: 100%;
5+
6+
:global {
7+
.slider-control-bottomcenter {
8+
z-index: 999999;
9+
}
10+
}
511
}
612

713
.singleContent {

src/shared/components/Contentful/Image/Image.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export class ImageInner extends React.Component {
8181
)}
8282
<img
8383
src={imageUrl}
84-
alt=""
84+
alt={image.alt || image.name}
8585
style={imgStyle}
8686
/>
8787
</div>

src/shared/components/Contentful/MemberCard/MemberCard.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export function MemberCardInner({
3535
>
3636
{ imageUrl && (
3737
<div className={theme.imageWrapper}>
38-
<img src={imageUrl} alt="profile" />
38+
<img src={imageUrl} alt={`${memberName}'s profile`} />
3939
</div>
4040
)}
4141
<div className={theme.info}>

src/shared/components/Contentful/Menu/index.jsx

Lines changed: 87 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import PT from 'prop-types';
1010
import React from 'react';
1111
import { removeTrailingSlash } from 'utils/url';
1212
import { isActive, target } from 'utils/contentful';
13+
import { isomorphy } from 'topcoder-react-utils';
1314

1415
import NavMenu from './Menu';
1516

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

@@ -65,23 +67,93 @@ function MenuItemsLoader(props) {
6567
</div>
6668
);
6769
}
68-
if (menuItem.fields.childRoutes && menuItem.fields.excludeFromNavigationMenus !== true && isActive(baseUrl, menuItem, 'childRoutes')) {
69-
return (
70-
<div className={themeToUse.submenu} key={menuItem.sys.id}>
71-
<MenuItemsLoader
72-
menuId={menuItem.sys.id}
73-
ids={_.map(menuItem.fields.childRoutes, 'sys.id')}
70+
if (menuItem.fields.childRoutes && menuItem.fields.excludeFromNavigationMenus !== true) {
71+
if (menuItem.fields.url && menuItem.fields.url !== '/' && isActive(baseUrl, menuItem, 'childRoutes')) {
72+
return (
73+
<div className={themeToUse.submenu} key={menuItem.sys.id}>
74+
<MenuItemsLoader
75+
menuId={menuItem.sys.id}
76+
ids={_.map(menuItem.fields.childRoutes, 'sys.id')}
77+
preview={preview}
78+
themeName={themeName}
79+
theme={themeToUse}
80+
baseUrl={target(baseUrl, menuItem)}
81+
parentBaseUrl={baseUrl}
82+
parentItems={_.values(data.entries.items)}
83+
activeParentItem={menuItem}
84+
level={level + 1}
85+
/>
86+
</div>
87+
);
88+
}
89+
if (!menuItem.fields.url || menuItem.fields.url === '/') {
90+
// need to load the submenu to see if it matches for the location
91+
// this is special case when we have sub menus under root "/"" path
92+
// all other cases are covered by above rule.
93+
94+
// get the current location 1st
95+
let location = '';
96+
if (isomorphy.isClientSide()) {
97+
location = window.location.pathname;
98+
location = location.toLowerCase();
99+
location = _.replace(location, '/__community__/tco19', '');
100+
} else {
101+
// TODO: should probably get the current URL from the web framework
102+
}
103+
// When we are at home/root just load the menu directly
104+
if (!location || location === '/') {
105+
return (
106+
<div className={themeToUse.submenu} key={menuItem.sys.id}>
107+
<MenuItemsLoader
108+
menuId={menuItem.sys.id}
109+
ids={_.map(menuItem.fields.childRoutes, 'sys.id')}
110+
preview={preview}
111+
themeName={themeName}
112+
theme={themeToUse}
113+
baseUrl={target(baseUrl, menuItem)}
114+
parentBaseUrl={baseUrl}
115+
parentItems={_.values(data.entries.items)}
116+
activeParentItem={menuItem}
117+
level={level + 1}
118+
/>
119+
</div>
120+
);
121+
}
122+
// In all other cases we need to load the menu items
123+
// to check if some matches against location path
124+
return (
125+
<ContentfulLoader
126+
entryIds={_.map(menuItem.fields.childRoutes, 'sys.id')}
74127
preview={preview}
75-
themeName={themeName}
76-
theme={themeToUse}
77-
baseUrl={target(baseUrl, menuItem)}
78-
parentBaseUrl={baseUrl}
79-
parentItems={_.values(data.entries.items)}
80-
activeParentItem={menuItem}
81-
level={level + 1}
128+
spaceName={spaceName}
129+
environment={environment}
130+
key={menuItem.sys.id}
131+
render={(childRoutesData) => {
132+
const links = _.values(childRoutesData.entries.items).map(childItem => `/${childItem.fields.url}`);
133+
if (links.some(link => location.startsWith(link))) {
134+
return (
135+
<div className={themeToUse.submenu} key={menuItem.sys.id}>
136+
<MenuItemsLoader
137+
menuId={menuItem.sys.id}
138+
ids={_.map(menuItem.fields.childRoutes, 'sys.id')}
139+
preview={preview}
140+
themeName={themeName}
141+
theme={themeToUse}
142+
baseUrl={target(baseUrl, menuItem)}
143+
parentBaseUrl={baseUrl}
144+
parentItems={_.values(data.entries.items)}
145+
activeParentItem={menuItem}
146+
level={level + 1}
147+
/>
148+
</div>
149+
);
150+
}
151+
return null;
152+
}}
153+
renderPlaceholder={LoadingIndicator}
82154
/>
83-
</div>
84-
);
155+
);
156+
}
85157
}
86158
return null;
87159
}));

src/shared/components/Contentful/Menu/themes/default.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
.outerContainer {
44
width: 100%;
55

6+
@include lg {
7+
padding-left: 30px;
8+
}
9+
610
.menuContainer {
711
display: flex;
812
width: 100%;

src/shared/components/Contentful/Menu/themes/tco19-header.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
width: 100%;
55
background-color: $tc-black;
66

7+
@include lg {
8+
padding-left: 30px;
9+
}
10+
711
.menuContainer {
812
display: flex;
913
width: 100%;
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
@import '~styles/mixins';
2+
3+
.outerContainer {
4+
@include xs-to-sm {
5+
margin-bottom: 1em !important;
6+
margin-left: 35px;
7+
}
8+
9+
.title {
10+
color: #fff;
11+
font-size: 16px;
12+
font-weight: 700;
13+
line-height: 25px;
14+
text-align: left;
15+
text-transform: uppercase;
16+
margin-bottom: 5px;
17+
}
18+
19+
.menuContainer {
20+
display: flex;
21+
align-items: left;
22+
23+
.container {
24+
display: flex;
25+
flex-direction: column;
26+
list-style-type: none;
27+
text-align: left;
28+
padding: 0;
29+
}
30+
}
31+
32+
a.menuItemLink {
33+
text-decoration: none;
34+
padding: 0;
35+
36+
@include roboto-regular;
37+
38+
color: #fff;
39+
font-size: 14px;
40+
font-weight: 400;
41+
line-height: 21px;
42+
}
43+
}
44+
45+
.submenu {
46+
display: none;
47+
48+
.outerContainer {
49+
margin-left: 1em;
50+
}
51+
52+
.menuContainer {
53+
display: flex;
54+
align-items: left;
55+
56+
.container {
57+
flex-direction: column !important;
58+
}
59+
}
60+
}

src/shared/components/buttons/outline/tco/tco07.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
font-size: 15px !important;
44
font-weight: 500 !important;
55
background-color: #ee9e0b !important;
6+
text-decoration: none !important;
67

78
&:hover {
89
background-image: none !important;

src/shared/components/buttons/outline/tco/tco09.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
font-weight: 500 !important;
55
background-color: #5f9ab4 !important;
66
text-transform: uppercase !important;
7+
text-decoration: none !important;
78

89
&:hover {
910
background-image: none !important;

src/shared/components/buttons/outline/tco/tco10.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
font-size: 15px !important;
44
font-weight: 500 !important;
55
background-color: #006dea !important;
6+
text-decoration: none !important;
67

78
&:hover {
89
background-image: none !important;

src/shared/components/buttons/outline/tco/tco11.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
font-size: 15px !important;
44
font-weight: 500 !important;
55
background-color: #00566b !important;
6+
text-decoration: none !important;
67

78
&:hover {
89
background-image: none !important;

src/shared/components/buttons/outline/tco/tco12.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
font-size: 15px !important;
44
font-weight: 500 !important;
55
background-color: #ff8300 !important;
6+
text-decoration: none !important;
67

78
&:hover {
89
background-image: none !important;

src/shared/components/buttons/outline/tco/tco13.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
font-weight: 500 !important;
55
background-color: #0e477a !important;
66
text-transform: uppercase !important;
7+
text-decoration: none !important;
78

89
&:hover {
910
background-image: none !important;

src/shared/components/buttons/outline/tco/tco14.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
font-weight: 500 !important;
55
background-color: #43abe4 !important;
66
text-transform: uppercase !important;
7+
text-decoration: none !important;
78

89
&:hover {
910
background-image: none !important;

src/shared/components/buttons/outline/tco/tco16.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
font-size: 15px !important;
44
font-weight: 500 !important;
55
background-color: #ff6000 !important;
6+
text-decoration: none !important;
67

78
&:hover {
89
background-image: none !important;

src/shared/components/buttons/outline/tco/tco18.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
color: #fafafb !important;
33
font-size: 15px !important;
44
font-weight: 500 !important;
5+
text-decoration: none !important;
56
}

src/shared/components/buttons/outline/tco/tco19-lg.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,5 @@ $tco-disabled-background: #e9e9e9;
2323
background-color: $tco-disabled-background !important;
2424
border-radius: 20px !important;
2525
border: none !important;
26+
text-decoration: none !important;
2627
}

src/shared/components/buttons/outline/tco/tco19-sec-lg.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,5 @@ $tco-disabled-background: #e9e9e9;
2424
border-radius: 20px !important;
2525
border: none !important;
2626
color: $tc-white !important;
27+
text-decoration: none !important;
2728
}

src/shared/components/buttons/outline/tco/tco19-sec.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,5 @@ $tco-disabled-background: #e9e9e9;
2424
border-radius: 15px !important;
2525
border: none !important;
2626
color: $tc-white !important;
27+
text-decoration: none !important;
2728
}

0 commit comments

Comments
 (0)