BigW Consortium Gitlab

Commit 9946d081 by Felipe Artur

Address review comments

parent dd071c4b
...@@ -9,6 +9,7 @@ module Boards ...@@ -9,6 +9,7 @@ module Boards
before_action :authorize_read_issue, only: [:index] before_action :authorize_read_issue, only: [:index]
before_action :authorize_create_issue, only: [:create] before_action :authorize_create_issue, only: [:create]
before_action :authorize_update_issue, only: [:update] before_action :authorize_update_issue, only: [:update]
skip_before_action :authenticate_user!, only: [:index]
def index def index
issues = Boards::Issues::ListService.new(board_parent, current_user, filter_params).execute issues = Boards::Issues::ListService.new(board_parent, current_user, filter_params).execute
...@@ -74,13 +75,11 @@ module Boards ...@@ -74,13 +75,11 @@ module Boards
end end
def project def project
@project ||= begin @project ||= if board.group_board?
if board.group_board? Project.find(issue_params[:project_id])
Project.find(issue_params[:project_id]) else
else board_parent
board_parent end
end
end
end end
def move_params def move_params
......
...@@ -37,13 +37,11 @@ module BoardsHelper ...@@ -37,13 +37,11 @@ module BoardsHelper
end end
def current_board_path(board) def current_board_path(board)
@current_board_path ||= begin @current_board_path ||= if board.group_board?
if board.group_board? group_board_path(current_board_parent, board)
group_board_path(current_board_parent, board) else
else project_board_path(current_board_parent, board)
project_board_path(current_board_parent, board) end
end
end
end end
def current_board_parent def current_board_parent
......
...@@ -129,7 +129,7 @@ module GroupsHelper ...@@ -129,7 +129,7 @@ module GroupsHelper
links = [:overview, :group_members] links = [:overview, :group_members]
if can?(current_user, :read_cross_project) if can?(current_user, :read_cross_project)
links += [:activity, :issues, :labels, :milestones, :merge_requests, :boards] links += [:activity, :issues, :boards, :labels, :milestones, :merge_requests]
end end
if can?(current_user, :admin_group, @group) if can?(current_user, :admin_group, @group)
......
--- ---
title: Add one group port to CE title: Add one group board to Libre
merge_request: merge_request:
author: author:
type: added type: added
...@@ -59,14 +59,6 @@ constraints(GroupUrlConstrainer.new) do ...@@ -59,14 +59,6 @@ constraints(GroupUrlConstrainer.new) do
# On CE only index and show actions are needed # On CE only index and show actions are needed
resources :boards, only: [:index, :show] 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 end
scope(path: '*id', scope(path: '*id',
......
...@@ -381,7 +381,7 @@ constraints(ProjectUrlConstrainer.new) do ...@@ -381,7 +381,7 @@ constraints(ProjectUrlConstrainer.new) do
get 'noteable/:target_type/:target_id/notes' => 'notes#index', as: 'noteable_notes' 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] resources :todos, only: [:create]
......
# 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 class AddGroupIdToBoards < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers include Gitlab::Database::MigrationHelpers
...@@ -11,24 +6,24 @@ class AddGroupIdToBoards < ActiveRecord::Migration ...@@ -11,24 +6,24 @@ class AddGroupIdToBoards < ActiveRecord::Migration
DOWNTIME = false DOWNTIME = false
def up def up
unless group_id_exists? return if group_id_exists?
add_column :boards, :group_id, :integer
add_foreign_key :boards, :namespaces, column: :group_id, on_delete: :cascade add_column :boards, :group_id, :integer
add_concurrent_index :boards, :group_id add_foreign_key :boards, :namespaces, column: :group_id, on_delete: :cascade
add_concurrent_index :boards, :group_id
change_column_null :boards, :project_id, true change_column_null :boards, :project_id, true
end
end end
def down def down
if group_id_exists? return unless group_id_exists?
remove_foreign_key :boards, column: :group_id
remove_index :boards, :group_id if index_exists? :boards, :group_id remove_foreign_key :boards, column: :group_id
remove_column :boards, :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 execute "DELETE from boards WHERE project_id IS NULL"
end change_column_null :boards, :project_id, false
end end
private private
......
...@@ -237,9 +237,9 @@ Issue Board, that is create/delete lists and drag issues around. ...@@ -237,9 +237,9 @@ Issue Board, that is create/delete lists and drag issues around.
## Group Issue Board ## 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 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 boards. When updating milestones and labels for an issue through the sidebar update mechanism, again only
group-level objects are available. group-level objects are available.
......
...@@ -44,7 +44,7 @@ module API ...@@ -44,7 +44,7 @@ module API
end end
segment ':id/boards/:board_id' do segment ':id/boards/:board_id' do
desc 'Get the lists of a group board' 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 success Entities::List
end end
params do params do
......
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