Compatibility with react-admin base components
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 25/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- react, typescript
调研方向
从 pwa/admin/index.tsx 开始,重现已报告的 HydraAdmin、ResourceGuesser、ListGuesser、TextField、List 和 Datagrid 组合。阅读错误所涉及的 HydraAdmin 集成,以及 react-admin 的 router 和 theme 设置。完成的标准是:常规的 react-admin 组件、路由、主题设置以及文档中说明的 JWT 登录流程都能正常工作,且不再出现已报告的错误。
由索引模型根据 Issue 内容生成。
描述
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
- 主要语言
- TypeScript
- 星标
- 516
- 派生
- 134
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
api-platform/admin 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 65/100
api-platform/admin#616 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 64/100
api-platform/admin#660 ·
-
难度 4/5 3-5 天 新手友好度 50/100
api-platform/admin#659 · 1 个 reaction ·
-
难度 3/5 1-2 天 新手友好度 35/100
api-platform/admin#631 · 6 条评论 ·
-
难度 4/5 3-5 天 新手友好度 35/100
api-platform/admin#626 · 1 条评论 · 1 个 reaction ·
查看 api-platform/admin 的全部 Issue
相似的 Issue
-
VerificationGate: ATTRIBUTION quote guard never matches a normal quotation (\b around the quote) 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
danielmiessler/LifeOS#2234 ·
-
T: Bug
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 65/100
-
难度 1/5 1 小时以内 新手友好度 85/100
-
Mend: dependency security vulnerability untriaged
难度 2/5 1-3 小时 新手友好度 70/100