-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
feat: remove deleted image from content #7310
base: main
Are you sure you want to change the base?
feat: remove deleted image from content #7310
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of prop drilling the config, it might be more efficient to read the config once before calling serializeValues and add this option to the fields that are passed into the function. The state should be accessible on that point, I think. This approach would also maintain the possibility for adding this feature to specific fields in the future (or now?). What do you think?
We also have a chance to solve two problems in one go here and extend this to other field types (@martinjagodic I think this might interest you).
@@ -3,6 +3,8 @@ import { Map, List } from 'immutable'; | |||
|
|||
import { getWidgetValueSerializer } from './registry'; | |||
|
|||
const _pathsToRemove = new Set(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think we could find a way to make this non-global?
We don't have to do this in this PR, but I would anticipate such a feature in config. So instead of |
Summary
Added configuration option for removing deleted image from content. Instead of saving empty string.
closes #7120
closes #7186
I wasn't sure that this should be working by default, that's why I extended cms configuration with new option
remove_empty_image_field
. conected PR for docs will follow.Implementation is overlapping with logic for #3314 , which inserts default values for all removed entries. The same reason prevented me from saving image value as
null
orundefined
instead of empty string.Test plan
BEFORE:
AFTER:
Checklist
Please add a
x
inside each checkbox:A picture of a cute animal (not mandatory but encouraged)