Skip to content

Commit c7e17cf

Browse files
Merge branch 'develop' into milestone-20200924
2 parents 418fa85 + f3e8601 commit c7e17cf

File tree

30 files changed

+241
-72
lines changed

30 files changed

+241
-72
lines changed

.circleci/config.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,14 +239,13 @@ workflows:
239239
branches:
240240
only:
241241
- feature-contentful
242-
- hot-fix
243242
# This is alternate dev env for parallel testing
244243
- "build-qa":
245244
context : org-global
246245
filters:
247246
branches:
248247
only:
249-
- hot-fix
248+
- community-app-tests-poc
250249
# This is beta env for production soft releases
251250
- "build-prod-beta":
252251
context : org-global
@@ -261,7 +260,6 @@ workflows:
261260
filters:
262261
branches:
263262
only:
264-
- milestone-20200924
265263
- develop
266264
# Production builds are exectuted
267265
# when PR is merged to the master

__tests__/shared/components/ChallengeTile/__snapshots__/index.jsx.snap

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,12 +202,15 @@ exports[`renders marathon 1`] = `
202202
className="src-shared-components-ChallengeTile-___style__completed-challenge___3w5tT"
203203
>
204204
<header>
205-
<a
205+
<Link
206206
className="src-shared-components-ChallengeTile-___style__name___1jF7j"
207-
href="https://community.topcoder.com/longcontest/stats/?module=ViewOverview&rd=17153"
207+
replace={false}
208+
to="/challenges/15404"
208209
>
209-
2018 TCO Marathon
210-
</a>
210+
<span>
211+
2018 TCO Marathon
212+
</span>
213+
</Link>
211214
<p
212215
className="src-shared-components-ChallengeTile-___style__subtrack-color___2AJaw"
213216
>

config/default.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,4 +410,5 @@ module.exports = {
410410
TC_EDU_SEARCH_BAR_MAX_RESULTS_EACH_GROUP: 3,
411411
POLICY_PAGES_PATH: '/policy',
412412
GIGS_PAGES_PATH: '/gigs',
413+
START_PAGE_PATH: '/start',
413414
};

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@
137137
"tc-accounts": "git+https://github.com/appirio-tech/accounts-app.git#dev",
138138
"tc-core-library-js": "github:appirio-tech/tc-core-library-js#v2.6.3",
139139
"tc-ui": "^1.0.12",
140-
"topcoder-react-lib": "1.0.4",
140+
"topcoder-react-lib": "1000.22.7",
141141
"topcoder-react-ui-kit": "1000.1.0",
142142
"topcoder-react-utils": "0.7.8",
143143
"turndown": "^4.0.2",

src/assets/images/gig-blob.svg

Lines changed: 23 additions & 0 deletions
Loading

src/assets/images/img-gig-work.png

254 KB
Loading

src/shared/components/ChallengeTile/index.jsx

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
* Challenge tile.
33
*/
44
/* eslint-env browser */
5-
import _ from 'lodash';
65
import React from 'react';
76
import PT from 'prop-types';
87
import { Link } from 'react-router-dom';
@@ -83,36 +82,27 @@ class ChallengeTile extends React.Component {
8382
margin: '10px 5px',
8483
};
8584

86-
const isDataScience = track === COMPETITION_TRACKS.DATA_SCIENCE;
8785
const isDevelopment = track === COMPETITION_TRACKS.DEVELOP;
8886
const isDesign = track === COMPETITION_TRACKS.DESIGN;
8987

90-
const roundId = isDataScience ? _.get(challenge, 'rounds.0.id') : 0;
91-
9288
return (
9389
<div styleName="challenge tile" style={extraStyle}>
9490
<div styleName={outStyleName}>
9591
<div styleName="completed-challenge">
9692
<header>
97-
{ !isDataScience && (!challenge.isPrivate
93+
{ !challenge.isPrivate
9894
? (
9995
<Link to={`/challenges/${challenge.id}`} styleName="name">
10096
<span>
10197
{ challenge.name }
10298
</span>
10399
</Link>
104-
) : (
100+
)
101+
: (
105102
<span>
106103
{ challenge.name }
107104
</span>
108-
)) }
109-
110-
{ isDataScience
111-
&& (
112-
<a styleName="name" href={`https://community.topcoder.com/longcontest/stats/?module=ViewOverview&rd=${roundId}`}>
113-
{ challenge.name }
114-
</a>
115-
) }
105+
)}
116106

117107
<p styleName="subtrack-color">
118108
{underscoreReplace(type)}

