Skip to content

Commit 640e0f7

Browse files
Merge pull request #102 from topcoder-platform/PROD-2195_migrate
PROD-2195 migrate -> PROD-2194_reincarnate
2 parents e498d48 + c9b3604 commit 640e0f7

File tree

709 files changed

+31710
-2544
lines changed

Some content is hidden

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

709 files changed

+31710
-2544
lines changed

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ It is written using React 17, Typescript 4, and Node 16.
3535

3636
### To create a personal config in order to track logs to your local environment
3737

38-
- Add [hostname] to src/config/app-host-environment.enum.ts
39-
- Copy an existing config from src/config/environment.*.config.ts
38+
- Add [hostname] to src-ts/config/app-host-environment.enum.ts
39+
- Copy an existing config from src-ts/config/environment.*.config.ts
4040
- Rename new config environment.[hostname].config.ts
4141
- Rename config variable to EnvironmentConfig[HostName]
4242
- Set the ENV variable to AppHostEnvironment.[hostnama]
43-
- Add the switch case for the host name to src/config/environment.config.ts
43+
- Add the switch case for the host name to src-ts/config/environment.config.ts
4444
- Prior to starting the server, set your host name:
4545
\> export REACT_APP_HOST_ENV=[hostname]
4646

@@ -54,7 +54,7 @@ It is written using React 17, Typescript 4, and Node 16.
5454
## Developing
5555

5656
The following descriptions correspond to the top-level directories within the
57-
src directory.
57+
src-ts directory.
5858

5959
### config
6060

@@ -98,9 +98,9 @@ The Tool Selectors correlate 1:1 to directories within the tools directory.
9898

9999
The name of a tool's directory should correlate w/the name of the tool and its url.
100100

101-
I.e. src/tools/[tool-name] == platform.topcoder.com/[tool-name]
101+
I.e. src-ts/tools/[tool-name] == platform.topcoder.com/[tool-name]
102102

103-
E.g. src/tools/self-service == platform.topcoder.com/self-service
103+
E.g. src-ts/tools/self-service == platform.topcoder.com/self-service
104104

105105
Tools should generally not import modules from any directories other than lib.
106106

@@ -112,11 +112,11 @@ generally be moved to lib.
112112
All of the routes for a tool, including root, section, and subsections should be
113113
defined in a top-level file.
114114

115-
I.e. [toolName]Routes in src/tools/[tool-name]/[tool-name].routes.ts
115+
I.e. [toolName]Routes in src-ts/tools/[tool-name]/[tool-name].routes.ts
116116

117-
E.g. selfServiceRoutes in src/tools/self-service/self-service.routes.ts
117+
E.g. selfServiceRoutes in src-ts/tools/self-service/self-service.routes.ts
118118

119-
These routes then need to be added to the src/tools/tools.routes.ts file,
119+
These routes then need to be added to the src-ts/tools/tools.routes.ts file,
120120
at which time the tool selectors should automatically be updatd.
121121

122122
### utils
@@ -127,9 +127,9 @@ The Utility Selectors correlate 1:1 to directories within the utils directory.
127127

128128
The name of a util's directory should correlate w/the name of the util and its url.
129129

130-
I.e. src/utils/[util-name] == platform.topcoder.com/[util-name]
130+
I.e. src-ts/utils/[util-name] == platform.topcoder.com/[util-name]
131131

132-
E.g. src/utils/profile == platform.topcoder.com/profile
132+
E.g. src-ts/utils/profile == platform.topcoder.com/profile
133133

134134
Utils should generally not import modules from any directories other than lib.
135135

@@ -141,9 +141,9 @@ generally be moved to lib.
141141
All of the routes for a util, including root, section, and subsections should be
142142
defined in a top-level file.
143143

144-
I.e. [utilName]Routes in src/utils/[util-name]/[util-name].routes.ts
144+
I.e. [utilName]Routes in src-ts/utils/[util-name]/[util-name].routes.ts
145145

146-
E.g. homeRoutes in src/tools/home/home.routes.ts
146+
E.g. homeRoutes in src-ts/tools/home/home.routes.ts
147147

148-
These routes then need to be added to the src/utils/utils.routes.ts file,
148+
These routes then need to be added to the src-ts/utils/utils.routes.ts file,
149149
at which time the tool selectors should automatically be updated.

babel.config.js

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
module.exports = function (api) {
2+
const isProd = process.env.APPMODE === "production";
3+
api.cache(!isProd);
4+
5+
const generateScopedName = isProd
6+
? "[hash:base64:6]"
7+
: "self_service_[path][name]___[local]___[hash:base64:6]";
8+
return {
9+
presets: ["@babel/preset-env", "@babel/preset-react"],
10+
plugins: [
11+
[
12+
"@babel/plugin-transform-runtime",
13+
{
14+
useESModules: true,
15+
regenerator: false,
16+
},
17+
],
18+
[
19+
"react-css-modules",
20+
{
21+
filetypes: {
22+
".scss": {
23+
syntax: "postcss-scss",
24+
},
25+
},
26+
generateScopedName,
27+
},
28+
],
29+
[
30+
"inline-react-svg",
31+
{
32+
"svgo": {
33+
"plugins": [
34+
{
35+
"cleanupIDs": false
36+
}
37+
]
38+
}
39+
}
40+
],
41+
],
42+
env: {
43+
test: {
44+
presets: [
45+
[
46+
"@babel/preset-env",
47+
{
48+
targets: "current node",
49+
},
50+
],
51+
],
52+
plugins: [
53+
[
54+
"module-resolver",
55+
{
56+
alias: {
57+
styles: "./src/styles",
58+
components: "./src/components",
59+
hooks: "./src/hooks",
60+
utils: "./src/utils",
61+
constants: "./src/constants",
62+
services: "./src/services",
63+
},
64+
},
65+
],
66+
],
67+
},
68+
},
69+
};
70+
};

config-overrides.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const { removeModuleScopePlugin } = require('customize-cra')
2+
3+
module.exports = removeModuleScopePlugin()

config/dev.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
module.exports = {
2+
/**
3+
* URL of Topcoder Community Website
4+
*/
5+
TOPCODER_COMMUNITY_WEBSITE_URL: "https://topcoder-dev.com",
6+
TERMS_URL:
7+
"https://www.topcoder-dev.com/challenges/terms/detail/317cd8f9-d66c-4f2a-8774-63c612d99cd4",
8+
PRIVACY_POLICY_URL: "https://www.topcoder-dev.com/policy",
9+
SIGN_IN_URL: `https://accounts-auth0.topcoder-dev.com/?retUrl=https%3A%2F%2Fplatform.topcoder-dev.com%2Fself-service%2Fwizard&regSource=selfService`,
10+
SIGN_UP_URL: `https://accounts-auth0.topcoder-dev.com/?retUrl=https%3A%2F%2Fplatform.topcoder-dev.com%2Fself-service%2Fwizard&regSource=selfService&mode=signUp`,
11+
/**
12+
* URL of Topcoder Connect Website
13+
*/
14+
CONNECT_WEBSITE_URL: "https://connect.topcoder-dev.com",
15+
VANILLA_EMBED_JS: "https://vanilla.topcoder-dev.com/js/embed.js",
16+
VANILLA_EMBED_TYPE: "mfe",
17+
VANILLA_FORUM_API: "https://vanilla.topcoder-dev.com/api/v2",
18+
VANILLA_ACCESS_TOKEN: "va.JApNvUOx3549h20I6tnl1kOQDc75NDIp.0jG3dA.EE3gZgV",
19+
20+
API: {
21+
V5: "https://api.topcoder-dev.com/v5",
22+
V3: "https://api.topcoder-dev.com/v3",
23+
},
24+
25+
STRIPE: {
26+
API_KEY: "pk_test_rfcS49MHRVUKomQ9JgSH7Xqz",
27+
API_VERSION: "2020-08-27",
28+
CUSTOMER_TOKEN:
29+
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJ0ZXN0MSIsImV4cCI6MjU2MzA3NjY4OSwidXNlcklkIjoiNDAwNTEzMzMiLCJpYXQiOjE0NjMwNzYwODksImVtYWlsIjoidGVzdEB0b3Bjb2Rlci5jb20iLCJqdGkiOiJiMzNiNzdjZC1iNTJlLTQwZmUtODM3ZS1iZWI4ZTBhZTZhNGEifQ.jl6Lp_friVNwEP8nfsfmL-vrQFzOFp2IfM_HC7AwGcg",
30+
ADMIN_TOKEN:
31+
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiYWRtaW5pc3RyYXRvciJdLCJpc3MiOiJodHRwczovL2FwaS50b3Bjb2Rlci1kZXYuY29tIiwiaGFuZGxlIjoidGVzdDEiLCJleHAiOjI1NjMwNzY2ODksInVzZXJJZCI6IjQwMDUxMzMzIiwiaWF0IjoxNDYzMDc2MDg5LCJlbWFpbCI6InRlc3RAdG9wY29kZXIuY29tIiwianRpIjoiYjMzYjc3Y2QtYjUyZS00MGZlLTgzN2UtYmViOGUwYWU2YTRhIn0.wKWUe0-SaiFVN-VR_-GwgFlvWaDkSbc8H55ktb9LAVw",
32+
},
33+
/**
34+
* Expire time period of auto saved intake form: 24 hours
35+
*/
36+
AUTO_SAVED_COOKIE_EXPIRED_IN: 24 * 60,
37+
TIME_ZONE: "Europe/London",
38+
};

config/index.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/* global process */
2+
3+
module.exports = (() => {
4+
const env = process.env.APPENV || "dev";
5+
6+
console.info(`APPENV: "${env}"`);
7+
8+
// for security reason don't let to require any arbitrary file defined in process.env
9+
if (["prod", "dev"].indexOf(env) < 0) {
10+
return require("./dev");
11+
}
12+
13+
return require("./" + env);
14+
})();

config/local.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
COMMUNITY_ADMIN_URL: "",
3+
};

config/prod.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
module.exports = {
2+
/**
3+
* URL of Topcoder Community Website
4+
*/
5+
TOPCODER_COMMUNITY_WEBSITE_URL: "https://topcoder.com",
6+
TERMS_URL:
7+
"https://www.topcoder.com/challenges/terms/detail/564a981e-6840-4a5c-894e-d5ad22e9cd6f",
8+
PRIVACY_POLICY_URL: "https://www.topcoder.com/policy",
9+
SIGN_IN_URL: `https://accounts-auth0.topcoder.com/?retUrl=https%3A%2F%2Fplatform.topcoder.com%2Fself-service%2Fwizard&regSource=selfService`,
10+
SIGN_UP_URL: `https://accounts-auth0.topcoder.com/?retUrl=https%3A%2F%2Fplatform.topcoder.com%2Fself-service%2Fwizard&regSource=selfService&mode=signUp`,
11+
12+
/**
13+
* URL of Topcoder Connect Website
14+
*/
15+
CONNECT_WEBSITE_URL: "https://connect.topcoder.com",
16+
VANILLA_EMBED_JS: "https://discussions.topcoder.com/js/embed.js",
17+
VANILLA_EMBED_TYPE: "standard",
18+
VANILLA_FORUM_API: "https://vanilla.topcoder.com/api/v2",
19+
VANILLA_ACCESS_TOKEN: "va.JApNvUOx3549h20I6tnl1kOQDc75NDIp.0jG3dA.EE3gZgV",
20+
21+
API: {
22+
V5: "https://api.topcoder.com/v5",
23+
V3: "https://api.topcoder.com/v3",
24+
},
25+
26+
STRIPE: {
27+
API_KEY: "pk_live_m3bCBVSfkfMOEp3unZFRsHXi",
28+
API_VERSION: "2020-08-27",
29+
CUSTOMER_TOKEN:
30+
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJ0ZXN0MSIsImV4cCI6MjU2MzA3NjY4OSwidXNlcklkIjoiNDAwNTEzMzMiLCJpYXQiOjE0NjMwNzYwODksImVtYWlsIjoidGVzdEB0b3Bjb2Rlci5jb20iLCJqdGkiOiJiMzNiNzdjZC1iNTJlLTQwZmUtODM3ZS1iZWI4ZTBhZTZhNGEifQ.jl6Lp_friVNwEP8nfsfmL-vrQFzOFp2IfM_HC7AwGcg",
31+
ADMIN_TOKEN:
32+
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiYWRtaW5pc3RyYXRvciJdLCJpc3MiOiJodHRwczovL2FwaS50b3Bjb2Rlci1kZXYuY29tIiwiaGFuZGxlIjoidGVzdDEiLCJleHAiOjI1NjMwNzY2ODksInVzZXJJZCI6IjQwMDUxMzMzIiwiaWF0IjoxNDYzMDc2MDg5LCJlbWFpbCI6InRlc3RAdG9wY29kZXIuY29tIiwianRpIjoiYjMzYjc3Y2QtYjUyZS00MGZlLTgzN2UtYmViOGUwYWU2YTRhIn0.wKWUe0-SaiFVN-VR_-GwgFlvWaDkSbc8H55ktb9LAVw",
33+
},
34+
/**
35+
* Expire time period of auto saved intake form: 24 hours
36+
*/
37+
AUTO_SAVED_COOKIE_EXPIRED_IN: 24 * 60,
38+
TIME_ZONE: "Europe/London",
39+
};

package.json

Lines changed: 74 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,44 +5,115 @@
55
"scripts": {
66
"start": "sh start-ssl.sh",
77
"start:bsouza": "sh start-ssl-bsouza.sh",
8+
"start:mfe": "cross-env webpack-dev-server --port 8519 --host 0.0.0.0",
89
"build": "react-scripts build",
910
"build:dev": "sh build-dev.sh",
1011
"build:prod": "sh build-prod.sh",
1112
"eject": "react-scripts eject",
12-
"lint": "tslint src/**/*.{ts,tsx}",
13-
"lint:fix": "tslint src/**/*.{ts,tsx} --fix",
13+
"lint": "tslint 'src-ts/**/*.{ts,tsx}'",
14+
"lint:fix": "tslint 'src-ts/**/*.{ts,tsx}' --fix",
15+
"eslint": "eslint 'src/**/*.{js,jsx}'",
16+
"eslint:fix": "eslint 'src/**/*.{js,jsx}' --fix",
1417
"test": "react-scripts test",
1518
"test:no-watch": "npm test -- --watchAll=false"
1619
},
1720
"dependencies": {
1821
"@datadog/browser-logs": "^4.5.0",
1922
"@heroicons/react": "^1.0.6",
23+
"apexcharts": "^3.35.3",
2024
"axios": "^0.26.1",
2125
"browser-cookies": "^1.2.0",
2226
"classnames": "^2.3.1",
27+
"crypto-js": "^4.1.1",
28+
"lodash": "^4.17.21",
29+
"moment": "^2.29.3",
30+
"moment-timezone": "^0.5.34",
31+
"prop-types": "^15.8.1",
32+
"rc-checkbox": "^2.3.2",
2333
"react": "^17.0.2",
34+
"react-apexcharts": "^1.4.0",
2435
"react-dom": "^17.0.2",
36+
"react-elastic-carousel": "^0.11.5",
2537
"react-gtm-module": "^2.0.11",
38+
"react-redux": "^8.0.2",
39+
"react-redux-toastr": "^7.6.8",
2640
"react-responsive-modal": "^6.2.0",
2741
"react-router-dom": "^6.2.1",
2842
"react-scripts": "5.0.0",
43+
"react-select": "^5.3.2",
44+
"react-spinners": "^0.13.1",
2945
"react-toastify": "^8.2.0",
46+
"react-tooltip": "^4.2.21",
47+
"redux": "^4.2.0",
48+
"redux-logger": "^3.0.6",
49+
"redux-promise-middleware": "^6.1.2",
50+
"redux-thunk": "^2.4.1",
3051
"sass": "^1.49.8",
52+
"styled-components": "^5.3.5",
3153
"tc-auth-lib": "topcoder-platform/tc-auth-lib#1.0.3",
3254
"typescript": "^4.4.2",
55+
"uuid": "^8.3.2",
3356
"web-vitals": "^2.1.0"
3457
},
3558
"devDependencies": {
59+
"@babel/core": "^7.7.5",
60+
"@babel/plugin-syntax-jsx": "^7.17.12",
61+
"@babel/plugin-transform-runtime": "^7.8.3",
62+
"@babel/preset-env": "^7.7.6",
63+
"@babel/preset-react": "^7.7.4",
64+
"@babel/preset-typescript": "^7.16.7",
65+
"@babel/runtime": "^7.8.7",
66+
"@stripe/react-stripe-js": "1.7.2",
67+
"@stripe/stripe-js": "1.29.0",
3668
"@testing-library/jest-dom": "^5.14.1",
3769
"@testing-library/react": "^12.0.0",
3870
"@testing-library/user-event": "^13.2.1",
3971
"@types/axios": "^0.14.0",
4072
"@types/jest": "^27.0.1",
73+
"@types/lodash": "^4.14.182",
4174
"@types/node": "^16.7.13",
75+
"@types/reach__router": "^1.3.10",
4276
"@types/react": "^17.0.20",
4377
"@types/react-dom": "^17.0.9",
4478
"@types/react-gtm-module": "^2.0.1",
45-
"@types/react-router-dom": "^5.3.3"
79+
"@types/react-redux-toastr": "^7.6.2",
80+
"@types/react-router-dom": "^5.3.3",
81+
"@types/systemjs": "^6.1.0",
82+
"autoprefixer": "^9.8.6",
83+
"babel-eslint": "^11.0.0-beta.2",
84+
"babel-jest": "^24.9.0",
85+
"babel-plugin-inline-react-svg": "^1.1.2",
86+
"babel-plugin-module-resolver": "^4.0.0",
87+
"babel-plugin-react-css-modules": "^5.2.6",
88+
"concurrently": "^5.0.1",
89+
"config": "^3.3.6",
90+
"cross-env": "^7.0.2",
91+
"customize-cra": "^1.0.0",
92+
"eslint": "^8.18.0",
93+
"eslint-config-prettier": "^6.7.0",
94+
"eslint-config-react-app": "^7.0.1",
95+
"eslint-config-react-important-stuff": "^2.0.0",
96+
"eslint-plugin-prettier": "^3.1.1",
97+
"file-loader": "^6.2.0",
98+
"identity-obj-proxy": "^3.0.0",
99+
"jest": "^25.2.7",
100+
"jest-cli": "^25.2.7",
101+
"postcss-loader": "^4.0.4",
102+
"postcss-scss": "^3.0.2",
103+
"prettier": "^2.0.4",
104+
"pretty-quick": "^2.0.1",
105+
"react-app-rewired": "^2.2.1",
106+
"resolve-url-loader": "^3.1.2",
107+
"sass": "^1.48.0",
108+
"sass-loader": "^10.0.5",
109+
"single-spa-react": "^2.14.0",
110+
"style-loader": "^2.0.0",
111+
"systemjs-webpack-interop": "^2.1.2",
112+
"webpack": "^4.41.2",
113+
"webpack-cli": "^3.3.10",
114+
"webpack-config-single-spa-react": "^1.0.3",
115+
"webpack-dev-server": "^3.9.0",
116+
"webpack-merge": "^4.2.2"
46117
},
47118
"eslintConfig": {
48119
"extends": [

public/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<meta name="theme-color" content="#000000" />
99
<meta name="description"
1010
content="Topcoder is home to the world’s largest community of designers, developers, and data scientists. Allowing you the freedom to start and execute faster." />
11+
<link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Barlow'>
1112
<link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Barlow Condensed'>
1213
<link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Roboto'>
1314
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo_512x512.png" />

0 commit comments

Comments
 (0)