Ward list layout is not seen in In-Patient module

Description

The dashboard of the InPatient module should show the display control for each registered ward. On 0.92 version, this ward list layout is not shown. See below:

 

The expected behaviour:

 

This is an issue injected into Bahmni after the implementation of showing spinner while loading the patient count in the program queue. The code change introduces a div tag for patient-list-spinner as the first element under the tab-content div of patient-search-wrapper. After the retrieval of patient count for each search type(To admit, admitted, to discharge, all), the first element under this tab-content(assumed to be patient-list-spinner) is hidden to show the webpage. see files:

openmrs-module-bahmniapps/ui/app/common/patient-search/views/patientsList.html, Line 20
openmrs-module-bahmniapps/ui/app/common/patient-search/controllers/patientsListController.js Line 74

In InPatient module the patient-search-wrapper is utilised but does not have patient-list-spinner as the first child element under the tab-content section. After loading the contents of the page, the first child of the tab-content under patient-search-wrapper is ward-list and is hidden as opposed to patient-list-spinner which is the second child element. The reason for this is that in the following code line, the ward-list is made as the first child element of the tab-content.

element.find('.tab-content').prepend($('#ward-list'));

openmrs-module-bahmniapps/ui/app/adt/directives/adtPatientSearch.js , Line 8

There are two approaches to resolving this issue:
1. Not assuming the first child element as patient-list-spinner and to look for the exact child element

$(container).children('patient-list-spinner').hide();

instead of $(container).children('div:first-child').hide(); in file patientsListController.js


2. Instead of prepending the "ward-list" to tab-content, the ward-list can be appended to the end

element.find('.tab-content').prepend($('#ward-list')); in adtPatientSearch.js

Status

Assignee

Angshuman Sarkar

Reporter

Praveena Dayanand

Labels

None

Units

None

PercentDone

None

DueTime

None

Clients

None

External issue ID

None

UAT Assignee

None

Reviewer

None

Components

Sprint

Fix versions

Configure