Skip to content

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?

add route list and add page.

image

localhost_5173_ui_routes_add (1)

@SkyeYoung SkyeYoung changed the base branch from master to dev/next April 30, 2025 05:54
@SkyeYoung SkyeYoung marked this pull request as ready for review April 30, 2025 05:57
Copy link
Contributor

@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 introduces a new feature to support a route list and an add page by updating API types, adding new components, and integrating a naming prefix utility for consistent form field naming. Key changes include:

  • New utility (useNamePrefix) for dynamic name prefixing across form components.
  • Extension of API types for routes and upstreams.
  • Updates to route management components (list and add page) with improved pagination and UI elements.

Reviewed Changes

Copilot reviewed 17 out of 18 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/utils/useNamePrefix.ts Adds a naming prefix hook to facilitate consistent form field naming.
src/types/schema/apisix/* Extends API types for routes, upstreams, and common HTTP methods.
src/routes/routes/index.tsx Refactors the route list page with updated pagination, table columns, and provider usage.
src/routes/routes/add.tsx Updates the add page with form integration using react-hook-form and notifications.
Other form-related components Integrates useNamePrefix for consistent naming across various form slices.
src/apis/upstreams.ts & src/apis/routes.ts Adjust API response types and add endpoints for route operations.
Files not reviewed (1)
  • src/locales/en/common.json: Language not supported

control={control}
name="status"
label={t('form.route.status')}
data={APISIX.RouteStatus.options.map((v) => v.value.toString())}
Copy link
Member

Choose a reason for hiding this comment

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

I'm okay with this option list, but any plans to add an info icon and description for this field?

image

Copy link
Member Author

Choose a reason for hiding this comment

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

After all pages are completed...

Copy link
Member Author

Choose a reason for hiding this comment

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

After all, it's strictly aligned with the API now.

control={control}
/>
<FormItemLabels name="labels" control={control} />
<FormItemLabels name={np('labels')} control={control} />
Copy link
Member

Choose a reason for hiding this comment

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

image

I just tried it. I can only make it work by inputting , or by blurring it.

Copy link
Member Author

Choose a reason for hiding this comment

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

enter should be able to work 🤔

<FormSection legend={t('form.upstream.nodes.title')}>
<FormItemNodes
name="nodes"
name={np('nodes')}
Copy link
Member

Choose a reason for hiding this comment

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

I can only delete this by clicking delete twice.

image

Copy link
Member Author

Choose a reason for hiding this comment

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

Found that the focus didn't automatically shift to the form, trying to solve it.

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

const { control } = useFormContext<FormPartUpstreamType>();
return <FormItemSwitch control={control} name="__checksPassiveEnabled" />;
};
const FormSectionChecksPassiveCore = () => {
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Let's not consider this issue for this version.

@SkyeYoung SkyeYoung requested a review from juzhiyuan April 30, 2025 09:39
@SkyeYoung SkyeYoung merged commit 9f451b0 into apache:dev/next Apr 30, 2025
@SkyeYoung SkyeYoung deleted the young/feat/routes-detail branch April 30, 2025 10:04
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.

3 participants