Merge branch 'cyy_bug' into 'zenops_44'

* Fix bug for repo view.

See merge request easycorp/zentaopms!5246
This commit is contained in:
李玉春
2022-09-05 00:33:45 +00:00
8 changed files with 25 additions and 14 deletions
+1
View File
@@ -257,6 +257,7 @@ class gitlab
$param = new stdclass;
$param->ref = ($revision and $revision != 'HEAD') ? $revision : $this->branch;
$results = $this->fetch($api, $param);
if(isset($results->message)) return array();
$blames = array();
$revLine = 0;
+1 -1
View File
@@ -322,7 +322,7 @@ class Subversion
{
$blame = array();
$blame['line'] = (int)$line['line-number'];
$blame['content'] = $content[$blame['line'] - 1];
$blame['content'] = zget($content, $blame['line'] - 1, '');
$blames[$blame['line']] = $blame;
$blames[$revLine]['lines'] ++;
+1 -1
View File
@@ -234,7 +234,7 @@ class gitlab extends control
$gitLab = $this->gitlab->getByID($id);
$changes = common::createChanges($oldGitLab, $gitLab);
$this->action->logHistory($actionID, $changes);
$this->loadModel('action')->logHistory($actionID, $changes);
echo js::reload('parent');
}
+1
View File
@@ -13,6 +13,7 @@
#relationTabs .tab-nav-item .icon {line-height: inherit;}
#relationTabs > .tabs-navbar {overflow: hidden; padding-bottom: 10px; position: relative; height: 35px;}
#relationTabs > .tabs-navbar > .nav-tabs {position: absolute; display: flex;}
#relationTabs .tab-nav-link .title {max-width: 300px; display: inline-block; white-space: nowrap; width: 100%; overflow: hidden; text-overflow: ellipsis; padding: 0 5px;}
#related .content, #related .btn {background-color: #F4F5F7; border: none;}
#related .nav-tabs > li.active > a:before {background: none; height: 0;}
#related .table-empty-tip {padding: 35px 10px;}
+14 -7
View File
@@ -69,14 +69,21 @@ $(function()
$('#tab-nav-item-' + tab.id).attr('title', decodeURIComponent(filepath));
});
var link = createLink('repo', 'ajaxGetBranchesAndTags', 'repoID=' + repoID + '&oldRevision=' + branchID);
$.get(link, function(data)
if(['Git', 'Gitlab', 'Gogs', 'Gitea'].indexOf(repo.SCM) != -1)
{
var result = $.parseJSON(data);
$('#branchList').empty();
$('#branchList').append(result.sourceHtml);
$('#branchList #branchesAndTags').tree({initialState: 'expand'});
});
var link = createLink('repo', 'ajaxGetBranchesAndTags', 'repoID=' + repoID + '&oldRevision=' + branchID);
$.get(link, function(data)
{
var result = $.parseJSON(data);
$('#branchList').empty();
$('#branchList').append(result.sourceHtml);
$('#branchList #branchesAndTags').tree({initialState: 'expand'});
});
}
else
{
$('#sourceSwapper').hide();
}
/**
* Refresh files tree.
+3 -3
View File
@@ -935,7 +935,7 @@ class repoModel extends model
$file->repo = $repoID;
$this->dao->insert(TABLE_REPOFILES)->data($file)->exec();
if($file->oldPath)
if($file->oldPath and $file->action == 'R')
{
$file->path = $file->oldPath;
$file->parent = dirname($file->path);
@@ -2439,7 +2439,7 @@ class repoModel extends model
}
else
{
$html .= "<span class='item doc-title text-ellipsis'><i class='icon icon-file-text-alt'></i> " . html::a('#filePath' . $file['key'], $file['name'], '', "class='repoFileName' data-path='{$file['path']}'") . '</span>';
$html .= "<span class='item doc-title text-ellipsis'><i class='icon icon-file-text-alt'></i> " . html::a('#filePath' . $file['key'], $file['name'], '', "class='repoFileName' data-path='{$file['path']}' title='{$file['path']}'") . '</span>';
}
$html .= '</li>';
}
@@ -2508,7 +2508,7 @@ class repoModel extends model
}
else
{
$html .= "<span class='item doc-title text-ellipsis'><i class='file icon icon-file-text-alt'></i> " . html::a('#filePath' . $childNode['key'], $childNode['name'], '', "class='repoFileName' data-path='{$childNode['path']}'") . '</span>';
$html .= "<span class='item doc-title text-ellipsis'><i class='file icon icon-file-text-alt'></i> " . html::a('#filePath' . $childNode['key'], $childNode['name'], '', "class='repoFileName' data-path='{$childNode['path']}' title='{$childNode['path']}'") . '</span>';
}
$html .= '</li>';
}
@@ -162,8 +162,7 @@ function setTab(titleObj)
{
return {
id: titleObj.type + '-' + titleObj.id,
title: ' ' + titleObj.title,
icon: titleObj.type == 'story' ? 'icon-lightbulb' : (titleObj.type == 'task' ? 'icon-check-sign' : 'icon-bug'),
title: titleObj.title,
icon: titleObj.type == 'story' ? 'icon-lightbulb text-primary' : (titleObj.type == 'task' ? 'icon-check-sign text-info' : 'icon-bug text-red'),
type: 'iframe',
url: createLink('repo', 'ajaxGetRelationInfo', 'objectID=' + titleObj.id + '&objectType=' + titleObj.type)
@@ -257,6 +256,8 @@ $(function()
$('#relationTabs').on('onOpen', function(event, tab)
{
$('#tab-nav-item-' + tab.id).attr('title', tab.title);
var objectInfo = tab.id.split('-');
objectID = objectInfo[0];
objectType = objectInfo[1];
+1
View File
@@ -14,6 +14,7 @@ js::import($jsRoot . '/zui/tabs/tabs.min.js');
js::import($jsRoot . 'misc/base64.js');
js::set('entry', $entry);
js::set('repoID', $repoID);
js::set('repo', $repo);
js::set('revision', $revision);
js::set('branchID', $branchID);
js::set('file', $pathInfo);