Sensitivity Calculator UI

The Sensitivity Calculator is an application for calculating the sensitivity of the SKA Mid-Frequency Aperture Array.

This Project was generated with Angular CLI version 13.

## Development server

Run npm start for a dev server. Navigate to http://localhost:4200/sensitivity-calculator. The app will automatically reload if you change any of the source files.

The necessary steps are:

  1. Install Git if you don’t already have it.

To find if Git is installed on your computer, type in a terminal: git –version. The output will either say which version of Git is installed, or that git is an unknown command.

If Git is not there, point your browser to https://git-scm.com/book/en/v2/Getting-Started-Installing-Git and follow the instructions for installation.

  1. Clone the sensitivity calculator from the SKA Git repository by moving to the destination directory on your machine, and typing: git clone https://gitlab.com/ska-telescope/ska-ost-senscalc-ui.git.

  2. Run npm start for a dev server. Navigate to http://localhost:4200/sensitivity-calculator.

Enter the code directory with: cd ska-ost-senscalc-ui ## Code scaffolding

Run ng generate component component-name to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module.

## Build

Run ng build to build the project. The build artifacts will be stored in the dist/ directory.

## Running unit tests

Run make test to execute the unit tests.

## Running static code analysis

Run make lint to lint the code.

## Installing project dependencies

Run make install_dependencies to install latest project dependencies from package.json and package-lock.json

### Deploying to Kubernetes

Makefiles with common targets are available in the submodule. To build the Docker image run the following

` make oci-build-all `

The umbrella Helm chart can then be deployed with

` make k8s-install-chart `

and uninstalled with ` make k8s-uninstall-chart `

Once installed, the UI should then be available externally at http://<HOST_IP>/<KUBE_NAMESPACE>/sensitivity-calculator/. If using minikube, run minikube ip to find the host IP. KUBE_NAMESPACE is set to ska-ost-senscalc-ui by default. The backend component will also be deployed to a separate pod, which the web application will make requests to.

## Running integration (Cypress) tests

Run npm run cypress:run to execute integration tests locally. This requires the application to be running (either with npm start or make up). Note that this also requires the SC back-end to be running and available at the location defined by SENSCALC_UI_BACKEND_URL environment variable.

To run integration tests in Kubernetes:

  1. Deploy the application to k8s (see above)

  2. Set the baseUrl in cypress.json to point to http://<HOST_IP>/<KUBE_NAMESPACE>/sensitivity-calculator/

  3. Run tests with npm run cypress:run

## Further help

To get more help on the Angular CLI use ng help or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.