Open BCerki opened 10 months ago
@BCerki do you think we still need this ticket?
@BCerki do you think we still need this ticket?
Yes, I think so--we still have frontend formData
conversion happening in client/app/components/routes/operations/form/Operation.tsx and this strategy caused a bug in the past
@marcellmueller suggested splitting it by forms for reviewing purposes.
@BCerki to add to this ticket list of schemas that are involved in this work
I've left this as a single ticket instead of creating separate tickets per file because the first bullet is just renaming a variable
This ticket may no longer be relevant if the registration part 2 form is so different it doesn't use the same schemas.
Description of the Tech Debt
In some of our forms, we transform the data received from the backend before passing it to an rjsf form. This transformation has caused a couple bugs (e.g. https://github.com/bcgov/cas-registration/pull/729#issuecomment-1912852671), so this ticket is about moving the transformation into a django ninja schema instead (unnest, use resolvers to change type if needed, etc.). Then, we can put the data directly into rjsf without any manipulation on the front end.
Note: django ninja has been updated since we wrote most of our schemas, so while looking at existing examples will help, there may be additional new features that could help with this ticket: https://django-ninja.dev/whatsnew_v1/
The following files need to be refactored:
await getUserOperatorFormData(userOperatorId as string)
directly into the form. (Currently it's "transformed" (nothing actually changes) into aformData
variable before getting passed to rjsf).formData
variable, and then we further manipulate that usingtransformedFormData
. Instead, we should be able to pass the response from await getOperation(numRow) straight into the formData. Update the schemas used for @router.get( "/operations/{operation_id}"Tech Debt Triage
The purpose of our technical debt triage process is to analyze technical debt to determine risk level of the technical debt and the value in tackling that technical debt.
Risk Value Scoring: