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

PROD-2087 Platform MVP Prod Deployment 2022-06-01 qa -> master #141

Merged
merged 25 commits into from
Jun 1, 2022
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
f95082c
PROD-1551_header
brooketopcoder May 2, 2022
eb793c7
PROD-1551 #comment merge dev and remove all
brooketopcoder May 3, 2022
a4d2084
PROD-1850 #comment hide navigation for
brooketopcoder May 5, 2022
9593bcf
Merge pull request #112 from topcoder-platform/PROD-1850_header-demo-…
testflyjets May 5, 2022
289ef43
PROD-1551 #comment lean-up obsolete
brooketopcoder May 6, 2022
9035527
Merge pull request #113 from topcoder-platform/PROD-1551_header
brooketopcoder May 6, 2022
34b91b8
Upgrades node to 10.24.1
testflyjets May 12, 2022
4be5824
Upgrades node to 12.22.12
testflyjets May 12, 2022
b5e5291
Upgrades node to 14.19.2
testflyjets May 12, 2022
003633a
Uses npm update to fix a few packages
testflyjets May 12, 2022
cab3193
Updates node-sass to 6.0.1
testflyjets May 12, 2022
ea5fdbb
Reinstalls node packages
testflyjets May 12, 2022
283d587
PROD-1536 #comment Added two shell scripts start-local.sh and start-l…
May 23, 2022
3db3a3e
PROD-1536 #comment Updated README #time 2h
May 23, 2022
aee5a27
PROD-2048 deploy qa to dev env #time 5m
brooketopcoder May 24, 2022
8233176
Merge pull request #131 from topcoder-platform/PROD-2048_deploy-qa
brooketopcoder May 24, 2022
9be4518
Merge branch 'qa' into PROD-1551_header
brooketopcoder May 24, 2022
614e635
Merge pull request #137 from topcoder-platform/PROD-1551_header
brooketopcoder May 24, 2022
cecdb5f
Merge branch 'qa' into PROD-1536_update-readme
brooketopcoder May 24, 2022
5ea50f0
Merge pull request #138 from topcoder-platform/PROD-1536_update-readme
brooketopcoder May 24, 2022
8939ecc
Merge branch 'qa' into PROD-1532_upgrade_header_node_version
brooketopcoder May 24, 2022
959e860
Merge pull request #139 from topcoder-platform/PROD-1532_upgrade_head…
brooketopcoder May 24, 2022
4edcf4e
PROD-2057 #comment add support route #time 5m
brooketopcoder May 26, 2022
5d9f7ac
Merge pull request #140 from topcoder-platform/PROD-2057_support-page
testflyjets May 26, 2022
367bdf9
PROD-2087 #comment revert deployment of qa branch to dev env #time 5m
brooketopcoder Jun 1, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22,980 changes: 347 additions & 22,633 deletions package-lock.json

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ const App = () => {
);
const location = useLocation();

// if this is the self-service app, don't display anything
if (!!['/self-service', '/work', '/account'].find(path => location.pathname.startsWith(path))) {
return <></>
}

