Skip to content
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

PROD - deploy PS-257, conditional links for Wipro users in the old header #6976

Merged
merged 16 commits into from
Apr 25, 2024
Merged
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
Loading