BigW Consortium Gitlab

Commit a0284b5b by 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)
- Ability to search milestones
- Gracefully handle SMTP user input errors (e.g. incorrect email addresses) to prevent Sidekiq retries (Stan Hu)
- Improve abuse reports management from admin area
- Move dashboard activity to separate page
v 7.14.1 (unreleased)
- Only include base URL in OmniAuth full_host parameter (Stan Hu)
......
......@@ -51,6 +51,7 @@ class Dispatcher
MergeRequests.init()
when 'dashboard:show', 'root:show'
new Dashboard()
when 'dashboard:activity'
new Activities()
when 'dashboard:projects:starred'
new Activities()
......
......@@ -8,7 +8,7 @@ class @ProjectsList
$(".projects-list-filter").keyup ->
terms = $(this).val()
uiBox = $(this).closest('.panel')
uiBox = $(this).closest('.projects-list-holder')
if terms == "" || terms == undefined
uiBox.find(".projects-list li").show()
else
......
......@@ -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 {
margin-left: 10px;
float: left;
......@@ -73,10 +38,9 @@
float: left;
.avatar {
margin-top: -8px;
margin-left: -15px;
@include border-radius(0px);
}
.identicon {
line-height: 40px;
}
......
......@@ -316,3 +316,34 @@ table.table.protected-branches-list tr.no-border {
pre.light-well {
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
before_action :load_projects
before_action :event_filter, only: :show
before_action :event_filter, only: :activity
respond_to :html
......@@ -10,13 +10,8 @@ class DashboardController < Dashboard::ApplicationController
respond_to do |format|
format.html
format.json do
load_events
pager_json("events/_events", @events.count)
end
format.atom do
event_filter
load_events
render layout: false
end
......@@ -40,6 +35,19 @@ class DashboardController < Dashboard::ApplicationController
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
def load_projects
......
.panel.panel-default
.panel-heading.clearfix
.projects-list-holder
.projects-search-form
.input-group
= search_field_tag :filter_projects, nil, placeholder: 'Filter by name', class: 'projects-list-filter form-control'
- if current_user.can_create_project?
......@@ -7,4 +7,7 @@
= link_to new_project_path, class: 'btn btn-success' do
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 @@
%section.activities.col-md-8
= render 'dashboard/activities'
%aside.col-md-4
.panel.panel-default
.panel.panel-default.projects-list-holder
.panel-heading.clearfix
.input-group
= search_field_tag :filter_projects, nil, placeholder: 'Filter by name', class: 'projects-list-filter form-control'
......
......@@ -4,14 +4,10 @@
= render 'dashboard/projects_head'
- if @projects.any?
= render 'shared/show_aside'
.dashboard.row
%section.activities.col-md-8
= render 'activities'
%aside.col-md-4
= render 'sidebar'
- if @last_push
= render "events/event_last_push", event: @last_push
- if @projects.any?
= render 'projects'
- else
= render "zero_authorized_projects"
......@@ -9,6 +9,6 @@
#{time_ago_with_tooltip(event.created_at)}
.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
%hr
.panel.panel-default
.panel.panel-default.projects-list-holder
.panel-heading.clearfix
.input-group
= search_field_tag :filter_projects, nil, placeholder: 'Filter by name', class: 'projects-list-filter form-control'
......
%ul.nav.nav-sidebar
= 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
= icon('dashboard fw')
= icon('home fw')
%span
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
= link_to (current_user ? dashboard_groups_path : explore_groups_path), title: 'Groups', data: {placement: 'right'} do
= icon('group fw')
......
......@@ -3,7 +3,7 @@
- if avatar
.dash-project-avatar
= project_icon(project, alt: '', class: 'avatar project-avatar s40')
%span.str-truncated
%span.str-truncated.project-full-name
%span.namespace-name
- if project.namespace
= project.namespace.human_name
......@@ -14,3 +14,7 @@
%span.pull-right.light
%i.fa.fa-star
= 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
member do
get :issues
get :merge_requests
get :activity
end
scope module: :dashboard do
......
......@@ -10,6 +10,10 @@ Feature: Dashboard
Scenario: I should see projects list
Then I should see "New 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
Scenario: I should see groups list
......@@ -26,12 +30,12 @@ Feature: Dashboard
@javascript
Scenario: I should see User joined Project event
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
@javascript
Scenario: I should see User left Project event
Given user with name "John Doe" joined 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
......@@ -6,7 +6,7 @@ Feature: Event Filters
And this project has push event
And this project has new member event
And this project has merge request event
And I visit dashboard page
And I visit dashboard activity page
@javascript
Scenario: I should see all events
......@@ -16,7 +16,7 @@ Feature: Event Filters
@javascript
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
And I should not see new member event
And I should not see merge request event
......@@ -38,11 +38,11 @@ Feature: Event Filters
@javascript
Scenario: I should see only selected events while page reloaded
When I click "push" event filter
And I visit dashboard page
And I visit dashboard activity 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
And I visit dashboard activity page
Then I should see push event
And I should see new member event
And I should not see merge request event
......
......@@ -71,6 +71,10 @@ module SharedPaths
visit dashboard_path
end
step 'I visit dashboard activity page' do
visit activity_dashboard_path
end
step 'I visit dashboard projects page' do
visit projects_dashboard_path
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