Files
payloadcms/docs/fields
Dan Ribbens 6cdf141380 feat: prevent create new for joins (#8929)
### What?

Adds a way to prevent creating new documents from the admin UI in a join
field.

### Why?

There are two reasons: 
1. You want to disable this any time as a feature of your admin user
experience
2. When creating a new document it is not yet possible to create the
relationship, preventing create is necessary for the workflow to make
sense.

### How?

join field has a new admin property called `allowCreate`, can be set to
false. By default the UI will never allow create when the current
document being edited does not yet have an `id`.

Fixes #

#8892

### Before

Even though the document doesn't have an ID yet, the create buttons are
shown which doesn't actually work.

![image](https://github.com/user-attachments/assets/152abed4-a174-498b-835c-aa4779c46834)

### After

Initial document creation: 
![Screenshot 2024-10-29
125132](https://github.com/user-attachments/assets/f33b1532-5b72-4c94-967d-bda618dadd34)

Prevented using `allowCreate: false`
![Screenshot 2024-10-29
130409](https://github.com/user-attachments/assets/69c3f601-fab3-4f5a-9df5-93fd133682ca)
2024-10-29 16:49:27 -04:00
..
2024-10-18 10:47:47 +03:00
2024-10-18 10:47:47 +03:00
2024-10-18 10:47:47 +03:00
2024-10-18 10:47:47 +03:00
2024-10-18 10:47:47 +03:00
2024-10-18 10:47:47 +03:00
2024-10-18 10:47:47 +03:00
2024-10-18 10:47:47 +03:00
2024-10-18 10:47:47 +03:00
2024-10-18 10:47:47 +03:00
2024-10-18 10:47:47 +03:00
2024-10-18 10:47:47 +03:00
2024-10-18 10:47:47 +03:00
2024-10-18 10:47:47 +03:00
2024-10-18 10:47:47 +03:00
2024-10-18 10:47:47 +03:00