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
839b38ac
Commit
839b38ac
authored
Oct 18, 2018
by
Brett Walker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dynamically store the valid label endpoint
parent
277a1747
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
4 deletions
+7
-4
app/assets/javascripts/boards/models/issue.js
app/assets/javascripts/boards/models/issue.js
+1
-0
app/assets/javascripts/labels_select.js
app/assets/javascripts/labels_select.js
+1
-1
app/models/issue.rb
app/models/issue.rb
+2
-1
app/views/shared/boards/components/sidebar/_labels.html.haml
app/views/shared/boards/components/sidebar/_labels.html.haml
+2
-2
spec/fixtures/api/schemas/issue.json
spec/fixtures/api/schemas/issue.json
+1
-0
No files found.
app/assets/javascripts/boards/models/issue.js
View file @
839b38ac
...
...
@@ -29,6 +29,7 @@ class ListIssue {
this
.
path
=
obj
.
real_path
;
this
.
toggleSubscriptionEndpoint
=
obj
.
toggle_subscription_endpoint
;
this
.
project_id
=
obj
.
project_id
;
this
.
validLabelsEndpoint
=
obj
.
valid_labels_endpoint
;
if
(
obj
.
project
)
{
this
.
project
=
new
IssueProject
(
obj
.
project
);
...
...
app/assets/javascripts/labels_select.js
View file @
839b38ac
...
...
@@ -59,7 +59,6 @@ export default class LabelsSelect {
$toggleText
=
$dropdown
.
find
(
'
.dropdown-toggle-text
'
);
namespacePath
=
$dropdown
.
data
(
'
namespacePath
'
);
projectPath
=
$dropdown
.
data
(
'
projectPath
'
);
labelUrl
=
$dropdown
.
data
(
'
labels
'
);
issueUpdateURL
=
$dropdown
.
data
(
'
issueUpdate
'
);
selectedLabel
=
$dropdown
.
data
(
'
selected
'
);
if
(
selectedLabel
!=
null
&&
!
$dropdown
.
hasClass
(
'
js-multiselect
'
))
{
...
...
@@ -168,6 +167,7 @@ export default class LabelsSelect {
$dropdown
.
glDropdown
({
showMenuAbove
:
showMenuAbove
,
data
:
function
(
term
,
callback
)
{
labelUrl
=
$dropdown
.
attr
(
'
data-labels
'
);
axios
.
get
(
labelUrl
)
.
then
(
res
=>
{
...
...
app/models/issue.rb
View file @
839b38ac
...
...
@@ -240,7 +240,8 @@ class Issue < ActiveRecord::Base
reference_path:
issue_reference
,
real_path:
url_helper
.
project_issue_path
(
project
,
self
),
issue_sidebar_endpoint:
url_helper
.
project_issue_path
(
project
,
self
,
format: :json
,
serializer:
'sidebar'
),
toggle_subscription_endpoint:
url_helper
.
toggle_subscription_project_issue_path
(
project
,
self
)
toggle_subscription_endpoint:
url_helper
.
toggle_subscription_project_issue_path
(
project
,
self
),
valid_labels_endpoint:
url_helper
.
project_labels_path
(
project
,
format: :json
,
include_ancestor_groups:
true
)
)
end
...
...
app/views/shared/boards/components/sidebar/_labels.html.haml
View file @
839b38ac
...
...
@@ -19,13 +19,13 @@
":value"
=>
"label.id"
}
.dropdown
%button
.dropdown-menu-toggle.js-label-select.js-multiselect.js-issue-board-sidebar
{
type:
"button"
,
"v-bind:data-selected"
=>
"selectedLabels"
,
":data-selected"
=>
"selectedLabels"
,
":data-labels"
=>
"issue.validLabelsEndpoint"
,
data:
{
toggle:
"dropdown"
,
field_name:
"issue[label_names][]"
,
show_no:
"true"
,
show_any:
"true"
,
project_id:
@project
&
.
try
(
:id
),
labels:
labels_filter_path_with_defaults
,
namespace_path:
@namespace_path
,
project_path:
@project
.
try
(
:path
)
}
}
%span
.dropdown-toggle-text
...
...
spec/fixtures/api/schemas/issue.json
View file @
839b38ac
...
...
@@ -16,6 +16,7 @@
"relative_position"
:
{
"type"
:
"integer"
},
"issue_sidebar_endpoint"
:
{
"type"
:
"string"
},
"toggle_subscription_endpoint"
:
{
"type"
:
"string"
},
"valid_labels_endpoint"
:
{
"type"
:
"string"
},
"reference_path"
:
{
"type"
:
"string"
},
"real_path"
:
{
"type"
:
"string"
},
"project"
:
{
...
...
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