From ba065051afa7c81a7ca5f6ce936556d191cecfc2 Mon Sep 17 00:00:00 2001 From: Gildas Garcia <1122076+djhi@users.noreply.github.com> Date: Wed, 29 Nov 2023 11:39:40 +0100 Subject: [PATCH 1/6] Update CreateInDialogButton documentation --- docs/CreateInDialogButton.md | 224 +++++++++++++++++++++++++++++++++-- docs/EditInDialogButton.md | 4 +- 2 files changed, 217 insertions(+), 11 deletions(-) diff --git a/docs/CreateInDialogButton.md b/docs/CreateInDialogButton.md index b5dd02e3320..57e0edc09d0 100644 --- a/docs/CreateInDialogButton.md +++ b/docs/CreateInDialogButton.md @@ -7,19 +7,29 @@ title: "CreateInDialogButton" This [Enterprise Edition](https://marmelab.com/ra-enterprise) component offers a way to open a `` view inside a dialog, hence allowing to create a new record without leaving the current view. -It can be useful in case you want the ability to create a record linked by a reference to the currently edited record, or if you have a nested `` inside a `` or an `` view. - +It can be useful in case you want the ability to create a record linked by a reference to the currently edited record, or if you have a nested `` inside a `` or an `` view. + Note that this component doesn't use routing, so it doesn't change the URL. It's therefore not possible to bookmark the creation dialog, or to link to it from another page. If you need that functionality, use [``](./CreateDialog.md) instead. ## Usage -Put `` wherever you would put a ``, and use the same children as you would for a `` component (e.g. a ``): +First, install the `@react-admin/ra-form-layout` package: + +```sh +npm install --save @react-admin/ra-form-layout +# or +yarn add @react-admin/ra-form-layout +``` + +**Tip**: [`ra-form-layout`](https://marmelab.com/ra-enterprise/modules/ra-form-layout#createindialogbutton-editindialogbutton-and-EditInDialogButton) is hosted in a private npm registry. You need to subscribe to one of the [Enterprise Edition](https://marmelab.com/ra-enterprise/) plans to access this package. + +Then, put `` wherever you would put a ``, and use the same children as you would for a `` component (e.g. a ``): {% raw %} ```jsx @@ -63,15 +73,211 @@ const CompanyShow = () => ( In the above example, `` is used to create a new employee for the current company. [The `` component](./WithRecord.md) helps to set the new employee company id by default. +## Props + `` accepts the following props: -* `inline`: set to true to display only a Material UI `` instead of the full `