EyeSeeTea / metadata-synchronization

The metadata & data synchronization solution for DHIS2
https://eyeseetea.github.io/metadata-synchronization-blessed/metadatasync/
GNU General Public License v3.0
0 stars 2 forks source link

Support 2.38 and min support 2.36 #940

Closed xurxodev closed 1 year ago

xurxodev commented 1 year ago

:pushpin: References

:memo: Implementation

This version has breaking changes then it's necessary to test all sync very well. @idelcano I have prepared a sheet to document the bugs that you find. Please read the note at the top of the sheet https://docs.google.com/spreadsheets/d/1lWoVUqFkOVaH978w0Ta4nm2bTagtWhdpYkqrJmbx_qU/edit?usp=sharing

:art: Screenshots

:fire: Is there anything the reviewer should know to test it?

:bookmark_tabs: Others

xurxodev commented 1 year ago

Issues to fix after review:

The current param Remove users and keep user references (UID) only remove users as objects to avoid overwriting users in the destination.
I've added a new param Remove users and references (UID) that removes users as objects and as references.
If you activate this new param the sync http://localhost:8081/#/sync-rules/metadata/edit/iwxWLHJnhRf works

- [x] Sync visualization error
It's an error 500 in the server and we need debug logs
The problem was by non including legendSet, now legendSet is included by default
- [x] - Instances cache
I've added a cache for instances. 
Important: This app does not cancel requests. If the first time instances are requested you wait until they have finished then never are requested by the network again. But if you move to another screen while instances are loading then duplicate requests are realized.
In the future, we should investigate cancellation requests for this app.
- [x] Sync tracker events with mapping
It's working

Origin
``` json
{
  "href": "https://dev.eyeseetea.com/who-dev-238/api/events/A31sFuoTF6D",
  "event": "A31sFuoTF6D",
  "status": "ACTIVE",
  "program": "rjsnrRKjtwU",
  "programStage": "DQitAUlaicG",
  "enrollment": "ubVJxNaIunK",
  "enrollmentStatus": "ACTIVE",
  "orgUnit": "H8RixfF8ugH",
  "orgUnitName": "Global",
  "trackedEntityInstance": "uY6e8NHVDH2",
  "relationships": [],
  "eventDate": "2021-09-01T00:00:00.000",
  "dueDate": "2021-09-01T12:00:02.188",
  "storedBy": "widp.info",
  "dataValues": [
    {
      "created": "2021-09-01T12:00:02.206",
      "createdByUserInfo": {
        "uid": "QiUHDbdHdBU",
        "username": "widp.info",
        "firstName": "Bot",
        "surname": "Basic access"
      },
      "lastUpdated": "2021-09-01T12:00:02.206",
      "lastUpdatedByUserInfo": {
        "uid": "QiUHDbdHdBU",
        "username": "widp.info",
        "firstName": "Bot",
        "surname": "Basic access"
      },
      "value": "true",
      "dataElement": "X8XLOWOJsbR",
      "providedElsewhere": false,
      "storedBy": "widp.info"
    }
  ],
  "notes": [],
  "followup": false,
  "deleted": false,
  "created": "2021-09-01T12:00:02.189",
  "lastUpdated": "2021-09-01T12:00:02.219",
  "createdAtClient": "2021-09-01T12:00:02.189",
  "lastUpdatedAtClient": "2021-09-01T12:00:02.219",
  "attributeOptionCombo": "Xr12mI7VPn3",
  "attributeCategoryOptions": "Y7fcspgsU43"
}

Destination

{
  "href": "http://172.16.0.2:8080/api/events/A31sFuoTF6D",
  "event": "A31sFuoTF6D",
  "status": "ACTIVE",
  "program": "rjsnrRKjtwU",
  "programStage": "DQitAUlaicG",
  "enrollment": "ubVJxNaIunK",
  "enrollmentStatus": "ACTIVE",
  "orgUnit": "H8RixfF8ugH",
  "orgUnitName": "Global",
  "trackedEntityInstance": "uY6e8NHVDH2",
  "relationships": [],
  "eventDate": "2021-09-01T00:00:00.000",
  "dueDate": "2021-09-01T12:00:02.188",
  "storedBy": "widp.info",
  "dataValues": [
    {
      "created": "2023-03-23T06:56:19.240",
      "createdByUserInfo": {
        "uid": "smGarTiKDdV",
        "username": "dev.user",
        "firstName": "Foche",
        "surname": "Ignacio"
      },
      "lastUpdated": "2023-03-23T06:56:19.240",
      "lastUpdatedByUserInfo": {
        "uid": "smGarTiKDdV",
        "username": "dev.user",
        "firstName": "Foche",
        "surname": "Ignacio"
      },
      "value": "true",
      "dataElement": "H1pW1QzzA72",
      "providedElsewhere": false,
      "storedBy": "widp.info"
    }
  ],
  "notes": [],
  "followup": false,
  "deleted": false,
  "created": "2023-03-23T06:56:19.307",
  "createdByUserInfo": {
    "uid": "smGarTiKDdV",
    "username": "dev.user",
    "firstName": "Foche",
    "surname": "Ignacio"
  },
  "lastUpdated": "2023-03-23T06:56:19.307",
  "lastUpdatedByUserInfo": {
    "uid": "smGarTiKDdV",
    "username": "dev.user",
    "firstName": "Foche",
    "surname": "Ignacio"
  },
  "attributeOptionCombo": "Xr12mI7VPn3",
  "attributeCategoryOptions": "Y7fcspgsU43"
}