Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(1.2): fix issue releations error #902

Merged

Conversation

laojun
Copy link
Contributor

@laojun laojun commented Aug 10, 2021

What this PR does / why we need it:

fix(1.2): fix issue releations error

Does this PR introduce a user interface change?

❎ No

ChangeLog

Language Changelog
🇺🇸 English fix issue relations error after change to backlog
🇨🇳 中文 修复事项详情中,一键转待办后,关联事项数据错误

Does this PR need be patched to older version?

✅ Yes(release/1.2)

Which issue(s) this PR fixes:

Fixes #

https://erda-org.erda.cloud/erda/dop/projects/387/issues/all?id=204825&issueFilter__urlQuery=eyJzdGF0ZUJlbG9uZ3MiOlsiT1BFTiIsIldPUktJTkciLCJXT05URklYIiwiUkVPUEVOIiwiUkVTT0xWRUQiXSwiYXNzaWduZWVJRHMiOlsiMTAzOTAiXX0%3D&issueTable__urlQuery=eyJwYWdlTm8iOjEsICJwYWdlU2l6ZSI6MTB9&issueViewGroup__urlQuery=eyJ2YWx1ZSI6ImthbmJhbiIsImNoaWxkcmVuVmFsdWUiOnsia2FuYmFuIjoiZGVhZGxpbmUifX0%3D&iterationID=431&type=BUG

@laojun laojun added bug Something isn't working dop DevOps platform labels Aug 10, 2021
@daskyrk daskyrk added bugfix Used in pr and removed bug Something isn't working labels Aug 10, 2021
@McDaddy McDaddy merged commit cbb6f5a into erda-project:master Aug 10, 2021
@McDaddy
Copy link
Contributor

McDaddy commented Aug 10, 2021

/cherry-pick release/1.2

@erda-bot
Copy link
Member

Automated cherry pick failed, please resolve the confilcts and create PR manually.
Details:

Auto-merging shell/app/modules/project/common/components/issue/issue-relation.tsx
CONFLICT (content): Merge conflict in shell/app/modules/project/common/components/issue/issue-relation.tsx
diff --cc shell/app/modules/project/common/components/issue/issue-relation.tsx
index 845054a7,f742276a..00000000
--- a/shell/app/modules/project/common/components/issue/issue-relation.tsx
+++ b/shell/app/modules/project/common/components/issue/issue-relation.tsx
@@@ -12,8 -12,8 +12,13 @@@
  // along with this program. If not, see <http://www.gnu.org/licenses/>.
  
  import { useUpdate, MemberSelector, IF } from 'common';
++<<<<<<< HEAD
 +import { Button, Select, Table, Popconfirm, Title, Tooltip } from 'app/nusi';
 +import React from 'react';
++=======
+ import { Button, Select, Table, Popconfirm, Title, Tooltip } from 'core/nusi';
+ import React, { useImperativeHandle } from 'react';
++>>>>>>> cbb6f5ad (fix(1.2): fix issue releations error (#902))
  import i18n from 'i18n';
  import routeInfoStore from 'core/stores/route';
  import issueStore from 'project/stores/issues';
@@@ -57,28 -55,22 +62,40 @@@ export const IssueRelation = React.forw
    const [activeButtonType, setActiveButtonType] = React.useState('');
  
    const [{ projectId }, { type: routeIssueType }] = routeInfoStore.getState((s) => [s.params, s.query]);
 -  const issueType = issueDetail?.type || routeIssueType;
 +  const issueType = propsIssueType || routeIssueType;
    const defaultIssueType = initTypeMap[issueType];
    const { getIssueRelation, addIssueRelation, deleteIssueRelation } = issueStore.effects;
 +  const issueDetail = issueStore.useStore((s) => s[`${issueType.toLowerCase()}Detail`]);
  
++<<<<<<< HEAD
 +  React.useEffect(() => {
 +    if (!ref.current) {
 +      // eslint-disable-next-line no-param-reassign
 +      ref.current = { getList };
 +    }
 +  });
 +
 +  const curIterationID = React.useMemo(() => {
 +    return issueDetail.iterationID || iterationID;
 +  }, [issueDetail.iterationID, iterationID]);
 +
 +  const getList = () => {
 +    getIssueRelation({ id: issue.id }).then((res) => {
 +      setRealtingList(res[0]);
++=======
+   const getList = React.useCallback(() => {
+     getIssueRelation({ id: issueDetail.id }).then((res) => {
+       setRelatingList(res[0]);
++>>>>>>> cbb6f5ad (fix(1.2): fix issue releations error (#902))
        setRelatedList(res[1]);
      });
-   };
+   }, [getIssueRelation, issueDetail]);
+ 
+   useImperativeHandle(ref, () => ({ getList }), [getList]);
+ 
+   const curIterationID = React.useMemo(() => {
+     return issueDetail.iterationID || iterationID;
+   }, [issueDetail.iterationID, iterationID]);
  
    useMount(() => {
      getList();

@laojun laojun deleted the hotfix/zxj-fix-issue-relation-error branch August 11, 2021 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Used in pr dop DevOps platform
Development

Successfully merging this pull request may close these issues.

None yet

4 participants