diff --git a/front/assets/js/tasks/history_page.js b/front/assets/js/tasks/history_page.js index 36e39c46a..55b753331 100644 --- a/front/assets/js/tasks/history_page.js +++ b/front/assets/js/tasks/history_page.js @@ -116,13 +116,12 @@ function jumpToBranch(historyPage) { }, mapResults: function (results, selectedIndex) { return results - .filter(result => result.type === 'branch') .map((result, index) => { const props = new Props(index, selectedIndex, "autocomplete") let appliedFilters = {} appliedFilters = Object.assign(appliedFilters, historyPage.filters) - appliedFilters = Object.assign(appliedFilters, { branch_name: escapeHtml(result.display_name) }) + appliedFilters = Object.assign(appliedFilters, { branch_name: result.name }) return ` diff --git a/front/lib/front_web/controllers/project_controller.ex b/front/lib/front_web/controllers/project_controller.ex index b224c1583..40a349a74 100644 --- a/front/lib/front_web/controllers/project_controller.ex +++ b/front/lib/front_web/controllers/project_controller.ex @@ -749,7 +749,7 @@ defmodule FrontWeb.ProjectController do branches = Enum.map(branches, fn branch -> - Map.take(branch, [:id, :display_name, :html_url, :type]) + Map.take(branch, [:id, :display_name, :name, :html_url, :type]) end) conn diff --git a/front/test/front_web/controllers/project_controller_test.exs b/front/test/front_web/controllers/project_controller_test.exs index 186836d06..473cea062 100644 --- a/front/test/front_web/controllers/project_controller_test.exs +++ b/front/test/front_web/controllers/project_controller_test.exs @@ -236,6 +236,7 @@ defmodule FrontWeb.ProjectControllerTest do %{ "id" => branch.id, "type" => "branch", + "name" => branch.api_model.name, "display_name" => branch.api_model.name, "html_url" => "/branches/#{branch.id}" }