Skip to content

Commit

Permalink
fix selecting meeting menu item
Browse files Browse the repository at this point in the history
  • Loading branch information
ulferts committed Jul 12, 2024
1 parent 13b48fc commit 10f8908
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
13 changes: 13 additions & 0 deletions modules/meeting/app/menus/meetings/menu.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,18 @@ def involvement_sidebar_menu_items
def query_path(query_params)
polymorphic_path([@project, :meetings], query_params)
end

def selected?(query_params)
case params[:query_id]
when nil
query_params[:query_id].to_s == MeetingQueries::Static::UPCOMING_INVITATIONS
else
query_params[:query_id].to_s == params[:query_id] unless modification_params?
end
end

def modification_params?
params.values_at(:filters, :columns, :sortBy).any?
end
end
end
2 changes: 1 addition & 1 deletion modules/meeting/app/models/meeting_queries/static.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def static_query_attendee
end

def static_query_creator
list_with(:label_creator) do |query|
list_with(:label_author) do |query|
query.where("author_id", "=", [User.current.id.to_s])
query.order(start_time: :asc)
end
Expand Down
2 changes: 1 addition & 1 deletion modules/meeting/app/views/meetings/menus/_menu.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%= turbo_frame_tag "meeting_sidemenu",
src: @project.present? ? menu_project_meetings_path(@project, **params.permit(:filters, :sort)) : meetings_menu_path(**params.permit(:filters, :sort)),
src: @project.present? ? menu_project_meetings_path(@project, **params.permit(:filters, :sort, :query_id)) : meetings_menu_path(**params.permit(:filters, :sort, :query_id)),
target: '_top',
data: { turbo: false },
loading: :lazy %>

0 comments on commit 10f8908

Please sign in to comment.