summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-08-25 16:19:12 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-08-25 16:19:12 +0000
commita0284b5b85378be291c263e4f60c725c807c1a6f (patch)
tree411b4e83a3cd2a2e7be2e7e1f4bcc7d026d685a4
parent429c0d14918d8727eac0e24ff01df5cdf55b2f79 (diff)
parent7569010bc3918af0098e00eb56fce1a18d8ca72e (diff)
downloadgitlab-ce-a0284b5b85378be291c263e4f60c725c807c1a6f.tar.gz
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
-rw-r--r--CHANGELOG1
-rw-r--r--app/assets/javascripts/dispatcher.js.coffee1
-rw-r--r--app/assets/javascripts/projects_list.js.coffee2
-rw-r--r--app/assets/stylesheets/pages/dashboard.scss38
-rw-r--r--app/assets/stylesheets/pages/projects.scss31
-rw-r--r--app/controllers/dashboard_controller.rb22
-rw-r--r--app/views/dashboard/_projects.html.haml9
-rw-r--r--app/views/dashboard/activity.html.haml6
-rw-r--r--app/views/dashboard/projects/starred.html.haml2
-rw-r--r--app/views/dashboard/show.html.haml12
-rw-r--r--app/views/events/_event_last_push.html.haml2
-rw-r--r--app/views/groups/_projects.html.haml2
-rw-r--r--app/views/layouts/nav/_dashboard.html.haml7
-rw-r--r--app/views/shared/_project.html.haml6
-rw-r--r--config/routes.rb1
-rw-r--r--features/dashboard/dashboard.feature8
-rw-r--r--features/dashboard/event_filters.feature8
-rw-r--r--features/steps/shared/paths.rb4
18 files changed, 95 insertions, 67 deletions
diff --git a/CHANGELOG b/CHANGELOG
index a66e898652c..5222ab1e3e1 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -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)
diff --git a/app/assets/javascripts/dispatcher.js.coffee b/app/assets/javascripts/dispatcher.js.coffee
index 81e73799271..539041c2862 100644
--- a/app/assets/javascripts/dispatcher.js.coffee
+++ b/app/assets/javascripts/dispatcher.js.coffee
@@ -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()
diff --git a/app/assets/javascripts/projects_list.js.coffee b/app/assets/javascripts/projects_list.js.coffee
index c0e36d1ccc5..db5faf71faf 100644
--- a/app/assets/javascripts/projects_list.js.coffee
+++ b/app/assets/javascripts/projects_list.js.coffee
@@ -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
diff --git a/app/assets/stylesheets/pages/dashboard.scss b/app/assets/stylesheets/pages/dashboard.scss
index 9a3b543ad10..c1103a1c2e6 100644
--- a/app/assets/stylesheets/pages/dashboard.scss
+++ b/app/assets/stylesheets/pages/dashboard.scss
@@ -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;
}
diff --git a/app/assets/stylesheets/pages/projects.scss b/app/assets/stylesheets/pages/projects.scss
index 29d3dbc25eb..1e138651d52 100644
--- a/app/assets/stylesheets/pages/projects.scss
+++ b/app/assets/stylesheets/pages/projects.scss
@@ -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;
+}
diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb
index d2f0c43929f..d745131694b 100644
--- a/app/controllers/dashboard_controller.rb
+++ b/app/controllers/dashboard_controller.rb
@@ -1,6 +1,6 @@
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
diff --git a/app/views/dashboard/_projects.html.haml b/app/views/dashboard/_projects.html.haml
index d676576067c..dc83d5343f2 100644
--- a/app/views/dashboard/_projects.html.haml
+++ b/app/views/dashboard/_projects.html.haml
@@ -1,5 +1,5 @@
-.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 }
diff --git a/app/views/dashboard/activity.html.haml b/app/views/dashboard/activity.html.haml
new file mode 100644
index 00000000000..7a5a093add5
--- /dev/null
+++ b/app/views/dashboard/activity.html.haml
@@ -0,0 +1,6 @@
+= 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'
diff --git a/app/views/dashboard/projects/starred.html.haml b/app/views/dashboard/projects/starred.html.haml
index 98b8cde4766..027387028b9 100644
--- a/app/views/dashboard/projects/starred.html.haml
+++ b/app/views/dashboard/projects/starred.html.haml
@@ -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'
diff --git a/app/views/dashboard/show.html.haml b/app/views/dashboard/show.html.haml
index a3a32b6932f..4cf2feb9aa6 100644
--- a/app/views/dashboard/show.html.haml
+++ b/app/views/dashboard/show.html.haml
@@ -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"
diff --git a/app/views/events/_event_last_push.html.haml b/app/views/events/_event_last_push.html.haml
index 501412642db..6a0c6cba41b 100644
--- a/app/views/events/_event_last_push.html.haml
+++ b/app/views/events/_event_last_push.html.haml
@@ -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
diff --git a/app/views/groups/_projects.html.haml b/app/views/groups/_projects.html.haml
index 4f8aec1c67e..2ae51a1c8c0 100644
--- a/app/views/groups/_projects.html.haml
+++ b/app/views/groups/_projects.html.haml
@@ -1,4 +1,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'
diff --git a/app/views/layouts/nav/_dashboard.html.haml b/app/views/layouts/nav/_dashboard.html.haml
index 8f010196d1a..154fd418399 100644
--- a/app/views/layouts/nav/_dashboard.html.haml
+++ b/app/views/layouts/nav/_dashboard.html.haml
@@ -1,9 +1,14 @@
%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')
diff --git a/app/views/shared/_project.html.haml b/app/views/shared/_project.html.haml
index 6bd61455d21..15df97b1333 100644
--- a/app/views/shared/_project.html.haml
+++ b/app/views/shared/_project.html.haml
@@ -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)
diff --git a/config/routes.rb b/config/routes.rb
index d7307a61ede..8ba439f08b8 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -261,6 +261,7 @@ Gitlab::Application.routes.draw do
member do
get :issues
get :merge_requests
+ get :activity
end
scope module: :dashboard do
diff --git a/features/dashboard/dashboard.feature b/features/dashboard/dashboard.feature
index 1959d327082..392d4235eff 100644
--- a/features/dashboard/dashboard.feature
+++ b/features/dashboard/dashboard.feature
@@ -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
diff --git a/features/dashboard/event_filters.feature b/features/dashboard/event_filters.feature
index ec5680caba6..96399ea21a6 100644
--- a/features/dashboard/event_filters.feature
+++ b/features/dashboard/event_filters.feature
@@ -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
diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb
index ca8fbb49101..b4deccb6520 100644
--- a/features/steps/shared/paths.rb
+++ b/features/steps/shared/paths.rb
@@ -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