Commit a0284b5b authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'separate-activity' into 'master'

Separate activity page

Move activity to separate page.

Part of #2225

![Screenshot_2015-08-25_15.07.23](https://gitlab.com/gitlab-org/gitlab-ce/uploads/2126b22ed7b98a2f748c96ad60bc8b2e/Screenshot_2015-08-25_15.07.23.png)

See merge request !1198
parents 429c0d14 7569010b
...@@ -16,6 +16,7 @@ v 8.0.0 (unreleased) ...@@ -16,6 +16,7 @@ v 8.0.0 (unreleased)
- Ability to search milestones - Ability to search milestones
- Gracefully handle SMTP user input errors (e.g. incorrect email addresses) to prevent Sidekiq retries (Stan Hu) - Gracefully handle SMTP user input errors (e.g. incorrect email addresses) to prevent Sidekiq retries (Stan Hu)
- Improve abuse reports management from admin area - Improve abuse reports management from admin area
- Move dashboard activity to separate page
v 7.14.1 (unreleased) v 7.14.1 (unreleased)
- Only include base URL in OmniAuth full_host parameter (Stan Hu) - Only include base URL in OmniAuth full_host parameter (Stan Hu)
......
...@@ -51,6 +51,7 @@ class Dispatcher ...@@ -51,6 +51,7 @@ class Dispatcher
MergeRequests.init() MergeRequests.init()
when 'dashboard:show', 'root:show' when 'dashboard:show', 'root:show'
new Dashboard() new Dashboard()
when 'dashboard:activity'
new Activities() new Activities()
when 'dashboard:projects:starred' when 'dashboard:projects:starred'
new Activities() new Activities()
......
...@@ -8,7 +8,7 @@ class @ProjectsList ...@@ -8,7 +8,7 @@ class @ProjectsList
$(".projects-list-filter").keyup -> $(".projects-list-filter").keyup ->
terms = $(this).val() terms = $(this).val()
uiBox = $(this).closest('.panel') uiBox = $(this).closest('.projects-list-holder')
if terms == "" || terms == undefined if terms == "" || terms == undefined
uiBox.find(".projects-list li").show() uiBox.find(".projects-list li").show()
else else
......
...@@ -23,41 +23,6 @@ ...@@ -23,41 +23,6 @@
} }
} }
.project-row, .group-row {
padding: 0 !important;
font-size: 14px;
line-height: 24px;
a {
display: block;
padding: 8px 15px;
}
.project-name, .group-name {
font-weight: 500;
}
.arrow {
float: right;
margin: 0;
font-size: 20px;
}
.last-activity {
float: right;
font-size: 12px;
color: #AAA;
display: block;
.date {
color: #777;
}
}
}
.project-description {
overflow: hidden;
}
.project-access-icon { .project-access-icon {
margin-left: 10px; margin-left: 10px;
float: left; float: left;
...@@ -73,10 +38,9 @@ ...@@ -73,10 +38,9 @@
float: left; float: left;
.avatar { .avatar {
margin-top: -8px;
margin-left: -15px;
@include border-radius(0px); @include border-radius(0px);
} }
.identicon { .identicon {
line-height: 40px; line-height: 40px;
} }
......
...@@ -316,3 +316,34 @@ table.table.protected-branches-list tr.no-border { ...@@ -316,3 +316,34 @@ table.table.protected-branches-list tr.no-border {
pre.light-well { pre.light-well {
border-color: #f1f1f1; border-color: #f1f1f1;
} }
.projects-search-form {
max-width: 600px;
margin: 0 auto;
margin-bottom: 20px;
input {
border-color: #BBB;
}
}
.project-row {
.project-full-name {
font-weight: bold;
font-size: 15px;
}
.project-description {
color: #888;
font-size: 13px;
p {
margin-bottom: 0;
color: #888;
}
}
}
.my-projects .project-row {
padding: 10px 0;
}
class DashboardController < Dashboard::ApplicationController class DashboardController < Dashboard::ApplicationController
before_action :load_projects before_action :load_projects
before_action :event_filter, only: :show before_action :event_filter, only: :activity
respond_to :html respond_to :html
...@@ -10,13 +10,8 @@ class DashboardController < Dashboard::ApplicationController ...@@ -10,13 +10,8 @@ class DashboardController < Dashboard::ApplicationController
respond_to do |format| respond_to do |format|
format.html format.html
format.json do
load_events
pager_json("events/_events", @events.count)
end
format.atom do format.atom do
event_filter
load_events load_events
render layout: false render layout: false
end end
...@@ -40,6 +35,19 @@ class DashboardController < Dashboard::ApplicationController ...@@ -40,6 +35,19 @@ class DashboardController < Dashboard::ApplicationController
end end
end end
def activity
@last_push = current_user.recent_push
respond_to do |format|
format.html
format.json do
load_events
pager_json("events/_events", @events.count)
end
end
end
protected protected
def load_projects def load_projects
......
.panel.panel-default .projects-list-holder
.panel-heading.clearfix .projects-search-form
.input-group .input-group
= search_field_tag :filter_projects, nil, placeholder: 'Filter by name', class: 'projects-list-filter form-control' = search_field_tag :filter_projects, nil, placeholder: 'Filter by name', class: 'projects-list-filter form-control'
- if current_user.can_create_project? - if current_user.can_create_project?
...@@ -7,4 +7,7 @@ ...@@ -7,4 +7,7 @@
= link_to new_project_path, class: 'btn btn-success' do = link_to new_project_path, class: 'btn btn-success' do
New project New project
= render 'shared/projects_list', projects: @projects, projects_limit: 20 %ul.projects-list.bordered-list.my-projects
- @projects.each do |project|
%li.project-row
= render partial: 'shared/project', locals: { project: project, avatar: true, stars: true }
= content_for :meta_tags do
- if current_user
= auto_discovery_link_tag(:atom, dashboard_url(format: :atom, private_token: current_user.private_token), title: "All activity")
%section.activities
= render 'activities'
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
%section.activities.col-md-8 %section.activities.col-md-8
= render 'dashboard/activities' = render 'dashboard/activities'
%aside.col-md-4 %aside.col-md-4
.panel.panel-default .panel.panel-default.projects-list-holder
.panel-heading.clearfix .panel-heading.clearfix
.input-group .input-group
= search_field_tag :filter_projects, nil, placeholder: 'Filter by name', class: 'projects-list-filter form-control' = search_field_tag :filter_projects, nil, placeholder: 'Filter by name', class: 'projects-list-filter form-control'
......
...@@ -4,14 +4,10 @@ ...@@ -4,14 +4,10 @@
= render 'dashboard/projects_head' = render 'dashboard/projects_head'
- if @projects.any? - if @last_push
= render 'shared/show_aside' = render "events/event_last_push", event: @last_push
.dashboard.row
%section.activities.col-md-8
= render 'activities'
%aside.col-md-4
= render 'sidebar'
- if @projects.any?
= render 'projects'
- else - else
= render "zero_authorized_projects" = render "zero_authorized_projects"
...@@ -9,6 +9,6 @@ ...@@ -9,6 +9,6 @@
#{time_ago_with_tooltip(event.created_at)} #{time_ago_with_tooltip(event.created_at)}
.pull-right .pull-right
= link_to new_mr_path_from_push_event(event), title: "New Merge Request", class: "btn btn-create btn-sm" do = link_to new_mr_path_from_push_event(event), title: "New Merge Request", class: "btn btn-info btn-sm" do
Create Merge Request Create Merge Request
%hr %hr
.panel.panel-default .panel.panel-default.projects-list-holder
.panel-heading.clearfix .panel-heading.clearfix
.input-group .input-group
= search_field_tag :filter_projects, nil, placeholder: 'Filter by name', class: 'projects-list-filter form-control' = search_field_tag :filter_projects, nil, placeholder: 'Filter by name', class: 'projects-list-filter form-control'
......
%ul.nav.nav-sidebar %ul.nav.nav-sidebar
= nav_link(path: ['dashboard#show', 'root#show', 'projects#trending', 'projects#starred', 'projects#index'], html_options: {class: 'home'}) do = nav_link(path: ['dashboard#show', 'root#show', 'projects#trending', 'projects#starred', 'projects#index'], html_options: {class: 'home'}) do
= link_to (current_user ? root_path : explore_root_path), title: 'Home', class: 'shortcuts-activity', data: {placement: 'right'} do = link_to (current_user ? root_path : explore_root_path), title: 'Home', class: 'shortcuts-activity', data: {placement: 'right'} do
= icon('dashboard fw') = icon('home fw')
%span %span
Projects Projects
= nav_link(path: 'dashboard#activity') do
= link_to activity_dashboard_path, title: 'Activity', data: {placement: 'right'} do
= icon('dashboard fw')
%span
Activity
= nav_link(controller: :groups) do = nav_link(controller: :groups) do
= link_to (current_user ? dashboard_groups_path : explore_groups_path), title: 'Groups', data: {placement: 'right'} do = link_to (current_user ? dashboard_groups_path : explore_groups_path), title: 'Groups', data: {placement: 'right'} do
= icon('group fw') = icon('group fw')
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
- if avatar - if avatar
.dash-project-avatar .dash-project-avatar
= project_icon(project, alt: '', class: 'avatar project-avatar s40') = project_icon(project, alt: '', class: 'avatar project-avatar s40')
%span.str-truncated %span.str-truncated.project-full-name
%span.namespace-name %span.namespace-name
- if project.namespace - if project.namespace
= project.namespace.human_name = project.namespace.human_name
...@@ -14,3 +14,7 @@ ...@@ -14,3 +14,7 @@
%span.pull-right.light %span.pull-right.light
%i.fa.fa-star %i.fa.fa-star
= project.star_count = project.star_count
- if project.description.present?
.project-description
.str-truncated
= markdown(project.description, pipeline: :description)
...@@ -261,6 +261,7 @@ Gitlab::Application.routes.draw do ...@@ -261,6 +261,7 @@ Gitlab::Application.routes.draw do
member do member do
get :issues get :issues
get :merge_requests get :merge_requests
get :activity
end end
scope module: :dashboard do scope module: :dashboard do
......
...@@ -10,6 +10,10 @@ Feature: Dashboard ...@@ -10,6 +10,10 @@ Feature: Dashboard
Scenario: I should see projects list Scenario: I should see projects list
Then I should see "New Project" link Then I should see "New Project" link
Then I should see "Shop" project link Then I should see "Shop" project link
@javascript
Scenario: I should see activity list
And I visit dashboard activity page
Then I should see project "Shop" activity feed Then I should see project "Shop" activity feed
Scenario: I should see groups list Scenario: I should see groups list
...@@ -26,12 +30,12 @@ Feature: Dashboard ...@@ -26,12 +30,12 @@ Feature: Dashboard
@javascript @javascript
Scenario: I should see User joined Project event Scenario: I should see User joined Project event
Given user with name "John Doe" joined project "Shop" Given user with name "John Doe" joined project "Shop"
When I visit dashboard page When I visit dashboard activity page
Then I should see "John Doe joined project Shop" event Then I should see "John Doe joined project Shop" event
@javascript @javascript
Scenario: I should see User left Project event Scenario: I should see User left Project event
Given user with name "John Doe" joined project "Shop" Given user with name "John Doe" joined project "Shop"
And user with name "John Doe" left project "Shop" And user with name "John Doe" left project "Shop"
When I visit dashboard page When I visit dashboard activity page
Then I should see "John Doe left project Shop" event Then I should see "John Doe left project Shop" event
...@@ -6,7 +6,7 @@ Feature: Event Filters ...@@ -6,7 +6,7 @@ Feature: Event Filters
And this project has push event And this project has push event
And this project has new member event And this project has new member event
And this project has merge request event And this project has merge request event
And I visit dashboard page And I visit dashboard activity page
@javascript @javascript
Scenario: I should see all events Scenario: I should see all events
...@@ -16,7 +16,7 @@ Feature: Event Filters ...@@ -16,7 +16,7 @@ Feature: Event Filters
@javascript @javascript
Scenario: I should see only pushed events Scenario: I should see only pushed events
When I click "push" event filter When I click "push" event filter
Then I should see push event Then I should see push event
And I should not see new member event And I should not see new member event
And I should not see merge request event And I should not see merge request event
...@@ -38,11 +38,11 @@ Feature: Event Filters ...@@ -38,11 +38,11 @@ Feature: Event Filters
@javascript @javascript
Scenario: I should see only selected events while page reloaded Scenario: I should see only selected events while page reloaded
When I click "push" event filter When I click "push" event filter
And I visit dashboard page And I visit dashboard activity page
Then I should see push event Then I should see push event
And I should not see new member event And I should not see new member event
When I click "team" event filter When I click "team" event filter
And I visit dashboard page And I visit dashboard activity page
Then I should see push event Then I should see push event
And I should see new member event And I should see new member event
And I should not see merge request event And I should not see merge request event
......
...@@ -71,6 +71,10 @@ module SharedPaths ...@@ -71,6 +71,10 @@ module SharedPaths
visit dashboard_path visit dashboard_path
end end
step 'I visit dashboard activity page' do
visit activity_dashboard_path
end
step 'I visit dashboard projects page' do step 'I visit dashboard projects page' do
visit projects_dashboard_path visit projects_dashboard_path
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment