Third-Culture-Software / bhima

A hospital information management application for rural Congolese hospitals
https://docs.bhi.ma/
GNU General Public License v2.0
220 stars 105 forks source link

Management module card list component #3135

Open sfount opened 6 years ago

sfount commented 6 years ago

A number of management modules make use of a 'card list' to display entities with a collection of useful attributes.

This pattern can currently be found on:

This pattern makes sense where there are entities with a lot of meta data but not too many records. Many records would best suit a grid but this view provides a middle ground of clearly legible but also able to provide a lot of information. Potential other candidates for this pattern are:

Example: screenshot from 2018-09-03 17-37-01

This issue proposes a design for a component to simplify, test and reduce duplication implementing this pattern across modules.

Component requirements:

Potential usage:

<!-- name - sorted A-Z and filtered -->
<!-- age - sorted oldest, newest -->
<!-- size - sorted largest, smallest -->
<bh-card-list 
  data="debtors" 
  name="debtorName"
  age="debtorDate"
  size="debtorSize"
  template="/my/debtor/template.card.html">
</bh-card-list>
mbayopanda commented 6 years ago

Hi @sfount

What do you think to have a pagination on this bh-card-list, sometime the list is too long a pagination can be useful for avoiding to scroll down.

sfount commented 6 years ago

Hey @mbayopanda great suggestion! I have not included pagination with the initial pull request for two reasons:

If this Component is merged and implemented then pagination would be a great feature to support on top of the base filtering and sorting!

(This comment relates to https://github.com/IMA-WorldHealth/bhima-2.X/pull/3137#discussion_r214874542)