React generator has inconsistent paths generation
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- react, typescript
Hướng nghiên cứu
Chạy lệnh yarn build và testgen.sh react được ghi trong tài liệu, sau đó so sánh tmp/react/routes/book.tsx với tmp/react/components/book/Show.tsx. Truy vết các template của trình tạo đã tạo ra những tệp này và xác định biến đường dẫn được sử dụng cho từng tệp. Hoàn thành khi các đường dẫn route được tạo và các liên kết điều hướng sử dụng cùng một đường dẫn tài nguyên.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
React generator has problem with paths for resources.
I generated a client using https://demo.api-platform.com/, while the generated routes have paths like /admin/books/create the Show components has paths like <Navigate to="/books/" replace />
How to reproduce
- Generate a client with
rm -rf ./tmp && yarn build && ENTRYPOINT=https://demo.api-platform.com/ ./testgen.sh react - Go to
tmp/react/routes/book.tsxyou will see
const routes = [
<Route path="/admin/books/create" element={<Create />} key="create" />,
<Route path="/admin/books/edit/:id" element={<Update />} key="update" />,
<Route path="/admin/books/show/:id" element={<Show />} key="show" />,
<Route path="/admin/books" element={<List />} key="list" />,
<Route path="/admin/books/:page" element={<List />} key="page" />,
];
- Go to
tmp/react/components/book/Show.tsxand you can see
<Link to="/books/" className="btn btn-primary">
Back to list
</Link>
Possible Solution
Use the same variable in all template when generating routes and links
Additional Context
PR here : https://github.com/api-platform/create-client/pull/377
- Ngôn ngữ chính
- TypeScript
- Star
- 376
- Fork
- 132
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của api-platform/create-client
-
[potential Security Alert] New `test-vue-app` script added in `@api-platform/[email protected]`Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
api-platform/create-client#396 ·
-
[potential Security Alert] New `test-nuxt-app` script added in `@api-platform/[email protected]`Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
api-platform/create-client#397 ·
-
[potential Security Alert] New `test-next-app` script added in `@api-platform/[email protected]`Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
api-platform/create-client#395 ·
-
[potential Security Alert] New `test-react-app` script added in `@api-platform/[email protected]`Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
api-platform/create-client#394 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
api-platform/create-client#393 · 1 bình luận ·
Tất cả issue của api-platform/create-client
Issue tương tự
-
bug confirmed perf
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
videojs/video.js#9400 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue hacktoberfest
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 70/100
HelpCode-ai/anythingmcp#996 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add: CanalPlusActionEurope.nlĐang mởcheck:passed streams:add
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 2 ngày
-
beta technical-medium ui
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
walletbeat/walletbeat#1625 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Good First Issue]: Add unit tests for NetworkVersionInfoCó thể đã có người làm @attilayener đã nhận hôm nay. Đang mởGood First Issue hacktoberfest
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
hiero-ledger/hiero-sdk-js#4489 ·
Maintainer thường phản hồi trong vòng 1 ngày