Skip to content

Conversation

@matthew-a-dunlap
Copy link
Contributor

This alongside previous form changes means that we will be able to send empty-but-changed values in forms

Copilot AI and others added 4 commits January 28, 2026 08:28
- Changed omitExtraData from true to false in ResourceForm to ensure empty string values are included in form submissions
- Added comprehensive unit tests for removeReadOnlyProps function to validate empty value handling
- Updated CHANGELOG.md with bug fix entry

Co-authored-by: marrobi <17089773+marrobi@users.noreply.github.com>
- Addressed code review feedback by removing unreachable duplicate case

Co-authored-by: marrobi <17089773+marrobi@users.noreply.github.com>
This alongside previous form changes means that we will be able to send empty-but-changed values in forms
@marrobi
Copy link
Member

marrobi commented Jan 28, 2026

@matthew-a-dunlap how about I close the copilot generated PR and you target this one at main? I can review/approve it that way, but can't if I created it. :)

You good with that?

@matthew-a-dunlap
Copy link
Contributor Author

@marrobi Sounds great!

@marrobi
Copy link
Member

marrobi commented Jan 28, 2026

@matthew-a-dunlap k, let us know when ready to review.

@marrobi marrobi changed the base branch from copilot/fix-workspace-property-blank to main January 29, 2026 16:46
@marrobi marrobi marked this pull request as draft January 30, 2026 09:22
Copy link
Collaborator

@JC-wk JC-wk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is an rjsf issue rather than a TRE one.
see rjsf-team/react-jsonschema-form#3728 (comment)
I'm not convinced this pr is required, can you confirm if you've tried this?

You can use the uiSchema option ui:emptyValue to ensure the empty case falls back to the empty string instead of removing it from the formData.

Happy to discuss and test different options but I think there may be more elegant solutions.
There are quite a number of issues on rjsf github discussing this situation

@matthew-a-dunlap
Copy link
Contributor Author

@JC-wk Thanks James for the thoughts. I'm definitely very naive and would love to discuss.

My instinct is to find a solution that works for all forms and all field types, to ensure fields that go from a value to empty during an update are always passed. Setting a default value for each field in each template seems cumbersome. I think this approach utilizing ui:emptyValue inside ResourceForm.tsx could work?

https://github.com/matthew-a-dunlap/AzureTRE/compare/main...matthew-a-dunlap:AzureTRE:fix-workspace-properties-blank-uiSchema?expand=1

@JC-wk
Copy link
Collaborator

JC-wk commented Feb 3, 2026

Hi @matthew-a-dunlap It looks like if you set uiSchema to have ui:emptyValue = "" everywhere then you'd run in to this issue rjsf-team/react-jsonschema-form#605 where it overrides a field being required so I think you could be best of just adding this to the templates where you think it is needed (i.e you definitely want to allow something that has a value to be set to blank) I don't think this is an issue for most TRE users and this seems to solve it acceptably for your use case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants