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

Cleanup Image widget and pass down onSelectItem prop if any #6132

Merged
merged 3 commits into from
Jun 28, 2024

Conversation

sneridagh
Copy link
Member

@sneridagh sneridagh commented Jun 28, 2024

@dobri1408 @ichim-david integrating it into VLT I found this.


📚 Documentation preview 📚: https://volto--6132.org.readthedocs.build/

Copy link

netlify bot commented Jun 28, 2024

Deploy Preview for plone-components canceled.

Name Link
🔨 Latest commit 76fe1d5
🔍 Latest deploy log https://app.netlify.com/sites/plone-components/deploys/667e8793f1cc1400083bc1f0

@@ -110,6 +93,7 @@ function Edit(props) {
block={props.block}
id={props.block}
objectBrowserPickerType={'image'}
onSelectItem={props.onSelectItem}
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

@sneridagh I don't understand this passing of onSelectItem because at least in volto core there is no props.onSelectItem for Image block Edit.jsx. I do understand giving the ability to call this method if it's passed in the props of ImageWidget.jsx but in the case of Image block it's simply undefined and the fallback is called.

It's nice that you found more things to cleanup such as the extra compose actions!

Copy link
Contributor

@dobri1408 dobri1408 Jun 28, 2024

Choose a reason for hiding this comment

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

Yes, I agree. I believe it can be removed. The intent of the onSelectItem function is to give developers more control over the ImageWidget, but in this case, it is undefined.

Copy link
Member Author

Choose a reason for hiding this comment

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

@ichim-david @dobri1408 Agreed! yeah, I'll remove it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@sneridagh sneridagh merged commit e4b1b22 into main Jun 28, 2024
70 checks passed
@sneridagh sneridagh deleted the improve-image-widget branch June 28, 2024 10:06
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.

None yet

3 participants