Allow easy access to the folder selection components #13914
CherryDT
started this conversation in
Feature Requests & Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I was trying to implement an import function for a collection which involved selecting the folder to import to. I did not succeed in implementing a nice folder selection UI, at the moment I put a
<RelationshipField>
which is not great because this app has folders several levels deep, and the field now of course just shows a flat list of all folders and not a tree.What I'd like to achieve is a button that works just like the one you get when creating a new item, where clicking it opens the "Select Folder for [XYZ]" drawer, and I'd like to initialize it with some value and read the value when changed.
I tried using the whole button from the
MoveDocToFolder
component, but it failed because it useduseDocumentInfo
internally and there was noDocumentInfoProvider
around my import screen. I thought about adding such a provider but then saw it takes so many properties, it seemed like the wrong direction, also I wasn't even sure how to read or write the folder value of the button.I also tried creating my own button and then using a
MoveItemsToFolderDrawer
which seemed to have a much nicer interface for my needs, but it resulted in a very strange problem in which the folder drawer itself seems to crash becauseuseModal()
returns{}
, howeveruseModal()
in my own component has no issue. Debugging it made me feel as if there were two instances of this component in memory, one perhaps in some bundled form and one from the direct import I made... something like that, because setting a breakpoint on that failinguseModal()
line within the drawer itself fired only when I clicked my custom button and did not fire when clicking a built-in button. (But there was only one@faceless-ui/modal
.)I wish there was an easy way to access the folder selection drawer and/or a folder selection button that opens it!
Beta Was this translation helpful? Give feedback.
All reactions