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
Update default to show upcoming invitations
Mir Bhatia53e313b4037f
diff --git a/modules/meeting/app/controllers/meetings_controller.rb b/modules/meeting/app/controllers/meetings_controller.rbindex d71402442d9..02ec1c34136 100644--- a/modules/meeting/app/controllers/meetings_controller.rb+++ b/modules/meeting/app/controllers/meetings_controller.rb@@ -58,7 +58,7 @@ class MeetingsController < ApplicationControllerdef index@query = load_query@meetings = load_meetings(@query)- render 'index', locals: { menu_name: project_or_global_menu }+ render "index", locals: { menu_name: project_or_global_menu }endcurrent_menu_item :index do@@ -70,11 +70,11 @@ class MeetingsController < ApplicationControllerif @meeting.is_a?(StructuredMeeting)render(Meetings::ShowComponent.new(meeting: @meeting, project: @project))elsif @meeting.agenda.present? && @meeting.agenda.locked?- params[:tab] ||= 'minutes'+ params[:tab] ||= "minutes"endend- def create+ def create # rubocop:disable Metrics/AbcSizecall =if @copy_from::Meetings::CopyService@@ -90,14 +90,15 @@ class MeetingsController < ApplicationControllertext = I18n.t(:notice_successful_create)if User.current.time_zone.nil?link = I18n.t(:notice_timezone_missing, zone: Time.zone)- text += " #{view_context.link_to(link, { controller: '/my', action: :settings, anchor: 'pref_time_zone' }, class: 'link_to_profile')}"+ text += " #{view_context.link_to(link, { controller: '/my', action: :settings, anchor: 'pref_time_zone' },+ class: 'link_to_profile')}"endflash[:notice] = text.html_safe # rubocop:disable Rails/OutputSafety- redirect_to action: 'show', id: call.result+ redirect_to action: "show", id: call.resultelse@meeting = call.result- render template: 'meetings/new', project_id: @project, locals: { copy_from: @copy_from }+ render template: "meetings/new", project_id: @project, locals: { copy_from: @copy_from }endend@@ -114,13 +115,13 @@ class MeetingsController < ApplicationController.call(save: false)@meeting = call.result- render action: 'new', project_id: @project, locals: { copy_from: }+ render action: "new", project_id: @project, locals: { copy_from: }enddef destroy@meeting.destroyflash[:notice] = I18n.t(:notice_successful_delete)- redirect_to action: 'index', project_id: @project+ redirect_to action: "index", project_id: @projectenddef edit@@ -154,9 +155,9 @@ class MeetingsController < ApplicationController@meeting.attributes = @converted_paramsif @meeting.saveflash[:notice] = I18n.t(:notice_successful_update)- redirect_to action: 'show', id: @meeting+ redirect_to action: "show", id: @meetingelse- render action: 'edit'+ render action: "edit"endend@@ -238,7 +239,7 @@ class MeetingsController < ApplicationControllerflash[:notice] = I18n.t(:notice_successful_notification)elseflash[:error] = I18n.t(:error_notification_with_errors,- recipients: result.errors.map(&:name).join('; '))+ recipients: result.errors.map(&:name).join("; "))endredirect_to action: :show, id: @meeting@@ -255,7 +256,7 @@ class MeetingsController < ApplicationControllerquery = apply_default_filter_if_none_given(query)if @project- query.where("project_id", '=', @project.id)+ query.where("project_id", "=", @project.id)endquery@@ -265,6 +266,7 @@ class MeetingsController < ApplicationControllerreturn query if query.filters.any?query.where("time", "=", Queries::Meetings::Filters::TimeFilter::FUTURE_VALUE)+ query.where("invited_user_id", "=", [User.current.id.to_s])enddef load_meetings(query)@@ -335,15 +337,15 @@ class MeetingsController < ApplicationControllerdef meeting_type(given_type)case given_type- when 'dynamic'- 'StructuredMeeting'+ when "dynamic"+ "StructuredMeeting"else- 'Meeting'+ "Meeting"endenddef verify_activities_module_activated- render_403 if @project && [email protected]_enabled?('activity')+ render_403 if @project && [email protected]_enabled?("activity")enddef set_activity@@ -370,8 +372,8 @@ class MeetingsController < ApplicationControllerif params[:from]begin- ; @date_to = params[:from].to_date + 1.day;- rescue StandardError;+ @date_to = params[:from].to_date + 1.day+ rescue StandardErrorendend@@ -393,8 +395,8 @@ class MeetingsController < ApplicationControllerdef copy_attributes{- copy_agenda: params[:copy_agenda] == '1',- copy_attachments: params[:copy_attachments] == '1',+ copy_agenda: params[:copy_agenda] == "1",+ copy_attachments: params[:copy_attachments] == "1"}endenddiff --git a/modules/meeting/app/helpers/meetings_helper.rb b/modules/meeting/app/helpers/meetings_helper.rbindex 0ba10516350..cbf86094711 100644--- a/modules/meeting/app/helpers/meetings_helper.rb+++ b/modules/meeting/app/helpers/meetings_helper.rb@@ -44,7 +44,12 @@ module MeetingsHelperenddef menu_upcoming_meetings_item- path = project_or_global_meetings_path+ path = project_or_global_meetings_path(+ filters: [+ { time: { operator: "=", values: ["future"] } }+ ],+ sort: "start_time"+ )menu_link_element path, t(:label_upcoming_meetings)end@@ -59,13 +64,7 @@ module MeetingsHelperenddef menu_upcoming_invitations_item- path = project_or_global_meetings_path(- filters: [- { time: { operator: "=", values: ["future"] } },- { invited_user_id: { operator: "=", values: [User.current.id.to_s] } }- ],- sort: "start_time"- )+ path = project_or_global_meetings_pathmenu_link_element path, t(:label_upcoming_invitations)enddiff --git a/modules/meeting/spec/features/meetings_global_menu_item_spec.rb b/modules/meeting/spec/features/meetings_global_menu_item_spec.rbindex d849d29f2e8..c489fb98320 100644--- a/modules/meeting/spec/features/meetings_global_menu_item_spec.rb+++ b/modules/meeting/spec/features/meetings_global_menu_item_spec.rb@@ -55,9 +55,9 @@ RSpec.describe "Meetings global menu item",expect(page).to have_current_path("/meetings")end- specify '"Upcoming meetings" is the default filter set' do+ specify '"Upcoming invitations" is the default filter set' dowithin "#main-menu" do- expect(page).to have_css(".selected", text: I18n.t(:label_upcoming_meetings))+ expect(page).to have_css(".selected", text: I18n.t(:label_upcoming_invitations))endendend