diff --git a/lib/zin/wg/storyrelatedlist/v1.php b/lib/zin/wg/storyrelatedlist/v1.php index b6e86683a9..a1838dd82f 100644 --- a/lib/zin/wg/storyrelatedlist/v1.php +++ b/lib/zin/wg/storyrelatedlist/v1.php @@ -14,6 +14,7 @@ class storyRelatedList extends relatedList 'releases' => '?array', // 关联的发布列表。 'storyProducts' => '?array', // 需求产品信息。 'linkedMRs' => '?array', // 需求 MR 信息。 + 'linkedPRs' => '?array', // 需求 PR 信息。 'linkedCommits' => '?linkedCommits', // 需求提交信息。 'story' => '?object' // 当前需求。 ); @@ -36,6 +37,7 @@ class storyRelatedList extends relatedList $builds = $this->prop('builds', data('builds')); $releases = $this->prop('releases', data('releases')); $linkedMRs = $this->prop('linkedMRs', data('linkedMRs')); + $linkedPRs = $this->prop('linkedPRs', data('linkedPRs')); $linkedCommits = $this->prop('linkedCommits', data('linkedCommits')); $data = array(); @@ -108,6 +110,26 @@ class storyRelatedList extends relatedList } ); + if($linkedPRs) + { + $data['pr'] = array + ( + 'title' => $lang->story->linkPR, + 'items' => $linkedPRs, + 'url' => hasPriv('pullreq', 'view') ? createLink('pullreq', 'view', 'MRID={id}') : false, + 'props' => array('data-app' => 'devops'), + 'onRender' => function($item, $mr) use($lang) + { + $item['titleClass'] = 'w-0 flex-1'; + $statusClass = $mr->status; + if($mr->status == 'opened') $statusClass = 'draft'; + if($mr->status == 'merged') $statusClass = 'done'; + $item['content'] = array('html' => "" . zget($lang->mr->statusList, $mr->status) . ''); + return $item; + } + ); + } + $data['commit'] = array ( 'title' => $lang->story->linkCommit,