You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by li...@apache.org on 2023/01/18 05:25:37 UTC

[incubator-devlake] branch release-v0.15 updated: fix(config-ui): connection initial values not work (#4222)

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

likyh pushed a commit to branch release-v0.15
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


The following commit(s) were added to refs/heads/release-v0.15 by this push:
     new 7b5cec0b1 fix(config-ui): connection initial values not work (#4222)
7b5cec0b1 is described below

commit 7b5cec0b146e27077b21e697c275e029eefb40e0
Author: 青湛 <0x...@gmail.com>
AuthorDate: Wed Jan 18 13:25:33 2023 +0800

    fix(config-ui): connection initial values not work (#4222)
---
 config-ui/src/pages/connection/form/index.tsx | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/config-ui/src/pages/connection/form/index.tsx b/config-ui/src/pages/connection/form/index.tsx
index 297bfd084..66ace0091 100644
--- a/config-ui/src/pages/connection/form/index.tsx
+++ b/config-ui/src/pages/connection/form/index.tsx
@@ -18,7 +18,7 @@
 
 import React, { useState, useEffect, useMemo } from 'react';
 import { useParams, useHistory } from 'react-router-dom';
-import { pick } from 'lodash';
+import { omit, pick } from 'lodash';
 import { FormGroup, InputGroup, Switch, ButtonGroup, Button, Icon, Intent, Position } from '@blueprintjs/core';
 import { Tooltip2 } from '@blueprintjs/popover2';
 
@@ -46,6 +46,7 @@ export const ConnectionFormPage = () => {
     setForm({
       ...form,
       ...(connection ?? {}),
+      ...(omit(initialValues, 'rateLimitPerHour') ?? {}),
     });
   }, [initialValues, connection]);
 
@@ -104,7 +105,7 @@ export const ConnectionFormPage = () => {
         {type === 'switch' && (
           <S.SwitchWrapper>
             <Switch
-              checked={form[key] ?? initialValues?.[key] ?? false}
+              checked={form[key] ?? false}
               onChange={(e) =>
                 setForm({
                   ...form,