Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
599365f
PROD-2195 rename src-ts in separate branch in order to isolate its 23…
brooketopcoder Jun 27, 2022
93122c0
PROD-2195 #comment add legacy src; delete test files from /src-ts #ti…
brooketopcoder Jun 27, 2022
0f4f123
PROD-2145 #comment update the /src-ts directory to use all the new co…
brooketopcoder Jun 27, 2022
89bf1bf
PROD-2195 #comment remove obsolete legacy files #time 15m
brooketopcoder Jun 27, 2022
c18350f
PROD-2195 clean up errant rename #time 5m
brooketopcoder Jun 27, 2022
a4bf1f6
PROD-2195 clean up errant rename #time 5m
brooketopcoder Jun 27, 2022
7f45469
PROD-2195 #comment configure react-scripts to allow files from outsid…
brooketopcoder Jun 28, 2022
9ad0b6e
PROd-2195 #comment fix page styling #time 30m
brooketopcoder Jun 28, 2022
6741c9d
PROD-2195 #comment convert legacy to updated router #time 1h
brooketopcoder Jun 28, 2022
f000ffe
PROD-2195 #comment lint fixes; random bug fixes; #time 5m
brooketopcoder Jun 28, 2022
9544916
Merge pull request #96 from topcoder-platform/PROD-2195_migrate-mfe
brooketopcoder Jun 28, 2022
ac4d215
Merge pull request #97 from topcoder-platform/PROD-2195_modify-src-ts
brooketopcoder Jun 28, 2022
1802de9
Merge pull request #98 from topcoder-platform/PROD-2195_remove-obsole…
brooketopcoder Jun 28, 2022
1e4b0c2
Merge pull request #95 from topcoder-platform/PROD-2195_rename-src-ts
brooketopcoder Jun 28, 2022
dcbb4f0
Merge pull request #100 from topcoder-platform/PROD-2195_migrate-mfe
brooketopcoder Jun 28, 2022
c9b3604
Merge pull request #99 from topcoder-platform/PROD-2195_remove-mfe-yipee
brooketopcoder Jun 29, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ It is written using React 17, Typescript 4, and Node 16.

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

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

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

The following descriptions correspond to the top-level directories within the
src directory.
src-ts directory.

### config

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

These routes then need to be added to the src/utils/utils.routes.ts file,
These routes then need to be added to the src-ts/utils/utils.routes.ts file,
at which time the tool selectors should automatically be updated.
70 changes: 70 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
module.exports = function (api) {
const isProd = process.env.APPMODE === "production";
api.cache(!isProd);

const generateScopedName = isProd
? "[hash:base64:6]"
: "self_service_[path][name]___[local]___[hash:base64:6]";
return {
presets: ["@babel/preset-env", "@babel/preset-react"],
plugins: [
[
"@babel/plugin-transform-runtime",
{
useESModules: true,
regenerator: false,
},
],
[
"react-css-modules",
{
filetypes: {
".scss": {
syntax: "postcss-scss",
},
},
generateScopedName,
},
],
[
"inline-react-svg",
{
"svgo": {
"plugins": [
{
"cleanupIDs": false
}
]
}
}
],
],
env: {
test: {
presets: [
[
"@babel/preset-env",
{
targets: "current node",
},
],
],
plugins: [
[
"module-resolver",
{
alias: {
styles: "./src/styles",
components: "./src/components",
hooks: "./src/hooks",
utils: "./src/utils",
constants: "./src/constants",
services: "./src/services",
},
},
],
],
},
},
};
};
3 changes: 3 additions & 0 deletions config-overrides.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const { removeModuleScopePlugin } = require('customize-cra')

