+ [task#128738,doing,0.3h] add push request for story linked.
This commit is contained in:
@@ -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' => "<span class='status-{$statusClass}'>" . zget($lang->mr->statusList, $mr->status) . '</span>');
|
||||
return $item;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
$data['commit'] = array
|
||||
(
|
||||
'title' => $lang->story->linkCommit,
|
||||
|
||||
Reference in New Issue
Block a user