Skip to content

Commit ea02018

Browse files
Merge pull request #257 from topcoder-platform/dev
TCA-109 Learn Tool MVP -> master
2 parents 51276a5 + a2d61e7 commit ea02018

File tree

510 files changed

+13941
-2283
lines changed

Some content is hidden

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

510 files changed

+13941
-2283
lines changed

.circleci/config.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ save_cache_settings: &save_cache_settings
3737
paths:
3838
- node_modules
3939

40+
running_yarn_tslint: &running_yarn_tslint
41+
name: Running Yarn tslint
42+
command: |
43+
yarn add tslint -g
44+
yarn lint
45+
4046
running_yarn_build: &running_yarn_build
4147
name: Running Yarn Build
4248
command: |
@@ -58,6 +64,12 @@ build_configuration_fetch: &build_configuration_fetch
5864
./awsconfiguration.sh $DEPLOY_ENV
5965
./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-${APPNAME}-buildvar
6066
67+
lint_steps: &lint_steps
68+
# Initialization.
69+
- checkout
70+
- setup_remote_docker
71+
- run: *running_yarn_tslint
72+
6173
build_steps: &build_steps
6274
# Initialization.
6375
- checkout
@@ -83,6 +95,22 @@ deploy_steps: &deploy_steps
8395
./master_deploy.sh -d CFRONT -e $DEPLOY_ENV -c $ENABLE_CACHE
8496
8597
jobs:
98+
lint-dev:
99+
<<: *defaults
100+
environment:
101+
DEPLOY_ENV: "DEV"
102+
LOGICAL_ENV: "dev"
103+
APPNAME: "platform-ui-mvp"
104+
steps: *lint_steps
105+
106+
lint-prod:
107+
<<: *defaults
108+
environment:
109+
DEPLOY_ENV: "PROD"
110+
LOGICAL_ENV: "prod"
111+
APPNAME: "platform-ui-mvp"
112+
steps: *lint_steps
113+
86114
build-dev:
87115
<<: *defaults
88116
environment:
@@ -122,6 +150,20 @@ workflows:
122150
version: 2
123151
build:
124152
jobs:
153+
- lint-dev:
154+
context : org-global
155+
filters:
156+
branches:
157+
ignore:
158+
- master
159+
160+
- lint-prod:
161+
context : org-global
162+
filters:
163+
branches:
164+
only:
165+
- master
166+
125167
- build-dev:
126168
context : org-global
127169
filters:

README.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,30 @@
22

33
The Platform UI is the official Topcoder web app to host all modern user interfaces to be used by all users.
44

5-
Beginning March, 2022 all future user interfaces at Topcoder will be implemented here. Pre-existing user interfaces will be ported to here over time until this is the only user interface any user sees when interacting with Topcoder.
5+
All future user interfaces at Topcoder will be implemented here.
6+
Pre-existing user interfaces will be ported to here over time until this is the only user interface any user sees when interacting with Topcoder.
7+
8+
>**NOTE:** The information in this file describes our coding standards and best practices. All new code should follow these guidelines both when coding new features as well as porting old features. Please take the time to read through this file in detail.
9+
10+
# Getting started with local development
611