module.exports = removeModuleScopePlugin()
38 changes: 38 additions & 0 deletions config/dev.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
module.exports = {
/**
* URL of Topcoder Community Website
*/
TOPCODER_COMMUNITY_WEBSITE_URL: "https://topcoder-dev.com",
TERMS_URL:
"https://www.topcoder-dev.com/challenges/terms/detail/317cd8f9-d66c-4f2a-8774-63c612d99cd4",
PRIVACY_POLICY_URL: "https://www.topcoder-dev.com/policy",
SIGN_IN_URL: `https://accounts-auth0.topcoder-dev.com/?retUrl=https%3A%2F%2Fplatform.topcoder-dev.com%2Fself-service%2Fwizard&regSource=selfService`,
SIGN_UP_URL: `https://accounts-auth0.topcoder-dev.com/?retUrl=https%3A%2F%2Fplatform.topcoder-dev.com%2Fself-service%2Fwizard&regSource=selfService&mode=signUp`,
/**
* URL of Topcoder Connect Website
*/
CONNECT_WEBSITE_URL: "https://connect.topcoder-dev.com",
VANILLA_EMBED_JS: "https://vanilla.topcoder-dev.com/js/embed.js",
VANILLA_EMBED_TYPE: "mfe",
VANILLA_FORUM_API: "https://vanilla.topcoder-dev.com/api/v2",
VANILLA_ACCESS_TOKEN: "va.JApNvUOx3549h20I6tnl1kOQDc75NDIp.0jG3dA.EE3gZgV",

API: {
V5: "https://api.topcoder-dev.com/v5",
V3: "https://api.topcoder-dev.com/v3",
},

STRIPE: {
API_KEY: "pk_test_rfcS49MHRVUKomQ9JgSH7Xqz",
API_VERSION: "2020-08-27",
CUSTOMER_TOKEN:
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJ0ZXN0MSIsImV4cCI6MjU2MzA3NjY4OSwidXNlcklkIjoiNDAwNTEzMzMiLCJpYXQiOjE0NjMwNzYwODksImVtYWlsIjoidGVzdEB0b3Bjb2Rlci5jb20iLCJqdGkiOiJiMzNiNzdjZC1iNTJlLTQwZmUtODM3ZS1iZWI4ZTBhZTZhNGEifQ.jl6Lp_friVNwEP8nfsfmL-vrQFzOFp2IfM_HC7AwGcg",
ADMIN_TOKEN:
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiYWRtaW5pc3RyYXRvciJdLCJpc3MiOiJodHRwczovL2FwaS50b3Bjb2Rlci1kZXYuY29tIiwiaGFuZGxlIjoidGVzdDEiLCJleHAiOjI1NjMwNzY2ODksInVzZXJJZCI6IjQwMDUxMzMzIiwiaWF0IjoxNDYzMDc2MDg5LCJlbWFpbCI6InRlc3RAdG9wY29kZXIuY29tIiwianRpIjoiYjMzYjc3Y2QtYjUyZS00MGZlLTgzN2UtYmViOGUwYWU2YTRhIn0.wKWUe0-SaiFVN-VR_-GwgFlvWaDkSbc8H55ktb9LAVw",
},
/**
* Expire time period of auto saved intake form: 24 hours
*/
AUTO_SAVED_COOKIE_EXPIRED_IN: 24 * 60,
TIME_ZONE: "Europe/London",
};
14 changes: 14 additions & 0 deletions config/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/* global process */

module.exports = (() => {
const env = process.env.APPENV || "dev";

console.info(`APPENV: "${env}"`);

// for security reason don't let to require any arbitrary file defined in process.env
if (["prod", "dev"].indexOf(env) < 0) {
return require("./dev");
}

return require("./" + env);
})();
3 changes: 3 additions & 0 deletions config/local.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
COMMUNITY_ADMIN_URL: "",
};
39 changes: 39 additions & 0 deletions config/prod.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
module.exports = {
/**
* URL of Topcoder Community Website
*/
TOPCODER_COMMUNITY_WEBSITE_URL: "https://topcoder.com",
TERMS_URL:
"https://www.topcoder.com/challenges/terms/detail/564a981e-6840-4a5c-894e-d5ad22e9cd6f",
PRIVACY_POLICY_URL: "https://www.topcoder.com/policy",
SIGN_IN_URL: `https://accounts-auth0.topcoder.com/?retUrl=https%3A%2F%2Fplatform.topcoder.com%2Fself-service%2Fwizard&regSource=selfService`,
SIGN_UP_URL: `https://accounts-auth0.topcoder.com/?retUrl=https%3A%2F%2Fplatform.topcoder.com%2Fself-service%2Fwizard&regSource=selfService&mode=signUp`,

/**
* URL of Topcoder Connect Website
*/
CONNECT_WEBSITE_URL: "https://connect.topcoder.com",
VANILLA_EMBED_JS: "https://discussions.topcoder.com/js/embed.js",
VANILLA_EMBED_TYPE: "standard",
VANILLA_FORUM_API: "https://vanilla.topcoder.com/api/v2",
VANILLA_ACCESS_TOKEN: "va.JApNvUOx3549h20I6tnl1kOQDc75NDIp.0jG3dA.EE3gZgV",

API: {
V5: "https://api.topcoder.com/v5",
V3: "https://api.topcoder.com/v3",
},

STRIPE: {
API_KEY: "pk_live_m3bCBVSfkfMOEp3unZFRsHXi",
API_VERSION: "2020-08-27",
CUSTOMER_TOKEN:
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJ0ZXN0MSIsImV4cCI6MjU2MzA3NjY4OSwidXNlcklkIjoiNDAwNTEzMzMiLCJpYXQiOjE0NjMwNzYwODksImVtYWlsIjoidGVzdEB0b3Bjb2Rlci5jb20iLCJqdGkiOiJiMzNiNzdjZC1iNTJlLTQwZmUtODM3ZS1iZWI4ZTBhZTZhNGEifQ.jl6Lp_friVNwEP8nfsfmL-vrQFzOFp2IfM_HC7AwGcg",
ADMIN_TOKEN:
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiYWRtaW5pc3RyYXRvciJdLCJpc3MiOiJodHRwczovL2FwaS50b3Bjb2Rlci1kZXYuY29tIiwiaGFuZGxlIjoidGVzdDEiLCJleHAiOjI1NjMwNzY2ODksInVzZXJJZCI6IjQwMDUxMzMzIiwiaWF0IjoxNDYzMDc2MDg5LCJlbWFpbCI6InRlc3RAdG9wY29kZXIuY29tIiwianRpIjoiYjMzYjc3Y2QtYjUyZS00MGZlLTgzN2UtYmViOGUwYWU2YTRhIn0.wKWUe0-SaiFVN-VR_-GwgFlvWaDkSbc8H55ktb9LAVw",
},
/**
* Expire time period of auto saved intake form: 24 hours
*/
AUTO_SAVED_COOKIE_EXPIRED_IN: 24 * 60,
TIME_ZONE: "Europe/London",
};
77 changes: 74 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,44 +5,115 @@
"scripts": {
"start": "sh start-ssl.sh",
"start:bsouza": "sh start-ssl-bsouza.sh",
"start:mfe": "cross-env webpack-dev-server --port 8519 --host 0.0.0.0",
"build": "react-scripts build",
"build:dev": "sh build-dev.sh",
"build:prod": "sh build-prod.sh",
"eject": "react-scripts eject",
"lint": "tslint src/**/*.{ts,tsx}",
"lint:fix": "tslint src/**/*.{ts,tsx} --fix",
"lint": "tslint 'src-ts/**/*.{ts,tsx}'",
"lint:fix": "tslint 'src-ts/**/*.{ts,tsx}' --fix",
"eslint": "eslint 'src/**/*.{js,jsx}'",
"eslint:fix": "eslint 'src/**/*.{js,jsx}' --fix",
"test": "react-scripts test",
"test:no-watch": "npm test -- --watchAll=false"
},
"dependencies": {
"@datadog/browser-logs": "^4.5.0",
"@heroicons/react": "^1.0.6",
"apexcharts": "^3.35.3",
"axios": "^0.26.1",
"browser-cookies": "^1.2.0",
"classnames": "^2.3.1",
"crypto-js": "^4.1.1",
"lodash": "^4.17.21",
"moment": "^2.29.3",
"moment-timezone": "^0.5.34",
"prop-types": "^15.8.1",
"rc-checkbox": "^2.3.2",
"react": "^17.0.2",
"react-apexcharts": "^1.4.0",
"react-dom": "^17.0.2",
"react-elastic-carousel": "^0.11.5",
"react-gtm-module": "^2.0.11",
"react-redux": "^8.0.2",
"react-redux-toastr": "^7.6.8",
"react-responsive-modal": "^6.2.0",
"react-router-dom": "^6.2.1",
"react-scripts": "5.0.0",
"react-select": "^5.3.2",
"react-spinners": "^0.13.1",
"react-toastify": "^8.2.0",
"react-tooltip": "^4.2.21",
"redux": "^4.2.0",
"redux-logger": "^3.0.6",
"redux-promise-middleware": "^6.1.2",
"redux-thunk": "^2.4.1",
"sass": "^1.49.8",
"styled-components": "^5.3.5",
"tc-auth-lib": "topcoder-platform/tc-auth-lib#1.0.3",
"typescript": "^4.4.2",
"uuid": "^8.3.2",
"web-vitals": "^2.1.0"
},
"devDependencies": {
"@babel/core": "^7.7.5",
"@babel/plugin-syntax-jsx": "^7.17.12",
"@babel/plugin-transform-runtime": "^7.8.3",
"@babel/preset-env": "^7.7.6",
"@babel/preset-react": "^7.7.4",
"@babel/preset-typescript": "^7.16.7",
"@babel/runtime": "^7.8.7",
"@stripe/react-stripe-js": "1.7.2",
"@stripe/stripe-js": "1.29.0",
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^12.0.0",
"@testing-library/user-event": "^13.2.1",
"@types/axios": "^0.14.0",
"@types/jest": "^27.0.1",
"@types/lodash": "^4.14.182",
"@types/node": "^16.7.13",
"@types/reach__router": "^1.3.10",
"@types/react": "^17.0.20",
"@types/react-dom": "^17.0.9",
"@types/react-gtm-module": "^2.0.1",
"@types/react-router-dom": "^5.3.3"
"@types/react-redux-toastr": "^7.6.2",
"@types/react-router-dom": "^5.3.3",
"@types/systemjs": "^6.1.0",
"autoprefixer": "^9.8.6",
"babel-eslint": "^11.0.0-beta.2",
"babel-jest": "^24.9.0",
"babel-plugin-inline-react-svg": "^1.1.2",
"babel-plugin-module-resolver": "^4.0.0",
"babel-plugin-react-css-modules": "^5.2.6",
"concurrently": "^5.0.1",
"config": "^3.3.6",
"cross-env": "^7.0.2",
"customize-cra": "^1.0.0",
"eslint": "^8.18.0",
"eslint-config-prettier": "^6.7.0",
"eslint-config-react-app": "^7.0.1",
"eslint-config-react-important-stuff": "^2.0.0",
"eslint-plugin-prettier": "^3.1.1",
"file-loader": "^6.2.0",
"identity-obj-proxy": "^3.0.0",
"jest": "^25.2.7",
"jest-cli": "^25.2.7",
"postcss-loader": "^4.0.4",
"postcss-scss": "^3.0.2",
"prettier": "^2.0.4",
"pretty-quick": "^2.0.1",
"react-app-rewired": "^2.2.1",
"resolve-url-loader": "^3.1.2",
"sass": "^1.48.0",
"sass-loader": "^10.0.5",
"single-spa-react": "^2.14.0",
"style-loader": "^2.0.0",
"systemjs-webpack-interop": "^2.1.2",
"webpack": "^4.41.2",
"webpack-cli": "^3.3.10",
"webpack-config-single-spa-react": "^1.0.3",
"webpack-dev-server": "^3.9.0",
"webpack-merge": "^4.2.2"
},
"eslintConfig": {
"extends": [
Expand Down
1 change: 1 addition & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<meta name="theme-color" content="#000000" />
<meta name="description"
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." />
<link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Barlow'>
<link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Barlow Condensed'>
<link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Roboto'>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo_512x512.png" />
Expand Down
Loading