Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
ad36ddfb
Commit
ad36ddfb
authored
Jul 21, 2017
by
Felipe Artur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adjustments and remove project_id not null constraint
parent
f216d57a
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
31 additions
and
12 deletions
+31
-12
app/controllers/groups/boards_controller.rb
app/controllers/groups/boards_controller.rb
+3
-1
app/controllers/projects/boards_controller.rb
app/controllers/projects/boards_controller.rb
+3
-1
app/helpers/boards_helper.rb
app/helpers/boards_helper.rb
+3
-3
app/helpers/ee/boards_helper.rb
app/helpers/ee/boards_helper.rb
+2
-1
app/models/board.rb
app/models/board.rb
+2
-1
app/models/ee/board.rb
app/models/ee/board.rb
+3
-1
app/services/boards/create_service.rb
app/services/boards/create_service.rb
+1
-1
app/views/groups/boards/_show.html.haml
app/views/groups/boards/_show.html.haml
+1
-1
db/migrate/20170718185922_add_group_id_to_boards.rb
db/migrate/20170718185922_add_group_id_to_boards.rb
+12
-1
db/schema.rb
db/schema.rb
+1
-1
No files found.
app/controllers/groups/boards_controller.rb
View file @
ad36ddfb
...
...
@@ -14,6 +14,8 @@ class Groups::BoardsController < Groups::ApplicationController
end
def
assign_endpoint_vars
@boards_endpoint
=
group_boards_path
(
@group
)
@boards_endpoint
=
group_boards_path
(
group
)
@issues_path
=
issues_group_path
(
group
)
@bulk_issues_path
=
""
end
end
app/controllers/projects/boards_controller.rb
View file @
ad36ddfb
...
...
@@ -30,7 +30,9 @@ class Projects::BoardsController < Projects::ApplicationController
private
def
assign_endpoint_vars
@boards_endpoint
=
project_boards_path
(
@project
)
@boards_endpoint
=
project_boards_path
(
project
)
@issues_path
=
project_issues_path
(
project
)
@bulk_issues_path
=
bulk_update_project_issues_path
(
@project
)
end
def
authorize_read_board!
...
...
app/helpers/boards_helper.rb
View file @
ad36ddfb
...
...
@@ -8,10 +8,10 @@ module BoardsHelper
endpoint:
@boards_endpoint
,
board_id:
board
.
id
,
board_milestone_title:
board
&
.
milestone
&
.
title
,
disabled:
"
#{
!
can?
(
current_user
,
:admin_list
,
@project
)
}
"
,
issue_link_base:
project_issues_path
(
@project
)
,
disabled:
"
#{
!
can?
(
current_user
,
:admin_list
,
@project
)
}
"
,
# Create this permission for groups( if needed )
issue_link_base:
@issues_path
,
root_path:
root_path
,
bulk_update_path:
bulk_update_project_issues_path
(
@project
)
,
bulk_update_path:
@bulk_issues_path
,
default_avatar:
image_path
(
default_avatar
)
}
end
...
...
app/helpers/ee/boards_helper.rb
View file @
ad36ddfb
module
EE
module
BoardsHelper
def
board_data
super
.
merge
(
focus_mode_available:
@project
.
feature_available?
(
:issue_board_focus_mode
).
to_s
)
parent
=
@group
||
@project
super
.
merge
(
focus_mode_available:
parent
.
feature_available?
(
:issue_board_focus_mode
).
to_s
)
end
end
end
app/models/board.rb
View file @
ad36ddfb
...
...
@@ -5,7 +5,8 @@ class Board < ActiveRecord::Base
has_many
:lists
,
->
{
order
(
:list_type
,
:position
)
},
dependent: :delete_all
# rubocop:disable Cop/ActiveRecordDependent
validates
:name
,
:project
,
presence:
true
validates
:name
,
presence:
true
validates
:project
,
presence:
true
,
unless:
->
{
respond_to?
(
:group_id
)
}
def
backlog_list
lists
.
merge
(
List
.
backlog
).
take
...
...
app/models/ee/board.rb
View file @
ad36ddfb
...
...
@@ -10,7 +10,9 @@ module EE
end
def
milestone
return
nil
unless
project
.
feature_available?
(
:issue_board_milestone
)
parent
=
project
||
group
return
nil
unless
parent
.
feature_available?
(
:issue_board_milestone
)
if
milestone_id
==
::
Milestone
::
Upcoming
.
id
::
Milestone
::
Upcoming
...
...
app/services/boards/create_service.rb
View file @
ad36ddfb
...
...
@@ -14,7 +14,7 @@ module Boards
def
create_board!
board
=
parent
.
boards
.
create
(
params
)
byebug
if
board
.
persisted?
board
.
lists
.
create
(
list_type: :backlog
)
board
.
lists
.
create
(
list_type: :closed
)
...
...
app/views/groups/boards/_show.html.haml
View file @
ad36ddfb
...
...
@@ -33,7 +33,7 @@
":root-path"
=>
"rootPath"
,
":board-id"
=>
"boardId"
,
":key"
=>
"_uid"
}
=
render
"projects/boards/components/sidebar"
=
#
render "projects/boards/components/sidebar"
%board-add-issues-modal
{
"blank-state-image"
=>
render
(
'shared/empty_states/icons/issues.svg'
),
"new-issue-path"
=>
""
,
"milestone-path"
=>
milestones_filter_dropdown_path
,
...
...
db/migrate/20170718185922_add_group_id_to_boards.rb
View file @
ad36ddfb
class
AddGroupIdToBoards
<
ActiveRecord
::
Migration
DOWNTIME
=
false
def
change
def
up
change_column_null
:boards
,
:project_id
,
true
add_column
:boards
,
:group_id
,
:integer
end
def
down
# We cannot rollback project_id not null constraint if there are records
# with null values.
execute
"DELETE from boards WHERE project_id IS NULL"
remove_column
:boards
,
:group_id
change_column
:boards
,
:project_id
,
:integer
,
null:
false
end
end
db/schema.rb
View file @
ad36ddfb
...
...
@@ -207,7 +207,7 @@ ActiveRecord::Schema.define(version: 20170718190627) do
add_index
"award_emoji"
,
[
"user_id"
,
"name"
],
name:
"index_award_emoji_on_user_id_and_name"
,
using: :btree
create_table
"boards"
,
force: :cascade
do
|
t
|
t
.
integer
"project_id"
,
null:
false
t
.
integer
"project_id"
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
t
.
string
"name"
,
default:
"Development"
,
null:
false
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment