Skip to content

feat: Upgrade frontend packages to react-admin v5 #1358

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

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

mguihal
Copy link
Contributor

@mguihal mguihal commented Jan 29, 2025

Hello,

I open this pull request to track frontend packages migration to react-admin v5.
React-admin migration guide is available here: https://marmelab.com/react-admin/Upgrade.html

Most of the packages have no significant changes. I just updated peer-dependencies to make them compatible with v5 (and keep compatibility to v4 for projects which have not migrated yet and still want latest version of semapps packages, but it would be wise to remove this retrocompatiblity in the future I think 🙏 .

Commits are splitted by package for easier readability.

Below are the significant changes I listed :

Auth-provider

1/ usePermissions hook signature had to be changed to take an object instead of uri string.

// Before
const { permissions } = usePermissions('http://pathToResource');

// After
const { permissions } = usePermissions({ uri: 'http://pathToResource' });

2/ ListActionsWithPermissions component doesn't take bulkActions prop anymore

3/ EditWithPermission component doesn't include EditToolbarWithPermissions component in its children anymore

// Before
import { EditWithPermissions } from '@semapps/auth-provider';

const Component = () => (
    <EditWithPermissions>
        <Form>
           ...
        </Form>
    </EditWithPermssions>
);

// After 
import { EditWithPermissions, EditToolbarWithPermissions } from '@semapps/auth-provider';

const Component = () => (
    <EditWithPermissions>
        <Form toolbar={<EditToolbarWithPermissions />}>
           ...
        </Form>
    </EditWithPermssions>
);

@mguihal mguihal self-assigned this Jan 29, 2025
@mguihal mguihal force-pushed the feat-UpgradeReactAdmin5 branch from 1deb8d6 to 5b157ed Compare March 9, 2025 17:26
@mguihal mguihal force-pushed the feat-UpgradeReactAdmin5 branch from 5b157ed to 5e166f9 Compare March 9, 2025 22:27
@mguihal mguihal marked this pull request as ready for review March 9, 2025 22:45
@Laurin-W
Copy link
Contributor

Laurin-W commented May 9, 2025

Hey @mguihal, thanks for your work here!

I started to have the need of this migration today and @srosset81 made me aware that you had created this PR already!

Is there anything left to do for this?
If so and if you are not available, do you mind if I finish your work?

@mguihal
Copy link
Contributor Author

mguihal commented May 9, 2025

Hello!

Nothing was blocking, but I made this before the v1.1 version was released, so we need to rebase, and check if all is still alright with the latest changes.

I am not available until June, so feel free to continue my work if you want :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants