Custom Edit modal on create from a document with doc data (for Relationship fields) #4954
Replies: 1 comment
-
Description & ExampleSuch a feature would be helpful to us, this to keep certain values between related objects in sync. We have multiple document types that have the same data format. We can always validate values on the backend with hooks on the parent, but its really not ideal to push all responsibility for data consistency fully to the user and just reject his saves until it fits. Solution PropositionAs @rubnvp wrote I'd see it as helpful if we had 2 admin hooks so we could prepopulate certain values in a new Modal window. Proposed hook example.
This could be achieved by what he described adding a Create ➕![]() Edit ✏️![]() This If the modal window finds a If someone needs even more configuration, then collection config shaping the modal window can also contain special field types that could react with field functionality to such a provided parent But implementing the creation and passing of such a ImplementationWould the Payload team be open to receive a potential contribution for such a feature? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
We are seeking for the ability to access the parent document and the triggering field when a modal is opened, allowing us to autocomplete specific fields based on the relevant document or field during creation.
At present, when developing a custom component for the Edit component, we receive certain props (such as id, internalState, collection, etc.) that can be modified, but there is no context indicating where this Edit component was invoked.
Ideally, we propose the introduction of Collection (or Field) Hooks, perhaps named
beforeCreate
andbeforeEdit
, which would provide these props along with additional context indicating the origin of the modal trigger. This could resemble the functionality of beforeValidate.Some related issues that I found on the Discord server:
Beta Was this translation helpful? Give feedback.
All reactions