This is an automated email from the ASF dual-hosted git repository.
mintsweet pushed a commit to branch feat-issue-trace-to-jira
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
The following commit(s) were added to refs/heads/feat-issue-trace-to-jira by
this push:
new e003ae172 feat: move issue trace to jira scope config
e003ae172 is described below
commit e003ae172579cb677dc38646e1562cd1b3195394
Author: mintsweet <[email protected]>
AuthorDate: Fri Sep 27 20:04:19 2024 +1200
feat: move issue trace to jira scope config
---
.../plugins/components/scope-config-form/index.tsx | 2 +-
config-ui/src/plugins/register/jira/config.tsx | 1 +
.../src/plugins/register/jira/transformation.tsx | 18 ++++++++++++++++--
.../src/routes/project/additional-settings/index.tsx | 20 --------------------
4 files changed, 18 insertions(+), 23 deletions(-)
diff --git a/config-ui/src/plugins/components/scope-config-form/index.tsx
b/config-ui/src/plugins/components/scope-config-form/index.tsx
index d4f4c04f4..9a954c188 100644
--- a/config-ui/src/plugins/components/scope-config-form/index.tsx
+++ b/config-ui/src/plugins/components/scope-config-form/index.tsx
@@ -150,7 +150,7 @@ export const ScopeConfigForm = ({
title="Data Entities"
description={
<>
- Select the data entities you wish to collect for the Data
Scope.
+ Select the data entities you wish to collect for the Data
Scope.
<ExternalLink link="{DOC_URL.DATA_ENTITIES}">Learn about
data entities</ExternalLink>
</>
}
diff --git a/config-ui/src/plugins/register/jira/config.tsx
b/config-ui/src/plugins/register/jira/config.tsx
index 488972068..33b4e6bf7 100644
--- a/config-ui/src/plugins/register/jira/config.tsx
+++ b/config-ui/src/plugins/register/jira/config.tsx
@@ -62,6 +62,7 @@ export const JiraConfig: IPluginConfig = {
transformation: {
storyPointField: '',
typeMappings: {},
+ enableIssueTrace: true,
remotelinkCommitShaPattern: '',
remotelinkRepoPattern: [],
},
diff --git a/config-ui/src/plugins/register/jira/transformation.tsx
b/config-ui/src/plugins/register/jira/transformation.tsx
index 97cd20967..9a74abe1b 100644
--- a/config-ui/src/plugins/register/jira/transformation.tsx
+++ b/config-ui/src/plugins/register/jira/transformation.tsx
@@ -19,10 +19,10 @@
import { useState, useEffect } from 'react';
import { uniqWith } from 'lodash';
import { CaretRightOutlined } from '@ant-design/icons';
-import { theme, Collapse, Tag, Form, Select } from 'antd';
+import { theme, Collapse, Tag, Form, Select, Switch } from 'antd';
import API from '@/api';
-import { PageLoading, HelpTooltip, ExternalLink } from '@/components';
+import { PageLoading, HelpTooltip, ExternalLink, Block } from '@/components';
import { useProxyPrefix, useRefreshData } from '@/hooks';
import { DOC_URL } from '@/release';
@@ -265,6 +265,20 @@ const renderCollapseItems = ({
}
/>
</Form.Item>
+ <Block
+ title="Enable Issue Trace"
+ description="Parse the issue status and assignee history from Jira
issue changelogs."
+ >
+ <Switch
+ checked={transformation.enableIssueTrace}
+ onChange={(checcked) =>
+ onChangeTransformation({
+ ...transformation,
+ enableIssueTrace: checcked,
+ })
+ }
+ />
+ </Block>
</Form>
),
},
diff --git a/config-ui/src/routes/project/additional-settings/index.tsx
b/config-ui/src/routes/project/additional-settings/index.tsx
index feac60215..19d967b90 100644
--- a/config-ui/src/routes/project/additional-settings/index.tsx
+++ b/config-ui/src/routes/project/additional-settings/index.tsx
@@ -37,9 +37,6 @@ export const ProjectAdditionalSettings = () => {
enable: false,
prToIssueRegexp: '',
});
- const [issueTrace, setIssueTrace] = useState({
- enable: false,
- });
const [operating, setOperating] = useState(false);
const [open, setOpen] = useState(false);
@@ -54,7 +51,6 @@ export const ProjectAdditionalSettings = () => {
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({
@@ -64,9 +60,6 @@ export const ProjectAdditionalSettings = () => {
enable: linker?.enable ?? false,
prToIssueRegexp: linker?.pluginOption?.prToIssueRegexp ??
RegexPrIssueDefaultValue,
});
- setIssueTrace({
- enable: issueTrace?.enable ?? false,
- });
}, [project]);
const handleUpdate = async () => {
@@ -92,11 +85,6 @@ export const ProjectAdditionalSettings = () => {
},
enable: linker.enable,
},
- {
- pluginName: 'issue_trace',
- pluginOption: {},
- enable: issueTrace.enable,
- },
],
}),
{
@@ -189,14 +177,6 @@ export const ProjectAdditionalSettings = () => {
/>
)}
</Block>
- <Block
- title={
- <Checkbox checked={issueTrace.enable} onChange={(e) =>
setIssueTrace({ enable: e.target.checked })}>
- Enable issue trace
- </Checkbox>
- }
- description="Parse the issue status and assignee history from
issue changelogs. Currently, only Jira issues are supported."
- />
<Block>
<Button type="primary" loading={operating} disabled={!name}
onClick={handleUpdate}>
Save