src/shared/components/Contentful/Article/Article.jsx

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ import LoadingIndicator from 'components/LoadingIndicator';
1515
import YouTubeVideo from 'components/YouTubeVideo';
1616
import moment from 'moment';
1717
import localStorage from 'localStorage';
18-
import { config, Link, isomorphy } from 'topcoder-react-utils';
18+
import { Helmet } from 'react-helmet';
19+
import {
20+
config, Link, isomorphy,
21+
} from 'topcoder-react-utils';
1922
import qs from 'qs';
2023
// SVGs and assets
2124
import GestureIcon from 'assets/images/icon-gesture.svg';
@@ -110,9 +113,27 @@ export default class Article extends React.Component {
110113
if (isomorphy.isClientSide()) {
111114
shareUrl = encodeURIComponent(window.location.href);
112115
}
116+
const description = htmlToText.fromString(
117+
ReactDOMServer.renderToString(markdown(fields.content)),
118+
{
119+
ignoreHref: true,
120+
ignoreImage: true,
121+
singleNewLineParagraphs: true,
122+
uppercaseHeadings: false,
123+
},
124+
).substring(0, CONTENT_PREVIEW_LENGTH);
113125

114126
return (
115127
<React.Fragment>
128+
<Helmet>
129+
<title>{fields.title}</title>
130+
<meta name="title" property="og:title" content={fields.title} />
131+
<meta name="description" property="og:description" content={description} />
132+
<meta name="description" property="description" content={description} />
133+
<meta name="twitter:description" content={description} />
134+
<meta name="image" property="og:image" content={fields.featuredImage ? `https:${subData.assets.items[fields.featuredImage.sys.id].fields.file.url}` : null} />
135+
<meta name="twitter:image" content={fields.featuredImage ? `https:${subData.assets.items[fields.featuredImage.sys.id].fields.file.url}` : null} />
136+
</Helmet>
116137
{/* Banner */}
117138
{
118139
fields.featuredImage ? (

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { errors } from 'topcoder-react-lib';
1414
import { themr } from 'react-css-super-themr';
1515
import classnames from 'classnames';
1616

17+
import defaultModalTheme from 'components/Leaderboard/ChallengeHistoryModal/styles.scss';
1718
import defaultStyle from './style.scss';
1819

1920
const { fireErrorMessage } = errors;
@@ -102,7 +103,10 @@ class ContentfulModal extends React.Component {
102103
className: classnames(theme.modalTrigger, child.props.className),
103104
}))}
104105
{isOpen && (
105-
<Modal onCancel={this.onCloseModal}>
106+
<Modal
107+
onCancel={this.onCloseModal}
108+
theme={defaultModalTheme}
109+
>
106110
<div
107111
className={theme.dismissButton}
108112
onClick={this.onCloseModal}

src/shared/components/Contentful/SearchBar/SearchBar.jsx

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export class SearchBarInner extends Component {
5656
this.getSuggestionList = this.getSuggestionList.bind(this);
5757
this.handleSearchChange = this.handleSearchChange.bind(this);
5858
this.handleClickOutside = this.handleClickOutside.bind(this);
59+
this.onKeyDown = this.onKeyDown.bind(this);
5960
// using debounce to avoid processing or requesting too much
6061
this.updateSuggestionListWithNewSearch = _.debounce(
6162
this.updateSuggestionListWithNewSearch.bind(this), 400,
@@ -71,6 +72,29 @@ export class SearchBarInner extends Component {
7172
document.removeEventListener('mousedown', this.handleClickOutside);
7273
}
7374

75+
onKeyDown(e) {
76+
const { inputlVal, selectedFilter } = this.state;
77+
if (inputlVal && e.which === 13) {
78+
const searchQuery = {};
79+
if (this.searchFieldRef && this.searchFieldRef.value) {
80+
if (selectedFilter.name === 'Tags') {
81+
searchQuery.tags = [this.searchFieldRef.value];
82+
}
83+
if (selectedFilter.name === 'All') {
84+
searchQuery.phrase = this.searchFieldRef.value;
85+
}
86+
if (selectedFilter.name === 'Title') {
87+
searchQuery.title = this.searchFieldRef.value;
88+
}
89+
}
90+
if (selectedFilter.name !== 'Author') {
91+
window.location.href = `${config.TC_EDU_BASE_PATH}${config.TC_EDU_SEARCH_PATH}?${qs.stringify(searchQuery)}`;
92+
} else {
93+
window.location.href = `${config.TC_EDU_BASE_PATH}${config.TC_EDU_SEARCH_PATH}?author=${inputlVal}`;
94+
}
95+
}
96+
}
97+
7498
/**
7599
* Set the search field ref
76100
*/
@@ -136,6 +160,7 @@ export class SearchBarInner extends Component {
136160
isShowSuggestion,
137161
suggestionList,
138162
selectedFilter,
163+
noResults,
139164
} = this.state;
140165

141166
const searchQuery = {};
@@ -151,7 +176,8 @@ export class SearchBarInner extends Component {
151176
}
152177
}
153178

154-
return (suggestionList && !_.isEmpty(suggestionList) && isShowSuggestion && (
179+
// eslint-disable-next-line no-nested-ternary
180+
return suggestionList && !_.isEmpty(suggestionList) && isShowSuggestion ? (
155181
<div
156182
className={theme['popup-search-result']}
157183
ref={this.setPopupSearchResultRef}
@@ -319,7 +345,14 @@ export class SearchBarInner extends Component {
319345
) : null
320346
}
321347
</div>
322-
));
348+
) : noResults ? (
349+
<div
350+
className={theme['popup-search-result']}
351+
ref={this.setPopupSearchResultRef}
352+
>
353+
<span>No Results</span>
354+
</div>
355+
) : null;
323356
}
324357

325358
handleClickOutside(e) {
@@ -379,23 +412,26 @@ export class SearchBarInner extends Component {
379412
.then((results) => {
380413
// Nothing found?
381414
if (!results.total) {
382-
this.setState({ suggestionList: {} });
415+
this.setState({
416+
suggestionList: {},
417+
noResults: true,
418+
});
383419
return;
384420
}
385421
// Author query?
386422
if (selectedFilter.name === 'Author') {
387423
const suggestionList = {
388424
Author: _.map(results.items, item => ({ ...item.fields })),
389425
};
390-
this.setState({ suggestionList });
426+
this.setState({ suggestionList, noResults: false });
391427
return;
392428
}
393429
// ALL && Tags
394430
const suggestionList = this.groupResults(results);
395431
this.setState({ suggestionList });
396432
});
397433
} else {
398-
this.setState({ suggestionList: {} });
434+
this.setState({ suggestionList: {}, noResults: false });
399435
}
400436
}
401437

@@ -419,6 +455,7 @@ export class SearchBarInner extends Component {
419455
contentAuthor: contentAuthor.fields,
420456
externalArticle: fields.externalArticle,
421457
contentUrl: fields.contentUrl,
458+
slug: fields.slug,
422459
};
423460
}),
424461
'type',
@@ -471,6 +508,7 @@ export class SearchBarInner extends Component {
471508
document.addEventListener('mousedown', this.handleClickOutside);
472509
}}
473510
onChange={this.handleSearchChange}
511+
onKeyDown={this.onKeyDown}
474512
/>
475513
<div className={theme.dropdown}>
476514
<button

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,10 @@ $link-color: #0d61bf;
156156
overflow-y: auto;
157157
box-shadow: 0 25px 50px 0 rgba(0, 0, 0, 0.15);
158158
z-index: 999;
159+
160+
> span {
161+
margin-left: 15px;
162+
}
159163
}
160164

