Copilot commented on code in PR #3005:
URL: https://github.com/apache/apisix-dashboard/pull/3005#discussion_r2065379209


##########
src/components/form-slice/FormItemPlugins/index.tsx:
##########
@@ -84,26 +105,32 @@ const FormItemPluginsCore = <T extends FieldValues>(
     <InputWrapper error={fieldState.error?.message} {...restProps}>
       <input name={fName} type="hidden" />
       <Group>
-        <PluginCardListSearch search={search} setSearch={setSearch} />
+        <PluginCardListSearch
+          search={pluginsOb.search}
+          setSearch={pluginsOb.setSearch}
+        />
         {!restField.disabled && (
           <SelectPluginsDrawer
             plugins={pluginsOb.unSelected}
-            onSave={pluginsOb.update}
+            opened={pluginsOb.selectPluginsOpened}
+            setCurPlugin={pluginsOb.setCurPlugin}
+            setOpened={pluginsOb.setSelectPluginsOpened}
           />
         )}
       </Group>
       <PluginCardList
         mode={isView ? 'view' : 'edit'}
         placeholder={t('form.plugins.searchForSelectedPlugins')}
         mah="60vh"
-        search={search}
+        search={pluginsOb.search}
         plugins={pluginsOb.selected}
         onDelete={pluginsOb.delete}
         onView={pluginsOb.setCurPlugin}
         onEdit={pluginsOb.setCurPlugin}
       />
       <PluginEditorDrawer
         mode={isView ? 'view' : 'edit'}
+        schema={getSchemaReq.data?.data}

Review Comment:
   The schema prop is being accessed as 'getSchemaReq.data?.data', but the 
query function already returns the data payload. Consider using 
'getSchemaReq.data' instead.
   ```suggestion
           schema={getSchemaReq.data}
   ```



##########
src/config/req.ts:
##########
@@ -43,6 +53,7 @@ req.interceptors.response.use(
   },
   (err) => {
     if (err.response) {
+      if (matchSkipInterceptor(err)) return;

Review Comment:
   Returning without propagating the error in the interceptor may cause 
unresolved promise rejections. Consider returning Promise.reject(err) to ensure 
proper error handling.
   ```suggestion
         if (matchSkipInterceptor(err)) return Promise.reject(err);
   ```



##########
src/components/page-slice/plugin-metadata/PluginMetadata.tsx:
##########
@@ -0,0 +1,144 @@
+import { Drawer, Group } from '@mantine/core';
+import { useTranslation } from 'react-i18next';
+import { usePluginMetadataList, type PluginInfo } from './hooks';
+import {
+  PluginCardList,
+  PluginCardListSearch,
+} from '@/components/form-slice/FormItemPlugins/PluginCardList';
+import { SelectPluginsDrawer } from 
'@/components/form-slice/FormItemPlugins/SelectPluginsDrawer';
+import { difference } from 'rambdax';
+import {
+  PluginEditorDrawer,
+  type PluginConfig,
+} from '@/components/form-slice/FormItemPlugins/PluginEditorDrawer';
+import { observer, useLocalObservable } from 'mobx-react-lite';
+import { toJS } from 'mobx';
+import { useDeepCompareEffect } from 'react-use';
+import type { PluginCardProps } from 
'@/components/form-slice/FormItemPlugins/PluginCard';
+import { useMutation } from '@tanstack/react-query';
+import { deletePluginMetadataReq, putPluginMetadataReq } from '@/apis/plugins';
+import { notifications } from '@mantine/notifications';
+
+export const PluginMetadata = observer(() => {
+  const { t } = useTranslation();
+
+  const getMetatdataListReq = usePluginMetadataList();

Review Comment:
   The variable name 'getMetatdataListReq' appears to be misspelled; consider 
renaming it to 'getMetadataListReq' for improved clarity.
   ```suggestion
     const getMetadataListReq = usePluginMetadataList();
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to