Closed ghost closed 1 year ago
@sifavahora to make a new ticket from the investigation. Dan to provide more info on solution.
When performing a Dictionary Migration, Donor documents are validated using Lectern. This populates the invalidDonorsErrors field which Submitted Data page relies on for displaying submission errors.
The errors that are returned do not consistently contain sufficient info for the Front End to accurately mark which records are invalid. This results in instances where we only know the DonorId and Error Field, but cannot distinguish between multiple records belonging to the same donor which all have the same error field.
The error objects that are returned from Lectern need an additional errorValue
field populated on every entry. There is already error.info.value
however only certain errors contain this field; ideally it should be populated for every error record.
This would allow front end to highlight cells where DonorId -> Field === errorValue
Example Error:
{
errorType 'INVALID_BY_SCRIPT',
fieldName 'line_of_treatment',
index 2,
info {
message "The 'line_of_treatment' field must be a value greater than 1",
},
message "The 'line_of_treatment' field must be a value greater than 1",
entityName 'treatment'
},
Proposed Change:
{
errorType 'INVALID_BY_SCRIPT',
fieldName 'line_of_treatment',
index 2,
info {
message "The 'line_of_treatment' field must be a value greater than 1",
** Additional field **
errorValue: 0,
},
message "The 'line_of_treatment' field must be a value greater than 1",
entityName 'treatment'
},
Investigation complete. Made an action ticket in lectern: https://github.com/overture-stack/js-lectern-client/issues/27. Closing this ticket.
Reference - https://github.com/icgc-argo/platform-ui/issues/2385
The dictionary includes a validation check as follows:
is_primary_treatment
=Yes
, thenline_of_treatment
should be empty (should not be submitted)is_primary_treatment
=No
, thenline_of_treatment
should be a value greater than 1 (since it is not the primary treatment), or left empty (since it is an 'Extended' (optional) field).However, the 'Submitted Data' section shows rows as errors, but they are not actually errors: