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 old meetings work within projects
Oliver Günther9f63d16661c7
diff --git a/modules/meeting/app/controllers/meeting_contents_controller.rb b/modules/meeting/app/controllers/meeting_contents_controller.rbindex 980cf6b3c88..4a7a926248f 100644--- a/modules/meeting/app/controllers/meeting_contents_controller.rb+++ b/modules/meeting/app/controllers/meeting_contents_controller.rb@@ -42,13 +42,10 @@ class MeetingContentsController < ApplicationControllerbefore_action :load_and_authorize_in_optional_projectbefore_action :find_meeting, :find_content- def show+ def show # rubocop:disable Metrics/AbcSizeif params[:id].present? && @content.last_journal.version == params[:id].to_i# Redirect links to the last version- redirect_to controller: "/meetings",- action: :show,- id: @meeting,- tab: @content_type.sub(/^meeting_/, "")+ redirect_to project_meeting_path(@project, @meeting, tab: @content_type.sub(/^meeting_/, ""))returnend@@ -65,7 +62,7 @@ class MeetingContentsController < ApplicationControllerif call.success?flash[:notice] = I18n.t(:notice_successful_update)- redirect_back_or_default controller: "/meetings", action: "show", id: @meeting+ redirect_back_or_default project_meeting_path(@project, @meeting)elseflash.now[:error] = call.messageparams[:tab] ||= "minutes" if @meeting.agenda.present? && @meeting.agenda.locked?@@ -99,6 +96,7 @@ class MeetingContentsController < ApplicationControllerdef find_meeting@meeting = Meeting.includes(:project, :author, :participants, :agenda, :minutes).find(params[:meeting_id])+ @project = @meeting.project@author = User.currentrescue ActiveRecord::RecordNotFoundrender_404diff --git a/modules/meeting/app/controllers/meetings_controller.rb b/modules/meeting/app/controllers/meetings_controller.rbindex 5bb20539d7e..8b2bfdf3b7c 100644--- a/modules/meeting/app/controllers/meetings_controller.rb+++ b/modules/meeting/app/controllers/meetings_controller.rb@@ -33,6 +33,7 @@ class MeetingsController < ApplicationControllerbefore_action :determine_author, only: %i[history]before_action :build_meeting, only: %i[new new_dialog]before_action :find_meeting, except: %i[index new create new_dialog]+ before_action :redirect_to_project, only: %i[show]before_action :set_activity, only: %i[history]before_action :find_copy_from_meeting, only: %i[create]before_action :convert_params, only: %i[create update update_participants]@@ -526,4 +527,10 @@ class MeetingsController < ApplicationControllerdef prevent_template_destructionrender_400 if @meeting.templated?end++ def redirect_to_project+ return if @project++ redirect_to project_meeting_path(@meeting.project, @meeting, tab: params[:tab]), status: :see_other+ endenddiff --git a/modules/meeting/app/views/meetings/show.html.erb b/modules/meeting/app/views/meetings/show.html.erbindex 744a84ed041..07304fbe12c 100644--- a/modules/meeting/app/views/meetings/show.html.erb+++ b/modules/meeting/app/views/meetings/show.html.erb@@ -39,7 +39,7 @@ See COPYRIGHT and LICENSE files for more details.<% end %><% if authorize_for(:meetings, :edit) %><li class="toolbar-item">- <%= link_to({ :controller => '/meetings', :action => 'edit', :id => @meeting }, class: 'button', :accesskey => accesskey(:edit)) do %>+ <%= link_to(edit_project_meeting_path(@project, @meeting), class: 'button', :accesskey => accesskey(:edit)) do %><%= op_icon('button--icon icon-edit') %><span class="button--text"><%= t(:button_edit) %></span><% end %>@@ -121,8 +121,26 @@ See COPYRIGHT and LICENSE files for more details.</div></div>-<%= render_tabs [{ :name => 'agenda', :action => :create_meeting_agendas, :partial => 'meeting_contents/show', :path => meeting_agenda_path(@meeting), :label => :label_meeting_agenda, :content => @meeting.agenda || @meeting.build_agenda, :content_type => "meeting_agenda" },- { :name => 'minutes', :action => :create_meeting_minutes, :partial => 'meeting_contents/show', :path => meeting_minutes_path(@meeting), :label => :label_meeting_minutes, :content => @meeting.minutes || @meeting.build_minutes, :content_type => "meeting_minutes" }] %>+<%= render_tabs(+ [+ { name: 'agenda',+ action: :create_meeting_agendas,+ partial: 'meeting_contents/show',+ path: meeting_agenda_path(@meeting),+ label: :label_meeting_agenda,+ content: @meeting.agenda || @meeting.build_agenda,+ content_type: "meeting_agenda"+ },+ {+ name: 'minutes',+ action: :create_meeting_minutes,+ partial: 'meeting_contents/show',+ path: meeting_minutes_path(@meeting),+ label: :label_meeting_minutes, content: @meeting.minutes || @meeting.build_minutes,+ content_type: "meeting_minutes"+ }+ ]+ ) %><% if @meeting.journals.changing.present? %><div id="history">diff --git a/modules/meeting/spec/controllers/meetings_controller_spec.rb b/modules/meeting/spec/controllers/meetings_controller_spec.rbindex c5606e768f7..abc55e4735c 100644--- a/modules/meeting/spec/controllers/meetings_controller_spec.rb+++ b/modules/meeting/spec/controllers/meetings_controller_spec.rb@@ -54,7 +54,7 @@ RSpec.describe MeetingsController doget "show", params: { id: meeting.id }end- it { expect(response).to be_successful }+ it { expect(response).to redirect_to(project_meeting_path(project, meeting)) }it { expect(assigns(:meeting)).to eql meeting }endenddiff --git a/modules/meeting/spec/features/meetings_close_spec.rb b/modules/meeting/spec/features/meetings_close_spec.rbindex d0222f0792c..5c4992fd40f 100644--- a/modules/meeting/spec/features/meetings_close_spec.rb+++ b/modules/meeting/spec/features/meetings_close_spec.rb@@ -51,7 +51,7 @@ RSpec.describe "Meetings close" dolet(:permissions) { %i[view_meetings close_meeting_agendas] }it "can delete own and other`s meetings" do- visit meetings_path(project)+ visit project_meetings_path(project)click_on meeting.title@@ -87,7 +87,7 @@ RSpec.describe "Meetings close" dolet(:permissions) { %i[view_meetings] }it "cannot delete own and other`s meetings" do- visit meetings_path(project)+ visit project_meetings_path(project)expect(page).to have_no_link "Close"