-
-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for react-admin v5 (#572)
* [WIP] Add support for react-admin v5 * Fix more TS errors * Fix build * Fix linter warnings * Fix one test * fix jest config for react-query * InputGuesser: fix array label and test * Add folder hierarchy * Fix tests * Add sort and filter to the test entity * Modernize override code * Fix console error * Fix override code * Add stroy testing view customization * Bump version * Apply suggestions from code review Co-authored-by: Gildas Garcia <[email protected]> * Update .dockerignore Co-authored-by: Kévin Dunglas <[email protected]> * Apply suggestion from code review --------- Co-authored-by: Jean-Baptiste Kaiser <[email protected]> Co-authored-by: Gildas Garcia <[email protected]> Co-authored-by: Kévin Dunglas <[email protected]>
- Loading branch information
1 parent
56efa7c
commit 2027186
Showing
54 changed files
with
675 additions
and
771 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,7 @@ | ||
# Upgrade to 3.0 | ||
# Upgrade to 4.0 | ||
|
||
First of all, read the [UPGRADE guide from react-admin](https://marmelab.com/react-admin/doc/4.0/Upgrade.html). | ||
API Platform Admin 4.0 has the same API as API Platform admin 3.4, but now requires react-admin v5. | ||
|
||
Since API Platform Admin is built on top of react-admin, almost everything in the react-admin upgrade guide applies to API Platform Admin as well. | ||
If your application only uses components from the '@api-platform/admin' package, it should work out of the box with API Platform Admin 4.0. | ||
|
||
This UPGRADE guide will only cover the specific changes for API Platform Admin. | ||
|
||
## Authentication Support | ||
|
||
Since the way to define custom routes has completely changed in react-admin, the way to add authentication support in API Platform Admin has also been modified. | ||
|
||
In short, you need to use the `<CustomRoutes>` component inside the `<HydraAdmin>` or `<AdminGuesser>` component, with a redirect condition on its child. | ||
The condition is taken from a state variable, and the state updater function is given to the data provider and will be used when there is an unauthorized error. | ||
|
||
To see the full updated example, please [go to the related documentation page](https://api-platform.com/docs/main/admin/authentication-support/). | ||
|
||
## Mercure Support | ||
|
||
Since react-admin does not use Redux anymore, it's also the case for Mercure in API Platform Admin. | ||
|
||
Instead it uses react-query cache to update the received changes in real time. | ||
|
||
You will not see the Redux data action when a resource is updated by Mercure anymore. | ||
If you have done some customization based on the 'react-admin' package, you will probably have to make some changes. Read the [UPGRADE guide from react-admin](https://marmelab.com/react-admin/doc/5.0/Upgrade.html) for further details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.