Skip to content

Commit

Permalink
[#162202] Fix Projects tab (#4398)
Browse files Browse the repository at this point in the history
* Avoid dup projects in index

* Hide account columns

* Add spec
  • Loading branch information
LeticiaErrandonea authored Jun 27, 2024
1 parent 0903018 commit 34329cf
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/services/projects_search/cross_core_searcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def input_type
private

def cross_core_projects
Projects::Project.cross_core.for_facility(@current_facility_id)
Projects::Project.cross_core.for_facility(@current_facility_id).distinct
end

def single_facility_projects
Expand Down
2 changes: 1 addition & 1 deletion app/views/shared/transactions/_table_inside.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
- if controller_name == "projects"
%td= order_detail.created_by_user.full_name
- colspan_for_total += 1
- if @account.nil?
- if @account.nil? && controller_name != "projects"
%td= order_detail.account
%td= order_detail.account.owner_user
- colspan_for_total += 2
Expand Down
12 changes: 12 additions & 0 deletions spec/system/admin/projects_show_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
expect(page).to have_link("Edit")
end

it "doesn't show account info" do
expect(page).not_to have_content(active_project_order.account.to_s)
end

it "navigates to order" do
click_link active_project_order.id

Expand Down Expand Up @@ -86,6 +90,10 @@
expect(page).to have_link("Edit")
end

it "doesn't show account info" do
expect(page).not_to have_content(active_project_order.account.to_s)
end

it "navigates to original order" do
click_link originating_order_facility1.id

Expand Down Expand Up @@ -114,6 +122,10 @@
expect(page).to have_link("Edit")
end

it "doesn't show account info" do
expect(page).not_to have_content(active_project_order.account.to_s)
end

it "shows other facility's orders as text" do
expect(page).not_to have_link(originating_order_facility2.id)
expect(page).not_to have_link(cross_core_orders[3].id)
Expand Down

0 comments on commit 34329cf

Please sign in to comment.