Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Prerequisites

  1. For Windows only, download and install the latest version of Git Bash from https://gitforwindows.org/index.html

  2. For Linux only, install git using the command sudo apt-get install git -y

  3. Clone so” project from https://gerrit.onap.org/r/#/admin/projects/so

    • Select “Clone with commit-msg hook”
    • Select “ssh”
    • Copy the git clone command to clipboard
    • Paste the command into Git Bash or terminal, in the directory that will store your project.


  4. Download and install the latest version of Atom text editor from https://atom.io/

  5. Install Python

    Windows

    Linux

    • Search “env” in Windows Start Search → Edit the system environment variables → Environment Variables → Edit the Path User variable → New “C:\Python27\Scripts\” and New “C:\Python27\Scripts\”
    • sudo apt install python-pip -y




  6. Download and install the appropriate JDK 8 package for your machine from https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

  7. Install Node.js

    Windows

    Linux

    • sudo apt-get install nodejs -y
    • sudo apt-get install npm -y


  8. Install Angular Command Line Interface (CLI)

    Windows

    Linux

    • In Git Bash run the command

    npm install -g @angular/cli

    Linux requires the following packages to be installed manually:

    • npm install -g @angular/cli
    • npm install typescript@3.2.2 --save-dev --save-exact
    • npm install --save-dev @angular-devkit/build-angular
    • npm install popper.js --save

    Update Angular:

    • ng update --all


  9. Install Maven

    Windows

    Linux

    • sudo apt-get install mvn -y


Setting up Atom

Install following packages in Atom (File tab -> Settings -> Install):

Package

Description

angularjs

AngularJS package for Atom

atom-beautify

Beautifying the structure of languages

atom-ide-ui

Collection of Atom UIs to support language services

atom-typescript

Informative plugin when developing TypeScript code

emmet

Shortcuts when developing HTML, CSS, SCSS

file-icons

Assigns icons and color for different file extensions

last-cursor-position

Keeps a history of past cursor positions for navigation


Working on the project

Open so/so-monitoring/so-monitoring-ui” folder in Atom.

...

NOTE: For all new files created, change line endings format to LF at the bottom of Atom’s UI.

Compiling Angular application

Change directory toso/so-monitoring/so-monitoring-ui/src/main/frontend” or to a directory further into the project structure.

...

Run the command ng build. This compiles the Angular application into a directory so/so-monitoring/so-monitoring-ui/src/main/frontend/dist”

Running the application locally

Run the command ng serve.

Open a browser at the address http://localhost:4200/


Testing the application

Test specification files have .spec.ts” file extensions.

...

 Without specifying this flag, upon saving a file in Atom, the tests will rerun, and Karma test runner will refresh the Chrome browser.

Testing with Headless Chrome

Headless Chrome allows testing Angular applications without launching a visible Chrome UI shell. This feature is built in with Chrome version 59 and above.

...

NOTE: remove the changes made to the “karma.conf.ts” file after testing, as this will appear as an unwanted change when committing code.

Displaying test code coverage results

Run the command ng test --code-coverage

...