Open tiri39 opened 1 month ago
When the informantType
is changed to father
, mother
, or spouse
, the detailsExist
checkbox gets hidden (thanks to conditionals defined in the country configuration), and its value is set to true
.
Now, before submitting this corrected declaration, the draftToGqlTransformer
runs, and at certain points, when it comes to deciding what to do with declaration.mother.detailsExist
, it calculates the conditionals for it. The following conditionals are defined for the mother.detailsExist
field:
export const mothersDetailsExistConditionals = [
{
action: 'hide',
expression: 'draftData?.informant?.informantType==="MOTHER"'
},
{
action: 'hideInPreview',
expression: 'values.detailsExist'
}
];
In the transformer, if the hide
conditional is found, then that field is removed from the declarations
. Hence, mother.detailsExist
is removed, it is submitted, and when we redownload this declaration, the detailsExist
field falls back to false
(as it is in the backend). As a result, the client shows that the informant data is not updated.
@rikukissa , can you suggest something? this looks like a design bug.
Bug description:
For birth declaration, if user updates/corrects the informant type from any other option to father/mother for the declarations that didn't have father/mother details at first (details not available checkboxes were checked true), the updated informations are not shown in view/ review page after registration.
For death declaration, If user updates/corrects the informant type from anyone to spouse for the declarations that didn't have spouse details at first (details not available checkbox was checked true), the updated informations are not shown in view/ review page after registration.
Steps to reproduce:
For birth -
For death -
Actual result: For birth declaration, father/ mother (the chosen informant) details are not shown in the view/ review page. For death declaration, spouse details are not shown in the view/ review page.
Expected result: For birth declaration, father/ mother (the chosen informant) details should be shown in the view/ review page. For death declaration, spouse details should be shown in the view/ review page.
Screenshot/ Recording:
For birth -
https://github.com/user-attachments/assets/59a6ec7b-7dfb-468e-b6eb-17c4c9d19f00
For death -
https://github.com/user-attachments/assets/86e2d65e-64fd-4c18-bd97-1bc02c59c058
Tested on: https://login.farajaland-qa.opencrvs.org/?lang=en
Version: v1.6.0, v1.5.1