Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Next] Backport changes from master #9923

Merged
merged 41 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
429ec98
prop table + prop sections
erwanMarmelab May 21, 2024
115ea84
lint + fix code example
erwanMarmelab May 21, 2024
84b4dcb
[skip-ci] don't accept common input props
erwanMarmelab May 21, 2024
31b26c5
[skip-ci] document allowMultipleRoots
erwanMarmelab May 21, 2024
9c9b773
[skip-ci] document showLine
erwanMarmelab May 21, 2024
6aff4f8
[skip-ci] document Insert as first child
erwanMarmelab May 21, 2024
fe6a013
[skip-ci] document create/show/edit
erwanMarmelab May 21, 2024
173671e
[skip-ci] fix img link in doc
erwanMarmelab May 21, 2024
89f8519
[skip ci] add position and meta in useGetTree doc
erwanMarmelab May 22, 2024
314933b
Add create/edit node section and deletebranchbutton
erwanMarmelab May 22, 2024
73d3132
fix jekyll build
erwanMarmelab May 22, 2024
f8a6986
Apply Adrien's suggestions from Enterprise code review
erwanMarmelab May 22, 2024
9bdf57f
Merge pull request #9862 from marmelab/update-ra-tree-doc
djhi May 23, 2024
711441d
docs: add trailing slash to api route
PaulieScanlon May 29, 2024
34831bb
[Doc] Add video tutorial to te ArrayInput chapter
fzaninotto May 29, 2024
7ec9c9e
Changed ressource to resource
wfouche May 29, 2024
0d05494
Merge pull request #9884 from wfouche/master
fzaninotto May 30, 2024
a2066d3
Merge pull request #9883 from PaulieScanlon/docs/next-js-app-router
fzaninotto May 30, 2024
b52abf6
Update FUNDING.yml
fzaninotto May 30, 2024
58020d7
added the genezio logo
bogdanripa May 31, 2024
810439c
Added Genezio to DataProviderList.md
bogdanripa May 31, 2024
3e724d9
Merge pull request #9890 from bogdanripa/master
fzaninotto May 31, 2024
92dca0b
Reduce backend logo size
fzaninotto May 31, 2024
9d2e2bd
Fix `<SelectInput resettable>` does not reset the value
fzaninotto Jun 3, 2024
0658077
fix: Filters visibility after user clicks "Remove filter" button
hmatthieu Jun 4, 2024
7f25557
fix: Filters visibility after user clicks "Remove filter" button
hmatthieu Jun 4, 2024
35cf7e2
add simple Codesandbox demo link to the demo doc
adguernier Jun 5, 2024
c4be2d1
Merge pull request #9900 from marmelab/doc-add-code-sandbox-blog-demo…
slax57 Jun 5, 2024
d8e38cb
fix: Adds an exists condition to cypress test to ensure app is ready
hmatthieu Jun 10, 2024
1a879e7
Merge pull request #9895 from marmelab/fix-selectinput-resettable
fzaninotto Jun 10, 2024
c2c7dbf
Merge pull request #9898 from hmatthieu/fix-filters-visibility-after-…
djhi Jun 11, 2024
fb383c8
[Doc] Clarify `<SaveButton transform>` usage
slax57 Jun 11, 2024
a91a5be
Merge pull request #9915 from marmelab/doc-SaveButton-transform
fzaninotto Jun 11, 2024
e7f1ec0
Fix ArrayInput ghost error after removing scalar item
djhi Jun 12, 2024
8b03446
Apply review suggestions
djhi Jun 12, 2024
b4c2608
Merge pull request #9918 from marmelab/fix-array-input-ghost-errors-a…
adguernier Jun 17, 2024
b73b1c6
Update changelog for 4.16.19
djhi Jun 17, 2024
f655345
v4.16.19
djhi Jun 17, 2024
98c0052
Update yarn.lock for 4.16.19
djhi Jun 17, 2024
cafddc3
Merge remote-tracking branch 'origin/master' into backport-from-maste…
slax57 Jun 17, 2024
c6e1c5d
fix ts error
slax57 Jun 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# These are supported funding model platforms

github: marmelab
open_collective: react-admin

