Skip to content

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

Open
wants to merge 21 commits into
base: dev/next
Choose a base branch
from

Conversation

SkyeYoung
Copy link
Member

@SkyeYoung SkyeYoung commented Apr 30, 2025

Please answer these questions before submitting a pull request, or your PR will get closed.

Why submit this pull request?

  • Bugfix
  • New feature provided
  • Improve performance
  • Backport patches

What changes will this PR take into?

route detail, edit page, with plugins related components fixed.

localhost_5173_ui_routes_detail_00000000000000000244

localhost_5173_ui_routes_detail_00000000000000000244 (1)

@SkyeYoung SkyeYoung mentioned this pull request Apr 30, 2025
32 tasks
@SkyeYoung SkyeYoung marked this pull request as ready for review April 30, 2025 09:49
Copy link

@Copilot Copilot AI left a 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'>;

disabled: readOnly,
});

// 将API数据加载到表单中
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove comments in chinese

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

}
}, [routeData, form, isLoading]);

// 处理表单提交和路由更新
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

@SkyeYoung SkyeYoung requested a review from bzp2010 April 30, 2025 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants