payload icon indicating copy to clipboard operation
payload copied to clipboard

Overwrite default edit view

Open dkirchhof opened this issue 1 year ago • 1 comments

Link to reproduction

https://github.com/payloadcms/payload/compare/main...dkirchhof:payload:custom-edit-view-test

Describe the Bug

Hello,

I want to extend the default edit view of a collection, so first I copied the original edit view and added it to the collection admin config. While opening the edit page of the collection, everything works fine. While opening this view in a drawer, the application will crash.

It seems that the component will be rendered with different props as the original one.

Related issue: https://github.com/payloadcms/payload/issues/4900

To Reproduce

Clone the linked repo and run pnpm dev admin.

Working example:

  1. Open the Test2 collection in the admin panel.
  2. Create a new doc.

Not working:

  1. Open the Test collection in the admin panel.
  2. Create a new doc and select a Test2 doc in the relation field.
  3. See error logs in the console.

Some missing props (like permissions) are causing errors in the DocumentControls and DocumentFields components of my custom edit view.

Payload Version

2.8.2

Adapters and Plugins

No response

dkirchhof avatar Jan 29 '24 20:01 dkirchhof

@dkirchhof are you able to confirm if this is still an issue in v3?

jacobsfletch avatar Nov 22 '24 18:11 jacobsfletch

This issue was automatically closed due to lack of activity. If this issue is still relevant against the latest codebase, please create a new issue.

github-actions[bot] avatar Dec 06 '24 15:12 github-actions[bot]

Didn't have time to check it in payload 3. But its unlikely that there is still a need to overwrite the view in payload 3.

dkirchhof avatar Dec 06 '24 15:12 dkirchhof

This issue has been automatically locked. Please open a new issue if this issue persists with any additional detail.

github-actions[bot] avatar Dec 08 '24 04:12 github-actions[bot]