Skip to content

Commit cf058fc

Browse files
Merge branch 'qa' into PROD-1532_upgrade_node_version
2 parents 1c1c80c + d39dcf7 commit cf058fc

File tree

413 files changed

+9842
-5915
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

413 files changed

+9842
-5915
lines changed

.circleci/config.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ workflows:
7575
filters:
7676
branches:
7777
only:
78-
- develop
78+
# - develop
79+
- qa
7980

8081
# Production builds are exectuted only on tagged commits to the
8182
# master branch.

babel.config.js

+12-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,18 @@ module.exports = function (api) {
2626
generateScopedName,
2727
},
2828
],
29-
"inline-react-svg",
29+
[
30+
"inline-react-svg",
31+
{
32+
"svgo": {
33+
"plugins": [
34+
{
35+
"cleanupIDs": false
36+
}
37+
]
38+
}
39+
}
40+
],
3041
],
3142
env: {
3243
test: {

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@
2727
"@testing-library/jest-dom": "^5.5.0",
2828
"@testing-library/react": "^9.4.0",
2929
"@types/jest": "^25.2.3",
30+
"@types/lodash": "^4.14.182",
3031
"@types/node": "^17.0.24",
32+
"@types/reach__router": "^1.3.10",
3133
"@types/react": "^18.0.5",
3234
"@types/react-dom": "^18.0.1",
3335
"@types/react-redux-toastr": "^7.6.2",

src-ts/App.tsx

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import { FC, ReactElement, useContext } from 'react'
2+
import { Routes } from 'react-router-dom'
3+
import { toast, ToastContainer } from 'react-toastify'
4+
5+
import { Header } from './header'
6+
import { routeContext, RouteContextData } from './lib'
7+
8+
const App: FC<{}> = () => {
9+
10+
const { allRoutes, getRouteElement }: RouteContextData = useContext(routeContext)
11+
12+
const routeElements: Array<ReactElement> = allRoutes
13+
.map(route => getRouteElement(route))
14+
15+
return (
16+
<>
17+
<Header />
18+
<Routes>
19+
{routeElements}
20+
</Routes >
21+
<ToastContainer
22+
position={toast.POSITION.TOP_RIGHT}
23+
autoClose={3000}
24+
hideProgressBar={false}
25+
newestOnTop
26+
closeOnClick
27+
rtl={false}
28+
pauseOnFocusLoss
29+
draggable
30+
pauseOnHover
31+
/>
32+
</>
33+
)
34+
}
35+
36+
export default App

src-ts/config/constants.ts

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
export enum ToolTitle {
2-
designLib = 'Design Library',
3-
settings = 'Profile Settings',
2+
settings = 'Account Settings',
43
work = 'Work',
54
}
5+
6+
export enum FooterSocialConfig {
7+
facebook = 'https://www.facebook.com/topcoder',
8+
youtube = 'https://www.youtube.com/channel/UCFv29ANLT2FQmtvS9DRixNA',
9+
linkedin = 'https://www.linkedin.com/company/topcoder',
10+
twitter = 'https://twitter.com/topcoder',
11+
instagram = 'https://www.instagram.com/topcoder',
12+
}

src-ts/config/environments/environment.config.ts

-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ import { EnvironmentConfigProd } from './environment.prod.config'
88

99
function getEnvironmentConfig(): GlobalConfig {
1010

11-
// switch (process.env.REACT_APP_HOST_ENV) {
12-
// TODO: allow the use of a separate
13-
// process var (REACT_APP_HOST_ENV)
14-
// so that we can have more than just local/dev/prod
1511
switch (process.env.APPENV) {
1612

1713
case AppHostEnvironment.bsouza:

src-ts/config/environments/environment.default.config.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ import { AppHostEnvironment } from './app-host-environment.enum'
44

55
export const EnvironmentConfigDefault: GlobalConfig = {
66
API: {
7+
FORUM_ACCESS_TOKEN: 'va.JApNvUOx3549h20I6tnl1kOQDc75NDIp.0jG3dA.EE3gZgV',
8+
FORUM_V2: 'https://vanilla.topcoder-dev.com/api/v2',
79
V3: 'https://api.topcoder-dev.com/v3',
810
V5: 'https://api.topcoder-dev.com/v5',
911
},
1012
ENV: AppHostEnvironment.default,
1113
LOGGING: {
1214
PUBLIC_TOKEN: 'puba0825671e469d16f940c5a30dc738f11',
13-
SERVICE: 'platform-ui',
15+
SERVICE: 'mfe-customer-work',
1416
},
1517
REAUTH_OFFSET: 55,
1618
TAG_MANAGER_ID: undefined,

src-ts/config/environments/environment.prod.config.ts

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { EnvironmentConfigDefault } from './environment.default.config'
77
export const EnvironmentConfigProd: GlobalConfig = {
88
...EnvironmentConfigDefault,
99
API: {
10+
FORUM_V2: 'https://vanilla.topcoder.com/api/v2',
1011
V3: 'https://api.topcoder.com/v3',
1112
V5: 'https://api.topcoder.com/v5',
1213
},

src-ts/declarations.d.ts

+11-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,17 @@ declare module '*.scss' {
88
export = scssFile
99
}
1010

11-
declare module 'tc-auth-lib'
11+
declare module '*.svg' {
12+
import * as React from 'react'
13+
14+
export const ReactComponent: React.FunctionComponent<React.SVGProps<
15+
SVGSVGElement
16+
> & { title?: string }>
17+
18+
const src: string
19+
export default src
20+
}
1221

1322
declare module '@topcoder/mfe-header'
1423

15-
declare module 'react-redux-toastr'
24+
declare module 'tc-auth-lib'

src-ts/header/Header.module.scss

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
@import '../lib/styles/includes';
2+
3+
.header-wrap {
4+
display: block;
5+
background-color: $tc-black;
6+
}
7+
8+
.header {
9+
display: grid;
10+
height: $header-height;
11+
align-items: center;
12+
width: 100%;
13+
margin: 0 auto;
14+
max-width: $xxl-min;
15+
@include pagePaddings;
16+
grid-template-columns: 78px 1fr auto;
17+
18+
@include ltemd {
19+
grid-template-columns: $header-height 1fr $header-height;
20+
align-items: center;
21+
}
22+
}
23+
24+
.subheader {
25+
width: 100%;
26+
position: relative;
27+
}

src-ts/header/Header.tsx

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { FC } from 'react'
2+
3+
import styles from './Header.module.scss'
4+
import { Logo } from './logo'
5+
import { ToolSelectors } from './tool-selectors'
6+
import { UtilitySelectors } from './utility-selectors'
7+
8+
const Header: FC<{}> = () => {
9+
return (
10+
<div className={styles['header-wrap']}>
11+
<header className={styles.header}>
12+
<ToolSelectors isWide={false} />
13+
<Logo />
14+
<ToolSelectors isWide={true} />
15+
<UtilitySelectors />
16+
</header>
17+
<div id='page-subheader-portal-el' className={styles.subheader}></div>
18+
</div>
19+
)
20+
}
21+
22+
export default Header

src-ts/header/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as Header } from './Header'

src-ts/header/logo/Logo.module.scss

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
@import '../../lib/styles/includes';
2+
3+
.logo-no-link,
4+
.logo-link {
5+
display: flex;
6+
7+
a {
8+
display: flex;
9+
}
10+
11+
svg {
12+
width: calc($pad-xxl + $pad-xxxxl);
13+
height: $pad-xl;
14+
fill: none;
15+
16+
path {
17+
fill: $tc-white;
18+
}
19+
20+
@include ltemd {
21+
padding: 0;
22+
}
23+
}
24+
@include ltemd {
25+
margin: 0 auto;
26+
}
27+
}
28+
29+
.logo-no-link {
30+
a {
31+
cursor: default;
32+
}
33+
}

src-ts/header/logo/Logo.tsx

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { FC } from 'react'
2+
import { Link, useLocation } from 'react-router-dom'
3+
4+
import { LogoIcon, routeIsHome, routeRoot } from '../../lib'
5+
import '../../lib/styles/index.scss'
6+
7+
import styles from './Logo.module.scss'
8+
9+
const Logo: FC<{}> = () => {
10+
11+
// the logo should be a link to the home page for all pages except the home page(
12+
const isLink: boolean = !routeIsHome(useLocation().pathname)
13+
14+
return (
15+
<div className={styles[`logo-${!isLink ? 'no-' : ''}link`]}>
16+
<Link
17+
tabIndex={-1}
18+
to={routeRoot}
19+
>
20+
<LogoIcon />
21+
</Link>
22+
</div>
23+
)
24+
}
25+
26+
export default Logo

src-ts/header/logo/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as Logo } from './Logo'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { FC } from 'react'
2+
3+
import { ToolSelectorsNarrow } from './tool-selectors-narrow'
4+
import { ToolSelectorsWide } from './tool-selectors-wide'
5+
6+
interface ToolSelectorsProps {
7+
isWide: boolean
8+
}
9+
10+
const ToolSelectors: FC<ToolSelectorsProps> = (props: ToolSelectorsProps) => {
11+
return props.isWide ? <ToolSelectorsWide /> : <ToolSelectorsNarrow />
12+
}
13+
14+
export default ToolSelectors

src-ts/header/tool-selectors/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as ToolSelectors } from './ToolSelectors'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
@import '../../../lib/styles/includes';
2+
3+
.tool-selectors-narrow {
4+
display: none;
5+
6+
@include ltemd {
7+
display: flex;
8+
}
9+
10+
svg {
11+
@include icon-xxxxl;
12+
fill: none;
13+
14+
path {
15+
stroke: $tc-white;
16+
stroke-width: $border;
17+
}
18+
}
19+
20+
.tool-selectors-narrow-container {
21+
position: absolute;
22+
top: $header-height;
23+
left: 0;
24+
bottom: 0;
25+
height: $content-height;
26+
width: calc(100% - calc(2 * $pad-xxl));
27+
z-index: 100;
28+
background-color: $black-100;
29+
padding: $pad-xxl;
30+
}
31+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import classNames from 'classnames'
2+
import { Dispatch, FC, SetStateAction, useContext, useState } from 'react'
3+
4+
import { IconOutline, routeContext, RouteContextData } from '../../../lib'
5+
6+
import { ToolSelectorNarrow } from './tool-selector-narrow'
7+
import styles from './ToolSelectorsNarrow.module.scss'
8+
9+
const ToolSelectorsNarrow: FC<{}> = () => {
10+
11+
const { toolsRoutes }: RouteContextData = useContext(routeContext)
12+
const [isOpen, setIsOpen]: [boolean, Dispatch<SetStateAction<boolean>>] = useState<boolean>(false)
13+
14+
const toolSelectors: Array<JSX.Element> = toolsRoutes
15+
.map(route => (
16+
<ToolSelectorNarrow
17+
key={route.title}
18+
route={route}
19+
/>
20+
))
21+
22+
const closed: JSX.Element = <IconOutline.MenuIcon />
23+
24+
const open: JSX.Element = (
25+
<>
26+
<IconOutline.XIcon />
27+
<div className={styles['tool-selectors-narrow-container']}>
28+
{toolSelectors}
29+
</div>
30+
</>
31+
)
32+
33+
return (
34+
<div
35+
className={classNames(styles['tool-selectors-narrow'], 'font-tc-white')}
36+
onClick={() => setIsOpen(!isOpen)}
37+
>
38+
{isOpen ? open : closed}
39+
</div>
40+
)
41+
}
42+
43+
export default ToolSelectorsNarrow
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as ToolSelectorsNarrow } from './ToolSelectorsNarrow'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
@import '../../../../lib/styles/includes';
2+
3+
.tool-selector-narrow {
4+
5+
a:last-of-type {
6+
border-bottom: 1px solid $black-60;
7+
}
8+
9+
.tool-selector-narrow-link {
10+
display: flex;
11+
justify-content: space-between;
12+
align-items: center;
13+
border-top: 1px solid $black-60;
14+
padding: $pad-lg 0;
15+
color: $tc-white;
16+
font-weight: $font-weight-medium;
17+
background-color: $black-100;
18+
19+
svg {
20+
@include icon-lg;
21+
fill: $tc-white;
22+
23+
path {
24+
stroke-width: 1.13px;
25+
fill: none;
26+
}
27+
}
28+
29+
&.tool-selector-narrow-active {
30+
color: $turq-100;
31+
}
32+
}
33+
}

0 commit comments

Comments
 (0)