161165
.icon-search {

src/shared/components/GUIKit/JobListCard/style.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
}
5050

5151
&:first-child {
52-
width: 200px;
52+
width: 250px;
5353
}
5454

5555
&:nth-child(2) {

src/shared/components/Gigs/GigDetails.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ export default function GigDetails(props) {
137137
</li>
138138
<li>
139139
<img src={iconLabel2} alt="label 2" />
140-
<div><strong>Subscribe to our <a target="_blank" rel="noreferrer" href="https://www.topcoder.com/community/taas">Gig notifications email.</a>.</strong> We’ll send you a weekly update on gigs available so you don’t miss a beat.</div>
140+
<div><strong>Subscribe to our <a target="_blank" rel="noreferrer" href="https://www.topcoder.com/community/taas">Gig notifications email</a>.</strong> We’ll send you a weekly update on gigs available so you don’t miss a beat.</div>
141141
</li>
142142
<li>
143143
<img src={iconLabel3} alt="label 3" />

src/shared/components/Gigs/style.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@
142142

143143
img {
144144
margin-right: 16px;
145+
min-width: 40px;
145146
}
146147

147148
&:last-child {
@@ -163,6 +164,7 @@
163164
font-weight: 600;
164165
font-family: Barlow, sans-serif;
165166
margin-top: 20px;
167+
line-height: 20px;
166168
}
167169
}
168170

@@ -189,6 +191,7 @@
189191
.skills {
190192
display: flex;
191193
align-items: center;
194+
line-height: 21px;
192195
/* stylelint-disable */
193196
img {
194197
margin-right: 8px;

0 commit comments

Comments
 (0)