You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "SkyeYoung (via GitHub)" <gi...@apache.org> on 2025/04/29 15:29:17 UTC

[PR] fix: align resource names with apisix [apisix-dashboard]

SkyeYoung opened a new pull request, #3007:
URL: https://github.com/apache/apisix-dashboard/pull/3007

   Please answer these questions before submitting a pull request, **or your PR will get closed**.
   
   **Why submit this pull request?**
   
   - [x] Bugfix
   - [ ] New feature provided
   - [ ] Improve performance
   - [ ] Backport patches
   
   **What changes will this PR take into?**
   
   solve:
   
   >  Don't forget to update all "-" to "_"
   >  Align resource names, routes, and APIs with the APISIX Admin API.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix: align resource names with apisix [apisix-dashboard]

Posted by "SkyeYoung (via GitHub)" <gi...@apache.org>.
SkyeYoung commented on code in PR #3007:
URL: https://github.com/apache/apisix-dashboard/pull/3007#discussion_r2067764676


##########
src/components/form/TagInput.tsx:
##########
@@ -6,24 +6,34 @@ import {
 } from 'react-hook-form';
 import { genControllerProps } from './util';
 
-export type FormItemTagsInputProps<T extends FieldValues> =
-  UseControllerProps<T> & TagsInputProps;
+export type FormItemTagsInputProps<
+  T extends FieldValues,
+  R
+> = UseControllerProps<T> &
+  TagsInputProps & {
+    from?: (v: R) => string;
+    to?: (v: string) => R;
+  };
 
-export const FormItemTagsInput = <T extends FieldValues>(
-  props: FormItemTagsInputProps<T>
+export const FormItemTagsInput = <T extends FieldValues, R>(
+  props: FormItemTagsInputProps<T, R>
 ) => {
-  const { controllerProps, restProps } = genControllerProps(props, []);
+  const {
+    controllerProps,
+    restProps: { from, to, ...restProps },
+  } = genControllerProps(props, []);
 
   const {
     field: { value, onChange: fOnChange, ...restField },
     fieldState,
   } = useController<T>(controllerProps);
   return (
     <TagsInput
-      value={value}
+      value={from ? value.map(from) : value}

Review Comment:
   that's a desgin.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix: align resource names with apisix [apisix-dashboard]

Posted by "juzhiyuan (via GitHub)" <gi...@apache.org>.
juzhiyuan commented on code in PR #3007:
URL: https://github.com/apache/apisix-dashboard/pull/3007#discussion_r2067700368


##########
src/apis/upstreams.ts:
##########
@@ -0,0 +1,21 @@
+import { API_UPSTREAMS } from '@/config/constant';
+import { req } from '@/config/req';
+import type { A6Type } from '@/types/schema/apisix';

Review Comment:
   ```suggestion
   import type { APISIXType } from '@/types/schema/apisix';
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix: align resource names with apisix [apisix-dashboard]

Posted by "SkyeYoung (via GitHub)" <gi...@apache.org>.
SkyeYoung merged PR #3007:
URL: https://github.com/apache/apisix-dashboard/pull/3007


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix: align resource names with apisix [apisix-dashboard]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #3007:
URL: https://github.com/apache/apisix-dashboard/pull/3007#discussion_r2066836833


##########
src/components/form/TagInput.tsx:
##########
@@ -6,24 +6,34 @@ import {
 } from 'react-hook-form';
 import { genControllerProps } from './util';
 
-export type FormItemTagsInputProps<T extends FieldValues> =
-  UseControllerProps<T> & TagsInputProps;
+export type FormItemTagsInputProps<
+  T extends FieldValues,
+  R
+> = UseControllerProps<T> &
+  TagsInputProps & {
+    from?: (v: R) => string;
+    to?: (v: string) => R;
+  };
 
-export const FormItemTagsInput = <T extends FieldValues>(
-  props: FormItemTagsInputProps<T>
+export const FormItemTagsInput = <T extends FieldValues, R>(
+  props: FormItemTagsInputProps<T, R>
 ) => {
-  const { controllerProps, restProps } = genControllerProps(props, []);
+  const {
+    controllerProps,
+    restProps: { from, to, ...restProps },
+  } = genControllerProps(props, []);
 
   const {
     field: { value, onChange: fOnChange, ...restField },
     fieldState,
   } = useController<T>(controllerProps);
   return (
     <TagsInput
-      value={value}
+      value={from ? value.map(from) : value}

Review Comment:
   The component transforms the value using the 'from' function for display but passes the original value to restProps.onChange. Consider passing the transformed value (i.e. 'val') consistently to ensure uniform handling of data.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org