Skip to content

Commit 082c32b

Browse files
fix: filter based on tags on top of branch names (#611)
## πŸ“ Description Lists tags in the task run history filter ## βœ… Checklist - [x] I have tested this change - [ ] This change requires documentation update
1 parent 0cb7b3c commit 082c32b

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

β€Žfront/assets/js/tasks/history_page.jsβ€Ž

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,12 @@ function jumpToBranch(historyPage) {
116116
},
117117
mapResults: function (results, selectedIndex) {
118118
return results
119-
.filter(result => result.type === 'branch')
120119
.map((result, index) => {
121120
const props = new Props(index, selectedIndex, "autocomplete")
122121
let appliedFilters = {}
123122

124123
appliedFilters = Object.assign(appliedFilters, historyPage.filters)
125-
appliedFilters = Object.assign(appliedFilters, { branch_name: escapeHtml(result.display_name) })
124+
appliedFilters = Object.assign(appliedFilters, { branch_name: result.name })
126125

127126
return `<a href=${formUrl(historyPage.baseUrl, appliedFilters)} ${props}>
128127
<img width=16 class="mr2 db-l" src="${gitIcon(result.type)}">

β€Žfront/lib/front_web/controllers/project_controller.exβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,7 @@ defmodule FrontWeb.ProjectController do
749749

750750
branches =
751751
Enum.map(branches, fn branch ->
752-
Map.take(branch, [:id, :display_name, :html_url, :type])
752+
Map.take(branch, [:id, :display_name, :name, :html_url, :type])
753753
end)
754754

755755
conn

β€Žfront/test/front_web/controllers/project_controller_test.exsβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ defmodule FrontWeb.ProjectControllerTest do
236236
%{
237237
"id" => branch.id,
238238
"type" => "branch",
239+
"name" => branch.api_model.name,
239240
"display_name" => branch.api_model.name,
240241
"html_url" => "/branches/#{branch.id}"
241242
}

0 commit comments

Comments
Β (0)