fix(next): admin panel UI not rendering custom upload components (#9925)

### What?

Currently it is not possible to override the upload component.

### Why?

The ability to override the upload component is missing from
`renderDocumentSlots`.

### How?

Adding a check to include the custom upload component if it is
available.

This issue is holding me back from releasing a payload plugin.

Fixes #9591
This commit is contained in:
Riley Langbein
2025-01-21 09:49:52 +10:30
committed by GitHub
parent 9684d3165e
commit e4fa1718aa
4 changed files with 33 additions and 1 deletions

View File

@@ -115,6 +115,14 @@ export const renderDocumentSlots: (args: {
}
}
if (collectionConfig?.upload && collectionConfig?.admin?.components?.edit?.Upload) {
components.Upload = RenderServerComponent({
Component: collectionConfig.admin.components.edit.Upload,
importMap: req.payload.importMap,
serverProps,
})
}
return components
}