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

chore[Op#57579]: ensure subheader component is appropriately hidden

Kabiru Mwenja705236d6b82a
diff --git a/app/views/admin/custom_fields/custom_field_projects/index.html.erb b/app/views/admin/custom_fields/custom_field_projects/index.html.erb
index 794dbb9fb75..ecc153ee115 100644
--- a/app/views/admin/custom_fields/custom_field_projects/index.html.erb
+++ b/app/views/admin/custom_fields/custom_field_projects/index.html.erb
@@ -35,7 +35,7 @@ See COPYRIGHT and LICENSE files for more details.
%>
<%=
- render(Primer::OpenProject::SubHeader.new) do |component|
+ render(Primer::OpenProject::SubHeader.new(test_selector: "add-projects-sub-header")) do |component|
component.with_action_component do
render(Primer::Beta::Button.new(
scheme: :primary,
@@ -47,7 +47,7 @@ See COPYRIGHT and LICENSE files for more details.
I18n.t(:label_add_projects)
end
end
- end unless @custom_field.required?
+ end unless @custom_field.is_for_all?
%>
<%=
diff --git a/app/views/admin/settings/project_custom_fields/project_mappings.html.erb b/app/views/admin/settings/project_custom_fields/project_mappings.html.erb
index 515b30d36e2..25cf9d666fa 100644
--- a/app/views/admin/settings/project_custom_fields/project_mappings.html.erb
+++ b/app/views/admin/settings/project_custom_fields/project_mappings.html.erb
@@ -35,7 +35,7 @@ See COPYRIGHT and LICENSE files for more details.
%>
<%=
- render(Primer::OpenProject::SubHeader.new) do |component|
+ render(Primer::OpenProject::SubHeader.new(test_selector: "add-projects-sub-header")) do |component|
component.with_action_component do
render(Primer::Beta::Button.new(
scheme: :primary,
diff --git a/spec/features/admin/custom_fields/custom_fields_project_spec.rb b/spec/features/admin/custom_fields/custom_fields_project_spec.rb
index 0bd024cf032..c587b664a99 100644
--- a/spec/features/admin/custom_fields/custom_fields_project_spec.rb
+++ b/spec/features/admin/custom_fields/custom_fields_project_spec.rb
@@ -130,6 +130,7 @@ RSpec.describe "Custom Fields Multi-Project Activation", :js do
it "renders a blank slate" do
expect(page).to have_text("For all projects")
+ expect(page).not_to have_test_selector("add-projects-sub-header")
end
end
end
diff --git a/spec/features/admin/project_custom_fields/project_mappings_spec.rb b/spec/features/admin/project_custom_fields/project_mappings_spec.rb
index 015f636f5b6..ea0eee6e21e 100644
--- a/spec/features/admin/project_custom_fields/project_mappings_spec.rb
+++ b/spec/features/admin/project_custom_fields/project_mappings_spec.rb
@@ -159,6 +159,7 @@ RSpec.describe "Project Custom Field Mappings", :js do
it "renders a blank slate" do
expect(page).to have_text("Required in all projects")
+ expect(page).not_to have_test_selector("add-projects-sub-header")
end
end
end