Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

chore: Remove debug code and fix `defaultOpenKey` for `AccordionNav`

haitao(lj)be1da8803670
diff --git a/ui/src/common/interface.ts b/ui/src/common/interface.ts
index 2e6b1883..5c08259c 100644
--- a/ui/src/common/interface.ts
+++ b/ui/src/common/interface.ts
@@ -549,7 +549,7 @@ export interface PluginItem {
type: UIWidget;
title: string;
description: string;
- uiOptions?: UIOptions;
+ ui_options?: UIOptions;
option?: PluginOption[];
value?: string;
required?: boolean;
diff --git a/ui/src/components/AccordionNav/index.tsx b/ui/src/components/AccordionNav/index.tsx
index 878e2141..7b63cd50 100644
--- a/ui/src/components/AccordionNav/index.tsx
+++ b/ui/src/components/AccordionNav/index.tsx
@@ -113,7 +113,7 @@ const AccordionNav: FC<AccordionProps> = ({ menus = [], path = '/' }) => {
};
useEffect(() => {
setOpenKey(getOpenKey());
- }, [activeKey]);
+ }, [activeKey, menus]);
return (
<Accordion activeKey={openKey} flush>
<Nav variant="pills" className="flex-column" activeKey={activeKey}>
diff --git a/ui/src/pages/Admin/Plugins/Config/index.tsx b/ui/src/pages/Admin/Plugins/Config/index.tsx
index ea2959d5..1c32a5ec 100644
--- a/ui/src/pages/Admin/Plugins/Config/index.tsx
+++ b/ui/src/pages/Admin/Plugins/Config/index.tsx
@@ -34,9 +34,10 @@ const Config = () => {
description: item.description,
default: item.value,
};
- if (item.uiOptions) {
+
+ if (item.ui_options) {
uiSchema[item.name] = {
- 'ui:options': item.uiOptions,
+ 'ui:options': item.ui_options,
};
}
if (item.required) {
@@ -72,8 +73,7 @@ const Config = () => {
plugin_slug_name: slug_name,
config_fields,
};
- updatePluginConfig(params).then((res) => {
- console.log(res);
+ updatePluginConfig(params).then(() => {
Toast.onShow({
msg: t('update', { keyPrefix: 'toast' }),
variant: 'success',
@@ -82,7 +82,6 @@ const Config = () => {
};
const handleOnChange = (form) => {
- console.log(form);
setFormData(form);
};