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
acba6dc3
Commit
acba6dc3
authored
Aug 25, 2017
by
Felipe Artur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve boards validation code and fix sidebar resources
parent
34d050f6
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
7 deletions
+13
-7
app/helpers/labels_helper.rb
app/helpers/labels_helper.rb
+2
-1
app/models/board.rb
app/models/board.rb
+5
-1
app/views/shared/boards/components/sidebar/_labels.html.haml
app/views/shared/boards/components/sidebar/_labels.html.haml
+1
-1
app/views/shared/boards/components/sidebar/_milestone.html.haml
...ews/shared/boards/components/sidebar/_milestone.html.haml
+1
-4
ee/app/models/ee/board.rb
ee/app/models/ee/board.rb
+4
-0
No files found.
app/helpers/labels_helper.rb
View file @
acba6dc3
...
@@ -127,7 +127,8 @@ module LabelsHelper
...
@@ -127,7 +127,8 @@ module LabelsHelper
if
project
if
project
project_labels_path
(
project
,
:json
)
project_labels_path
(
project
,
:json
)
elsif
@group
elsif
@group
group_labels_path
(
@group
,
:json
,
only_group_labels:
only_group_labels
)
options
=
{
only_group_labels:
only_group_labels
}
if
only_group_labels
group_labels_path
(
@group
,
:json
,
options
)
else
else
dashboard_labels_path
(
:json
)
dashboard_labels_path
(
:json
)
end
end
...
...
app/models/board.rb
View file @
acba6dc3
...
@@ -7,7 +7,11 @@ class Board < ActiveRecord::Base
...
@@ -7,7 +7,11 @@ class Board < ActiveRecord::Base
validates
:name
,
presence:
true
validates
:name
,
presence:
true
validates
:project
,
presence:
true
,
if:
->
{
respond_to?
(
:group_id
)
&&
!
group
}
validates
:project
,
presence:
true
,
if: :project_needed?
def
project_needed?
true
end
def
backlog_list
def
backlog_list
lists
.
merge
(
List
.
backlog
).
take
lists
.
merge
(
List
.
backlog
).
take
...
...
app/views/shared/boards/components/sidebar/_labels.html.haml
View file @
acba6dc3
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
show_no:
"true"
,
show_no:
"true"
,
show_any:
"true"
,
show_any:
"true"
,
project_id:
@project
&
.
try
(
:id
),
project_id:
@project
&
.
try
(
:id
),
labels:
labels_filter_path
(
tru
e
),
labels:
labels_filter_path
(
fals
e
),
namespace_path:
@project
.
try
(
:namespace
).
try
(
:full_path
),
namespace_path:
@project
.
try
(
:namespace
).
try
(
:full_path
),
project_path:
@project
.
try
(
:path
)
},
project_path:
@project
.
try
(
:path
)
},
":data-issue-update"
=>
"'#{build_issue_link_base}/' + issue.iid + '.json'"
}
":data-issue-update"
=>
"'#{build_issue_link_base}/' + issue.iid + '.json'"
}
...
...
app/views/shared/boards/components/sidebar/_milestone.html.haml
View file @
acba6dc3
-
milestone_filter_opts
=
{
format: :json
}
-
milestone_filter_opts
=
milestone_filter_opts
.
merge
(
only_group_milestones:
true
)
if
board
.
group_board?
.block.milestone
.block.milestone
.title
.title
Milestone
Milestone
...
@@ -19,7 +16,7 @@
...
@@ -19,7 +16,7 @@
name:
"issue[milestone_id]"
,
name:
"issue[milestone_id]"
,
"v-if"
=>
"issue.milestone"
}
"v-if"
=>
"issue.milestone"
}
.dropdown
.dropdown
%button
.dropdown-menu-toggle.js-milestone-select.js-issue-board-sidebar
{
type:
"button"
,
data:
{
toggle:
"dropdown"
,
show_no:
"true"
,
field_name:
"issue[milestone_id]"
,
milestones:
milestones_filter_path
(
milestone_filter_opts
),
ability_name:
"issue"
,
use_id:
"true"
,
default_no:
"true"
},
%button
.dropdown-menu-toggle.js-milestone-select.js-issue-board-sidebar
{
type:
"button"
,
data:
{
toggle:
"dropdown"
,
show_no:
"true"
,
field_name:
"issue[milestone_id]"
,
milestones:
milestones_filter_path
(
format: :json
),
ability_name:
"issue"
,
use_id:
"true"
,
default_no:
"true"
},
":data-selected"
=>
"milestoneTitle"
,
":data-selected"
=>
"milestoneTitle"
,
":data-issuable-id"
=>
"issue.iid"
,
":data-issuable-id"
=>
"issue.iid"
,
":data-issue-update"
=>
"'#{build_issue_link_base}/' + issue.iid + '.json'"
}
":data-issue-update"
=>
"'#{build_issue_link_base}/' + issue.iid + '.json'"
}
...
...
ee/app/models/ee/board.rb
View file @
acba6dc3
...
@@ -9,6 +9,10 @@ module EE
...
@@ -9,6 +9,10 @@ module EE
validates
:group
,
presence:
true
,
unless: :project
validates
:group
,
presence:
true
,
unless: :project
end
end
def
project_needed?
!
group
end
def
milestone
def
milestone
return
nil
unless
parent
.
feature_available?
(
:issue_board_milestone
)
return
nil
unless
parent
.
feature_available?
(
:issue_board_milestone
)
...
...
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