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 unwanted data overrides when bulk editing #9842

Merged
merged 9 commits into from
Dec 10, 2024

Conversation

PatrikKozak
Copy link
Contributor

@PatrikKozak PatrikKozak commented Dec 9, 2024

What?

It became possible for fields to reset to a defined defaultValue when bulk editing from the edit-many drawer.

Why?

The form-state of all fields were being considered during a bulk edit - this also meant using their initial states - this meant any fields with default values or nested fields (like arrays) would be overwritten with their initial states

I.e. empty values or default values.

How?

Now - we only send through the form data of the fields specifically being edited in the edit-many drawer and ignore all other fields.

Leaving all other fields stay their current values.

Fixes #9590

Copy link
Contributor

@DanRibbens DanRibbens left a comment

Choose a reason for hiding this comment

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

The approach looks good. I do have some feedback.

test/admin/e2e/3/e2e.spec.ts Outdated Show resolved Hide resolved
test/admin/collections/Posts.ts Show resolved Hide resolved
packages/ui/src/forms/Form/types.ts Outdated Show resolved Hide resolved
packages/ui/src/forms/Form/index.tsx Outdated Show resolved Hide resolved
Copy link
Contributor

@DanRibbens DanRibbens left a comment

Choose a reason for hiding this comment

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

Looks good!

@DanRibbens DanRibbens merged commit 563694d into main Dec 10, 2024
54 checks passed
@DanRibbens DanRibbens deleted the fix/bulk-edit branch December 10, 2024 16:39
Copy link
Contributor

🚀 This is included in version v3.6.0

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.

HIGH DATALOSS RISK: Multi Edit overrides field data with its "defaultValue"
3 participants