@iapps/ngx-dhis2-validation-rule-group-filter
v1.0.0-beta.2
Published
[![CircleCI](https://circleci.com/gh/hisptz/ngx-dhis2-validation-rule-filter.svg?style=svg)](https://circleci.com/gh/hisptz/ngx-dhis2-validation-rule-filter) [![Build Status](https://travis-ci.org/hisptz/ngx-dhis2-validation-rule-filter.svg?branch=master)
Downloads
5
Maintainers
Keywords
Readme
Dhis2 Validation Rule Group Filter Library
Introduction
Dhis2 Validation Rule Group(DVRG) is a user interface component library for developing DHIS2 applications. DHIS2 Team from UDSM uses and maintain this component to ensure visual and usability consistency where it is used in the process of developing different DHIS2 web application.
Features
- Fetching all the validation rules group from the DHIS2 Instance where the you have installed the Web app you are developing and use this library as part of it.
- Give support to use to select the validation rule group available withing the instance and proceed with the analysis process.
- Give support to De-select the validation rule group if it wrong selection.
- It give support to select and de-select all the selection i.e validation rule group all at once.
Quickstart Guide
Prerequisite Requirements
Install the following dependencies withing your project before starting using the following library.
- NgRx Store v7.4.0 or Higher- @ngrx/store
- NgRx Effects v7.4.0 or Higher- @ngrx/effects
- RxJS: Reactive Extensions For JavaScript v6.5.2 or Higher - rxjs
- lodash v4.17.11 or Higher- lodash v4.17.11
- DHIS2 Http Client library v2.0.8-beta.2 or Higher - @iapps/ngx-dhis2-http-client
- Dhis2 Validation Rule Group Filter Library v1.0.0-alpha.6 or Higher - @iapps/ngx-dhis2-validation-rule-group-filter
Installation Commands
npm i @ngrx/store
npm i @ngrx/effects
npm i rxjs
npm i --save lodash
npm i @iapps/ngx-dhis2-http-client
npm i @iapps/ngx-dhis2-validation-rule-group-filter
Installation Procedure
Import StoreModule, EffectsModule and HttpClientModule to the appModule.ts. Below is an example of configuration for a fresh project, but if you have already done installation based on your configuration the follow all along to see what is need to be added to make installation successfully
import { StoreModule } from '@ngrx/store';
import { EffectsModule } from '@ngrx/effects';
import { HttpClientModule } from '@angular/common/http';
import { NgxDhis2ValidationRuleFilterModule } from '@iapps/ngx-dhis2-validation-rule-group-filter';
@NgModule({
declarations: [
AppComponent,
],
imports: [
BrowserModule,
AppRoutingModule,
StoreModule.forRoot({}),
EffectsModule.forRoot([]),
HttpClientModule,
NgxDhis2ValidationRuleFilterModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
NOTE: This library is using @iapps/ngx-dhis2-http-client library, Please follow installation instructions for this package as well. Instructions can found here
How to use
After installation you can use the following tags to start using it in your project.
<lib-ngx-dhis2-validation-rule-filter
[dataSelection]='dataElements'
[selectedVRGs]='preSelectedVRGs'
(update)="onUpdateValidationRule($event)"
(close)="onUpdateValidationRule($event)">
<lib-ngx-dhis2-validation-rule-filter>
Output Emmitted
Template of the OUTPUT Emmitted after clicking the UPDATE or CANCEL button:
items: []
periodTypes: {}
dimensions: "vrg"
change: true
Example of the output Emmitted after clicking the UPDATE or CANCEL button:
items: [
{
id: "odiGzVETtQQ",
name: "Form: National Malaria control program"
}
]
periodTypes: {
id: "Monthly"
name: "Monthly"
rank: 3
}
dimensions: "vrg"
change: true