From 190ea250319be7c028d434f075ff907d3cf756df Mon Sep 17 00:00:00 2001 From: hamir-suspect Date: Tue, 23 Sep 2025 12:10:25 +0200 Subject: [PATCH 1/2] fix: filter based on tags on top of branch names fix(front): filter based on tags on top of branch names fix: filter based on tags on top of branch names fix: front do not escape the name --- front/assets/js/tasks/history_page.js | 3 +-- front/lib/front_web/controllers/project_controller.ex | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) 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 From 4d2e0485f0108d7be18c7f52d2f841d26009bbbb Mon Sep 17 00:00:00 2001 From: hamir-suspect Date: Thu, 25 Sep 2025 15:32:29 +0200 Subject: [PATCH 2/2] fix(front): failing test expectation --- front/test/front_web/controllers/project_controller_test.exs | 1 + 1 file changed, 1 insertion(+) 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}" }