opensrp / opensrp-server-web

OpenSRP Server Generic Web Application
Other
10 stars 21 forks source link

WHO ANC OpenSRP Web: Location units page has no data #1158

Closed Naima-Bashir closed 1 year ago

Naima-Bashir commented 1 year ago

STEPS:

  1. Login to https://web.anc-stage.smartregister.org/admin/location/unit
  2. Click on the Location Unit page
  3. Observe how there is no data.
  4. The locations unit's group also doesn't have data but after afew tries loads the unit groups.

image

peterMuriuki commented 1 year ago

Related: https://github.com/opensrp/web/issues/920 In the past we have had 2 ways to load root locations on the opensrp-web:

  1. filter where location.properties.parentId is null
  2. filter based on geoLevel i.e where location.properties.geoLevel === 0.

While they logically imply the same thing, It just so happens they are independent and cannot be used interchangeably. Maybe we can get clarification of why/how exactly that is from opensrp support

Solution:

dubdabasoduba commented 1 year ago

@p-netm the geoLevel check is very inconsistent hence the reason we moved to the parentd

The reason for the inconsistency is

I would advice using the parentId check instead of the geoLevel check.

peterMuriuki commented 1 year ago

@dubdabasoduba cool, so then we do not need to do any changes on the web for the location list view. The changes will have to be done on the data or on the backend

dubdabasoduba commented 1 year ago

@p-netm agreed!

The current root location is wrongly configured. It is set to have a parentId Uganda This is wrong.

@SebaMutuku Please update this location to remove the parentId in the root location.

Current root location payload

  {
    "type": "Feature",
    "id": "02ebbc84-5e29-4cd5-9b79-c594058923e9",
    "properties": {
      "status": "Active",
      "parentId": "Uganda",
      "name": "Uganda",
      "geographicLevel": 0,
      "version": 0
    },
    "serverVersion": 1,
    "locationTags": [
      {
        "id": 1,
        "name": "Country"
      }
    ]
  }
SebaMutuku commented 1 year ago

@dubdabasoduba @Naima-Bashir the parent location has been updated to

{
   "id":"02ebbc84-5e29-4cd5-9b79-c594058923e9",
   "type":"Feature",
   "properties":{
      "name":"Uganda",
      "status":"Active",
      "version":0,
      "geographicLevel":0
   },
   "locationTags":[
      {
         "id":1,
         "name":"Country"
      }
   ],
   "serverVersion":1
} 

This is the same value as what exists on preview instance

Naima-Bashir commented 1 year ago

Hi @SebaMutuku @dubdabasoduba , the Locations units page is still showing no data. See te image below: image

SebaMutuku commented 1 year ago

@dubdabasoduba do we need a restart of the stage instance?

dubdabasoduba commented 1 year ago

@SebaMutuku Please go ahead and make the following bug fixes

Please review and add an LOE to this piece or work.

SebaMutuku commented 1 year ago

@dubdabasoduba @Naima-Bashir I would request for two days to work on this. First day to fix the issue and corresponding dependency libraries and second day to write test. If I need more time them I will update.

Naima-Bashir commented 1 year ago

Hi @SebaMutuku . Here are my findings: I can see data on the Locations Units Page. The Locations Unit Group however doesn't have any data, is this the case? image

Also unrelated but also related, how come we use Uganda as our stage data? @dubdabasoduba

SebaMutuku commented 1 year ago

@Naima-Bashir I have realized for location unit group, on clicking the button first time, it shows empty data. However, when you click another button and then click on Location Unit Group then it shows data.

peterMuriuki commented 1 year ago

@SebaMutuku @Naima-Bashir The location unit group module issue, is fixed in https://github.com/opensrp/web/releases/tag/v2.3.3, just need to redeploy the web app.