From d66bf9dbc99bfae0cd1bb633c0e2e7ddf052fc44 Mon Sep 17 00:00:00 2001 From: Kat Date: Wed, 22 Nov 2023 15:47:35 +0000 Subject: [PATCH] Add managed by filter to sales --- app/helpers/filters_helper.rb | 2 +- app/views/logs/_log_filters.html.erb | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/helpers/filters_helper.rb b/app/helpers/filters_helper.rb index 2df2d21b1..dbedd4e89 100644 --- a/app/helpers/filters_helper.rb +++ b/app/helpers/filters_helper.rb @@ -128,7 +128,7 @@ module FiltersHelper end def non_support_with_multiple_managing_orgs? - current_user.organisation.managing_agents.count > 1 && user_lettings_path? + current_user.organisation.managing_agents.count > 1 end def user_lettings_path? diff --git a/app/views/logs/_log_filters.html.erb b/app/views/logs/_log_filters.html.erb index 72f73e47c..0bfb5d3b8 100644 --- a/app/views/logs/_log_filters.html.erb +++ b/app/views/logs/_log_filters.html.erb @@ -93,7 +93,7 @@ } %> <% end %> - <% if (current_user.support? || non_support_with_multiple_managing_orgs?) && user_or_org_lettings_path? %> + <% if (current_user.support? || non_support_with_multiple_managing_orgs?) && (user_or_org_lettings_path? || FeatureToggle.sales_managing_organisation_enabled?) %> <%= render partial: "filters/radio_filter", locals: { f:, options: { @@ -102,13 +102,13 @@ label: "Specific managing organisation", conditional_filter: { type: "select", - label: "Managed by", + label: user_or_org_lettings_path? ? "Managed by" : "Reported by", category: "managing_organisation", options: managing_organisation_filter_options(current_user), }, }, }, - label: "Managed by", + label: user_or_org_lettings_path? ? "Managed by" : "Reported by", category: "managing_organisation_select", } %> <% end %>