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:30 UTC

[apisix-dashboard] branch juzhiyuan/fix-plugin created (now 020c327)

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

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


      at 020c327  fix(plugin): set disable but useless

This branch includes the following new commits:

     new 020c327  fix(plugin): set disable but useless

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



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

Posted by ju...@apache.org.
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,