12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,18 @@
* [TypeScript] Make types more strict in ra-core, part II ([#9743](https://github.com/marmelab/react-admin/pull/9743)) ([fzaninotto](https://github.com/fzaninotto))
* [TypeScript] Make types more strict in ra-core ([#9741](https://github.com/marmelab/react-admin/pull/9741)) ([fzaninotto](https://github.com/fzaninotto))

## v4.16.19

* Fix `<ArrayInput>` ghost error after removing scalar item ([#9918](https://github.com/marmelab/react-admin/pull/9918)) ([djhi](https://github.com/djhi))
* Fix filters with complex object are not removed from the UI ([#9898](https://github.com/marmelab/react-admin/pull/9898)) ([hmatthieu](https://github.com/hmatthieu))
* Fix `<SelectInput resettable>` does not reset the value ([#9895](https://github.com/marmelab/react-admin/pull/9895)) ([fzaninotto](https://github.com/fzaninotto))
* [Doc] Clarify `<SaveButton transform>` usage ([#9915](https://github.com/marmelab/react-admin/pull/9915)) ([slax57](https://github.com/slax57))
* [Doc] Add link to Codesandbox for the simple demo ([#9900](https://github.com/marmelab/react-admin/pull/9900)) ([adguernier](https://github.com/adguernier))
* [Doc] Added Genezio as a data provider ([#9890](https://github.com/marmelab/react-admin/pull/9890)) ([bogdanripa](https://github.com/bogdanripa))
* [Doc] Fix typo in TreeWithDetails props list ([#9884](https://github.com/marmelab/react-admin/pull/9884)) ([wfouche](https://github.com/wfouche))
* [Doc] Fix NextJS API routing snippet ([#9883](https://github.com/marmelab/react-admin/pull/9883)) ([PaulieScanlon](https://github.com/PaulieScanlon))
* [Doc] Update ra-tree documentation ([#9862](https://github.com/marmelab/react-admin/pull/9862)) ([erwanMarmelab](https://github.com/erwanMarmelab))

## v4.16.18

* Fix `<Datagrid>` uses wrong element for "Select All" label ([#9826](https://github.com/marmelab/react-admin/pull/9826)) ([fzaninotto](https://github.com/fzaninotto))
Expand Down
1 change: 1 addition & 0 deletions cypress/e2e/mobile.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ describe('Mobile UI', () => {
it('should load more items when scrolling to the bottom of the page', () => {
ListPagePosts.navigate();
cy.contains('Sint dignissimos in architecto aut');
cy.contains('Fusce massa lorem').should('exist');
cy.contains('Sed quo et et fugiat modi').should('not.exist');
cy.wait(500);
cy.contains('Sint dignissimos in architecto aut').scrollIntoView();
Expand Down
18 changes: 10 additions & 8 deletions docs/ArrayInput.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@ title: "The ArrayInput Component"

To edit arrays of data embedded inside a record, `<ArrayInput>` creates a list of sub-forms.

<video controls autoplay playsinline muted loop>
<source src="./img/array-input.webm" type="video/webm"/>
<source src="./img/array-input.mp4" type="video/mp4"/>
Your browser does not support the video tag.
</video>
<iframe src="https://www.youtube-nocookie.com/embed/-8OFsP7CiVc" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen style="aspect-ratio: 16 / 9;width:100%;margin-bottom:1em;"></iframe>

## Usage

`<ArrayInput>` allows editing of embedded arrays, like the `items` field in the following `order` record:

Expand Down Expand Up @@ -41,9 +38,6 @@ To edit arrays of data embedded inside a record, `<ArrayInput>` creates a list o
}
```

**Tip**: If you need to edit an array of *related* records, i.e. if the `items` above actually come from another resource, you should use a [`<ReferenceManyInput>`](./ReferenceManyInput.md) instead.

## Usage

`<ArrayInput>` expects a single child, which must be a *form iterator* component. A form iterator is a component rendering a field array (the object returned by react-hook-form's [`useFieldArray`](https://react-hook-form.com/docs/usefieldarray)). For instance, [the `<SimpleFormIterator>` component](./SimpleFormIterator.md) displays an array of react-admin Inputs in an unordered list (`<ul>`), one sub-form by list item (`<li>`). It also provides controls for adding and removing a sub-record.

Expand Down Expand Up @@ -75,8 +69,16 @@ const OrderEdit = () => (
);
```

<video controls autoplay playsinline muted loop>
<source src="./img/array-input.webm" type="video/webm"/>
<source src="./img/array-input.mp4" type="video/mp4"/>
Your browser does not support the video tag.
</video>

Check [the `<SimpleFormIterator>` documentation](./SimpleFormIterator.md) for details about how to customize the sub form layout.

**Tip**: If you need to edit an array of *related* records, i.e. if the `items` above actually come from another resource, you should use a [`<ReferenceManyInput>`](./ReferenceManyInput.md) instead.

## Props

`<ArrayInput>` accepts the [common input props](./Inputs.md#common-input-props) (except `format` and `parse`).
Expand Down
1 change: 1 addition & 0 deletions docs/DataProviderList.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ If you can't find a Data Provider for your backend below, no worries! [Writing a
* ![Firebase Firestore Logo](./img/backend-logos/firebase.png "Firebase Firestore Logo")**[Firebase Firestore](https://firebase.google.com/docs/firestore)**: [benwinding/react-admin-firebase](https://github.com/benwinding/react-admin-firebase).
* ![Firebase Realtime Logo](./img/backend-logos/firebase.png "Firebase Realtime Logo")**[Firebase Realtime Database](https://firebase.google.com/docs/database)**: [aymendhaya/ra-data-firebase-client](https://github.com/aymendhaya/ra-data-firebase-client).
* ![geoserver Logo](./img/backend-logos/geoserver.png "geoserver Logo")**[GeoServer](http://geoserver.org/)**: [sergioedo/ra-data-geoserver](https://github.com/sergioedo/ra-data-geoserver)
* ![Genezio Logo](./img/backend-logos/genezio.png "Genezio Logo")**[Genezio](https://genezio.com/)**: [bogdanripa/react-admin-genezio](https://github.com/bogdanripa/react-admin-genezio)
* ![sheets Logo](./img/backend-logos/sheets.svg "sheets Logo")**[Google Sheets](https://www.google.com/sheets/about/)**: [marmelab/ra-data-google-sheets](https://github.com/marmelab/ra-data-google-sheets)
* ![graphql Logo](./img/backend-logos/graphql.svg "graphql Logo")**[GraphQL (generic)](https://graphql.org/)**: [marmelab/ra-data-graphql](https://github.com/marmelab/react-admin/tree/master/packages/ra-data-graphql) (uses [Apollo](https://www.apollodata.com/))
* ![graphql Logo](./img/backend-logos/graphql.svg "graphql Logo")**[GraphQL (simple)](https://graphql.org/)**: [marmelab/ra-data-graphql-simple](https://github.com/marmelab/react-admin/tree/master/packages/ra-data-graphql-simple).
Expand Down
2 changes: 1 addition & 1 deletion docs/Demos.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ A simple application with posts, comments and users that we use for our e2e test

![Blog demo](./img/blog_demo.png)

* Demo: [https://stackblitz.com/github/marmelab/react-admin/tree/master/examples/simple](https://stackblitz.com/github/marmelab/react-admin/tree/master/examples/simple)
* Demo: available on [Stackblitz](https://stackblitz.com/github/marmelab/react-admin/tree/master/examples/simple) or on [Codesandbox](https://codesandbox.io/p/devbox/github/marmelab/react-admin/tree/master/examples/simple)
* Source code: [https://github.com/marmelab/react-admin/tree/master/examples/simple](https://github.com/marmelab/react-admin/tree/master/examples/simple)

## Music Player
Expand Down
2 changes: 1 addition & 1 deletion docs/NextJs.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ async function handler(request: Request) {
const requestUrl = request.url.split('/api/admin')[1];

// build the CRUD request based on the incoming request
const url = `${process.env.SUPABASE_URL}/rest/v1/${requestUrl}`;
const url = `${process.env.SUPABASE_URL}/rest/v1${requestUrl}`;

const options: RequestInit = {
method: request.method,
Expand Down
4 changes: 3 additions & 1 deletion docs/SaveButton.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,11 +255,13 @@ const transformUser = data => ({

const UserCreateToolbar = () => (
<Toolbar>
<SaveButton transform={transformUser} />
<SaveButton type="button" transform={transformUser} />
</Toolbar>
);
```

**Tip:** You need to set `type="button"` on the `<SaveButton>` to use `transform`. Without it, the form would be submitted with the default `transform` from the main page.

## `type`

By default, `<SaveButton>` renders a `submit` button. You can change this by passing `type="button"`. It is especially useful when using more than one save button in a form:
Expand Down
Loading
Loading