This app serves as an user auditing utility for DHIS2.
Author: Gregory Wilson Copyright: BAO Systems Initial Sponsor: PSI
#Setup
In order for this app to work as intended the User
must have a User Role
containing View User Group Managing Relationships
and access to this app itself.
For user groups to show by default on the Dashboard, they need an attribute where the attribute code = 'BATapp_ShowOnDashboard'.
- Access: List of users who have logged in during the last X days
- Stagnation: List of users who have not logged on in the past X days
- Disabling/Enabling of accounts
- Filtering by OU
- Filtering by User Group
- Filtering by not disabled
- Filtering by Name
- Filtering by OU (rolled up)
- Infographic % active logins by group by days, color coded
- Number or status (yes/no) of log-in days within a certain period (eg. user(s) that logged in on at least one day each week).
- Filter groups to just those with a particular attribute
- Infographic % active logins by group by days, color coded
- Most often clicked on item
- How often using feature X
- 4: Most often clicked on item
- 4: How often using feature X
- More progress wheels for better user feedback that something is happening
- Bulk inactivation
- Paging of results
- Link from user to account management page (no. sqlview prevented from getting user id)
- Cache the dashboard results to the dataStore
Make sure you have at least the following versions of node
and npm
.
- Node version v5.6.0 or higher
- npm version 3.8.0 or higher
Use the following commands to check your current versions
node -v
npm -v
Clone the repository from github with the following command
git clone git@bitbucket.org:baosystems/bat-app.git
Install the node dependencies
npm install
To set up your DHIS2 instance to work with the development service you will need to add the development servers address to the CORS whitelist. You can do this within the DHIS2 Settings app under the access tab. On the access tab add http://localhost:8081
to the CORS Whitelist.
The starter app will look for a DHIS 2 development instance configuration in
$DHIS2_HOME/config
. So for example if yourDHIS2_HOME
environment variable is set to~/.dhis2
, the starter app will look for~/.dhis2/config.js
and then~/.dhis2/config.json
and load the first one it can find.The config should export an object with the properties
baseUrl
andauthorization
, where authorization is the base64 encoding of your username and password. You can obtain this value by opening the console in your browser and typingbtoa('user:pass')
.If no config is found, the default
baseUrl
ishttp://localhost:8080/dhis
and the default username and password isadmin
anddistrict
, respectively.See
webpack.config.js
for details.
This should enable you to run the following node commands:
To run the development server
npm start
To run the tests one time
npm test
To run the tests continuously on file changes (for your BDD workflow)
npm run test-watch
To generate a coverage report for the tests
npm run coverage
To check the code style for both the JS and SCSS files run
npm run lint
To make a DHIS2 app zip file, run:
npm run-script dist
Then load the build/bat-app.zip
file to your DHIS2 instance.