pull-requests: added commit flow into pr listing tables

This commit is contained in:
RhodeCode Admin 2023-09-28 21:46:42 +02:00
parent a172362b8a
commit 57a99ba18f
6 changed files with 79 additions and 42 deletions

View file

@ -91,6 +91,10 @@ formencode==2.0.1
six==1.16.0
gunicorn==21.2.0
packaging==23.1
gevent==23.7.0
greenlet==2.0.2
zope.event==5.0.0
zope.interface==6.0.0
infrae.cache==1.0.1
beaker==1.12.1
repoze.lru==0.7

View file

@ -706,6 +706,7 @@ class MyAccountView(BaseAppView, DataGridAppView):
'my_status': _render('pullrequest_status',
my_review_status),
'title': _render('pullrequest_title', pr.title, pr.description),
'pr_flow': _render('pullrequest_commit_flow', pr),
'description': h.escape(pr.description),
'updated_on': _render('pullrequest_updated_on',
h.datetime_to_time(pr.updated_on),

View file

@ -124,6 +124,7 @@ class RepoPullRequestsView(RepoAppView, DataGridAppView):
'my_status': _render('pullrequest_status',
my_review_status),
'title': _render('pullrequest_title', pr.title, pr.description),
'pr_flow': _render('pullrequest_commit_flow', pr),
'description': h.escape(pr.description),
'updated_on': _render('pullrequest_updated_on',
h.datetime_to_time(pr.updated_on),

View file

@ -93,6 +93,12 @@
"sort": "title"
}, title: "${_('Title')}", className: "td-description"
},
{
data: {
"_": "pr_flow",
"sort": "pr_flow"
}, title: "${_('Flow')}", className: "td-componentname"
},
{
data: {
"_": "author",

View file

@ -374,6 +374,25 @@ ${h.style_metatag(tag_type, tag)|n,trim}
${title}
</%def>
<%def name="pullrequest_commit_flow(pull_request)">
<div class="pr-commit-flow">
<%!
def pr_ref_type_to_icon(ref_type):
return dict(
branch='branch',
book='bookmark',
rev='history',
).get(ref_type, 'branch')
%>
## Source
<code class="pr-source-info"><i class="icon-${pr_ref_type_to_icon(pull_request.source_ref_parts.type)}"></i>${pull_request.source_ref_parts.name}</code>
&rarr;
## Target
<code class="pr-target-info"><i class="icon-${pr_ref_type_to_icon(pull_request.target_ref_parts.type)}"></i>${pull_request.target_ref_parts.name}</code>
</div>
</%def>
<%def name="pullrequest_comments(comments_nr)">
<i class="icon-comment"></i> ${comments_nr}
</%def>

View file

@ -91,48 +91,54 @@ $(document).ready(function() {
pageLength: ${c.visual.dashboard_items},
order: [[ 2, "desc" ]],
columns: [
{
data: {
"_": "status",
"sort": "status"
}, title: "PR", className: "td-status", orderable: false
},
{
data: {
"_": "my_status",
"sort": "status"
}, title: "You", className: "td-status", orderable: false
},
{
data: {
"_": "name",
"sort": "name_raw"
}, title: "${_('Id')}", className: "td-componentname", "type": "num"
},
{
data: {
"_": "title",
"sort": "title"
}, title: "${_('Title')}", className: "td-description"
},
{
data: {
"_": "author",
"sort": "author_raw"
}, title: "${_('Author')}", className: "td-user", orderable: false
},
{
data: {
"_": "comments",
"sort": "comments_raw"
}, title: "", className: "td-comments", orderable: false
},
{
data: {
"_": "updated_on",
"sort": "updated_on_raw"
}, title: "${_('Last Update')}", className: "td-time"
}
{
data: {
"_": "status",
"sort": "status"
}, title: "PR", className: "td-status", orderable: false
},
{
data: {
"_": "my_status",
"sort": "status"
}, title: "You", className: "td-status", orderable: false
},
{
data: {
"_": "name",
"sort": "name_raw"
}, title: "${_('Id')}", className: "td-componentname", "type": "num"
},
{
data: {
"_": "title",
"sort": "title"
}, title: "${_('Title')}", className: "td-description"
},
{
data: {
"_": "pr_flow",
"sort": "pr_flow"
}, title: "${_('Flow')}", className: "td-componentname"
},
{
data: {
"_": "author",
"sort": "author_raw"
}, title: "${_('Author')}", className: "td-user", orderable: false
},
{
data: {
"_": "comments",
"sort": "comments_raw"
}, title: "", className: "td-comments", orderable: false
},
{
data: {
"_": "updated_on",
"sort": "updated_on_raw"
}, title: "${_('Last Update')}", className: "td-time"
}
],
language: {
paginate: DEFAULT_GRID_PAGINATION,