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

klesh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


The following commit(s) were added to refs/heads/main by this push:
     new a9ff06ba1 fix(config-ui): incorrect default value when updating data 
scope in a project (#5769)
a9ff06ba1 is described below

commit a9ff06ba1684a8daa6de915f902160dc731d7ae2
Author: 青湛 <[email protected]>
AuthorDate: Mon Jul 31 18:44:13 2023 +1200

    fix(config-ui): incorrect default value when updating data scope in a 
project (#5769)
---
 config-ui/src/plugins/components/data-scope-select/index.tsx | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/config-ui/src/plugins/components/data-scope-select/index.tsx 
b/config-ui/src/plugins/components/data-scope-select/index.tsx
index 05f60a5be..145e87778 100644
--- a/config-ui/src/plugins/components/data-scope-select/index.tsx
+++ b/config-ui/src/plugins/components/data-scope-select/index.tsx
@@ -16,7 +16,7 @@
  *
  */
 
-import { useState } from 'react';
+import { useState, useEffect } from 'react';
 import { Button, Intent } from '@blueprintjs/core';
 import { useDebounce } from 'ahooks';
 
@@ -48,6 +48,10 @@ export const DataScopeSelect = ({
   const [scopeIds, setScopeIds] = useState<ID[]>([]);
   const [query, setQuery] = useState('');
 
+  useEffect(() => {
+    setScopeIds((initialScope ?? []).map((sc: any) => getPluginScopeId(plugin, 
sc)) ?? []);
+  }, []);
+
   const search = useDebounce(query, { wait: 500 });
 
   const { ready, data } = useRefreshData(() => API.getDataScope(plugin, 
connectionId), [version]);

Reply via email to