Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

show project count in index

Ivan Kuchinc676588d4da0
diff --git a/app/components/settings/project_life_cycle_step_definitions/row_component.html.erb b/app/components/settings/project_life_cycle_step_definitions/row_component.html.erb
index 711efabbe01..4f75a969d91 100644
--- a/app/components/settings/project_life_cycle_step_definitions/row_component.html.erb
+++ b/app/components/settings/project_life_cycle_step_definitions/row_component.html.erb
@@ -43,6 +43,9 @@ See COPYRIGHT and LICENSE files for more details.
title_container.with_column(pt: 1) do
render(Projects::LifeCycleTypeComponent.new(definition))
end
+ title_container.with_column(pt: 1, ml: 3) do
+ render(Primer::Beta::Text.new) { t("project.count", count: definition.project_count) }
+ end
end
end
%>
diff --git a/app/controllers/admin/settings/project_life_cycle_step_definitions_controller.rb b/app/controllers/admin/settings/project_life_cycle_step_definitions_controller.rb
index 584804e477a..6afae30c38d 100644
--- a/app/controllers/admin/settings/project_life_cycle_step_definitions_controller.rb
+++ b/app/controllers/admin/settings/project_life_cycle_step_definitions_controller.rb
@@ -80,7 +80,7 @@ module Admin::Settings
end
def find_definitions
- @definitions = Project::LifeCycleStepDefinition.all
+ @definitions = Project::LifeCycleStepDefinition.with_project_count
end
def find_definition
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 506099f83cd..16d48fbec46 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -3348,9 +3348,9 @@ en:
are_you_sure: "Are you sure you want to archive the project '%{name}'?"
archived: "Archived"
count:
- zero: "0 Projects"
- one: "1 Project"
- other: "%{count} Projects"
+ zero: "0 projects"
+ one: "1 project"
+ other: "%{count} projects"
project_module_activity: "Activity"
project_module_forums: "Forums"
diff --git a/spec/features/admin/project_custom_fields/list_spec.rb b/spec/features/admin/project_custom_fields/list_spec.rb
index 8c337fe1238..1caf5186e60 100644
--- a/spec/features/admin/project_custom_fields/list_spec.rb
+++ b/spec/features/admin/project_custom_fields/list_spec.rb
@@ -169,7 +169,7 @@ RSpec.describe "List project custom fields", :js do
it "shows the number of projects using a custom field" do
within_project_custom_field_container(boolean_project_custom_field) do
- expect(page).to have_text("0 Projects")
+ expect(page).to have_text("0 projects")
end
project = create(:project)
@@ -178,7 +178,7 @@ RSpec.describe "List project custom fields", :js do
visit admin_settings_project_custom_fields_path
within_project_custom_field_container(boolean_project_custom_field) do
- expect(page).to have_text("1 Project")
+ expect(page).to have_text("1 project")
end
end