From c51836515c9e38b4a36f6011cf6f17f5d2de8074 Mon Sep 17 00:00:00 2001 From: Henrique <45046146+hmdros@users.noreply.github.com> Date: Wed, 27 Sep 2023 09:27:57 -0300 Subject: [PATCH] DT-244 show ID in row - filter by id (#301) * DT-244 show ID in row - filter by id * Add replace to remove string 'story' from ID value * Update label tag * Add spec case to fill search input and filter elements * DT-244 Spec clause to ensure only 1 row render --- app/assets/javascripts/project.js | 2 +- app/views/projects/show.html.erb | 4 ++-- spec/features/stories_manage_spec.rb | 21 +++++++++++++++++++++ 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/project.js b/app/assets/javascripts/project.js index bdfe2dbe..e8eae375 100644 --- a/app/assets/javascripts/project.js +++ b/app/assets/javascripts/project.js @@ -105,7 +105,7 @@ const filterStories = () => { const storyTitle = element .querySelector("td:first-child") .innerText.toLowerCase(); - if (storyTitle.includes(searchTerm)) { + if (storyTitle.includes(searchTerm) || element.id.replace(/\D/g, '').includes(searchTerm)) { cl.remove("hidden"); } else { cl.add("hidden"); diff --git a/app/views/projects/show.html.erb b/app/views/projects/show.html.erb index c6555974..1bb4c6bb 100644 --- a/app/views/projects/show.html.erb +++ b/app/views/projects/show.html.erb @@ -3,7 +3,7 @@