Commit 9946d081 authored by Felipe Artur's avatar Felipe Artur

Address review comments

parent dd071c4b
......@@ -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,14 +75,12 @@ module Boards
end
def project
@project ||= begin
if board.group_board?
@project ||= if board.group_board?
Project.find(issue_params[:project_id])
else
board_parent
end
end
end
def move_params
params.permit(:board_id, :id, :from_list_id, :to_list_id, :move_before_id, :move_after_id)
......
......@@ -37,14 +37,12 @@ module BoardsHelper
end
def current_board_path(board)
@current_board_path ||= begin
if board.group_board?
@current_board_path ||= if board.group_board?
group_board_path(current_board_parent, board)
else
project_board_path(current_board_parent, board)
end
end
end
def current_board_parent
@current_board_parent ||= @group || @project
......
......@@ -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)
......
---
title: Add one group port to CE
title: Add one group board to Libre
merge_request:
author:
type: added
......@@ -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',
......
......@@ -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]
......
# 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,17 +6,18 @@ class AddGroupIdToBoards < ActiveRecord::Migration
DOWNTIME = false
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_concurrent_index :boards, :group_id
change_column_null :boards, :project_id, true
end
end
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_column :boards, :group_id
......@@ -29,7 +25,6 @@ class AddGroupIdToBoards < ActiveRecord::Migration
execute "DELETE from boards WHERE project_id IS NULL"
change_column_null :boards, :project_id, false
end
end
private
......
......@@ -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.
......
......@@ -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
......
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