Skip to content

Commit ce6c2f5

Browse files
authored
Merge pull request #2666 from appirio-tech/dev
Production Release 2.4.7
2 parents a0b16cc + c0b01bc commit ce6c2f5

File tree

173 files changed

+17285
-11939
lines changed

Some content is hidden

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

173 files changed

+17285
-11939
lines changed

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5
1+
8

README.md

Lines changed: 32 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,32 @@
1-
#### For folks working on this code base, we're organizing coding style and general guidelines [here](https://github.com/appirio-tech/connect-app/wiki/Community-Work-Read-Me-First!).
1+
# Topcoder Connect App
22

3-
# TC Deployment Notes
3+
Topcoder Connect is client facing application of Topcoder. Customers use Topcoder Connect to input requirements of their projects, then managers and
4+
copilots take it from there.
5+
6+
## Requirements
7+
8+
- Node.js 8+
9+
- Npm 5+
10+
11+
## Run locally for development
12+
13+
Prior to running the application locally you should add into your `/etc/hosts` the line `127.0.0.1 local.topcoder-dev.com`.
14+
15+
- `$ npm install` - Installs all dependencies.
16+
- `$ npm start` - Run application in development mode against Topcoder development environment using [dev](https://github.com/appirio-tech/connect-app/blob/dev/config/constants/dev.js) config. In this case the frontend is build in memory by webpack server and uses dev tools like redux-logger.
17+
18+
Open browser with URL http://local.topcoder-dev.com:3000.
19+
20+
## NPM commands
21+
22+
- `$ npm start` - Run application in development mode against Topcoder development environment. In this case the frontend is build in memory by webpack server and uses dev tools like redux-logger.
23+
- `$ npm build` - Create build for production in `/dest` folder. In this case built app is configured to run against Topcoder production environment using [prod](https://github.com/appirio-tech/connect-app/blob/dev/config/constants/master.js) config. Files are being minimized and `gzipped`.
24+
- `$ npm run lint` - Check js code linting.
25+
- `$ npm run lint:fix` - Check js code linting and trying to fix errors automatically.
26+
- `$ npm run test` - Performs tests running. **Note** we don't really have tests, so we only keep this command run successfully.
27+
- `$ npm run test:watch` - Performs tests on files changes.
28+
29+
## TC Deployment Notes
430
_[TC Deployment Notes should always be kept up to date **on the default branch**. Update these notes when changes to this information occur]_
531

632
**General Deployment:** This software is deployed to AWS S3 by CircleCI. It's ultimately delivered through AWS Cloudfront, which is fed from the S3 bucket. There are no EC2 systems involved in the delivery (althought Connect is fed from various micro-services).
@@ -18,47 +44,12 @@ _[TC Deployment Notes should always be kept up to date **on the default branch**
1844
* The _circle.yml_ file controls the build - see this file if you need to confirm if your commit will deploy anything
1945
* Circle-ci builds can be easily cancelled - please do so if you accidentally trigger an undesired build
2046

21-
# Customer-App
22-
23-
This repository houses new Customer pages, using React, Redux, and Webpack.
24-
25-
## Installation
26-
27-
We use node 8.9.x and npm 6.x, so you may need to download a new version of node. The easiest way is to download [nvm](https://github.com/creationix/nvm). We have a `.nvmrc` file in the root of the project, so you can just run `nvm use` to switch to the correct version of node.
28-
29-
Install dependencies by running the following in the root of the project:
30-
- `npm i`
31-
- **Note:** You must use npm 6.x. Type `npm -v` to ensure you have the correct version.
32-
33-
## NPM Commands
34-
- To run locally, run `npm start` and head to `http://localhost:3000/new_project`
35-
- Run tests with `npm test` or use `npm run test:watch` to rerun tests after files change
36-
- To make sure your code passes linting: `npm run lint`
37-
- To create the build: `npm run build`
38-
39-
## Login
40-
41-
During login, if your see `Invalid URL: http://localhost:3000` error in browser console, just browse http://localhost:3000 and it will show up.
42-
43-
Or, you can add into your `/etc/hosts` the line `127.0.0.1 local.topcoder-dev.com`. And access the app with http://local.topcoder-dev.com:3000. It will prevent you from getting `Invalid URL: http://localhost:3000` and you will be redirected successfully after login.
44-
4547
## Contributing
4648

4749
### Pull Requests
4850

4951
To contribute to the repository, please create a feature branch off of the dev branch. Once you're finished working on the feature, make a pull request to merge it into dev. Please make sure that every pull request has passed the build checks, which appear just before the "Merge pull request" button in github.
5052

51-
### Updating npm-shrinkwrap.json
52-
53-
General workflow to update `npm-shrinkwrap.json` would be:
54-
55-
- `npm install --no-optional` - with old npm-shrinkwrap (--no-optional to skip fsevents)
56-
- update `package.json` if you need to remove/update/add any packages
57-
- remove `npm-shrinkwrap.json`
58-
- `npm install --no-optional` with new `package.json`
59-
- `npm shrinkwrap` - to convert `package-lock.json` to `npm-shrinkwrap.json`
60-
- the new `npm-shrinkwrap.json` will have just the minimal diff
61-
6253
### Code Style
6354

6455
***Checkout the code and comments in `src/components/ExampleComponent` for an example React component, `.scss` file, and tests.***
@@ -107,12 +98,12 @@ SCSS Files
10798
}
10899
}
109100
SVG Icons
110-
- This repository uses plugin babel-plugin-inline-react-svg
101+
- This repository uses plugin babel-plugin-inline-react-svg
111102
- The plugin is used to inline-embed svg icons inside the markup
112-
103+
113104
Steps to adding new icons
114-
- Insert the svg file in the ~/src/assets/images/ directory
115-
- Add a new icon component file in directory ~/src/components/Icons/Icon-Name.jsx and reference it on the global
105+
- Insert the svg file in the ~/src/assets/images/ directory
106+
- Add a new icon component file in directory ~/src/components/Icons/Icon-Name.jsx and reference it on the global
116107
icon component in the ~/src/components/icons/ directory
117108
- Wrap the svg icon inside an object for caching to optimize on perfomance.
118109
```

config/babel/webpack.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/**
2+
* Babel config preset.
3+
*
4+
* Here we can update babel config which comes from `topcoder-react-utils` with Connect App specific things.
5+
*/
6+
const topCoderBabelConfig = require('topcoder-react-utils/config/babel/webpack')
7+
8+
/*
9+
Make sure that the list of plugins is defined
10+
*/
11+
topCoderBabelConfig.plugins = topCoderBabelConfig.plugins || []
12+
13+
/*
14+
Add babel-plugin-lodash to exclude full lodash lib and include only necessary methods
15+
*/
16+
topCoderBabelConfig.plugins.push('lodash')
17+
18+
/*
19+
Update options for `inline-react-svg` plugin.
20+
We have to clean `data-color` and `data-cap` attributes in SVG files which are used in Connect App
21+
because otherwise we will have `Warning: Unknown prop` from React
22+
*/
23+
topCoderBabelConfig.plugins = topCoderBabelConfig.plugins.map((plugin) => {
24+
if (plugin === 'inline-react-svg') {
25+
return ['inline-react-svg', {
26+
svgo: {
27+
plugins: [
28+
{
29+
removeAttrs: { attrs: '(data-color|data-cap)' }
30+
}
31+
]
32+
33+
}
34+
}]
35+
}
36+
37+
return plugin
38+
})
39+
40+
module.exports = topCoderBabelConfig

config/constants/dev.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,7 @@ module.exports = {
4646
TC_NOTIFICATION_URL: 'https://api.topcoder-dev.com/v5/notifications',
4747
CONNECT_MESSAGE_API_URL: 'https://api.topcoder-dev.com/v5',
4848
TC_SYSTEM_USERID: process.env.DEV_TC_SYSTEM_USERID,
49-
MAINTENANCE_MODE: process.env.DEV_MAINTENANCE_MODE
49+
MAINTENANCE_MODE: process.env.DEV_MAINTENANCE_MODE,
50+
51+
RESET_PASSWORD_URL: 'https://accounts.topcoder-dev.com/connect/reset-password'
5052
}

config/constants/master.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,7 @@ module.exports = {
4646
TC_NOTIFICATION_URL: 'https://api.topcoder.com/v5/notifications',
4747
CONNECT_MESSAGE_API_URL: 'https://api.topcoder.com/v5',
4848
TC_SYSTEM_USERID: process.env.PROD_TC_SYSTEM_USERID,
49-
MAINTENANCE_MODE: process.env.PROD_MAINTENANCE_MODE
49+
MAINTENANCE_MODE: process.env.PROD_MAINTENANCE_MODE,
50+
51+
RESET_PASSWORD_URL: 'https://accounts.topcoder.com/connect/reset-password'
5052
}

config/webpack/common-modifications.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
* webpack merge.
55
*/
66

7+
const path = require('path')
8+
const dirname = path.resolve(__dirname, '../..')
9+
710
module.exports = function (config) {
811
/*
912
Exclude some folders from babel-loader
@@ -15,9 +18,10 @@ module.exports = function (config) {
1518
]
1619

1720
/*
18-
Add babel-plugin-lodash to exclude full lodash lib and include only necessary methods
19-
*/
20-
jsxRule.options.plugins = (jsxRule.options.plugins || []).concat(['lodash'])
21+
Use Connect App preset file for babel config
22+
It may contain some modifications of babel config which comes from `topcoder-react-utils`
23+
*/
24+
jsxRule.options.presets = [path.resolve(dirname, './config/babel/webpack.js')]
2125

2226
/*
2327
Include packages `appirio-tech-react-components` and `tc-ui`

0 commit comments

Comments
 (0)