fix(ui): preselect folder when bulk uploading from inside a folder#16030
Conversation
Good catch. updated folderID to optional. Thanks for the review! |
Thanks! Confirmed — setFolderID(undefined) resets the state when the drawer closes, and on the next open, ListBulkUploadButton sets the fresh folderID from useFolder() before opening the modal. So if the user navigates to a different folder and opens bulk upload again, it picks up the new folder correctly. |
This comment was marked as spam.
This comment was marked as spam.
|
🚀 This is included in version v3.83.0 |
…ayloadcms#16030) ### What? Preselect the current folder when triggering bulk upload from inside a folder view. ### Why? When bulk uploading from inside a folder, all files show "No Folder" instead of the current folder. Users have to manually assign each file to the folder, which is tedious and easy to miss. See payloadcms#15647 ### How? - Added `folderID` to `BulkUploadContext` to pass folder state from the button to the drawer - In `ListBulkUploadButton`, read `folderID` from `useFolder()` and set it on the context when opening bulk upload - In `FormsManager`, inject the `folderID` into each form's initial state so the folder field is pre-populated Fixes payloadcms#15647 --------- Co-authored-by: Paul Popus <paul@payloadcms.com>
What?
Preselect the current folder when triggering bulk upload from inside a folder view.
Why?
When bulk uploading from inside a folder, all files show "No Folder" instead of the current folder. Users have to manually assign each file to the folder, which is tedious and easy to miss. See #15647
How?
folderIDtoBulkUploadContextto pass folder state from the button to the drawerListBulkUploadButton, readfolderIDfromuseFolder()and set it on the context when opening bulk uploadFormsManager, inject thefolderIDinto each form's initial state so the folder field is pre-populatedFixes #15647