I can select a program that is not supported by My Facility on the Create/Initiate page.

Description

Encountered on Mozilla Firefox 43.0.1 on Windows 8.1

Reproduction steps

  • Remove Essential Meds from the list of supported programs for Confort Health Clinic

  • Log in as administrator

  • Go to the Create/Initiate screen

  • Select My Facility as Facility Type

  • Select Essential Meds from the list of available programs

  • Click Search button

  • Get Internal Application Error modal

NOTE:
1. The problem occurs when removing/deactivating supported program for user home facility. It appears that when getting permission string for user there still are lines that have home facility + removed supported program. Regeneration of right assignments may not be working correctly here.
2. Issue can be found also when doing steps above, selecting 'Supervised facility' and then removed program. You can see that home facility is still there.
3. Some code for the UI caching was committed here but than reverted for the release. It does not fix this issue, but when right assignment issue is fixed UI caching can still cause some problems, so restore the reverted code.

Environment

None

Activity

Show:
Chongsun Ahn
November 13, 2017, 10:10 PM

Review is closed; assigning to you .

Mateusz Kwiatkowski
November 14, 2017, 3:30 PM

I've restored UI code and it seems to work for me. Server part with permission strings also seems to work fine. Moved to QA.

Joanna Bebak
November 15, 2017, 8:50 AM

I deactivated Essential Meds for Comfort Health Clinic through the UI (Edit Facility > Associated Programs), and everything worked correctly both for administrator, and for srmanager2: only Family Planning showed when the facility was chosen from the drop-down.

I unfortunately wasn't able to check whether everything works correctly when the supported program is removed altogether from the facility because I encountered issues with the PUT facilities/{id} endpoint. When executing step 2 from 3554 test case, I got the following error message:

{
"timestamp": "2017-11-15T08:42:36.326+0000",
"status": 400,
"error": "Bad Request",
"exception": "org.springframework.http.converter.HttpMessageNotReadableException",
"message": "JSON parse error: Unrecognized token 'access_token': was expecting ('true', 'false' or 'null'); nested exception is com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'access_token': was expecting ('true', 'false' or 'null')\n at [Source: java.io.PushbackInputStream@5e702eaa; line: 1, column: 14]",
"path": "/api/facilities/e6799d64-d10d-4011-b8c2-0e4d4a3f65ce"
}

Even though the access token, as well as all other data, were correct. On Postman, I got the 405 Not Allowed response.

Please also add the changelog.

Mateusz Kwiatkowski
November 15, 2017, 9:39 AM

I think that the problem here is with outdated json or/and probably you used expired token. I've just removed supported program from Comfort Health Clinic and it worked.

Joanna Bebak
November 15, 2017, 10:05 AM

Yes, I checked and the data in the JSON from the test case were outdated. I thought they weren't because the test step in the test case from which it was taken, 2730, was marked as "Pass" in the most-recent execution, during which the current bug was discovered. I updated the test steps in my test case to be more universal (ids, JSONs etc. might change, after all). Everything works correctly also when one removes the supported program through the API. The changelog was also added, so I will close the ticket.

Assignee

Mateusz Kwiatkowski

Reporter

Nikodem Graczewski

Story Points

5

Time tracking

0m

Time remaining

0m

Components

Sprint

None

Priority

Critical
Configure