BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
97d17cf8
Commit
97d17cf8
authored
Dec 03, 2012
by
Alex Denisov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Event filters stores at cookies.
parent
b255c3c4
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
56 additions
and
11 deletions
+56
-11
dashboard.js
app/assets/javascripts/dashboard.js
+27
-0
dashboard_controller.rb
app/controllers/dashboard_controller.rb
+2
-1
events_helper.rb
app/helpers/events_helper.rb
+1
-4
index.html.haml
app/views/dashboard/index.html.haml
+1
-0
event_filters.feature
features/dashboard/event_filters.feature
+19
-0
dashboard_event_filters.rb
features/steps/dashboard/dashboard_event_filters.rb
+6
-6
No files found.
app/assets/javascripts/dashboard.js
0 → 100644
View file @
97d17cf8
/**
* Init dashboard page
*
*/
function
dashboardPage
(){
$
(
".event_filter_link"
).
bind
(
'click'
,(
function
(){
enableFilter
(
this
.
id
);
}));
}
function
enableFilter
(
sender_id
){
var
event_filters
=
$
.
cookie
(
'event_filter'
);
var
filter
=
sender_id
.
split
(
'_'
)[
0
];
if
(
!
event_filters
)
{
event_filters
=
new
Array
();
}
else
{
event_filters
=
event_filters
.
split
(
','
);
}
var
index
=
event_filters
.
indexOf
(
filter
);
if
(
index
==
-
1
)
{
event_filters
.
push
(
filter
);
}
else
{
event_filters
.
splice
(
index
,
1
);
}
$
.
cookie
(
'event_filter'
,
event_filters
.
join
(
','
));
};
app/controllers/dashboard_controller.rb
View file @
97d17cf8
...
...
@@ -60,6 +60,7 @@ class DashboardController < ApplicationController
end
def
event_filter
@event_filter
||=
EventFilter
.
new
(
params
[
:event_filter
])
filters
=
cookies
[
'event_filter'
].
split
(
','
)
if
cookies
[
'event_filter'
]
@event_filter
||=
EventFilter
.
new
(
filters
)
end
end
app/helpers/events_helper.rb
View file @
97d17cf8
...
...
@@ -22,9 +22,6 @@ module EventsHelper
def
event_filter_link
key
,
tooltip
key
=
key
.
to_s
filter
=
@event_filter
.
options
key
inactive
=
if
@event_filter
.
active?
key
nil
else
...
...
@@ -32,7 +29,7 @@ module EventsHelper
end
content_tag
:div
,
class:
"filter_icon
#{
inactive
}
"
do
link_to
dashboard_path
(
event_filter:
filter
),
class:
'has_tooltip
'
,
id:
"
#{
key
}
_event_filter"
,
'data-original-title'
=>
tooltip
do
link_to
dashboard_path
,
class:
'has_tooltip event_filter_link
'
,
id:
"
#{
key
}
_event_filter"
,
'data-original-title'
=>
tooltip
do
image_tag
"event_filter_
#{
key
}
.png"
end
end
...
...
app/views/dashboard/index.html.haml
View file @
97d17cf8
=
javascript_include_tag
'dashboard'
-
if
@has_authorized_projects
.projects
.activities.span8
...
...
features/dashboard/event_filters.feature
View file @
97d17cf8
...
...
@@ -12,20 +12,39 @@ Feature: Event filters
And
I should see new member event
And
I should see merge request event
@javascript
Scenario
:
I
should see only pushed events
When
I click
"push"
event filter
Then
I should see push event
And
I should not see new member event
And
I should not see merge request event
@javascript
Scenario
:
I
should see only joined events
When
I click
"team"
event filter
Then
I should see new member event
And
I should not see push event
And
I should not see merge request event
@javascript
Scenario
:
I
should see only merged events
When
I click
"merge"
event filter
Then
I should see merge request event
And
I should not see push event
And
I should not see new member event
@javascript
Scenario
:
I
should see only selected events while page reloaded
When
I click
"push"
event filter
And
I visit dashboard page
Then
I should see push event
And
I should not see new member event
When
I click
"team"
event filter
And
I visit dashboard page
Then
I should see push event
And
I should see new member event
And
I should not see merge request event
When
I click
"push"
event
Then
I should not see push event
And
I should see new member event
And
I should not see merge request event
features/steps/dashboard/dashboard_event_filters.rb
View file @
97d17cf8
...
...
@@ -4,27 +4,27 @@ class EventFilters < Spinach::FeatureSteps
include
SharedProject
Then
'I should see push event'
do
page
.
has_selector?
(
'span.pushed'
).
should
be_true
page
.
should
have_selector
(
'span.pushed'
)
end
Then
'I should not see push event'
do
page
.
has_selector?
(
'span.pushed'
).
should
be_false
page
.
should_not
have_selector
(
'span.pushed'
)
end
Then
'I should see new member event'
do
page
.
has_selector?
(
'span.joined'
).
should
be_true
page
.
should
have_selector
(
'span.joined'
)
end
And
'I should not see new member event'
do
page
.
has_selector?
(
'span.joined'
).
should
be_false
page
.
should_not
have_selector
(
'span.joined'
)
end
Then
'I should see merge request event'
do
page
.
has_selector?
(
'span.merged'
).
should
be_true
page
.
should
have_selector
(
'span.merged'
)
end
And
'I should not see merge request event'
do
page
.
has_selector?
(
'span.merged'
).
should
be_false
page
.
should_not
have_selector
(
'span.merged'
)
end
And
'this project has push event'
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment