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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Support attribute help texts for multi input types
Alexander Brandon Coles4d23b31ca1c4
diff --git a/lib/primer/open_project/forms/dsl/input_methods.rb b/lib/primer/open_project/forms/dsl/input_methods.rbindex cb01ec27345..5ff89481631 100644--- a/lib/primer/open_project/forms/dsl/input_methods.rb+++ b/lib/primer/open_project/forms/dsl/input_methods.rb@@ -5,6 +5,22 @@ module Primermodule Formsmodule Dslmodule InputMethods+ def multi(**, &)+ super(**decorate_options(**), &)+ end++ def check_box(**, &)+ super(**decorate_options(**), &)+ end++ def radio_button_group(**, &)+ super(**decorate_options(**), &)+ end++ def check_box_group(**, &)+ super(**decorate_options(**), &)+ end+def autocompleter(**, &)add_input AutocompleterInput.new(builder:, form:, **decorate_options(**), &)enddiff --git a/spec/forms/custom_fields/inputs/bool_spec.rb b/spec/forms/custom_fields/inputs/bool_spec.rbindex 6fb9fb34d89..7d248ac8ce2 100644--- a/spec/forms/custom_fields/inputs/bool_spec.rb+++ b/spec/forms/custom_fields/inputs/bool_spec.rb@@ -35,7 +35,7 @@ RSpec.describe CustomFields::Inputs::Bool, type: :forms dolet(:custom_field) { create(:boolean_project_custom_field, name: "Boolean field") }- it_behaves_like "rendering label", "Boolean field"+ it_behaves_like "rendering label with help text", "Boolean field"context "without a value" doit "renders field" dodiff --git a/spec/lib/primer/open_project/forms/dsl/input_methods_spec.rb b/spec/lib/primer/open_project/forms/dsl/input_methods_spec.rbindex 4dbfeccff53..b67f2856093 100644--- a/spec/lib/primer/open_project/forms/dsl/input_methods_spec.rb+++ b/spec/lib/primer/open_project/forms/dsl/input_methods_spec.rb@@ -85,6 +85,36 @@ RSpec.describe Primer::OpenProject::Forms::Dsl::InputMethods, type: :forms doendend+ describe "multi input methods" do+ describe "#multi" do+ let(:field_group) { form_dsl.multi(name:, label:, **options) }++ include_examples "input class", Primer::Forms::Dsl::MultiInput+ it_behaves_like "supporting help texts"+ end++ describe "#check_box" do+ let(:field_group) { form_dsl.check_box(name:, label:, **options) }++ include_examples "input class", Primer::Forms::Dsl::CheckBoxInput+ it_behaves_like "supporting help texts"+ end++ describe "#radio_button_group" do+ let(:field_group) { form_dsl.radio_button_group(name:, label:, **options) }++ include_examples "input class", Primer::Forms::Dsl::RadioButtonGroupInput+ it_behaves_like "supporting help texts"+ end++ describe "#check_box_group" do+ let(:field_group) { form_dsl.check_box_group(name:, label:, **options) }++ include_examples "input class", Primer::Forms::Dsl::CheckBoxGroupInput+ it_behaves_like "supporting help texts"+ end+ end+describe "#separator" dolet(:field_group) { form_dsl.separator }