diff options
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/count_helper.rb | 8 | ||||
-rw-r--r-- | app/helpers/nav_helper.rb | 1 | ||||
-rw-r--r-- | app/helpers/projects_helper.rb | 3 |
3 files changed, 10 insertions, 2 deletions
diff --git a/app/helpers/count_helper.rb b/app/helpers/count_helper.rb index 24ee62e68ba..5cd98f40f78 100644 --- a/app/helpers/count_helper.rb +++ b/app/helpers/count_helper.rb @@ -1,5 +1,9 @@ module CountHelper - def approximate_count_with_delimiters(model) - number_with_delimiter(Gitlab::Database::Count.approximate_count(model)) + def approximate_count_with_delimiters(count_data, model) + count = count_data[model] + + raise "Missing model #{model} from count data" unless count + + number_with_delimiter(count) end end diff --git a/app/helpers/nav_helper.rb b/app/helpers/nav_helper.rb index 7754c34d6f0..a84a39235d8 100644 --- a/app/helpers/nav_helper.rb +++ b/app/helpers/nav_helper.rb @@ -11,6 +11,7 @@ module NavHelper class_name = page_gutter_class class_name << 'page-with-contextual-sidebar' if defined?(@left_sidebar) && @left_sidebar class_name << 'page-with-icon-sidebar' if collapsed_sidebar? && @left_sidebar + class_name -= ['right-sidebar-expanded'] if defined?(@right_sidebar) && !@right_sidebar class_name end diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index fa54eafd3a3..55078e1a2d2 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -257,6 +257,9 @@ module ProjectsHelper if project.builds_enabled? && can?(current_user, :read_pipeline, project) nav_tabs << :pipelines + end + + if can?(current_user, :read_environment, project) || can?(current_user, :read_cluster, project) nav_tabs << :operations end |