// set/remove class for the whole page, to know if sidebar is present or no
useEffect(() => {
if (isSideBarDisabled) {
Expand All @@ -58,11 +63,7 @@ const App = () => {
<NavBar
default
noThrow
profileUrl={
location.pathname.includes("/self-service")
? "/self-service/account/"
: `/profile/${_.get(auth, "profile.handle", "")}`
}
profileUrl={`/profile/${_.get(auth, "profile.handle", "")}`}
hideSwitchTools={isNavigationDisabled}
path="/*"
/>
Expand Down
95 changes: 38 additions & 57 deletions src/components/NavBar/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,13 @@ import { Link, useLocation } from "@reach/router";
import TCLogo from "../../assets/images/tc-logo.svg";
import {
getLoginUrl,
getSelfServiceLoginUrl,
getSelfServiceSignupUrl,
} from "../../utils";
import { BUTTON_TYPE } from "constants/";
import "./styles.css";
import { useMediaQuery } from "react-responsive";
import NotificationsMenu from "../NotificationsMenu";
import Button from "../Button";

const NavBar = ({ hideSwitchTools, profileUrl }) => {
const [isSelfService, setIsSelfService] = useState(false);

// all menu options
const menu = useSelector((state) => state.menu.categories);
// flat list of all apps
Expand All @@ -43,8 +39,7 @@ const NavBar = ({ hideSwitchTools, profileUrl }) => {

const routerLocation = useLocation();

const loginUrl = isSelfService ? getSelfServiceLoginUrl() : getLoginUrl();
const signupUrl = isSelfService ? getSelfServiceSignupUrl() : "";
const loginUrl = getLoginUrl();

// Check app title with route activated
useEffect(() => {
Expand All @@ -53,7 +48,6 @@ const NavBar = ({ hideSwitchTools, profileUrl }) => {
);
setActiveApp(activeApp);

setIsSelfService(routerLocation.pathname.indexOf("/self-service") !== -1);
}, [routerLocation, apps]);

// Change micro-app callback
Expand All @@ -64,14 +58,42 @@ const NavBar = ({ hideSwitchTools, profileUrl }) => {
[setActiveApp]
);

const renderTopcoderLogo =
hideSwitchTools && !isSelfService ? (
// if the consuming app has requested that we disable the navigation
// don't make the logo a link
let renderTopcoderLogo
if (hideSwitchTools) {

renderTopcoderLogo = (
<img src={TCLogo} alt="Topcoder Logo" />
) : (
<Link to={isSelfService ? "/self-service" : "/"}>
)

} else {

renderTopcoderLogo = (
<Link to={"/"}>
<img src={TCLogo} alt="Topcoder Logo" />
</Link>
);
)
}

const renderTitle = activeApp?.title || ""

const renderProfile = (
<>
<NotificationsMenu />
<UserMenu
profileUrl={profileUrl}
profile={auth.profile}
hideSwitchTools={hideSwitchTools}
/>
</>
)

const renderLogin = (
<a href={loginUrl} className="navbar-login">
Log in
</a>
)

return (
<div className="navbar">
Expand All @@ -85,7 +107,7 @@ const NavBar = ({ hideSwitchTools, profileUrl }) => {
{renderTopcoderLogo}
<div className="navbar-divider"></div>
<div className="navbar-app-title">
{activeApp ? activeApp.title : ""}
{renderTitle}
</div>
</Fragment>
)}
Expand All @@ -102,22 +124,7 @@ const NavBar = ({ hideSwitchTools, profileUrl }) => {
{isMobile ? (
<Fragment>
{auth.isInitialized &&
(auth.tokenV3 ? (
auth.profile && (
<Fragment>
<NotificationsMenu />
<UserMenu
profileUrl={profileUrl}
profile={auth.profile}
hideSwitchTools={hideSwitchTools}
/>
</Fragment>
)
) : (
<a href={loginUrl} className="navbar-login">
Login
</a>
))}
(auth.tokenV3 ? (auth.profile && (renderProfile)) : (renderLogin))}
</Fragment>
) : (
<Fragment>
Expand All @@ -128,33 +135,7 @@ const NavBar = ({ hideSwitchTools, profileUrl }) => {
</Fragment>
)}
{auth.isInitialized &&
(auth.tokenV3 ? (
auth.profile && (
<Fragment>
{!isSelfService && <NotificationsMenu />}
<UserMenu
profileUrl={profileUrl}
profile={auth.profile}
hideSwitchTools={hideSwitchTools}
/>
</Fragment>
)
) : (
<Fragment>
<a href={loginUrl} className="navbar-login">
Login
</a>
{isSelfService && (
<Button
href={signupUrl}
className="navbar-signup"
type={BUTTON_TYPE.SECONDARY}
>
SIGN UP
</Button>
)}
</Fragment>
))}
(auth.tokenV3 ? (auth.profile && (renderProfile)) : (renderLogin))}
</Fragment>
)}
</div>
Expand Down
2 changes: 0 additions & 2 deletions src/components/NavBar/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
position: relative;
z-index: 1;
font-family: "Roboto", Arial, Helvetica, sans-serif;
}
.navbar {
padding: 0 24px;
background-color: #0C0C0C;
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/UserMenu/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const UserMenu = ({ profile, profileUrl }) => {
to={`${profileUrl}`}
onClick={closeMenu}
>
{profileUrl.startsWith('/self-service') ? 'Account' : 'Profile'}
Profile
</Link>
</li>
<li>
Expand Down
21 changes: 0 additions & 21 deletions src/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,27 +36,6 @@ export const getBusinessLoginUrl = () =>
window.location.href.match(/[^?]*/)[0]
)}`;

/**
* Returns login URL using which the user should be redirected to self service
* dashboard page after login.
*
* @returns {string}
*/
export const getSelfServiceLoginUrl = () =>
`${config.URL.AUTH}?retUrl=${encodeURIComponent(
`${window.location.origin}/self-service`
)}&regSource=selfService&mode=login`;

/**
* Returns Sign up URL for self service app.
*
* @returns {string}
*/
export const getSelfServiceSignupUrl = () =>
`${config.URL.AUTH}?retUrl=${encodeURIComponent(
`${window.location.origin}/self-service`
)}&regSource=selfService&mode=signUp`;

/**
* Logout user from Topcoder
*/
Expand Down
34 changes: 0 additions & 34 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,34 +0,0 @@
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"strictNullChecks": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
"typeRoots": [
"./types",
"./node_modules/@types"
]
},
"include": [
"src"
],
"exclude": [
"**/*.test.*"
]
}
Loading