From ab3e61da89f54c1e2eb57e588b5a963dac5c36bd Mon Sep 17 00:00:00 2001 From: Kiril Kartunov Date: Tue, 2 Nov 2021 11:39:59 +0200 Subject: [PATCH 1/9] Fix spooky1 301 --- src/server/services/contentful.js | 4 +++- src/shared/services/contentful.js | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/server/services/contentful.js b/src/server/services/contentful.js index fa42172b12..2525696f30 100644 --- a/src/server/services/contentful.js +++ b/src/server/services/contentful.js @@ -134,7 +134,9 @@ class ApiService { * @return {Promise} */ async queryEntries(query) { - const res = await this.client.getEntries(query); + const decode = o => _.mapValues(o, prop => (typeof prop === 'object' ? decode(prop) : decodeURIComponent(prop))); + const decoded = decode(query); + const res = await this.client.getEntries(decoded); return res.stringifySafe ? JSON.parse(res.stringifySafe()) : res; } } diff --git a/src/shared/services/contentful.js b/src/shared/services/contentful.js index 81b7dd1e1c..e4dda01962 100644 --- a/src/shared/services/contentful.js +++ b/src/shared/services/contentful.js @@ -316,7 +316,7 @@ class Service { // thus we need to find it first await this.queryEntries({ content_type: 'person', - query: encodeURIComponent(author), + query: author, }) .then((result) => { query['fields.contentAuthor.sys.id'] = result.total ? result.items[0].sys.id : 'NO_SUCH_ID'; @@ -340,12 +340,12 @@ class Service { } if (track) query['fields.trackCategory'] = track; if (!_.isEmpty(tags)) { - query['fields.tags[all]'] = tags.map(t => encodeURIComponent(t)).join(','); + query['fields.tags[all]'] = tags.map(t => t).join(','); } if (startDate) query['fields.creationDate[gte]'] = startDate; if (endDate) query['fields.creationDate[lte]'] = endDate; - if (phrase) query.query = encodeURIComponent(phrase); - if (title) query['fields.title[match]'] = encodeURIComponent(title); + if (phrase) query.query = phrase; + if (title) query['fields.title[match]'] = title; if (sortBy) { switch (sortBy) { case 'Likes': query.order = '-fields.upvotes,-fields.creationDate'; break; From 23721f6a57318a36070eeb5379256363d3d832f7 Mon Sep 17 00:00:00 2001 From: Kiril Kartunov Date: Tue, 2 Nov 2021 11:40:48 +0200 Subject: [PATCH 2/9] ci: on beta --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3294f14378..0cfd31565c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -363,7 +363,7 @@ workflows: filters: branches: only: - - free + - thrive-spooky1-p0-2 # This is stage env for production QA releases - "build-prod-staging": context : org-global From 4e3facfeb00c98b01d745fd712536d00b67c401f Mon Sep 17 00:00:00 2001 From: Kiril Kartunov Date: Tue, 2 Nov 2021 11:53:28 +0200 Subject: [PATCH 3/9] fix spooky 186 --- src/shared/components/Contentful/Article/themes/default.scss | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/shared/components/Contentful/Article/themes/default.scss b/src/shared/components/Contentful/Article/themes/default.scss index 7874e05796..bd3c5b5f56 100644 --- a/src/shared/components/Contentful/Article/themes/default.scss +++ b/src/shared/components/Contentful/Article/themes/default.scss @@ -139,9 +139,8 @@ .catsContainer { display: flex; - justify-content: flex-start; - align-items: center; - flex-wrap: wrap; + flex-direction: column; + align-items: flex-start; border-left: 3px solid #e9e9e9; padding-left: 7px; margin-bottom: 5px; From e53d91c392912eba03b903f5ab525ebf27403f46 Mon Sep 17 00:00:00 2001 From: Kiril Kartunov Date: Tue, 2 Nov 2021 14:57:53 +0200 Subject: [PATCH 4/9] Fix spooky1 400 --- src/shared/containers/EDU/Search.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/containers/EDU/Search.jsx b/src/shared/containers/EDU/Search.jsx index f0c41118e6..a5eb6b57cb 100644 --- a/src/shared/containers/EDU/Search.jsx +++ b/src/shared/containers/EDU/Search.jsx @@ -111,7 +111,7 @@ export default class EDUSearch extends React.Component { {/* Banner */}
- +
From 58b19c68b6a4e5adb041e400347fe0400d5a8b6a Mon Sep 17 00:00:00 2001 From: Kiril Kartunov Date: Tue, 2 Nov 2021 15:12:22 +0200 Subject: [PATCH 5/9] fix s109 --- src/shared/components/Contentful/ArticleCard/themes/video.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/src/shared/components/Contentful/ArticleCard/themes/video.scss b/src/shared/components/Contentful/ArticleCard/themes/video.scss index 6a59af708c..2ffe187bb1 100644 --- a/src/shared/components/Contentful/ArticleCard/themes/video.scss +++ b/src/shared/components/Contentful/ArticleCard/themes/video.scss @@ -9,6 +9,7 @@ min-height: 217px; display: flex; flex-direction: column; + cursor: pointer; @include xs-to-sm { margin: auto; From 0a257ebf281d1bf49a9c9c15b8d6e284d1e93913 Mon Sep 17 00:00:00 2001 From: Kiril Kartunov Date: Tue, 2 Nov 2021 15:51:29 +0200 Subject: [PATCH 6/9] fix s441 --- config/default.js | 8 ++++---- config/production.js | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/config/default.js b/config/default.js index 75d0d7fedd..569d65b3ca 100644 --- a/config/default.js +++ b/config/default.js @@ -358,19 +358,19 @@ module.exports = { }, { title: 'Data Science', - href: '/thrive/tracks?track=Data%20Science&tax=', + href: '/thrive/tracks?track=Data%20Science', }, { title: 'Design', - href: '/thrive/tracks?track=Design&tax=', + href: '/thrive/tracks?track=Design', }, { title: 'Development', - href: '/thrive/tracks?track=Development&tax=', + href: '/thrive/tracks?track=Development', }, { title: 'QA', - href: '/thrive/tracks?track=QA&tax=', + href: '/thrive/tracks?track=QA', }, ], }, diff --git a/config/production.js b/config/production.js index 7a62d55e7f..3e65ad253d 100644 --- a/config/production.js +++ b/config/production.js @@ -139,19 +139,19 @@ module.exports = { }, { title: 'Data Science', - href: '/thrive/tracks?track=Data%20Science&tax=', + href: '/thrive/tracks?track=Data%20Science', }, { title: 'Design', - href: '/thrive/tracks?track=Design&tax=', + href: '/thrive/tracks?track=Design', }, { title: 'Development', - href: '/thrive/tracks?track=Development&tax=', + href: '/thrive/tracks?track=Development', }, { title: 'QA', - href: '/thrive/tracks?track=QA&tax=', + href: '/thrive/tracks?track=QA', }, ], }, From a132e11a154b1e1dbd7e0d355bc7430ad97900f5 Mon Sep 17 00:00:00 2001 From: Kiril Kartunov Date: Tue, 2 Nov 2021 18:20:02 +0200 Subject: [PATCH 7/9] fixed tests --- .../shared/components/Header/__snapshots__/index.jsx.snap | 8 ++++---- src/shared/containers/EDU/Search.jsx | 7 ++++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/__tests__/shared/components/Header/__snapshots__/index.jsx.snap b/__tests__/shared/components/Header/__snapshots__/index.jsx.snap index 8932e2e547..cc4996f8f9 100644 --- a/__tests__/shared/components/Header/__snapshots__/index.jsx.snap +++ b/__tests__/shared/components/Header/__snapshots__/index.jsx.snap @@ -82,19 +82,19 @@ exports[`Default render 1`] = ` "title": "Competitive Programming", }, Object { - "href": "/thrive/tracks?track=Data%20Science&tax=", + "href": "/thrive/tracks?track=Data%20Science", "title": "Data Science", }, Object { - "href": "/thrive/tracks?track=Design&tax=", + "href": "/thrive/tracks?track=Design", "title": "Design", }, Object { - "href": "/thrive/tracks?track=Development&tax=", + "href": "/thrive/tracks?track=Development", "title": "Development", }, Object { - "href": "/thrive/tracks?track=QA&tax=", + "href": "/thrive/tracks?track=QA", "title": "QA", }, ], diff --git a/src/shared/containers/EDU/Search.jsx b/src/shared/containers/EDU/Search.jsx index a5eb6b57cb..c9c9f530b9 100644 --- a/src/shared/containers/EDU/Search.jsx +++ b/src/shared/containers/EDU/Search.jsx @@ -88,6 +88,8 @@ export default class EDUSearch extends React.Component { } = this.state; const title = 'Tutorials And Workshops That Matter | Thrive | Topcoder'; 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!'; + let inputSelectedFilter = '0'; + if (query.phrase) inputSelectedFilter = '1'; const metaTags = (
- +
From f77a571a1e38c8ae2f6b7f3d72a4ce175fee0282 Mon Sep 17 00:00:00 2001 From: Kiril Kartunov Date: Tue, 2 Nov 2021 18:30:20 +0200 Subject: [PATCH 8/9] fix s303 --- .../SearchPageFilter/FilterAuthor/themes/default.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/shared/components/Contentful/SearchPageFilter/FilterAuthor/themes/default.scss b/src/shared/components/Contentful/SearchPageFilter/FilterAuthor/themes/default.scss index 46a667792b..cef148c5cd 100644 --- a/src/shared/components/Contentful/SearchPageFilter/FilterAuthor/themes/default.scss +++ b/src/shared/components/Contentful/SearchPageFilter/FilterAuthor/themes/default.scss @@ -87,6 +87,10 @@ $text-black: #2a2a2a; align-items: center; width: 100%; justify-content: flex-start; + + &:last-child { + height: auto; + } } span { From 8aae3618ce568859262de8e2937a95b8dba3ef47 Mon Sep 17 00:00:00 2001 From: Kiril Kartunov Date: Tue, 2 Nov 2021 18:38:59 +0200 Subject: [PATCH 9/9] fix s438 --- src/shared/containers/EDU/Search.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/shared/containers/EDU/Search.jsx b/src/shared/containers/EDU/Search.jsx index c9c9f530b9..28d9c7d0a8 100644 --- a/src/shared/containers/EDU/Search.jsx +++ b/src/shared/containers/EDU/Search.jsx @@ -13,6 +13,7 @@ import { updateQuery } from 'utils/url'; import qs from 'qs'; import LoadingIndicator from 'components/LoadingIndicator'; import SearchPageFilter from 'components/Contentful/SearchPageFilter/SearchPageFilter'; +import moment from 'moment'; // Partials import ResultTabs from './partials/ResultTabs'; // CSS @@ -66,8 +67,8 @@ export default class EDUSearch extends React.Component { const queryUpdate = { author: filterState.selectedAuthor, tags: filterState.tags, - startDate: filterState.startDate.format('YYYY-MM-DD'), - endDate: filterState.endDate.format('YYYY-MM-DD'), + startDate: filterState.startDate instanceof moment ? filterState.startDate.format('YYYY-MM-DD') : moment(filterState.startDate).format('YYYY-MM-DD'), + endDate: filterState.endDate instanceof moment ? filterState.endDate.format('YYYY-MM-DD') : moment(filterState.endDate).format('YYYY-MM-DD'), track: filterState.selectedCategory ? filterState.selectedCategory.title : null, tax: filterState.selectedCategory ? _.map( _.filter(filterState.selectedCategory.items, item => item.selected),