# HG changeset patch # User RhodeCode Admin # Date 2023-09-28 19:46:42 # Node ID a77dd674126b90b30ac3529649afe2806a28c897 # Parent 2045434b6b36d4f6e223ba0dbc74259a3f1c3f0f pull-requests: added commit flow into pr listing tables diff --git a/requirements.txt b/requirements.txt --- a/requirements.txt +++ b/requirements.txt @@ -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 diff --git a/rhodecode/apps/my_account/views/my_account.py b/rhodecode/apps/my_account/views/my_account.py --- a/rhodecode/apps/my_account/views/my_account.py +++ b/rhodecode/apps/my_account/views/my_account.py @@ -706,6 +706,7 @@ class MyAccountView(BaseAppView, DataGri '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), diff --git a/rhodecode/apps/repository/views/repo_pull_requests.py b/rhodecode/apps/repository/views/repo_pull_requests.py --- a/rhodecode/apps/repository/views/repo_pull_requests.py +++ b/rhodecode/apps/repository/views/repo_pull_requests.py @@ -124,6 +124,7 @@ class RepoPullRequestsView(RepoAppView, '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), diff --git a/rhodecode/templates/admin/my_account/my_account_pullrequests.mako b/rhodecode/templates/admin/my_account/my_account_pullrequests.mako --- a/rhodecode/templates/admin/my_account/my_account_pullrequests.mako +++ b/rhodecode/templates/admin/my_account/my_account_pullrequests.mako @@ -95,6 +95,12 @@ }, { data: { + "_": "pr_flow", + "sort": "pr_flow" + }, title: "${_('Flow')}", className: "td-componentname" + }, + { + data: { "_": "author", "sort": "author_raw" }, title: "${_('Author')}", className: "td-user", orderable: false diff --git a/rhodecode/templates/data_table/_dt_elements.mako b/rhodecode/templates/data_table/_dt_elements.mako --- a/rhodecode/templates/data_table/_dt_elements.mako +++ b/rhodecode/templates/data_table/_dt_elements.mako @@ -374,6 +374,25 @@ ${title} +<%def name="pullrequest_commit_flow(pull_request)"> +
+ <%! + def pr_ref_type_to_icon(ref_type): + return dict( + branch='branch', + book='bookmark', + rev='history', + ).get(ref_type, 'branch') + + %> + ## Source + ${pull_request.source_ref_parts.name} + → + ## Target + ${pull_request.target_ref_parts.name} +
+ + <%def name="pullrequest_comments(comments_nr)"> ${comments_nr} diff --git a/rhodecode/templates/pullrequests/pullrequests.mako b/rhodecode/templates/pullrequests/pullrequests.mako --- a/rhodecode/templates/pullrequests/pullrequests.mako +++ b/rhodecode/templates/pullrequests/pullrequests.mako @@ -91,48 +91,54 @@ 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,