summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Artur <felipefac@gmail.com>2018-03-05 11:39:24 -0300
committerFelipe Artur <felipefac@gmail.com>2018-03-05 14:30:56 -0300
commit9946d0813c8e377ecf22552c4af075e563144712 (patch)
tree0f1399f16d1d6c70e41d60e11d0fa8a85db913dc
parentdd071c4b6e9754a0abeec45ab2040d9e2d5a62b8 (diff)
downloadgitlab-ce-9946d0813c8e377ecf22552c4af075e563144712.tar.gz
Address review comments
-rw-r--r--app/controllers/boards/issues_controller.rb13
-rw-r--r--app/helpers/boards_helper.rb12
-rw-r--r--app/helpers/groups_helper.rb2
-rw-r--r--changelogs/unreleased/issue_38337.yml2
-rw-r--r--config/routes/group.rb8
-rw-r--r--config/routes/project.rb2
-rw-r--r--db/migrate/20180227182112_add_group_id_to_boards.rb33
-rw-r--r--doc/user/project/issue_board.md4
-rw-r--r--lib/api/group_boards.rb2
9 files changed, 31 insertions, 47 deletions
diff --git a/app/controllers/boards/issues_controller.rb b/app/controllers/boards/issues_controller.rb
index 35571fa9603..19dbee84c11 100644
--- a/app/controllers/boards/issues_controller.rb
+++ b/app/controllers/boards/issues_controller.rb
@@ -9,6 +9,7 @@ module Boards
before_action :authorize_read_issue, only: [:index]
before_action :authorize_create_issue, only: [:create]
before_action :authorize_update_issue, only: [:update]
+ skip_before_action :authenticate_user!, only: [:index]
def index
issues = Boards::Issues::ListService.new(board_parent, current_user, filter_params).execute
@@ -74,13 +75,11 @@ module Boards
end
def project
- @project ||= begin
- if board.group_board?
- Project.find(issue_params[:project_id])
- else
- board_parent
- end
- end
+ @project ||= if board.group_board?
+ Project.find(issue_params[:project_id])
+ else
+ board_parent
+ end
end
def move_params
diff --git a/app/helpers/boards_helper.rb b/app/helpers/boards_helper.rb
index 8304a83a952..275e892b2e6 100644
--- a/app/helpers/boards_helper.rb
+++ b/app/helpers/boards_helper.rb
@@ -37,13 +37,11 @@ module BoardsHelper
end
def current_board_path(board)
- @current_board_path ||= begin
- if board.group_board?
- group_board_path(current_board_parent, board)
- else
- project_board_path(current_board_parent, board)
- end
- end
+ @current_board_path ||= if board.group_board?
+ group_board_path(current_board_parent, board)
+ else
+ project_board_path(current_board_parent, board)
+ end
end
def current_board_parent
diff --git a/app/helpers/groups_helper.rb b/app/helpers/groups_helper.rb
index 796623041bb..16eceb3f48f 100644
--- a/app/helpers/groups_helper.rb
+++ b/app/helpers/groups_helper.rb
@@ -129,7 +129,7 @@ module GroupsHelper
links = [:overview, :group_members]
if can?(current_user, :read_cross_project)
- links += [:activity, :issues, :labels, :milestones, :merge_requests, :boards]
+ links += [:activity, :issues, :boards, :labels, :milestones, :merge_requests]
end
if can?(current_user, :admin_group, @group)
diff --git a/changelogs/unreleased/issue_38337.yml b/changelogs/unreleased/issue_38337.yml
index a05eacefd68..df65118b65c 100644
--- a/changelogs/unreleased/issue_38337.yml
+++ b/changelogs/unreleased/issue_38337.yml
@@ -1,5 +1,5 @@
---
-title: Add one group port to CE
+title: Add one group board to Libre
merge_request:
author:
type: added
diff --git a/config/routes/group.rb b/config/routes/group.rb
index 612929dba09..710f12e33ad 100644
--- a/config/routes/group.rb
+++ b/config/routes/group.rb
@@ -59,14 +59,6 @@ constraints(GroupUrlConstrainer.new) do
# On CE only index and show actions are needed
resources :boards, only: [:index, :show]
-
- legacy_ee_group_boards_redirect = redirect do |params, request|
- path = "/groups/#{params[:group_id]}/-/boards"
- path << "/#{params[:extra_params]}" if params[:extra_params].present?
- path << "?#{request.query_string}" if request.query_string.present?
- path
- end
- get 'boards(/*extra_params)', as: :legacy_ee_group_boards_redirect, to: legacy_ee_group_boards_redirect
end
scope(path: '*id',
diff --git a/config/routes/project.rb b/config/routes/project.rb
index 34636285c51..c443ee85623 100644
--- a/config/routes/project.rb
+++ b/config/routes/project.rb
@@ -381,7 +381,7 @@ constraints(ProjectUrlConstrainer.new) do
get 'noteable/:target_type/:target_id/notes' => 'notes#index', as: 'noteable_notes'
- resources :boards, only: [:index, :show, :create, :update, :destroy]
+ resources :boards, only: [:index, :show]
resources :todos, only: [:create]
diff --git a/db/migrate/20180227182112_add_group_id_to_boards.rb b/db/migrate/20180227182112_add_group_id_to_boards.rb
index d5da85bebcd..8e5460d44c9 100644
--- a/db/migrate/20180227182112_add_group_id_to_boards.rb
+++ b/db/migrate/20180227182112_add_group_id_to_boards.rb
@@ -1,8 +1,3 @@
-# This is part of a backport from EE group boards feature which a few extra steps
-# are required on this migration since it will be merged into EE which already
-# contains the group_id column.
-# like checking if the group_id column already exists before adding it.
-
class AddGroupIdToBoards < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
@@ -11,24 +6,24 @@ class AddGroupIdToBoards < ActiveRecord::Migration
DOWNTIME = false
def up
- unless group_id_exists?
- add_column :boards, :group_id, :integer
- add_foreign_key :boards, :namespaces, column: :group_id, on_delete: :cascade
- add_concurrent_index :boards, :group_id
+ return if group_id_exists?
+
+ add_column :boards, :group_id, :integer
+ add_foreign_key :boards, :namespaces, column: :group_id, on_delete: :cascade
+ add_concurrent_index :boards, :group_id
- change_column_null :boards, :project_id, true
- end
+ change_column_null :boards, :project_id, true
end
def down
- if group_id_exists?
- remove_foreign_key :boards, column: :group_id
- remove_index :boards, :group_id if index_exists? :boards, :group_id
- remove_column :boards, :group_id
-
- execute "DELETE from boards WHERE project_id IS NULL"
- change_column_null :boards, :project_id, false
- end
+ return unless group_id_exists?
+
+ remove_foreign_key :boards, column: :group_id
+ remove_index :boards, :group_id if index_exists? :boards, :group_id
+ remove_column :boards, :group_id
+
+ execute "DELETE from boards WHERE project_id IS NULL"
+ change_column_null :boards, :project_id, false
end
private
diff --git a/doc/user/project/issue_board.md b/doc/user/project/issue_board.md
index 8df84db5139..07d3ef20ba7 100644
--- a/doc/user/project/issue_board.md
+++ b/doc/user/project/issue_board.md
@@ -237,9 +237,9 @@ Issue Board, that is create/delete lists and drag issues around.
## Group Issue Board
-Group issue board i analogous to project-level issue board and it is accessible at the group
+Group issue board is analogous to project-level issue board and it is accessible at the group
navigation level. A group-level issue board allows you to view all issues from all projects in that group
-(currently, it does not see issues from projects in subgroups) Similarly, you can only filter by group labels for these
+(currently, it does not see issues from projects in subgroups). Similarly, you can only filter by group labels for these
boards. When updating milestones and labels for an issue through the sidebar update mechanism, again only
group-level objects are available.
diff --git a/lib/api/group_boards.rb b/lib/api/group_boards.rb
index 48709a5de6b..aa9fff25fc8 100644
--- a/lib/api/group_boards.rb
+++ b/lib/api/group_boards.rb
@@ -44,7 +44,7 @@ module API
end
segment ':id/boards/:board_id' do
desc 'Get the lists of a group board' do
- detail 'Does not include backlog and closed lists. This feature was introduced in 10.4'
+ detail 'Does not include backlog and closed lists. This feature was introduced in 10.6'
success Entities::List
end
params do