You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by ju...@apache.org on 2020/12/12 01:51:31 UTC

[apisix-dashboard] 01/01: fix(plugin): set disable but useless

This is an automated email from the ASF dual-hosted git repository.

juzhiyuan pushed a commit to branch juzhiyuan/fix-plugin
in repository https://gitbox.apache.org/repos/asf/apisix-dashboard.git

commit 020c3273745fb98fc0917bdb370222d833fde0b7
Author: juzhiyuan <ju...@apache.org>
AuthorDate: Sat Dec 12 09:51:12 2020 +0800

    fix(plugin): set disable but useless
---
 web/src/components/Plugin/PluginPage.tsx | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/web/src/components/Plugin/PluginPage.tsx b/web/src/components/Plugin/PluginPage.tsx
index 6296e74..5073aa0 100644
--- a/web/src/components/Plugin/PluginPage.tsx
+++ b/web/src/components/Plugin/PluginPage.tsx
@@ -61,7 +61,7 @@ const PluginPage: React.FC<Props> = ({
       const { valid, errors } = validate(value, schema);
       if (valid) {
         setName(NEVER_EXIST_PLUGIN_FLAG);
-        onChange({ ...initialData, [pluginName]: { ...value, disable: false } });
+        onChange({ ...initialData, [pluginName]: value });
         return;
       }
       errors?.forEach((item) => {
@@ -146,7 +146,10 @@ const PluginPage: React.FC<Props> = ({
                         disabled={readonly}
                         onChange={(isChecked) => {
                           if (isChecked) {
-                            validateData(item.name, initialData[item.name]);
+                            validateData(item.name, {
+                              ...initialData[item.name],
+                              disable: false
+                            });
                           } else {
                             onChange({
                               ...initialData,