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