Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ui): prevents fieldSelect from showing invalid fields in editMany #10132

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

akhrarovsaid
Copy link
Contributor

@akhrarovsaid akhrarovsaid commented Dec 22, 2024

What?

This PR aims to fix two issues with the bulk edit flow. First, prevent the selection of invalid fields in the FieldSelect component. Second, prevent a runtime error when bulk editting docs in fields that have not defined an admin property.

Why?

For a more straightforward experience while bulk editing documents which have, potentially, several non-editable fields. Also, to prevent a runtime error.

How?

By taking into account that admin may not always be provided in the reduceFields function, and including checks for admin.hidden (which is distinct from hidden) and admin.readonly.

Fixes #10131

Before:
Media-bulkedit-before--Payload.webm

After:
Media-bulkedit-after--Payload.webm

Notes:

  • Observed an issue with fields that have readOnly set, where sometimes the value is not populated in those fields in the EditMany drawer. This also reverts rows, or adds strange messages to row fields in array fields with readOnly members.
  • I opted not to touch the fieldIsHiddenOrDisabled function in the payload package as that behavior seems distinct from checking against admin.readOnly since admin.hidden does not imply that it should be hidden from API calls.

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

Successfully merging this pull request may close these issues.

FieldSelect in EditMany shows invalid fields and causes runtime error when admin property not defined
1 participant