From ed3a90cf0015fb5daae70b8e37932dbf60fe76b1 Mon Sep 17 00:00:00 2001 From: "Harrison (Harry) Cramer" <32515581+harrisoncramer@users.noreply.github.com> Date: Sat, 13 Jan 2024 10:45:17 -0500 Subject: [PATCH] Feat: Add target branch to details panel (#160) This is a PATCH release, it adds the target branch to the details panel in the summary view. --- doc/gitlab.nvim.txt | 23 ++++++++++++----------- lua/gitlab/actions/summary.lua | 1 + lua/gitlab/state.lua | 3 ++- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/doc/gitlab.nvim.txt b/doc/gitlab.nvim.txt index c7ae3fb..638ce37 100644 --- a/doc/gitlab.nvim.txt +++ b/doc/gitlab.nvim.txt @@ -177,17 +177,18 @@ you call this function with no values the defaults will be used: info = { -- Show additional fields in the summary view enabled = true, horizontal = false, -- Display metadata to the left of the summary rather than underneath - fields = { -- The fields listed here will be displayed, in whatever order you choose - "author", - "created_at", - "updated_at", - "merge_status", - "draft", - "conflicts", - "assignees", - "reviewers", - "branch", - "pipeline", + fields = { -- The fields listed here will be displayed, in whatever order you choose + "author", + "created_at", + "updated_at", + "merge_status", + "draft", + "conflicts", + "assignees", + "reviewers", + "branch", + "target_branch", + "pipeline", "labels", }, }, diff --git a/lua/gitlab/actions/summary.lua b/lua/gitlab/actions/summary.lua index 448c214..b9564a9 100644 --- a/lua/gitlab/actions/summary.lua +++ b/lua/gitlab/actions/summary.lua @@ -131,6 +131,7 @@ M.build_info_lines = function() reviewers = { title = "Reviewers", content = u.make_readable_list(info.reviewers, "name") }, branch = { title = "Branch", content = info.source_branch }, labels = { title = "Labels", content = u.make_comma_separated_readable(info.labels) }, + target_branch = { title = "Target Branch", content = state.INFO.target_branch }, pipeline = { title = "Pipeline Status", content = function() diff --git a/lua/gitlab/state.lua b/lua/gitlab/state.lua index 0af2ada..62758cc 100644 --- a/lua/gitlab/state.lua +++ b/lua/gitlab/state.lua @@ -88,8 +88,9 @@ M.settings = { "conflicts", "assignees", "reviewers", - "branch", "pipeline", + "branch", + "target_branch", "labels", }, },