Skip to content

Commit

Permalink
Fixed incorrect breadcrumbs for project and group activity page, fixe…
Browse files Browse the repository at this point in the history
…d issue with settings menu not remaining open when an item was selected on the group activity page, updated project details page to show the number of members without automation bots
  • Loading branch information
deepsidhu85 committed Oct 8, 2024
1 parent b5b26a1 commit 4bf63ee
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<%= viral_tooltip(title: t(:"components.project_dashboard.information.number_of_members")) do %>
<span class="flex items-center">
<%= viral_icon(name: :users, color: :subdued, classes: "h-5 w-5 m-0 mr-2") %>
<%= @project.namespace.project_members.count %>
<%= @project.namespace.project_members.without_automation_bots.count %>
</span>
<% end %>
</span>
Expand Down
5 changes: 5 additions & 0 deletions app/controllers/groups_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,11 @@ def context_crumbs
case action_name
when 'new', 'create', 'show'
@context_crumbs
when 'activity'
@context_crumbs += [{
name: I18n.t('groups.activity.title'),
path: group_activity_path
}]
else
@context_crumbs += [{
name: I18n.t('groups.edit.title'),
Expand Down
5 changes: 5 additions & 0 deletions app/controllers/projects_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,11 @@ def context_crumbs
name: I18n.t('projects.edit.title'),
path: namespace_project_edit_path
}]
when 'activity'
@context_crumbs += [{
name: I18n.t('projects.activity.title'),
path: namespace_project_activity_path
}]
end
end

Expand Down
6 changes: 6 additions & 0 deletions app/models/member.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ class Member < ApplicationRecord # rubocop:disable Metrics/ClassLength

scope :not_expired, -> { where('expires_at IS NULL OR expires_at > ?', Time.zone.now.beginning_of_day) }

scope :without_automation_bots, lambda {
joins(:user).where.not(
user: { user_type: User.user_types[:project_automation_bot] }
)
}

class << self
DEFAULT_CAN_OPTIONS = {
include_group_links: true
Expand Down
1 change: 1 addition & 0 deletions app/views/layouts/groups.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
selectable_pages: [
t(:"groups.sidebar.general"),
t(:"groups.sidebar.bot_accounts"),
t(:"groups.sidebar.history"),
],
current_page: @current_page
) do |multi_level_menu| %>
Expand Down

0 comments on commit 4bf63ee

Please sign in to comment.