teams: fix judging form things
Bug description
- After a draft j-form is saved, when update it, checkbox goes wrong since some hooks(or value overwrite something). It's Difficult to refactor in a short period of time.
- If click checkbox first, and then turn to the link, the value will not be detected and submitting process will be failed (since it's required in the form).
Tried to
- handle
checked === true
in different levels, including reseting the form field when load the components/hooks, failed
Solution
- Simply re-constructing the form.value it in DTO level works, remove all checked flag but keep the part-names and selected prizes
- Since current this FE implementation trigger re-load form after
save
, some checked data would be removed, which make submitting after saving impossible. As we already have implementedsubmit
withsave and submit
in BE and team can withdraw submitted form as draft form, so simply removeonSave
in FE, useonSubmit
directly (close to the implementation of 2023) - Refactor
RequiredLinkCheckbox
to avoid team clicking checkbox first which may results unknown error, optimize language expression at the same time