mirror of
https://gitlab.com/gitlab-org/gitlab-foss.git
synced 2025-07-23 00:47:51 +00:00
Fix inconsistent highlighting of already selected activity nav-links
This commit is contained in:
@ -2,8 +2,8 @@ class EventFilter
|
||||
attr_accessor :params
|
||||
|
||||
class << self
|
||||
def default_filter
|
||||
%w{ push issues merge_requests team}
|
||||
def all
|
||||
'all'
|
||||
end
|
||||
|
||||
def push
|
||||
@ -35,18 +35,21 @@ class EventFilter
|
||||
return events unless params.present?
|
||||
|
||||
filter = params.dup
|
||||
|
||||
actions = []
|
||||
actions << Event::PUSHED if filter.include? 'push'
|
||||
actions << Event::MERGED if filter.include? 'merged'
|
||||
|
||||
if filter.include? 'team'
|
||||
actions << Event::JOINED
|
||||
actions << Event::LEFT
|
||||
case filter
|
||||
when EventFilter.push
|
||||
actions = [Event::PUSHED]
|
||||
when EventFilter.merged
|
||||
actions = [Event::MERGED]
|
||||
when EventFilter.comments
|
||||
actions = [Event::COMMENTED]
|
||||
when EventFilter.team
|
||||
actions = [Event::JOINED, Event::LEFT]
|
||||
when EventFilter.all
|
||||
actions = [Event::PUSHED, Event::MERGED, Event::COMMENTED, Event::JOINED, Event::LEFT]
|
||||
end
|
||||
|
||||
actions << Event::COMMENTED if filter.include? 'comments'
|
||||
|
||||
events.where(action: actions)
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user