Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit d3a22fa

Browse files
committed
TSJR-182 - disable profiles, update url for profiles menu item
1 parent d398820 commit d3a22fa

File tree

8 files changed

+15
-38
lines changed

8 files changed

+15
-38
lines changed

config/dev.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module.exports = {
88
PLATFORM_DOMAIN: "https://platform.topcoder-dev.com",
99
TAAS_APP: "https://platform.topcoder-dev.com/taas/myteams",
1010
PLATFORM_UI: "https://platform-ui.topcoder-dev.com",
11+
PLATFORM_PROFILES_URL: "https://profiles.topcoder-dev.com",
1112
},
1213
API: {
1314
V3: "https://api.topcoder-dev.com/v3",

config/prod.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module.exports = {
88
PLATFORM_DOMAIN: "https://platform.topcoder.com",
99
TAAS_APP: "https://platform.topcoder.com/taas/myteams",
1010
PLATFORM_UI: "https://platform-ui.topcoder.com",
11+
PLATFORM_PROFILES_URL: "https://profiles.topcoder.com",
1112
},
1213
API: {
1314
V3: "https://api.topcoder.com/v3",

config/qa.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module.exports = {
88
PLATFORM_DOMAIN: "https://platform.topcoder-qa.com",
99
TAAS_APP: "https://platform.topcoder-qa.com/taas/myteams",
1010
PLATFORM_UI: "https://platform-ui.topcoder-qa.com",
11+
PLATFORM_PROFILES_URL: "https://profiles.topcoder.com",
1112
},
1213
API: {
1314
V3: "https://api.topcoder-qa.com/v3",

src/App.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ const App = () => {
6363
<NavBar
6464
default
6565
noThrow
66-
profileUrl={`/profile/${_.get(auth, "profile.handle", "")}`}
6766
hideSwitchTools={isNavigationDisabled}
6867
path="/*"
6968
/>

src/components/NavBar/index.jsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import "./styles.css";
2424
import { useMediaQuery } from "react-responsive";
2525
import NotificationsMenu from "../NotificationsMenu";
2626

27-
const NavBar = ({ hideSwitchTools, profileUrl }) => {
27+
const NavBar = ({ hideSwitchTools }) => {
2828

2929
// all menu options
3030
const menu = useSelector((state) => state.menu.categories);
@@ -81,11 +81,7 @@ const NavBar = ({ hideSwitchTools, profileUrl }) => {
8181
const renderProfile = (
8282
<>
8383
<NotificationsMenu />
84-
<UserMenu
85-
profileUrl={profileUrl}
86-
profile={auth.profile}
87-
hideSwitchTools={hideSwitchTools}
88-
/>
84+
<UserMenu profile={auth.profile} hideSwitchTools={hideSwitchTools} />
8985
</>
9086
)
9187

@@ -145,11 +141,9 @@ const NavBar = ({ hideSwitchTools, profileUrl }) => {
145141

146142
NavBar.defaultProps = {
147143
hideSwitchTools: false,
148-
profileUrl: '/profile/',
149144
};
150145

151146
NavBar.propTypes = {
152-
profileUrl: PropTypes.string,
153147
hideSwitchTools: PropTypes.boolean,
154148
};
155149

src/components/UserMenu/index.jsx

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,14 @@
44
* Shows logged-in user with user menu with options like log-out.
55
*/
66
import React, { useState, useCallback, Fragment } from "react";
7-
import { Link } from "@reach/router";
8-
import PropTypes from "prop-types";
97
import Avatar from "../Avatar";
108
import cn from "classnames";
119
import OutsideClickHandler from "react-outside-click-handler";
12-
import { logout, getLogoutUrl } from "../../utils";
10+
import { logout, getLogoutUrl, getProfileUrl } from "../../utils";
1311
import "./styles.css";
1412
import { useMediaQuery } from "react-responsive";
1513

16-
const UserMenu = ({ profile, profileUrl }) => {
14+
const UserMenu = ({ profile }) => {
1715
const [isOpenMenu, setIsOpenMenu] = useState(false);
1816

1917
const closeMenu = useCallback(() => {
@@ -65,12 +63,9 @@ const UserMenu = ({ profile, profileUrl }) => {
6563
<div className="user-menu-popover-content">
6664
<ul className="user-menu-list">
6765
<li>
68-
<Link
69-
to={`${profileUrl}`}
70-
onClick={closeMenu}
71-
>
66+
<a href={getProfileUrl(profile.handle)} onClick={closeMenu}>
7267
Profile
73-
</Link>
68+
</a>
7469
</li>
7570
<li>
7671
<a href={getLogoutUrl()} onClick={onLogoutClick}>
@@ -87,12 +82,4 @@ const UserMenu = ({ profile, profileUrl }) => {
8782
);
8883
};
8984

90-
UserMenu.defaultProps = {
91-
profileUrl: '/profile',
92-
};
93-
94-
UserMenu.propTypes = {
95-
profileUrl: PropTypes.string,
96-
};
97-
9885
export default UserMenu;

src/constants/apps.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -83,18 +83,6 @@ export const APP_CATEGORIES = [
8383
},
8484
],
8585
},
86-
{
87-
category: "Profile",
88-
hidden: true,
89-
apps: [
90-
{
91-
title: "Profile App",
92-
path: "/profile/",
93-
isExact: false,
94-
menu: [],
95-
},
96-
],
97-
},
9886
{
9987
category: "Onboard",
10088
hidden: true,

src/utils/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ export const getLogoutUrl = () =>
1111
"https://" + window.location.host
1212
)}`;
1313

14+
/**
15+
* Generate Profiles URL
16+
*/
17+
export const getProfileUrl = (handle) =>
18+
`${config.URL.PLATFORM_PROFILES_URL}/${handle}`;
19+
1420
/**
1521
* Generate Login URL
1622
*/

0 commit comments

Comments
 (0)