Skip to content

Thrive fixes sep20 #4909

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 42 commits into from
Sep 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
7fa4377
ci: on dev
kkartunov Aug 5, 2020
1533fcd
Fixes #4683
kkartunov Aug 5, 2020
3fecfcf
fix(submission-management): missing `Add Submission` button
cagdas001 Sep 3, 2020
4b2bcb7
fix(challenge-detail): condition for showing thrive articles
cagdas001 Sep 3, 2020
0e221c8
fix: for issue #4756
narekcat Sep 3, 2020
5503702
fix(submission-management): add null checking for `currentPhase`
cagdas001 Sep 3, 2020
97e3f1a
Merge pull request #4855 from cagdas001/fix-4765
luizrrodrigues Sep 4, 2020
7a3c513
fix(submission-management): `challenge.status` at conditional check
cagdas001 Sep 4, 2020
9544644
Merge pull request #4854 from cagdas001/fix-4755
luizrrodrigues Sep 4, 2020
9c14d5a
Merge pull request #4857 from cagdas001/fix-4758
luizrrodrigues Sep 4, 2020
83352cf
fix: for #4752
luizrrodrigues Sep 4, 2020
7ac1ae3
Deploy milestone-v1.3 to Dev and Staging
luizrrodrigues Sep 4, 2020
9459936
fix(profile-page): wrong MM url at history graph
cagdas001 Sep 5, 2020
bf0c810
fix: for topgear submission page
sushilshinde Sep 7, 2020
dcbf32e
Fix Topgear submissions page
luizrrodrigues Sep 7, 2020
5204b25
Merge pull request #4866 from topcoder-platform/issue-4844
luizrrodrigues Sep 7, 2020
b1368b2
Merge pull request #4862 from cagdas001/fix-4760
luizrrodrigues Sep 7, 2020
5604c6c
fix: for #4787
luizrrodrigues Sep 7, 2020
fd0381a
Deploy milestone-20200910 to Dev and Staging
luizrrodrigues Sep 7, 2020
221473f
Merge pull request #4856 from narekcat/issue-4756
luizrrodrigues Sep 7, 2020
539853d
Revert "fix: for topgear submission page"
luizrrodrigues Sep 7, 2020
a514c88
Merge pull request #4870 from topcoder-platform/milestone-20200910
sushilshinde Sep 8, 2020
218802d
Merge remote-tracking branch 'origin/develop' into milestone-v1.3
sushilshinde Sep 8, 2020
9a21345
fix: smoke release
sushilshinde Sep 8, 2020
eb966b7
Merge branch 'develop' into oanh-kiril-tasks
sushilshinde Sep 8, 2020
8b441f5
Merge pull request #4869 from topcoder-platform/oanh-kiril-tasks
sushilshinde Sep 8, 2020
ca67b6b
Merge branch 'develop' into milestone-v1.3
sushilshinde Sep 8, 2020
0adea2f
Merge pull request #4871 from topcoder-platform/milestone-v1.3
sushilshinde Sep 8, 2020
0318d13
fix: prod release 2020-09-08 (v1.1.4)
sushilshinde Sep 8, 2020
d2a32f9
Merge pull request #4873 from topcoder-platform/develop
sushilshinde Sep 8, 2020
2451ca2
fix: for #4441
luizrrodrigues Sep 10, 2020
a883d4b
fix: for #4441
luizrrodrigues Sep 10, 2020
06894f4
Merge branch 'develop' into gig-work-fix
luizrrodrigues Sep 10, 2020
f94fb46
Merge pull request #4883 from topcoder-platform/gig-work-fix
luizrrodrigues Sep 10, 2020
9e4229f
Merge branch 'develop' into milestone-20200917
luizrrodrigues Sep 10, 2020
c7e37dc
Merge pull request #4884 from topcoder-platform/milestone-20200917
luizrrodrigues Sep 10, 2020
16bd8dc
fix: changed nav comp branch
sushilshinde Sep 10, 2020
c57652c
Merge pull request #4885 from topcoder-platform/develop
sushilshinde Sep 10, 2020
227c600
Fixes for #4887
kkartunov Sep 14, 2020
cbe66c8
Fixes for #4888
kkartunov Sep 14, 2020
b833932
Fix #4896
kkartunov Sep 14, 2020
21576ee
Fix #4889
kkartunov Sep 14, 2020
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
4 changes: 3 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ workflows:
filters:
branches:
only:
- milestone-20200917
- develop
# This is alternate dev env for parallel testing
- "build-test":
Expand All @@ -251,14 +252,15 @@ workflows:
filters:
branches:
only:
- integration-v5-challenge-api
- hot-fix
# This is stage env for production QA releases
- "build-prod-staging":
context : org-global
filters:
branches:
only:
- feature-contentful
- develop
# Production builds are exectuted
# when PR is merged to the master
# Don't change anything in this configuration
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
"tc-accounts": "git+https://github.com/appirio-tech/accounts-app.git#dev",
"tc-core-library-js": "github:appirio-tech/tc-core-library-js#v2.6.3",
"tc-ui": "^1.0.12",
"topcoder-react-lib": "1.0.3",
"topcoder-react-lib": "1.0.4",
"topcoder-react-ui-kit": "2.0.0",
"topcoder-react-utils": "0.7.8",
"turndown": "^4.0.2",
Expand Down
23 changes: 22 additions & 1 deletion src/shared/components/Contentful/Article/Article.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ import LoadingIndicator from 'components/LoadingIndicator';
import YouTubeVideo from 'components/YouTubeVideo';
import moment from 'moment';
import localStorage from 'localStorage';
import { config, Link, isomorphy } from 'topcoder-react-utils';
import { Helmet } from 'react-helmet';
import {
config, Link, isomorphy,
} from 'topcoder-react-utils';
import qs from 'qs';
// SVGs and assets
import GestureIcon from 'assets/images/icon-gesture.svg';
Expand Down Expand Up @@ -110,9 +113,27 @@ export default class Article extends React.Component {
if (isomorphy.isClientSide()) {
shareUrl = encodeURIComponent(window.location.href);
}
const description = htmlToText.fromString(
ReactDOMServer.renderToString(markdown(fields.content)),
{
ignoreHref: true,
ignoreImage: true,
singleNewLineParagraphs: true,
uppercaseHeadings: false,
},
).substring(0, CONTENT_PREVIEW_LENGTH);

return (
<React.Fragment>
<Helmet>
<title>{fields.title}</title>
<meta name="title" property="og:title" content={fields.title} />
<meta name="description" property="og:description" content={description} />
<meta name="description" property="description" content={description} />
<meta name="twitter:description" content={description} />
<meta name="image" property="og:image" content={fields.featuredImage ? `https:${subData.assets.items[fields.featuredImage.sys.id].fields.file.url}` : null} />
<meta name="twitter:image" content={fields.featuredImage ? `https:${subData.assets.items[fields.featuredImage.sys.id].fields.file.url}` : null} />
</Helmet>
{/* Banner */}
{
fields.featuredImage ? (
Expand Down
48 changes: 43 additions & 5 deletions src/shared/components/Contentful/SearchBar/SearchBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export class SearchBarInner extends Component {
this.getSuggestionList = this.getSuggestionList.bind(this);
this.handleSearchChange = this.handleSearchChange.bind(this);
this.handleClickOutside = this.handleClickOutside.bind(this);
this.onKeyDown = this.onKeyDown.bind(this);
// using debounce to avoid processing or requesting too much
this.updateSuggestionListWithNewSearch = _.debounce(
this.updateSuggestionListWithNewSearch.bind(this), 400,
Expand All @@ -71,6 +72,29 @@ export class SearchBarInner extends Component {
document.removeEventListener('mousedown', this.handleClickOutside);
}

onKeyDown(e) {
const { inputlVal, selectedFilter } = this.state;
if (inputlVal && e.which === 13) {
const searchQuery = {};
if (this.searchFieldRef && this.searchFieldRef.value) {
if (selectedFilter.name === 'Tags') {
searchQuery.tags = [this.searchFieldRef.value];
}
if (selectedFilter.name === 'All') {
searchQuery.phrase = this.searchFieldRef.value;
}
if (selectedFilter.name === 'Title') {
searchQuery.title = this.searchFieldRef.value;
}
}
if (selectedFilter.name !== 'Author') {
window.location.href = `${config.TC_EDU_BASE_PATH}${config.TC_EDU_SEARCH_PATH}?${qs.stringify(searchQuery)}`;
} else {
window.location.href = `${config.TC_EDU_BASE_PATH}${config.TC_EDU_SEARCH_PATH}?author=${inputlVal}`;
}
}
}

/**
* Set the search field ref
*/
Expand Down Expand Up @@ -136,6 +160,7 @@ export class SearchBarInner extends Component {
isShowSuggestion,
suggestionList,
selectedFilter,
noResults,
} = this.state;

const searchQuery = {};
Expand All @@ -151,7 +176,8 @@ export class SearchBarInner extends Component {
}
}

return (suggestionList && !_.isEmpty(suggestionList) && isShowSuggestion && (
// eslint-disable-next-line no-nested-ternary
return suggestionList && !_.isEmpty(suggestionList) && isShowSuggestion ? (
<div
className={theme['popup-search-result']}
ref={this.setPopupSearchResultRef}
Expand Down Expand Up @@ -319,7 +345,14 @@ export class SearchBarInner extends Component {
) : null
}
</div>
));
) : noResults ? (
<div
className={theme['popup-search-result']}
ref={this.setPopupSearchResultRef}
>
<span>No Results</span>
</div>
) : null;
}

handleClickOutside(e) {
Expand Down Expand Up @@ -379,23 +412,26 @@ export class SearchBarInner extends Component {
.then((results) => {
// Nothing found?
if (!results.total) {
this.setState({ suggestionList: {} });
this.setState({
suggestionList: {},
noResults: true,
});
return;
}
// Author query?
if (selectedFilter.name === 'Author') {
const suggestionList = {
Author: _.map(results.items, item => ({ ...item.fields })),
};
this.setState({ suggestionList });
this.setState({ suggestionList, noResults: false });
return;
}
// ALL && Tags
const suggestionList = this.groupResults(results);
this.setState({ suggestionList });
});
} else {
this.setState({ suggestionList: {} });
this.setState({ suggestionList: {}, noResults: false });
}
}

Expand All @@ -419,6 +455,7 @@ export class SearchBarInner extends Component {
contentAuthor: contentAuthor.fields,
externalArticle: fields.externalArticle,
contentUrl: fields.contentUrl,
slug: fields.slug,
};
}),
'type',
Expand Down Expand Up @@ -471,6 +508,7 @@ export class SearchBarInner extends Component {
document.addEventListener('mousedown', this.handleClickOutside);
}}
onChange={this.handleSearchChange}
onKeyDown={this.onKeyDown}
/>
<div className={theme.dropdown}>
<button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ $link-color: #0d61bf;
overflow-y: auto;
box-shadow: 0 25px 50px 0 rgba(0, 0, 0, 0.15);
z-index: 999;

> span {
margin-left: 15px;
}
}

.icon-search {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ export default class HistoryGraph extends React.Component {
}
if (track === 'DATA_SCIENCE') {
if (subTrack === 'MARATHON_MATCH') {
return `/challenges/${challengeId}`;
return `${config.URL.COMMUNITY}/tc?module=MatchDetails&rd=${challengeId}`;
}
if (subTrack === 'SRM') {
return `${config.URL.COMMUNITY}/stat?c=round_overview&rd=${challengeId}`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import React from 'react';
import PT from 'prop-types';
import moment from 'moment';
import { PrimaryButton } from 'topcoder-react-ui-kit';
import { phaseEndDate } from 'utils/challenge-listing/helper';
import SubmissionsTable from '../SubmissionsTable';

import style from './styles.scss';
Expand Down Expand Up @@ -47,9 +48,11 @@ export default function SubmissionManagement(props) {
const currentPhase = challenge.phases
.filter(p => p.name !== 'Registration' && p.isOpen)
.sort((a, b) => moment(a.scheduledEndDate).diff(b.scheduledEndDate))[0];
const submissionPhase = challenge.phases.filter(p => p.name === 'Submission')[0];
const submissionEndDate = submissionPhase && phaseEndDate(submissionPhase);

const now = moment();
const end = moment(currentPhase.scheduledEndDate);
const end = moment(currentPhase && currentPhase.scheduledEndDate);
const diff = end.isAfter(now) ? end.diff(now) : 0;
const timeLeft = moment.duration(diff);

Expand Down Expand Up @@ -78,11 +81,15 @@ export default function SubmissionManagement(props) {
</a>
</div>
<div styleName="right-col">
<p styleName="round">
{currentPhase.name}
</p>
{
challenge.status !== 'COMPLETED' ? (
currentPhase && (
<p styleName="round">
{currentPhase.name}
</p>
)
}
{
challenge.status !== 'Completed' ? (
<div>
<p styleName="time-left">
{days > 0 && (`${days}D`)}
Expand Down Expand Up @@ -111,7 +118,7 @@ export default function SubmissionManagement(props) {
Manage your submissions
</p>
{
isDesign && (
isDesign && currentPhase && (
<p styleName="round-ends">
<span styleName="ends-label">
{currentPhase.name}
Expand Down Expand Up @@ -159,7 +166,7 @@ export default function SubmissionManagement(props) {
)
}
</div>
{now.isBefore(challenge.submissionEndDate) && (
{now.isBefore(submissionEndDate) && (
<div styleName="btn-wrap">
<PrimaryButton
theme={{
Expand Down
4 changes: 2 additions & 2 deletions src/shared/components/SubmissionPage/Submit/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ class Submit extends React.Component {
const topGearCommunity = _.find(communitiesList.data, { mainSubdomain: 'topgear' });
if (topGearCommunity) {
// check the group info match with group list
_.forOwn(groups, (value, key) => {
if (value && _.includes(topGearCommunity.groupIds, key)) {
_.forOwn(groups, (value) => {
if (value && _.includes(topGearCommunity.groupIds, value)) {
isChallengeBelongToTopgearGroup = true;
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ import cardImg02 from

import MarchMadnessBanner from '../MarchMadnessBanner';

import NewsSignup from '../NewsSignup';

import style from './style.scss';

export default function GetStarted({ baseUrl }) {
Expand Down Expand Up @@ -88,7 +86,6 @@ export default function GetStarted({ baseUrl }) {
/>
</ImageText>
</div>
<NewsSignup />
</main>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { config, Link } from 'topcoder-react-utils';
import davePhotoUrl from 'assets/images/communities/cognitive/home/dave.jpg';

import IbmCloudBanner from '../IbmCloudBanner';
import NewsletterSignup from '../NewsSignup';

import style from './style.scss';

Expand Down Expand Up @@ -317,8 +316,6 @@ export default function Home({
</div>
</div>
</div>

<NewsletterSignup />
</main>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import React from 'react';
import Differences from './Differences';
import HeadBanner from './HeadBanner';
import JoinBlock from './JoinBlock';
import NewsSignup from '../NewsSignup';

export default function IbmCloudPage() {
return (
Expand All @@ -16,8 +15,6 @@ export default function IbmCloudPage() {
{/* Hidden by the request from Trevor: the transition process won't start
* until Feb 12. */}
{/* <AutoTransition /> */}

<NewsSignup />
</div>
);
}

This file was deleted.

Loading