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

abeizn pushed a commit to branch release-v1.0
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


The following commit(s) were added to refs/heads/release-v1.0 by this push:
     new 7f68dc381 feat: add issue trace configuration for project (#7624) 
(#7627)
7f68dc381 is described below

commit 7f68dc3816b2b54c315cc7648a08fa3e59cbb3af
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Mon Jun 17 10:08:48 2024 +0800

    feat: add issue trace configuration for project (#7624) (#7627)
    
    Co-authored-by: 青湛 <[email protected]>
---
 .../src/routes/project/detail/settings-panel.tsx     | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/config-ui/src/routes/project/detail/settings-panel.tsx 
b/config-ui/src/routes/project/detail/settings-panel.tsx
index 2de91701d..4cb096a27 100644
--- a/config-ui/src/routes/project/detail/settings-panel.tsx
+++ b/config-ui/src/routes/project/detail/settings-panel.tsx
@@ -46,6 +46,9 @@ export const SettingsPanel = ({ project, onRefresh }: Props) 
=> {
     enable: false,
     prToIssueRegexp: '',
   });
+  const [issueTrace, setIssueTrace] = useState({
+    enable: false,
+  });
   const [operating, setOperating] = useState(false);
   const [open, setOpen] = useState(false);
 
@@ -54,6 +57,7 @@ export const SettingsPanel = ({ project, onRefresh }: Props) 
=> {
   useEffect(() => {
     const dora = project.metrics.find((ms) => ms.pluginName === 'dora');
     const linker = project.metrics.find((ms) => ms.pluginName === 'linker');
+    const issueTrace = project.metrics.find((ms) => ms.pluginName === 
'issue_trace');
 
     setName(project.name);
     setDora({
@@ -63,6 +67,9 @@ export const SettingsPanel = ({ project, onRefresh }: Props) 
=> {
       enable: linker?.enable ?? false,
       prToIssueRegexp: linker?.pluginOption?.prToIssueRegexp ?? 
RegexPrIssueDefaultValue,
     });
+    setIssueTrace({
+      enable: issueTrace?.enable ?? false,
+    });
   }, [project]);
 
   const handleUpdate = async () => {
@@ -89,6 +96,11 @@ export const SettingsPanel = ({ project, onRefresh }: Props) 
=> {
               },
               enable: linker.enable,
             },
+            {
+              pluginName: 'issue_trace',
+              pluginOption: {},
+              enable: issueTrace.enable,
+            },
           ],
         }),
       {
@@ -174,6 +186,14 @@ export const SettingsPanel = ({ project, onRefresh }: 
Props) => {
               />
             )}
           </Block>
+          <Block
+            title={
+              <Checkbox checked={issueTrace.enable} onChange={(e) => 
setIssueTrace({ enable: e.target.checked })}>
+                Enable Issue Trace
+              </Checkbox>
+            }
+            description=""
+          />
           <Block>
             <Button type="primary" loading={operating} disabled={!name} 
onClick={handleUpdate}>
               Save

Reply via email to