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
Apply unique IDs for each help text dialog
Alexander Brandon Coles6f4000bb92dc
diff --git a/app/components/attribute_help_texts/show_dialog_component.rb b/app/components/attribute_help_texts/show_dialog_component.rbindex 93ac44f425f..c8759159639 100644--- a/app/components/attribute_help_texts/show_dialog_component.rb+++ b/app/components/attribute_help_texts/show_dialog_component.rb@@ -31,8 +31,6 @@class AttributeHelpTexts::ShowDialogComponent < ApplicationComponentinclude OpTurbo::Streamable- DIALOG_ID = "attribute-help-text-show-modal"-def initialize(attribute_help_text:, current_user: User.current)super@attribute_help_text = attribute_help_text@@ -41,7 +39,7 @@ class AttributeHelpTexts::ShowDialogComponent < ApplicationComponentprivate- def dialog_id = DIALOG_ID+ def dialog_id = dom_id(@attribute_help_text, :dialog)def title = @attribute_help_text.attribute_captiondiff --git a/spec/components/attribute_help_texts/show_dialog_component_spec.rb b/spec/components/attribute_help_texts/show_dialog_component_spec.rbindex fe62f4dc726..757acfac76d 100644--- a/spec/components/attribute_help_texts/show_dialog_component_spec.rb+++ b/spec/components/attribute_help_texts/show_dialog_component_spec.rb@@ -50,6 +50,14 @@ RSpec.describe AttributeHelpTexts::ShowDialogComponent, type: :component dopageend+ it "renders a dialog" do+ expect(subject).to have_element :dialog+ end++ it "applies an ID" do+ expect(subject).to have_element id: "dialog_attribute_help_text_project_#{attribute_help_text.id}"+ end+describe "dialog heading" doit "renders the heading" doexpect(subject).to have_heading attribute_help_text.attribute_caption