volto icon indicating copy to clipboard operation
volto copied to clipboard

Passes the `user` to the `restricted` function of the block settings

Open wesleybl opened this issue 1 year ago • 2 comments

The restricted function is called inside a useMemo. So we can't call useSelector on it. To work around this, we get the user before useMemo and pass it to the restricted function.

fixes #6264

wesleybl avatar Aug 26 '24 19:08 wesleybl

Deploy Preview for plone-components canceled.

Name Link
Latest commit e96e6b5c56c68f89ec09882ded0ad45ce9ba8515
Latest deploy log https://app.netlify.com/sites/plone-components/deploys/66da0f399aed390008590d45

netlify[bot] avatar Aug 26 '24 19:08 netlify[bot]

Looks good. Could you please also mention user in the docs?

Done

wesleybl avatar Aug 29 '24 12:08 wesleybl

It was missing to do the dispatch in getUser. It may be that the user is not in the store yet. I'll see if I can make a PR.

wesleybl avatar Sep 16 '24 18:09 wesleybl

@wesleybl @sneridagh @davisagli Do you think we can have this backported into Volto 17.x.x?

avoinea avatar Sep 25 '24 14:09 avoinea

@avoinea we have to finish #6293. I don't see a problem with having that in Volto 17.

wesleybl avatar Sep 25 '24 19:09 wesleybl

@wesleybl @avoinea I think it is backwards compatible and could be backported. If someone prepares the PR I can review it.

davisagli avatar Sep 25 '24 20:09 davisagli

@wesleybl As #6293 was merged, maybe we can reiterate now the back-port of this to Volto 17.x :thinking:

avoinea avatar Oct 04 '24 16:10 avoinea

As https://github.com/plone/volto/pull/6293 was merged, maybe we can reiterate now the back-port of this to Volto 17.x 🤔

Done in #6375

wesleybl avatar Oct 04 '24 18:10 wesleybl