Skip to content

Smoke Testing 2020/11/10 - SEO Challenge Listing and Details #5181

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 4 commits into from
Nov 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ workflows:
filters:
branches:
only:
- apollo-site
- free
# This is alternate dev env for parallel testing
- "build-qa":
context : org-global
Expand Down
16 changes: 4 additions & 12 deletions src/shared/containers/challenge-detail/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import Terms from 'containers/Terms';
import termsActions from 'actions/terms';
import ChallengeCheckpoints from 'components/challenge-detail/Checkpoints';
import React from 'react';
import htmlToText from 'html-to-text';
import PT from 'prop-types';
import { connect } from 'react-redux';
import challengeDetailsActions, { TABS as DETAIL_TABS }
Expand Down Expand Up @@ -376,15 +375,8 @@ class ChallengeDetailPageContainer extends React.Component {
prizesStr = challenge.prizes.map(p => `$${p}`).join('/');
prizesStr = `[${prizesStr}] - `;
}
const title = challenge.name;

let description = challenge.description || challenge.detailedRequirements;
description = description ? description.slice(0, 256) : '';
description = htmlToText.fromString(description, {
singleNewLineParagraphs: true,
wordwrap: false,
});
description = description.replace(/\n/g, ' ');
const title = 'Topcoder Challenge | Topcoder Community | Topcoder';
const description = 'Browse the challenges currently available on Topcoder. Search by type of challenge, then find those of interest to register for and compete in today.';

const results2 = resultsLoadedForChallengeId === _.toString(challengeId)
? results : null;
Expand Down Expand Up @@ -432,10 +424,10 @@ class ChallengeDetailPageContainer extends React.Component {
!isEmpty
&& (
<MetaTags
description={description.slice(0, 155)}
description={description}
image={getOgImage(challenge)}
siteName="Topcoder"
socialDescription={description.slice(0, 200)}
socialDescription={description}
socialTitle={`${prizesStr}${title}`}
title={title}
/>
Expand Down
8 changes: 3 additions & 5 deletions src/shared/containers/challenge-listing/Listing/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ const { mapToBackend } = challengeUtils.filter;

let mounted = false;

const SEO_PAGE_TITLE = 'Topcoder Challenges';

export class ListingContainer extends React.Component {
componentDidMount() {
const {
Expand Down Expand Up @@ -368,7 +366,6 @@ export class ListingContainer extends React.Component {
challengesUrl,
challengeTags,
communityFilters,
communityId,
communityName,
defaultCommunityId,
expanding,
Expand Down Expand Up @@ -494,7 +491,8 @@ export class ListingContainer extends React.Component {
let communityFilter = communityFilters.find(item => item.communityId === selectedCommunityId);
if (communityFilter) communityFilter = communityFilter.challengeFilter;

const description = 'Join Topcoder and compete in these challenges, to learn and earn!';
const title = 'Topcoder Challenge Listings | Topcoder Community | Topcoder';
const description = 'Browse the challenges currently available on Topcoder. Search by type of challenge, then find those of interest to register for and compete in today.';

let banner;
if (!listingOnly) {
Expand All @@ -520,7 +518,7 @@ export class ListingContainer extends React.Component {
description={description}
image={ogImage}
siteName="Topcoder"
title={communityId ? `${communityName} Challenges` : SEO_PAGE_TITLE}
title={title}
/>
{banner}
<ChallengeListing
Expand Down
18 changes: 9 additions & 9 deletions src/shared/routes/Topcoder/ChallengeListing.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

import _ from 'lodash';
import LoadingIndicator from 'components/LoadingIndicator';
// import path from 'path';
import path from 'path';
import qs from 'qs';
import React from 'react';
// import { StaticRouter } from 'react-router-dom';
import { AppChunk } from 'topcoder-react-utils';
import { StaticRouter } from 'react-router-dom';
import { AppChunk, webpack } from 'topcoder-react-utils';

export default function ChallengeListingRoute() {
return (
Expand Down Expand Up @@ -39,13 +39,14 @@ export default function ChallengeListingRoute() {
/*
TODO: Making server-side rendering work demands some more efforts
with reducers coding.
*/
renderServer={(renderProps) => {
const p = resolveWeak('containers/challenge-listing/Listing');
const ChallengeListing = requireWeak(path.resolve(__dirname, p));
const p = webpack.resolveWeak('containers/challenge-listing/Listing');
const ChallengeListing = webpack.requireWeak(path.resolve(__dirname, p));
/* TODO: Choice of currency and prize mode should be moved to
* Redux actions / reducers. *//*
const query = renderProps.location.search ?
qs.parse(renderProps.location.search.slice(1)) : null;
* Redux actions / reducers. */
const query = renderProps.location.search
? qs.parse(renderProps.location.search.slice(1)) : null;
const currencyFromUrl = _.get(query, 'currency');
const prizeMode = currencyFromUrl && `money-${currencyFromUrl}`;
return (
Expand All @@ -61,7 +62,6 @@ export default function ChallengeListingRoute() {
</StaticRouter>
);
}}
*/
/>
);
}