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
Ensure project dropdown remains present after validation errors
Aaron Contrerasd66ed3d3ac78
diff --git a/modules/meeting/app/helpers/meetings_helper.rb b/modules/meeting/app/helpers/meetings_helper.rbindex acd2a3b5e1a..b1e123d093a 100644--- a/modules/meeting/app/helpers/meetings_helper.rb+++ b/modules/meeting/app/helpers/meetings_helper.rb@@ -171,7 +171,15 @@ module MeetingsHelpercontent_tag('div', "#{header}#{details}".html_safe, id: "change-#{journal.id}", class: 'journal')end- def global_create_context?+ def global_meeting_create_context?+ global_new_meeting_action? || global_create_meeting_action?+ end++ def global_new_meeting_action?request.path == new_meeting_pathend++ def global_create_meeting_action?+ request.path == meetings_path && @project.nil?+ endenddiff --git a/modules/meeting/app/views/meetings/_form.html.erb b/modules/meeting/app/views/meetings/_form.html.erbindex 11738e292f3..14902e91bca 100644--- a/modules/meeting/app/views/meetings/_form.html.erb+++ b/modules/meeting/app/views/meetings/_form.html.erb@@ -35,7 +35,7 @@ See COPYRIGHT and LICENSE files for more details.<%= f.text_field :title, :required => true, :size => 60, container_class: '-wide' %></div>- <% if global_create_context? %>+ <% if global_meeting_create_context? %><div class="form--field -required"><label class="form--label" for="project_id"><%= Meeting.human_attribute_name(:project) %>:</label><div class="form--field-container">diff --git a/modules/meeting/spec/features/meetings_new_spec.rb b/modules/meeting/spec/features/meetings_new_spec.rbindex fcf0b82f1eb..0bcae2a8b9d 100644--- a/modules/meeting/spec/features/meetings_new_spec.rb+++ b/modules/meeting/spec/features/meetings_new_spec.rb@@ -145,6 +145,8 @@ RSpec.describe 'Meetings new', :js, with_cuprite: false donew_page.expect_toast(message: "#{Project.model_name.human} #{I18n.t('activerecord.errors.messages.blank')}",type: :error)++ new_page.expect_project_dropdownendendend@@ -190,6 +192,7 @@ RSpec.describe 'Meetings new', :js, with_cuprite: false donew_page.expect_toast(message: "#{Project.model_name.human} #{I18n.t('activerecord.errors.messages.blank')}",type: :error)+ new_page.expect_project_dropdownendenddiff --git a/modules/meeting/spec/support/pages/meetings/new.rb b/modules/meeting/spec/support/pages/meetings/new.rbindex 49978f73513..528552fedc2 100644--- a/modules/meeting/spec/support/pages/meetings/new.rb+++ b/modules/meeting/spec/support/pages/meetings/new.rb@@ -53,6 +53,10 @@ module Pages::Meetingsfill_in 'Title', with: textend+ def expect_project_dropdown+ find "[data-qa-selector='project_id']"+ end+def set_project(project)select_autocomplete find("[data-qa-selector='project_id']"),query: project.name,