Update version to 1.13.4
[sdc.git] / catalog-ui / README.md
1 # CatalogUi
2
3 ## Development server
4 1. Run `npm start` for a dev server.
5 2. Navigate to <http://localhost:9000/>.
6    * The app will automatically reload if you change any of the source files.
7
8
9 To Specify the user role:
10
11 `npm start --env.role designer`
12
13 `npm run <role>`
14
15
16 ## Build
17 ### dev 
18 Run `npm run build` to build the project. 
19
20 The build artifacts will be stored in the `dist/` directory. 
21
22
23 ### prod
24 Run `npm run build:prod` to build the project. 
25
26 The build artifacts will be stored in the `dist/` directory. 
27
28 ## Configuration
29
30 ### webpack.server.js
31 Development server is configured in `/webpack.server.js` file. Configure the constants accordingly:
32 - const __devPort__: the webpack server port;
33 - const __feHost__: the catalog front-end container host;
34 - const __fePort__: the catalog front-end container port.
35
36 The server will create a proxy to the front end calls based on the  __feHost__ and __fePort__. 
37
38 It will also create authorization cookies to those requests. The cookies and user information comes from the 
39 `/configurations/mock.json` file under the nodes `sdcConfig.cookie` and `sdcConfig.userTypes` respectively.
40
41 The default user role is the node `sdcConfig.userTypes.designer` (configurable with the npm parameter --env.role).
42
43
44 ### Application Configuration
45 Application configuration `dev.js` or `prod.js` and `menu.js` are located in `/configuration` folder and required by `app.ts` according to __ENV__ parameter from webpack.
46
47
48
49 ## Running unit tests
50 Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
51
52 ## Running end-to-end tests
53 Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
54
55 Before running the tests make sure you are serving the app via `ng serve`.
56
57 ## Working with WebStorm  
58
59 1. go to File --> Settings --> Languages & Frameworks
60 2. Under JavaScript -> set JavaScript language version to ECMAScript6
61 3. Under TypeScript -> select `Enable TypeScript Compiler` and choose `Use tsconfige.json`
62