1345: Alert styles and wrapper

Test Case #:1345

Test Case Name:Alert styles and wrapper

System: OpenLMIS

Subsystem:

Test case designed by: Paulina Borowa

Design Date:28.11.2016

Short description

There is currently variation in how alerts are displayed across the UI. Most of the technical work in this ticket is creating a wrapper around bootbox.alert

The major change is in where alerts are used in OpenLMIS — they should only be used when a user is forced to acknowledge an action — such as a page the user is forbidden from seeing or a response from a service that is a non-trivial error (500 errors)

Note that a success alert has not been added — there should be no reason to create this style of alert

This ticket has three main components:

  1. Create an AlertFactory, that documents when and how to use alerts
  2. Create a styleguide page that shows stylistic variations of alerts (info and error)
  3. Update the use of alerts in the OpenLMIS-UI codebase

Each method of the Alert factory should return a promise which is resolved when the alert is closed by the user. When used in a controller the Alert factory should work like:

// Normal alert
var promise = Alert('message.language.key', 'Additional information can be entered as an optional second argument');

// Error alert (with callback)
Alert.error('message.language.key').then(function(){
    // do something else
});

                                                                                                                                                   

Pre – conditions:

                                                                                                                                                                                                                                                       

Step

Action

Expected system response

Comment

1

 

go on http://test.openlmis.org/public

and login as an administrator

                                                                                                      

                                                                                                                            

                                                 

2

go to approve view and chose  program Essential Meds DH01 Balaka District Hospital

 

 

3

 Server error

 

 

OpenLMIS: the global initiative for powerful LMIS software