Skip to content

Commit a2f6055

Browse files
Merge pull request #6352 from topcoder-platform/footer-update
Footer update
2 parents aead278 + f72c1af commit a2f6055

File tree

4 files changed

+15
-6
lines changed

4 files changed

+15
-6
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ workflows:
370370
filters:
371371
branches:
372372
only:
373-
- thrive-discord-button
373+
- footer-update
374374
# This is stage env for production QA releases
375375
- "build-prod-staging":
376376
context : org-global

__tests__/shared/components/__snapshots__/TopcoderFooter.jsx.snap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,10 +349,10 @@ exports[`Matches shallow shapshot 1`] = `
349349
className="src-shared-components-TopcoderFooter-___style__link___3-nzm"
350350
>
351351
<a
352-
href="https://www.topcoder-dev.com/community/changelog?ref=navb"
353-
target="_self"
352+
href="https://www.topcoder-dev.com/releases/?ref=navb"
353+
target="_blank"
354354
>
355-
Changelog
355+
Releases & Updates
356356
</a>
357357
</li>
358358
<li

src/shared/components/Contentful/Route.jsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ import React from 'react';
1313
import { Route, Switch, Redirect } from 'react-router-dom';
1414
import Viewport from 'components/Contentful/Viewport';
1515
import PasswordScreen from 'components/Contentful/PasswordScreen';
16-
import { isomorphy } from 'topcoder-react-utils';
16+
import { isomorphy, config } from 'topcoder-react-utils';
17+
import cookies from 'browser-cookies';
1718
import { removeTrailingSlash } from 'utils/url';
1819

1920
// Concatenates a base and segment and handles optional trailing slashes
@@ -173,6 +174,14 @@ export default function ContentfulRoute(props) {
173174
// eslint-disable-next-line no-restricted-globals
174175
const currentPathname = typeof location === 'undefined' ? '' : removeTrailingSlash(location.pathname);
175176
const redirectToUrl = _.trim(fields.redirectToUrl);
177+
const requireLogin = fields.protected;
178+
const loggedIn = isomorphy.isClientSide() && cookies.get('tcjwt') !== null;
179+
if (requireLogin && !loggedIn) {
180+
// route is protected by TC Login
181+
// send to login/register with proper retUrl set
182+
const authUrl = config.URL.AUTH;
183+
return <RedirectWithStatus status={401} from={url} to={`${authUrl}?retUrl=${encodeURIComponent(config.URL.BASE + url)}`} />;
184+
}
176185
return redirectToUrl && currentPathname === url ? (
177186
<RedirectWithStatus status={301} from={url} to={redirectToUrl} />
178187
) : (

src/shared/components/TopcoderFooter/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export default function TopcoderFooter() {
104104
&& <Link to={`${authUrl}?utm_source=community&utm_campaign=tc-footer&utm_medium=promotion&retUrl=${retUrl}&ref=navb`}>Join Community</Link>
105105
}
106106
<Link to={`${base}/community/learn?ref=navb`}>About Community</Link>
107-
<Link to={`${base}/community/changelog?ref=navb`}>Changelog</Link>
107+
<Link to={`${base}/releases/?ref=navb`} openNewTab>Releases &amp; Updates</Link>
108108
<Link to="https://go.topcoder.com/contact/?ref=navb">Talk to Sales</Link>
109109
</ul>
110110
</div>

0 commit comments

Comments
 (0)