712
- [Local Environment Setup](#local-environment-setup)
813
- [Deployments](#deployments)
914
- [Yarn Commands](#yarn-commands)
15+
16+
# Application structure
17+
1018
- [Folder Structure](#folder-structure)
1119
- [Adding a Tool or Util](#adding-a-tool-or-util)
20+
21+
# Coding Practices
1222
- [Git](#git)
1323
- [Linting](#linting)
1424
- [Styling](#styling)
1525
- [Icons](#icons)
1626

27+
---
28+
1729
## Local Environment Setup
1830

1931
### Dependencies
@@ -393,6 +405,23 @@ example.scss
393405
}
394406
}
395407
```
408+
409+
Mobile UIs use xs, sm, and md breakpoints. Larger breakpoints are desktop UIs.
410+
411+
For specifying mobile CSS, you can use @include ltemd:
412+
```
413+
.exampleDesktopContent {
414+
display: flex;
415+
width: 100%;
416+
flex-direction: column;
417+
418+
@include ltemd {
419+
flex-direction: row;
420+
}
421+
}
422+
```
423+
424+
396425
>**WARNING:** Do not add any breakpoints!
397426
398427
## Icons

package.json

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,33 @@
66
"start": "sh start-ssl.sh",
77
"start:bsouza": "sh start-ssl-bsouza.sh",
88
"build": "yarn react-app-rewired build",
9-
"lint": "tslint 'src-ts/**/*.{ts,tsx}'",
10-
"lint:fix": "tslint 'src-ts/**/*.{ts,tsx}' --fix",
9+
"lint": "tslint 'src-ts/**/*.{ts,tsx}' && eslint 'src*/**/*.{js,jsx,ts,tsx}'",
10+
"lint:fix": "tslint 'src-ts/**/*.{ts,tsx}' --fix && eslint 'src*/**/*.{js,jsx,ts,tsx}' --fix",
11+
"tslint": "tslint 'src-ts/**/*.{ts,tsx}'",
12+
"tslint:fix": "tslint 'src-ts/**/*.{ts,tsx}' --fix",
1113
"eslint": "eslint 'src/**/*.{js,jsx}'",
1214
"eslint:fix": "eslint 'src/**/*.{js,jsx}' --fix",
1315
"test": "react-scripts test --watchAll",
1416
"test:no-watch": "react-scripts test --watchAll=false --passWithNoTests"
1517
},
1618
"dependencies": {
17-
"@datadog/browser-logs": "^4.5.0",
19+
"@datadog/browser-logs": "^4.7.1",
1820
"@heroicons/react": "^1.0.6",
1921
"apexcharts": "^3.35.3",
2022
"axios": "^0.26.1",
2123
"browser-cookies": "^1.2.0",
2224
"classnames": "^2.3.1",
2325
"crypto-js": "^4.1.1",
26+
"customize-cra": "^1.0.0",
27+
"html2canvas": "^1.4.1",
2428
"lodash": "^4.17.21",
2529
"moment": "^2.29.3",
2630
"moment-timezone": "^0.5.34",
2731
"prop-types": "^15.8.1",
2832
"rc-checkbox": "^2.3.2",
2933
"react": "^17.0.2",
3034
"react-apexcharts": "^1.4.0",
35+
"react-app-rewired": "^2.2.1",
3136
"react-dom": "^17.0.2",
3237
"react-elastic-carousel": "^0.11.5",
3338
"react-gtm-module": "^2.0.11",
@@ -46,10 +51,9 @@
4651
"redux-thunk": "^2.4.1",
4752
"sass": "^1.49.8",
4853
"styled-components": "^5.3.5",
49-
"tc-auth-lib": "topcoder-platform/tc-auth-lib#1.0.3",
50-
"typescript": "^4.4.2",
51-
"uuid": "^8.3.2",
52-
"web-vitals": "^2.1.0"
54+
"tc-auth-lib": "topcoder-platform/tc-auth-lib#1.0.4",
55+
"typescript": "^4.6.3",
56+
"uuid": "^8.3.2"
5357
},
5458
"devDependencies": {
5559
"@babel/core": "^7.7.5",
@@ -67,14 +71,16 @@
6771
"@types/axios": "^0.14.0",
6872
"@types/jest": "^27.0.1",
6973
"@types/lodash": "^4.14.182",
70-
"@types/node": "^16.7.13",
74+
"@types/node": "^17.0.24",
7175
"@types/reach__router": "^1.3.10",
72-
"@types/react": "^17.0.20",
73-
"@types/react-dom": "^17.0.9",
76+
"@types/react": "^18.0.5",
77+
"@types/react-dom": "^18.0.1",
7478
"@types/react-gtm-module": "^2.0.1",
7579
"@types/react-redux-toastr": "^7.6.2",
7680
"@types/react-router-dom": "^5.3.3",
81+
"@types/segment-analytics": "^0.0.34",
7782
"@types/systemjs": "^6.1.0",
83+
"@types/uuid": "^8.3.4",
7884
"autoprefixer": "^9.8.6",
7985
"babel-eslint": "^11.0.0-beta.2",
8086
"babel-jest": "^24.9.0",
@@ -84,23 +90,22 @@
8490
"concurrently": "^5.0.1",
8591
"config": "^3.3.6",
8692
"cross-env": "^7.0.2",
87-
"customize-cra": "^1.0.0",
8893
"eslint": "^8.18.0",
8994
"eslint-config-prettier": "^6.7.0",
9095
"eslint-config-react-app": "^7.0.1",
9196
"eslint-config-react-important-stuff": "^2.0.0",
9297
"eslint-plugin-prettier": "^3.1.1",
9398
"file-loader": "^6.2.0",
99+
"husky": "^8.0.0",
94100
"identity-obj-proxy": "^3.0.0",
95101
"jest": "^25.2.7",
96102
"jest-cli": "^25.2.7",
103+
"lint-staged": "^13.0.3",
97104
"postcss-loader": "^4.0.4",
98105
"postcss-scss": "^3.0.2",
99106
"prettier": "^2.0.4",
100107
"pretty-quick": "^2.0.1",
101-
"react-app-rewired": "^2.2.1",
102108
"resolve-url-loader": "^3.1.2",
103-
"sass": "^1.48.0",
104109
"sass-loader": "^10.0.5",
105110
"style-loader": "^2.0.0",
106111
"systemjs-webpack-interop": "^2.1.2",

src-ts/App.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,8 @@ import { FC, ReactElement, useContext } from 'react'
22
import { Routes } from 'react-router-dom'
33
import { toast, ToastContainer } from 'react-toastify'
44

5-
import { EnvironmentConfig } from './config'
65
import { Header } from './header'
7-
import { analyticsInitialize, logInitialize, routeContext, RouteContextData } from './lib'
8-
9-
analyticsInitialize(EnvironmentConfig)
10-
logInitialize(EnvironmentConfig)
6+
import { routeContext, RouteContextData } from './lib'
117

128
const App: FC<{}> = () => {
139

src-ts/config/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export enum ToolTitle {
2+
learn = 'Learn',
23
settings = 'Account Settings',
34
work = 'Work',
45
}

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

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,40 @@ import { GlobalConfig } from '../../lib'
22

33
import { AppHostEnvironment } from './app-host-environment.enum'
44

5+
const COMMUNITY_WEBSITE: string = 'https://www.topcoder-dev.com'
6+
57
export const EnvironmentConfigDefault: GlobalConfig = {
8+
ANALYTICS: {
9+
SEGMENT_KEY: undefined,
10+
TAG_MANAGER_ID: undefined,
11+
},
612
API: {
713
FORUM_ACCESS_TOKEN: 'va.JApNvUOx3549h20I6tnl1kOQDc75NDIp.0jG3dA.EE3gZgV',
814
FORUM_V2: 'https://vanilla.topcoder-dev.com/api/v2',
915
V3: 'https://api.topcoder-dev.com/v3',
1016
V5: 'https://api.topcoder-dev.com/v5',
1117
},
1218
ENV: AppHostEnvironment.default,
19+
LEARN_SRC: 'https://fcc.topcoder-dev.com:4431',
1320
LOGGING: {
1421
PUBLIC_TOKEN: 'puba0825671e469d16f940c5a30dc738f11',
1522
SERVICE: 'platform-ui',
1623
},
1724
REAUTH_OFFSET: 55,
18-
TAG_MANAGER_ID: undefined,
25+
// TODO: Move stripe creds to .env file
26+
STRIPE: {
27+
ADMIN_TOKEN:
28+
'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiYWRtaW5pc3RyYXRvciJdLCJpc3MiOiJodHRwczovL2FwaS50b3Bjb2Rlci1kZXYuY29tIiwiaGFuZGxlIjoidGVzdDEiLCJleHAiOjI1NjMwNzY2ODksInVzZXJJZCI6IjQwMDUxMzMzIiwiaWF0IjoxNDYzMDc2MDg5LCJlbWFpbCI6InRlc3RAdG9wY29kZXIuY29tIiwianRpIjoiYjMzYjc3Y2QtYjUyZS00MGZlLTgzN2UtYmViOGUwYWU2YTRhIn0.wKWUe0-SaiFVN-VR_-GwgFlvWaDkSbc8H55ktb9LAVw',
29+
API_KEY: 'pk_test_rfcS49MHRVUKomQ9JgSH7Xqz',
30+
API_VERSION: '2020-08-27',
31+
CUSTOMER_TOKEN:
32+
'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJ0ZXN0MSIsImV4cCI6MjU2MzA3NjY4OSwidXNlcklkIjoiNDAwNTEzMzMiLCJpYXQiOjE0NjMwNzYwODksImVtYWlsIjoidGVzdEB0b3Bjb2Rlci5jb20iLCJqdGkiOiJiMzNiNzdjZC1iNTJlLTQwZmUtODM3ZS1iZWI4ZTBhZTZhNGEifQ.jl6Lp_friVNwEP8nfsfmL-vrQFzOFp2IfM_HC7AwGcg',
33+
},
34+
TOPCODER_URLS: {
35+
CHALLENGES_PAGE: `${COMMUNITY_WEBSITE}/challenges`,
36+
GIGS_PAGE: `${COMMUNITY_WEBSITE}/gigs`,
37+
USER_PROFILE: `${COMMUNITY_WEBSITE}/members`,
38+
},
1939
URL: {
2040
ACCOUNTS_APP_CONNECTOR: 'https://accounts-auth0.topcoder-dev.com',
2141
},
Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,25 @@
11
import { GlobalConfig } from '../../lib'
2-
import { ToolTitle } from '../constants'
32

43
import { AppHostEnvironment } from './app-host-environment.enum'
54
import { EnvironmentConfigDefault } from './environment.default.config'
65

76
export const EnvironmentConfigDev: GlobalConfig = {
87
...EnvironmentConfigDefault,
9-
DISABLED_TOOLS: [
10-
ToolTitle.designLib,
11-
],
8+
ANALYTICS: {
9+
SEGMENT_KEY: EnvironmentConfigDefault.ANALYTICS.SEGMENT_KEY,
10+
TAG_MANAGER_ID: 'GTM-MXXQHG8',
11+
// TAG_MANAGER_ID: 'GTM-W7B537Z',
12+
},
13+
DISABLED_TOOLS: [],
1214
ENV: AppHostEnvironment.dev,
13-
TAG_MANAGER_ID: 'GTM-W7B537Z',
15+
LEARN_SRC: 'https://freecodecamp.topcoder-dev.com',
16+
// TODO: Move stripe creds to .env file
17+
STRIPE: {
18+
ADMIN_TOKEN:
19+
'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiYWRtaW5pc3RyYXRvciJdLCJpc3MiOiJodHRwczovL2FwaS50b3Bjb2Rlci1kZXYuY29tIiwiaGFuZGxlIjoidGVzdDEiLCJleHAiOjI1NjMwNzY2ODksInVzZXJJZCI6IjQwMDUxMzMzIiwiaWF0IjoxNDYzMDc2MDg5LCJlbWFpbCI6InRlc3RAdG9wY29kZXIuY29tIiwianRpIjoiYjMzYjc3Y2QtYjUyZS00MGZlLTgzN2UtYmViOGUwYWU2YTRhIn0.wKWUe0-SaiFVN-VR_-GwgFlvWaDkSbc8H55ktb9LAVw',
20+
API_KEY: 'pk_test_rfcS49MHRVUKomQ9JgSH7Xqz',
21+
API_VERSION: '2020-08-27',
22+
CUSTOMER_TOKEN:
23+
'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJ0ZXN0MSIsImV4cCI6MjU2MzA3NjY4OSwidXNlcklkIjoiNDAwNTEzMzMiLCJpYXQiOjE0NjMwNzYwODksImVtYWlsIjoidGVzdEB0b3Bjb2Rlci5jb20iLCJqdGkiOiJiMzNiNzdjZC1iNTJlLTQwZmUtODM3ZS1iZWI4ZTBhZTZhNGEifQ.jl6Lp_friVNwEP8nfsfmL-vrQFzOFp2IfM_HC7AwGcg',
24+
},
1425
}

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

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,39 @@
11
import { GlobalConfig } from '../../lib'
2-
import { ToolTitle } from '../constants'
32

43
import { AppHostEnvironment } from './app-host-environment.enum'
54
import { EnvironmentConfigDefault } from './environment.default.config'
65

6+
const COMMUNITY_WEBSITE: string = 'https://www.topcoder.com'
7+
78
export const EnvironmentConfigProd: GlobalConfig = {
89
...EnvironmentConfigDefault,
10+
ANALYTICS: {
11+
SEGMENT_KEY: '8fCbi94o3ruUUGxRRGxWu194t6iVq9LH',
12+
TAG_MANAGER_ID: 'GTM-MXXQHG8',
13+
},
914
API: {
15+
FORUM_ACCESS_TOKEN: EnvironmentConfigDefault.API.FORUM_ACCESS_TOKEN,
1016
FORUM_V2: 'https://vanilla.topcoder.com/api/v2',
1117
V3: 'https://api.topcoder.com/v3',
1218
V5: 'https://api.topcoder.com/v5',
1319
},
1420
DISABLED_TOOLS: [ ],
1521
ENV: AppHostEnvironment.prod,
16-
TAG_MANAGER_ID: 'GTM-MXXQHG8',
22+
LEARN_SRC: 'https://fcc.topcoder.com:4431',
23+
// TODO: Move stripe creds to .env file
24+
STRIPE: {
25+
ADMIN_TOKEN:
26+
'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiYWRtaW5pc3RyYXRvciJdLCJpc3MiOiJodHRwczovL2FwaS50b3Bjb2Rlci1kZXYuY29tIiwiaGFuZGxlIjoidGVzdDEiLCJleHAiOjI1NjMwNzY2ODksInVzZXJJZCI6IjQwMDUxMzMzIiwiaWF0IjoxNDYzMDc2MDg5LCJlbWFpbCI6InRlc3RAdG9wY29kZXIuY29tIiwianRpIjoiYjMzYjc3Y2QtYjUyZS00MGZlLTgzN2UtYmViOGUwYWU2YTRhIn0.wKWUe0-SaiFVN-VR_-GwgFlvWaDkSbc8H55ktb9LAVw',
27+
API_KEY: 'pk_live_m3bCBVSfkfMOEp3unZFRsHXi',
28+
API_VERSION: '2020-08-27',
29+
CUSTOMER_TOKEN:
30+
'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJ0ZXN0MSIsImV4cCI6MjU2MzA3NjY4OSwidXNlcklkIjoiNDAwNTEzMzMiLCJpYXQiOjE0NjMwNzYwODksImVtYWlsIjoidGVzdEB0b3Bjb2Rlci5jb20iLCJqdGkiOiJiMzNiNzdjZC1iNTJlLTQwZmUtODM3ZS1iZWI4ZTBhZTZhNGEifQ.jl6Lp_friVNwEP8nfsfmL-vrQFzOFp2IfM_HC7AwGcg',
31+
},
32+
TOPCODER_URLS: {
33+
CHALLENGES_PAGE: `${COMMUNITY_WEBSITE}/challenges`,
34+
GIGS_PAGE: `${COMMUNITY_WEBSITE}/gigs`,
35+
USER_PROFILE: `${COMMUNITY_WEBSITE}/members`,
36+
},
1737
URL: {
1838
ACCOUNTS_APP_CONNECTOR: 'https://accounts-auth0.topcoder.com',
1939
},

src-ts/declarations.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ declare module '*.html' {
33
export = htmlFile
44
}
55

6+
declare module '*.pdf'
7+
68
declare module '*.scss' {
79
const scssFile: { [style: string]: any }
810
export = scssFile

0 commit comments

Comments
 (0)