Skip to content
Snippets Groups Projects
README.md 1.98 KiB
Newer Older
Martin Gardyan's avatar
Martin Gardyan committed
# Org.Eclipse.OpenkUsermodules.GridFailureInformation.Frontend
Martin Gardyan's avatar
Martin Gardyan committed

Martin Gardyan's avatar
Martin Gardyan committed
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 8.3.19.
Martin Gardyan's avatar
Martin Gardyan committed

Martin Gardyan's avatar
Martin Gardyan committed
## Development server
Martin Gardyan's avatar
Martin Gardyan committed

Martin Gardyan's avatar
Martin Gardyan committed
Run `npm run start-integration` for a dev server. Navigate to `http://entopkon:8880/portalFE/#/login`. Try to login with known credentials and open the 'SIT Localhost' app. The app will automatically reload if you change any of the source files.
Martin Gardyan's avatar
Martin Gardyan committed

Martin Gardyan's avatar
Martin Gardyan committed
## Build
Martin Gardyan's avatar
Martin Gardyan committed

Martin Gardyan's avatar
Martin Gardyan committed
Run `npm run build-main-app` to build the project. The build artifacts will be stored in the `dist/` directory.
Martin Gardyan's avatar
Martin Gardyan committed

Martin Gardyan's avatar
Martin Gardyan committed
## Running unit tests
Martin Gardyan's avatar
Martin Gardyan committed

Martin Gardyan's avatar
Martin Gardyan committed
Run `mpm run test` to execute the unit tests via [Karma](https://karma-runner.github.io).
Martin Gardyan's avatar
Martin Gardyan committed

Martin Gardyan's avatar
Martin Gardyan committed
## Running end-to-end tests
Martin Gardyan's avatar
Martin Gardyan committed

Martin Gardyan's avatar
Martin Gardyan committed
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
Martin Gardyan's avatar
Martin Gardyan committed

Martin Gardyan's avatar
Martin Gardyan committed
## Further help
Martin Gardyan's avatar
Martin Gardyan committed

Martin Gardyan's avatar
Martin Gardyan committed
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
Martin Gardyan's avatar
Martin Gardyan committed

Martin Gardyan's avatar
Martin Gardyan committed
## Implementation

### Directives

#### VisibleByDependentFieldDirective

Martin Gardyan's avatar
Martin Gardyan committed
This directive is used to hide or show html elemnts depending on defined dependencies (isVisible = true) Additionally it sets the state of depending field to avoid ngrx-forms validation errors.
Martin Gardyan's avatar
Martin Gardyan committed

**Example**

```
<button
  [visibleByDependentField]="formState.value.branch === Globals.BUSINESS_RULE_FIELDS.branch.telecommunication">
</button>
```

#### FormValidatorDirective

This validator fills the validation(visualization) gap of ngrx-forms for disabled/dependent fields

It ist important that `.ngrx-forms-invalid-directive` class is added to global style.scss

#### FormDisableDirective

This directive disables the entire form depending on user rights. It automatically select `form[ngrxFormState]` and checks user rights

### VisibleByRightDirective

This directive shows/hides html elements depending on user rights.

**Example**
Martin Gardyan's avatar
Martin Gardyan committed

Martin Gardyan's avatar
Martin Gardyan committed
```
<button *visibleByRight="[RolesEnum.PUBLISHER]" type="button" class="btn btn-link navbar-btn">
  <fa name="users"></fa>
</button>
```