Skip to content

Commit e5b3f5e

Browse files
Merge pull request #5767 from topcoder-platform/thrive-spooky1-p0-2
Thrive spooky1 p0 2
2 parents eff97d5 + 8aae361 commit e5b3f5e

File tree

10 files changed

+36
-24
lines changed

10 files changed

+36
-24
lines changed

.circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ workflows:
363363
filters:
364364
branches:
365365
only:
366-
- free
366+
- thrive-spooky1-p0-2
367367
# This is stage env for production QA releases
368368
- "build-prod-staging":
369369
context : org-global

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -82,19 +82,19 @@ exports[`Default render 1`] = `
8282
"title": "Competitive Programming",
8383
},
8484
Object {
85-
"href": "/thrive/tracks?track=Data%20Science&tax=",
85+
"href": "/thrive/tracks?track=Data%20Science",
8686
"title": "Data Science",
8787
},
8888
Object {
89-
"href": "/thrive/tracks?track=Design&tax=",
89+
"href": "/thrive/tracks?track=Design",
9090
"title": "Design",
9191
},
9292
Object {
93-
"href": "/thrive/tracks?track=Development&tax=",
93+
"href": "/thrive/tracks?track=Development",
9494
"title": "Development",
9595
},
9696
Object {
97-
"href": "/thrive/tracks?track=QA&tax=",
97+
"href": "/thrive/tracks?track=QA",
9898
"title": "QA",
9999
},
100100
],

config/default.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -358,19 +358,19 @@ module.exports = {
358358
},
359359
{
360360
title: 'Data Science',
361-
href: '/thrive/tracks?track=Data%20Science&tax=',
361+
href: '/thrive/tracks?track=Data%20Science',
362362
},
363363
{
364364
title: 'Design',
365-
href: '/thrive/tracks?track=Design&tax=',
365+
href: '/thrive/tracks?track=Design',
366366
},
367367
{
368368
title: 'Development',
369-
href: '/thrive/tracks?track=Development&tax=',
369+
href: '/thrive/tracks?track=Development',
370370
},
371371
{
372372
title: 'QA',
373-
href: '/thrive/tracks?track=QA&tax=',
373+
href: '/thrive/tracks?track=QA',
374374
},
375375
],
376376
},

config/production.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -139,19 +139,19 @@ module.exports = {
139139
},
140140
{
141141
title: 'Data Science',
142-
href: '/thrive/tracks?track=Data%20Science&tax=',
142+
href: '/thrive/tracks?track=Data%20Science',
143143
},
144144
{
145145
title: 'Design',
146-
href: '/thrive/tracks?track=Design&tax=',
146+
href: '/thrive/tracks?track=Design',
147147
},
148148
{
149149
title: 'Development',
150-
href: '/thrive/tracks?track=Development&tax=',
150+
href: '/thrive/tracks?track=Development',
151151
},
152152
{
153153
title: 'QA',
154-
href: '/thrive/tracks?track=QA&tax=',
154+
href: '/thrive/tracks?track=QA',
155155
},
156156
],
157157
},

src/server/services/contentful.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,9 @@ class ApiService {
134134
* @return {Promise}
135135
*/
136136
async queryEntries(query) {
137-
const res = await this.client.getEntries(query);
137+
const decode = o => _.mapValues(o, prop => (typeof prop === 'object' ? decode(prop) : decodeURIComponent(prop)));
138+
const decoded = decode(query);
139+
const res = await this.client.getEntries(decoded);
138140
return res.stringifySafe ? JSON.parse(res.stringifySafe()) : res;
139141
}
140142
}

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

+2-3
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,8 @@
139139

140140
.catsContainer {
141141
display: flex;
142-
justify-content: flex-start;
143-
align-items: center;
144-
flex-wrap: wrap;
142+
flex-direction: column;
143+
align-items: flex-start;
145144
border-left: 3px solid #e9e9e9;
146145
padding-left: 7px;
147146
margin-bottom: 5px;

src/shared/components/Contentful/ArticleCard/themes/video.scss

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
min-height: 217px;
1010
display: flex;
1111
flex-direction: column;
12+
cursor: pointer;
1213

1314
@include xs-to-sm {
1415
margin: auto;

src/shared/components/Contentful/SearchPageFilter/FilterAuthor/themes/default.scss

+4
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ $text-black: #2a2a2a;
8787
align-items: center;
8888
width: 100%;
8989
justify-content: flex-start;
90+
91+
&:last-child {
92+
height: auto;
93+
}
9094
}
9195

9296
span {

src/shared/containers/EDU/Search.jsx

+9-3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { updateQuery } from 'utils/url';
1313
import qs from 'qs';
1414
import LoadingIndicator from 'components/LoadingIndicator';
1515
import SearchPageFilter from 'components/Contentful/SearchPageFilter/SearchPageFilter';
16+
import moment from 'moment';
1617
// Partials
1718
import ResultTabs from './partials/ResultTabs';
1819
// CSS
@@ -66,8 +67,8 @@ export default class EDUSearch extends React.Component {
6667
const queryUpdate = {
6768
author: filterState.selectedAuthor,
6869
tags: filterState.tags,
69-
startDate: filterState.startDate.format('YYYY-MM-DD'),
70-
endDate: filterState.endDate.format('YYYY-MM-DD'),
70+
startDate: filterState.startDate instanceof moment ? filterState.startDate.format('YYYY-MM-DD') : moment(filterState.startDate).format('YYYY-MM-DD'),
71+
endDate: filterState.endDate instanceof moment ? filterState.endDate.format('YYYY-MM-DD') : moment(filterState.endDate).format('YYYY-MM-DD'),
7172
track: filterState.selectedCategory ? filterState.selectedCategory.title : null,
7273
tax: filterState.selectedCategory ? _.map(
7374
_.filter(filterState.selectedCategory.items, item => item.selected),
@@ -88,6 +89,8 @@ export default class EDUSearch extends React.Component {
8889
} = this.state;
8990
const title = 'Tutorials And Workshops That Matter | Thrive | Topcoder';
9091
const description = 'Thrive is our vault of content that we have been gathering over the years. It is full of tutorials and workshops that matter. Grow with us!';
92+
let inputSelectedFilter = '0';
93+
if (query.phrase) inputSelectedFilter = '1';
9194

9295
const metaTags = (
9396
<MetaTags
@@ -111,7 +114,10 @@ export default class EDUSearch extends React.Component {
111114
{/* Banner */}
112115
<div className={searchTheme.bannerContainer}>
113116
<div className={searchTheme.searchBarWrapp}>
114-
<SearchBar inputlVal={query.phrase || query.title} selectedFilter={query.phrase ? '1' : '0'} />
117+
<SearchBar
118+
inputlVal={query.phrase || query.title}
119+
inputSelectedFilter={inputSelectedFilter}
120+
/>
115121
</div>
116122
</div>
117123
<div className={searchTheme.shapeBanner} />

src/shared/services/contentful.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ class Service {
316316
// thus we need to find it first
317317
await this.queryEntries({
318318
content_type: 'person',
319-
query: encodeURIComponent(author),
319+
query: author,
320320
})
321321
.then((result) => {
322322
query['fields.contentAuthor.sys.id'] = result.total ? result.items[0].sys.id : 'NO_SUCH_ID';
@@ -340,12 +340,12 @@ class Service {
340340
}
341341
if (track) query['fields.trackCategory'] = track;
342342
if (!_.isEmpty(tags)) {
343-
query['fields.tags[all]'] = tags.map(t => encodeURIComponent(t)).join(',');
343+
query['fields.tags[all]'] = tags.map(t => t).join(',');
344344
}
345345
if (startDate) query['fields.creationDate[gte]'] = startDate;
346346
if (endDate) query['fields.creationDate[lte]'] = endDate;
347-
if (phrase) query.query = encodeURIComponent(phrase);
348-
if (title) query['fields.title[match]'] = encodeURIComponent(title);
347+
if (phrase) query.query = phrase;
348+
if (title) query['fields.title[match]'] = title;
349349
if (sortBy) {
350350
switch (sortBy) {
351351
case 'Likes': query.order = '-fields.upvotes,-fields.creationDate'; break;

0 commit comments

Comments
 (0)