summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-09-02 19:50:37 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-09-02 19:50:37 +0000
commit14274cdc3bb3770dc9390f0735ca36536ca53ea1 (patch)
treea2e5c132078e5d604653cc11e817a21b1fbd6964
parentd9f794a850202cb579b8c8e935b9e07b798ad0b6 (diff)
parent774c523c1f0ccb259329ff0b945c73ca5e06a7aa (diff)
downloadgitlab-ce-14274cdc3bb3770dc9390f0735ca36536ca53ea1.tar.gz
Merge branch 'refactor-starred-projects-page' into 'master'
Split starred projects list and activity In same way like we did with your projects. For consistency Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> See merge request !1238
-rw-r--r--CHANGELOG2
-rw-r--r--app/controllers/dashboard_controller.rb11
-rw-r--r--app/views/dashboard/_activity_head.html.haml7
-rw-r--r--app/views/dashboard/activity.html.haml2
-rw-r--r--app/views/dashboard/projects/starred.html.haml18
-rw-r--r--features/steps/dashboard/starred_projects.rb2
6 files changed, 21 insertions, 21 deletions
diff --git a/CHANGELOG b/CHANGELOG
index e46fb5d6c1e..339df2bcac1 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -21,7 +21,7 @@ v 8.0.0 (unreleased)
- Create cross-reference for closing references on commits pushed to non-default branches (Maƫl Valais)
- Ability to search milestones
- Gracefully handle SMTP user input errors (e.g. incorrect email addresses) to prevent Sidekiq retries (Stan Hu)
- - Move dashboard activity to separate page
+ - Move dashboard activity to separate page (for your projects and starred projects)
- Improve performance of git blame
- Limit content width to 1200px for most of pages to improve readability on big screens
- Fix 500 error when submit project snippet without body
diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb
index d745131694b..2bc2e5e58f5 100644
--- a/app/controllers/dashboard_controller.rb
+++ b/app/controllers/dashboard_controller.rb
@@ -1,5 +1,5 @@
class DashboardController < Dashboard::ApplicationController
- before_action :load_projects
+ before_action :load_projects, except: :activity
before_action :event_filter, only: :activity
respond_to :html
@@ -55,7 +55,14 @@ class DashboardController < Dashboard::ApplicationController
end
def load_events
- @events = Event.in_projects(current_user.authorized_projects.pluck(:id))
+ project_ids =
+ if params[:filter] == "starred"
+ current_user.starred_projects
+ else
+ current_user.authorized_projects
+ end.pluck(:id)
+
+ @events = Event.in_projects(project_ids)
@events = @event_filter.apply_filter(@events).with_associations
@events = @events.limit(20).offset(params[:offset] || 0)
end
diff --git a/app/views/dashboard/_activity_head.html.haml b/app/views/dashboard/_activity_head.html.haml
new file mode 100644
index 00000000000..9f4be025bf2
--- /dev/null
+++ b/app/views/dashboard/_activity_head.html.haml
@@ -0,0 +1,7 @@
+%ul.center-top-menu
+ %li{ class: ("active" unless params[:filter]) }
+ = link_to activity_dashboard_path, class: 'shortcuts-activity', data: {placement: 'right'} do
+ Your Projects
+ %li{ class: ("active" if params[:filter] == 'starred') }
+ = link_to activity_dashboard_path(filter: 'starred'), data: {placement: 'right'} do
+ Starred Projects
diff --git a/app/views/dashboard/activity.html.haml b/app/views/dashboard/activity.html.haml
index 7a5a093add5..72419bf94dd 100644
--- a/app/views/dashboard/activity.html.haml
+++ b/app/views/dashboard/activity.html.haml
@@ -2,5 +2,7 @@
- if current_user
= auto_discovery_link_tag(:atom, dashboard_url(format: :atom, private_token: current_user.private_token), title: "All activity")
+= render 'dashboard/activity_head'
+
%section.activities
= render 'activities'
diff --git a/app/views/dashboard/projects/starred.html.haml b/app/views/dashboard/projects/starred.html.haml
index 19f3975e530..becd989c1f3 100644
--- a/app/views/dashboard/projects/starred.html.haml
+++ b/app/views/dashboard/projects/starred.html.haml
@@ -2,23 +2,7 @@
= render 'dashboard/projects_head'
- if @projects.any?
- = render 'shared/show_aside'
-
- .dashboard.row
- %section.activities.col-md-7
- = render 'dashboard/activities'
- %aside.col-md-5
- .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'
- - if current_user.can_create_project?
- %span.input-group-btn
- = link_to new_project_path, class: 'btn btn-success' do
- New project
-
- = render 'shared/projects/list', projects: @projects, projects_limit: 20
-
+ = render 'dashboard/projects'
- else
%h3 You don't have starred projects yet
%p.slead Visit project page and press on star icon and it will appear on this page.
diff --git a/features/steps/dashboard/starred_projects.rb b/features/steps/dashboard/starred_projects.rb
index 59c73fe63f2..c33813e550b 100644
--- a/features/steps/dashboard/starred_projects.rb
+++ b/features/steps/dashboard/starred_projects.rb
@@ -8,7 +8,7 @@ class Spinach::Features::DashboardStarredProjects < Spinach::FeatureSteps
end
step 'I should not see project "Shop"' do
- page.within 'aside' do
+ page.within '.projects-list' do
expect(page).not_to have_content('Shop')
end
end