[OPEN-ILS-DEV] prototype staff client, feedback/2

schan at vcn.bc.ca schan at vcn.bc.ca
Sat Jan 25 15:14:10 EST 2014


I am giving more feedback on the prototype staff client that was recently
released.

I advocate for a fairly capable notification service at the outset so that
end-users don't have to endure something cheap and nasty.  I think it matters
to put more brain power into the notification service right away, because it's
responsible for representing the staff client to users in times when they are
learning or struggling with its use, for example, doing nonsensical sequences
of operations, errors are showing up, network connections are broken, and so
on.

In the staff/services/ui.js file, two notification services, egAlertDialog and
egConfirmDialog, are defined alongside some low-level functions.

a. The differences between Alert and Confirm are slight. It seems more
efficient to collapse the two into one, and to define the code in its own file,
staff/services/notification.js or similar.  The calling scheme for the single
service would be something like

var confirm = egNotify({ title:'title', body:'body', yes:yes, no:no });
var alert   = egNotify({ title:'title', body:'body', yes:yes        });

b. If no yes/no callbacks are specified, for example,

var progress1  = egNotify({ title:'title'              });
var progress2  = egNotify({                body:'body' });
var progress3  = egNotify({ title:'title', body:'body' });
var no_op      = egNotify(                              );

would show the message for a short time period, say 2 seconds.

c. If egNotify() is quickly called multiple times, the service would queue up
the inbound messages and show them in a first-in, first-out fashion.

d. A call to egNotify() would not directly execute a function to show the
message, but would broadcast the input object as a custom event. An event
handler would be listening for the same type of events and would respond by
showing the message according to the details in the object. This loose coupling
of the service from the rest of the UI would allow controllers or other
services to use egNotify and not be much affected by a refactoring of egNotify.

The end result would be something akin to the notification service one finds on
a desktop. Perhaps there is something like this already written in the
angularjs world.

-- 
steven <steven.chan at bc.libraries.coop>
bc libraries co-op/sitka


More information about the Open-ils-dev mailing list