Skip to content

Commit

Permalink
Merge pull request #6976 from topcoder-platform/develop
Browse files Browse the repository at this point in the history
PROD - deploy PS-257, conditional links for Wipro users in the old header
  • Loading branch information
jmgasper authored Apr 25, 2024
2 parents ab8608d + f0730eb commit 9c68d0f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/shared/components/Header/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ Header.propTypes = {
profile: PT.shape({
photoURL: PT.string,
handle: PT.string,
email: PT.string,
}),
auth: PT.shape(),
notifications: PT.arrayOf(PT.object).isRequired,
Expand Down
15 changes: 13 additions & 2 deletions src/shared/components/tc-communities/Header/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,28 @@ function Header(props) {
}

let userSubMenu;

if (profile) {
let profileLink = `${meta ? _.replace(BASE_URL, 'www', meta.subdomains[0]) : BASE_URL}/members/${normalizedProfile.handle}`;
let paymentsLink = `${config.URL.COMMUNITY}/PactsMemberServlet?module=PaymentHistory&full_list=false`;

// Handle Wipro specific links (PS-257)
if (profile && profile.email && profile.email.includes('@wipro.com')) {
profileLink = 'https://topgear-app.wipro.com/user-details';
paymentsLink = 'https://topgear-app.wipro.com/my_payments';
}

userSubMenu = {
title: 'User',
items: [{
enforceA: true,
icon: <IconNavProfile />,
link: `${meta ? _.replace(BASE_URL, 'www', meta.subdomains[0]) : BASE_URL}/members/${normalizedProfile.handle}`,
link: profileLink,
title: 'My Profile',
}, {
openNewTab: true,
icon: <IconNavWallet />,
link: `${config.URL.COMMUNITY}/PactsMemberServlet?module=PaymentHistory&full_list=false`,
link: paymentsLink,
title: 'Payments',
}, {
icon: <IconNavSettings />,
Expand Down Expand Up @@ -385,6 +395,7 @@ Header.propTypes = {
photoURL: PT.string,
groups: PT.any,
handle: PT.string,
email: PT.string,
}),
theme: PT.shape().isRequired,
logoutRedirect: PT.string,
Expand Down

0 comments on commit 9c68d0f

Please sign in to comment.