Compatibility with react-admin base components
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- react, typescript
Research direction
Start with pwa/admin/index.tsx and reproduce the reported combinations of HydraAdmin, ResourceGuesser, ListGuesser, TextField, List, and Datagrid. Read the HydraAdmin integration and the react-admin router and theme setup implicated by the errors. Done means regular react-admin components, routing, theming, and the documented JWT login flow work without the reported errors.
Written by the indexing model from the issue text.
Description
API Platform version(s) affected: 3.4.3 (api platform admin version)
Description
I am having multiple issues when trying to use regular react-admin components.
For example trying to use a 'TextField' in ListGuesser doesn't display anything.
Worse, if i try to replace the ListGuesser with a regular List + Datagrid, I am getting error about useNavigate() needing a Router. If i encapsulate HydraAdmin with BrowserRouter, i am getting a 'theme' is null error instead... and on and on... I am just wondering if this is something i am doing wrong, or if it's just not ready at the moment ?
I managed to get to login with jwt, but ran into numerous issues too despite using the code in the documentation. Basically, can't replace the login page either, running also in the router + theme issues...
How to reproduce
only modification from the base project, in the pwa/admin/index.tsx page
import Head from "next/head";
import { useEffect, useState } from "react";
import {FieldGuesser, ListGuesser, ResourceGuesser} from "@api-platform/admin";
import {TextField} from "react-admin";
const GreetingList = props => (
<ListGuesser {...props}>
<FieldGuesser source={"name"} />
<TextField source={"name"} />
</ListGuesser>
);
const Admin = () => {
// Load the admin client-side
const [DynamicAdmin, setDynamicAdmin] = useState(<p>Loading...</p>);
useEffect(() => {
(async () => {
const HydraAdmin = (await import("@api-platform/admin")).HydraAdmin;
setDynamicAdmin(<HydraAdmin entrypoint={window.origin}>
<ResourceGuesser name={"greetings"} list={GreetingList} />
</HydraAdmin>);
})();
}, []);
return (
<>
<Head>
<title>API Platform Admin</title>
</Head>
{DynamicAdmin}
</>
);
};
export default Admin;
Possible Solution
Additional Context
- Dominant language
- TypeScript
- Stars
- 516
- Forks
- 134
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from api-platform/admin
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
api-platform/admin#616 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 64/100
api-platform/admin#660 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 50/100
api-platform/admin#659 · 1 reaction ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
api-platform/admin#631 · 6 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
api-platform/admin#626 · 1 comment · 1 reaction ·
All issues in api-platform/admin
Similar issues
-
clawsweeper:linked-pr-open clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:message-loss issue-rating: 🦞 diamond lobster maturity:stable P2
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#616 ·
-
ZCode 3.14.3 に対応する Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
supermomonga/zcode-acp#24 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
growthbook/growthbook#7100 ·
-
triage
Difficulty 1/5 1-3 hours Newbie friendliness 88/100