* Adjust bug and story view page branch btn display rule.

This commit is contained in:
caoyanyi
2024-04-02 15:03:20 +08:00
parent a288b7270a
commit a5ddbd3963
5 changed files with 36 additions and 23 deletions
+11 -1
View File
@@ -55,6 +55,16 @@ if(!$bug->deleted)
/* Construct common actions for bug. */
$actions = $operateList['mainActions'];
if(!empty($operateList['suffixActions'])) $actions = array_merge($actions, array(array('type' => 'divider')), $operateList['suffixActions']);
$hasRepo = $this->loadModel('repo')->getListByProduct($bug->product, 'Gitlab,Gitea,Gogs,GitFox', 1);
foreach($actions as $key => $action)
{
if(!$hasRepo && isset($action['icon']) && $action['icon'] == 'treemap')
{
unset($actions[$key]);
continue;
}
}
}
/* 初始化主栏内容。Init sections in main column. */
@@ -107,7 +117,7 @@ detail
set::toolbar($toolbar),
set::sections($sections),
set::tabs($tabs),
set::actions($actions)
set::actions(array_values($actions))
);
modal