-
Notifications
You must be signed in to change notification settings - Fork 551
feat: route detail, edit page #3009
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
base: dev/next
Are you sure you want to change the base?
feat: route detail, edit page #3009
Conversation
…reams-detail-edit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements route detail and edit pages with updated plugins-related components and API integrations. Key changes include:
- Adding a new produceTime function and incorporating it into the production chain for data cleaning.
- Updating route components to use unified page button components (ToDetailPageBtn and ToAddPageBtn).
- Introducing the new route detail/edit page with form handling and API updates for route detail retrieval and submission.
Reviewed Changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
src/utils/producer.ts | Updated pipeProduce to include produceTime in the production chain. |
src/utils/form-producer.ts | Added produceTime to remove time-related properties from API responses. |
src/routes/upstreams/index.tsx | Replaced custom detail button with ToDetailPageBtn for consistency. |
src/routes/routes/index.tsx | Updated action column to use ToDetailPageBtn, and adjusted imports. |
src/routes/routes/detail.$id.tsx | Introduced route detail/edit form with react-hook-form and mutation handling. |
src/routes/protos/index.tsx & global_rules/index.tsx | Adjusted imports of page button components. |
src/components/page/ToAddPageBtn.tsx | Refactored ToAddPageBtn and added ToDetailPageBtn for route navigation. |
src/components/form-slice/FormItemPlugins/* | Updated plugin components to use Drawer.Stack and support a disabled state. |
src/apis/routes.ts | Added new API functions (getRouteQueryOptions and putRouteReq) for route detail handling. |
Files not reviewed (1)
- src/locales/en/common.json: Language not supported
Comments suppressed due to low confidence (2)
src/components/form-slice/FormItemPlugins/index.tsx:116
- [nitpick] Confirm that wrapping the plugin components within Drawer.Stack aligns with the design system and responsive layout requirements. It would be beneficial to document any design assumptions regarding this UI structure.
<Drawer.Stack>
src/components/page/ToAddPageBtn.tsx:10
- Ensure that using 'keyof FilterKeys<FileRoutesByTo, "add">' for the 'to' prop is consistently applied across the routing components and accurately restricts the valid route keys. Verify that this type change propagates correctly to prevent route mismatches.
to: keyof FilterKeys<FileRoutesByTo, 'add'>;
src/routes/routes/detail.$id.tsx
Outdated
disabled: readOnly, | ||
}); | ||
|
||
// 将API数据加载到表单中 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove comments in chinese
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
src/routes/routes/detail.$id.tsx
Outdated
} | ||
}, [routeData, form, isLoading]); | ||
|
||
// 处理表单提交和路由更新 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
Please answer these questions before submitting a pull request, or your PR will get closed.
Why submit this pull request?
What changes will this PR take into?
route detail, edit page, with plugins related components fixed.