Skip to content

Release v1.16.1 #6354

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 16 commits into from
May 24, 2022
Merged
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ workflows:
filters:
branches:
only:
- thrive-discord-button
- footer-update
# This is stage env for production QA releases
- "build-prod-staging":
context : org-global
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,10 +349,10 @@ exports[`Matches shallow shapshot 1`] = `
className="src-shared-components-TopcoderFooter-___style__link___3-nzm"
>
<a
href="https://www.topcoder-dev.com/community/changelog?ref=navb"
target="_self"
href="https://www.topcoder-dev.com/releases/?ref=navb"
target="_blank"
>
Changelog
Releases & Updates
</a>
</li>
<li
Expand Down
11 changes: 10 additions & 1 deletion src/shared/components/Contentful/Route.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import React from 'react';
import { Route, Switch, Redirect } from 'react-router-dom';
import Viewport from 'components/Contentful/Viewport';
import PasswordScreen from 'components/Contentful/PasswordScreen';
import { isomorphy } from 'topcoder-react-utils';
import { isomorphy, config } from 'topcoder-react-utils';
import cookies from 'browser-cookies';
import { removeTrailingSlash } from 'utils/url';

// Concatenates a base and segment and handles optional trailing slashes
Expand Down Expand Up @@ -173,6 +174,14 @@ export default function ContentfulRoute(props) {
// eslint-disable-next-line no-restricted-globals
const currentPathname = typeof location === 'undefined' ? '' : removeTrailingSlash(location.pathname);
const redirectToUrl = _.trim(fields.redirectToUrl);
const requireLogin = fields.protected;
const loggedIn = isomorphy.isClientSide() && cookies.get('tcjwt') !== null;
if (requireLogin && !loggedIn) {
// route is protected by TC Login
// send to login/register with proper retUrl set
const authUrl = config.URL.AUTH;
return <RedirectWithStatus status={401} from={url} to={`${authUrl}?retUrl=${encodeURIComponent(config.URL.BASE + url)}`} />;
}
return redirectToUrl && currentPathname === url ? (
<RedirectWithStatus status={301} from={url} to={redirectToUrl} />
) : (
Expand Down
2 changes: 1 addition & 1 deletion src/shared/components/TopcoderFooter/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export default function TopcoderFooter() {
&& <Link to={`${authUrl}?utm_source=community&utm_campaign=tc-footer&utm_medium=promotion&retUrl=${retUrl}&ref=navb`}>Join Community</Link>
}
<Link to={`${base}/community/learn?ref=navb`}>About Community</Link>
<Link to={`${base}/community/changelog?ref=navb`}>Changelog</Link>
<Link to={`${base}/releases/?ref=navb`} openNewTab>Releases &amp; Updates</Link>
<Link to="https://go.topcoder.com/contact/?ref=navb">Talk to Sales</Link>
</ul>
</div>
Expand Down