feat: bulk upload (#7800)

## Description

Adds bulk upload functionality to upload enabled configs.

You can disable the ability by defining `upload.bulkUpload: false` in
your upload enabled config.

- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

- [x] New feature (non-breaking change which adds functionality)

## Checklist:

- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] Existing test suite passes locally with my changes
- [ ] I have made corresponding changes to the documentation
This commit is contained in:
Jarrod Flesch
2024-08-21 17:44:34 -04:00
committed by GitHub
parent af0105ced5
commit 1ee19d3016
63 changed files with 1936 additions and 5 deletions

View File

@@ -120,6 +120,7 @@ export const sanitizeCollection = async (
// disable duplicate for uploads by default
sanitized.disableDuplicate = sanitized.disableDuplicate || true
sanitized.upload.bulkUpload = sanitized.upload?.bulkUpload ?? true
sanitized.upload.staticDir = sanitized.upload.staticDir || sanitized.slug
sanitized.admin.useAsTitle =
sanitized.admin.useAsTitle && sanitized.admin.useAsTitle !== 'id'

View File

@@ -95,6 +95,11 @@ export type UploadConfig = {
* - A function that generates a fully qualified URL for the thumbnail, receives the doc as the only argument.
**/
adminThumbnail?: GetAdminThumbnail | string
/**
* Enables bulk upload of files from the list view.
* @default true
*/
bulkUpload?: boolean
/**
* Enables cropping of images.
* @default true