Commit 8d8c161a7f1daa92a58194765816b75449769fb1
1 parent
6c777ff8
Exists in
master
and in
4 other branches
Speedup dashboard via loading events with ajax
Showing
4 changed files
with
14 additions
and
4 deletions
Show diff stats
app/assets/javascripts/pager.js
... | ... | @@ -4,9 +4,16 @@ var Pager = { |
4 | 4 | disable:false, |
5 | 5 | |
6 | 6 | init: |
7 | - function(limit) { | |
7 | + function(limit, preload) { | |
8 | 8 | this.limit=limit; |
9 | - this.offset=limit; | |
9 | + | |
10 | + if(preload) { | |
11 | + this.offset = 0; | |
12 | + this.getOld(); | |
13 | + } else { | |
14 | + this.offset = limit; | |
15 | + } | |
16 | + | |
10 | 17 | this.initLoadMore(); |
11 | 18 | }, |
12 | 19 | ... | ... |
app/views/dashboard/_activities.html.haml
app/views/dashboard/index.html.haml
features/dashboard/dashboard.feature
... | ... | @@ -5,6 +5,7 @@ Feature: Dashboard |
5 | 5 | And project "Shop" has push event |
6 | 6 | And I visit dashboard page |
7 | 7 | |
8 | + @javascript | |
8 | 9 | Scenario: I should see projects list |
9 | 10 | Then I should see "New Project" link |
10 | 11 | Then I should see "Shop" project link |
... | ... | @@ -26,11 +27,13 @@ Feature: Dashboard |
26 | 27 | And I click "Create Merge Request" link |
27 | 28 | Then I see prefilled new Merge Request page |
28 | 29 | |
30 | + @javascript | |
29 | 31 | Scenario: I should see User joined Project event |
30 | 32 | Given user with name "John Doe" joined project "Shop" |
31 | 33 | When I visit dashboard page |
32 | 34 | Then I should see "John Doe joined project at Shop" event |
33 | 35 | |
36 | + @javascript | |
34 | 37 | Scenario: I should see User left Project event |
35 | 38 | Given user with name "John Doe" joined project "Shop" |
36 | 39 | And user with name "John Doe" left project "Shop" | ... | ... |