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
2a5ca841
Commit
2a5ca841
authored
Feb 12, 2019
by
Robert Schilling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
API: Expose text_color for project and group labels
parent
7a8f8714
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
25 additions
and
2 deletions
+25
-2
changelogs/unreleased/50006-expose-textcolor-from-public-labels-api.yml
...eleased/50006-expose-textcolor-from-public-labels-api.yml
+5
-0
doc/api/group_labels.md
doc/api/group_labels.md
+6
-0
doc/api/labels.md
doc/api/labels.md
+8
-0
lib/api/entities.rb
lib/api/entities.rb
+1
-1
spec/fixtures/api/schemas/public_api/v4/group_labels.json
spec/fixtures/api/schemas/public_api/v4/group_labels.json
+1
-0
spec/requests/api/labels_spec.rb
spec/requests/api/labels_spec.rb
+4
-1
No files found.
changelogs/unreleased/50006-expose-textcolor-from-public-labels-api.yml
0 → 100644
View file @
2a5ca841
---
title
:
'
API:
Expose
text_color
for
project
and
group
labels'
merge_request
:
25172
author
:
Robert Schilling
type
:
added
doc/api/group_labels.md
View file @
2a5ca841
...
@@ -28,6 +28,7 @@ Example response:
...
@@ -28,6 +28,7 @@ Example response:
"id"
:
7
,
"id"
:
7
,
"name"
:
"bug"
,
"name"
:
"bug"
,
"color"
:
"#FF0000"
,
"color"
:
"#FF0000"
,
"text_color"
:
"#FFFFFF"
,
"description"
:
null
,
"description"
:
null
,
"open_issues_count"
:
0
,
"open_issues_count"
:
0
,
"closed_issues_count"
:
0
,
"closed_issues_count"
:
0
,
...
@@ -38,6 +39,7 @@ Example response:
...
@@ -38,6 +39,7 @@ Example response:
"id"
:
4
,
"id"
:
4
,
"name"
:
"feature"
,
"name"
:
"feature"
,
"color"
:
"#228B22"
,
"color"
:
"#228B22"
,
"text_color"
:
"#FFFFFF"
,
"description"
:
null
,
"description"
:
null
,
"open_issues_count"
:
0
,
"open_issues_count"
:
0
,
"closed_issues_count"
:
0
,
"closed_issues_count"
:
0
,
...
@@ -73,6 +75,7 @@ Example response:
...
@@ -73,6 +75,7 @@ Example response:
"id"
:
9
,
"id"
:
9
,
"name"
:
"Feature Proposal"
,
"name"
:
"Feature Proposal"
,
"color"
:
"#FFA500"
,
"color"
:
"#FFA500"
,
"text_color"
:
"#FFFFFF"
,
"description"
:
"Describes new ideas"
,
"description"
:
"Describes new ideas"
,
"open_issues_count"
:
0
,
"open_issues_count"
:
0
,
"closed_issues_count"
:
0
,
"closed_issues_count"
:
0
,
...
@@ -108,6 +111,7 @@ Example response:
...
@@ -108,6 +111,7 @@ Example response:
"id"
:
9
,
"id"
:
9
,
"name"
:
"Feature Idea"
,
"name"
:
"Feature Idea"
,
"color"
:
"#FFA500"
,
"color"
:
"#FFA500"
,
"text_color"
:
"#FFFFFF"
,
"description"
:
"Describes new ideas"
,
"description"
:
"Describes new ideas"
,
"open_issues_count"
:
0
,
"open_issues_count"
:
0
,
"closed_issues_count"
:
0
,
"closed_issues_count"
:
0
,
...
@@ -158,6 +162,7 @@ Example response:
...
@@ -158,6 +162,7 @@ Example response:
"id"
:
9
,
"id"
:
9
,
"name"
:
"Feature Idea"
,
"name"
:
"Feature Idea"
,
"color"
:
"#FFA500"
,
"color"
:
"#FFA500"
,
"text_color"
:
"#FFFFFF"
,
"description"
:
"Describes new ideas"
,
"description"
:
"Describes new ideas"
,
"open_issues_count"
:
0
,
"open_issues_count"
:
0
,
"closed_issues_count"
:
0
,
"closed_issues_count"
:
0
,
...
@@ -192,6 +197,7 @@ Example response:
...
@@ -192,6 +197,7 @@ Example response:
"id"
:
9
,
"id"
:
9
,
"name"
:
"Feature Idea"
,
"name"
:
"Feature Idea"
,
"color"
:
"#FFA500"
,
"color"
:
"#FFA500"
,
"text_color"
:
"#FFFFFF"
,
"description"
:
"Describes new ideas"
,
"description"
:
"Describes new ideas"
,
"open_issues_count"
:
0
,
"open_issues_count"
:
0
,
"closed_issues_count"
:
0
,
"closed_issues_count"
:
0
,
...
...
doc/api/labels.md
View file @
2a5ca841
...
@@ -24,6 +24,7 @@ Example response:
...
@@ -24,6 +24,7 @@ Example response:
"id"
:
1
,
"id"
:
1
,
"name"
:
"bug"
,
"name"
:
"bug"
,
"color"
:
"#d9534f"
,
"color"
:
"#d9534f"
,
"text_color"
:
"#FFFFFF"
,
"description"
:
"Bug reported by user"
,
"description"
:
"Bug reported by user"
,
"open_issues_count"
:
1
,
"open_issues_count"
:
1
,
"closed_issues_count"
:
0
,
"closed_issues_count"
:
0
,
...
@@ -34,6 +35,7 @@ Example response:
...
@@ -34,6 +35,7 @@ Example response:
{
{
"id"
:
4
,
"id"
:
4
,
"color"
:
"#d9534f"
,
"color"
:
"#d9534f"
,
"text_color"
:
"#FFFFFF"
,
"name"
:
"confirmed"
,
"name"
:
"confirmed"
,
"description"
:
"Confirmed issue"
,
"description"
:
"Confirmed issue"
,
"open_issues_count"
:
2
,
"open_issues_count"
:
2
,
...
@@ -46,6 +48,7 @@ Example response:
...
@@ -46,6 +48,7 @@ Example response:
"id"
:
7
,
"id"
:
7
,
"name"
:
"critical"
,
"name"
:
"critical"
,
"color"
:
"#d9534f"
,
"color"
:
"#d9534f"
,
"text_color"
:
"#FFFFFF"
,
"description"
:
"Critical issue. Need fix ASAP"
,
"description"
:
"Critical issue. Need fix ASAP"
,
"open_issues_count"
:
1
,
"open_issues_count"
:
1
,
"closed_issues_count"
:
3
,
"closed_issues_count"
:
3
,
...
@@ -57,6 +60,7 @@ Example response:
...
@@ -57,6 +60,7 @@ Example response:
"id"
:
8
,
"id"
:
8
,
"name"
:
"documentation"
,
"name"
:
"documentation"
,
"color"
:
"#f0ad4e"
,
"color"
:
"#f0ad4e"
,
"text_color"
:
"#FFFFFF"
,
"description"
:
"Issue about documentation"
,
"description"
:
"Issue about documentation"
,
"open_issues_count"
:
1
,
"open_issues_count"
:
1
,
"closed_issues_count"
:
0
,
"closed_issues_count"
:
0
,
...
@@ -67,6 +71,7 @@ Example response:
...
@@ -67,6 +71,7 @@ Example response:
{
{
"id"
:
9
,
"id"
:
9
,
"color"
:
"#5cb85c"
,
"color"
:
"#5cb85c"
,
"text_color"
:
"#FFFFFF"
,
"name"
:
"enhancement"
,
"name"
:
"enhancement"
,
"description"
:
"Enhancement proposal"
,
"description"
:
"Enhancement proposal"
,
"open_issues_count"
:
1
,
"open_issues_count"
:
1
,
...
@@ -105,6 +110,7 @@ Example response:
...
@@ -105,6 +110,7 @@ Example response:
"id"
:
10
,
"id"
:
10
,
"name"
:
"feature"
,
"name"
:
"feature"
,
"color"
:
"#5843AD"
,
"color"
:
"#5843AD"
,
"text_color"
:
"#FFFFFF"
,
"description"
:
null
,
"description"
:
null
,
"open_issues_count"
:
0
,
"open_issues_count"
:
0
,
"closed_issues_count"
:
0
,
"closed_issues_count"
:
0
,
...
@@ -161,6 +167,7 @@ Example response:
...
@@ -161,6 +167,7 @@ Example response:
"id"
:
8
,
"id"
:
8
,
"name"
:
"docs"
,
"name"
:
"docs"
,
"color"
:
"#8E44AD"
,
"color"
:
"#8E44AD"
,
"text_color"
:
"#FFFFFF"
,
"description"
:
"Documentation"
,
"description"
:
"Documentation"
,
"open_issues_count"
:
1
,
"open_issues_count"
:
1
,
"closed_issues_count"
:
0
,
"closed_issues_count"
:
0
,
...
@@ -196,6 +203,7 @@ Example response:
...
@@ -196,6 +203,7 @@ Example response:
"id"
:
1
,
"id"
:
1
,
"name"
:
"bug"
,
"name"
:
"bug"
,
"color"
:
"#d9534f"
,
"color"
:
"#d9534f"
,
"text_color"
:
"#FFFFFF"
,
"description"
:
"Bug reported by user"
,
"description"
:
"Bug reported by user"
,
"open_issues_count"
:
1
,
"open_issues_count"
:
1
,
"closed_issues_count"
:
0
,
"closed_issues_count"
:
0
,
...
...
lib/api/entities.rb
View file @
2a5ca841
...
@@ -1003,7 +1003,7 @@ module API
...
@@ -1003,7 +1003,7 @@ module API
end
end
class
LabelBasic
<
Grape
::
Entity
class
LabelBasic
<
Grape
::
Entity
expose
:id
,
:name
,
:color
,
:description
expose
:id
,
:name
,
:color
,
:description
,
:text_color
end
end
class
Label
<
LabelBasic
class
Label
<
LabelBasic
...
...
spec/fixtures/api/schemas/public_api/v4/group_labels.json
View file @
2a5ca841
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
"id"
:
{
"type"
:
"integer"
},
"id"
:
{
"type"
:
"integer"
},
"name"
:
{
"type"
:
"string "
},
"name"
:
{
"type"
:
"string "
},
"color"
:
{
"type"
:
"string "
},
"color"
:
{
"type"
:
"string "
},
"text_color"
:
{
"type"
:
"string "
},
"description"
:
{
"type"
:
"string "
},
"description"
:
{
"type"
:
"string "
},
"open_issues_count"
:
{
"type"
:
"integer "
},
"open_issues_count"
:
{
"type"
:
"integer "
},
"closed_issues_count"
:
{
"type"
:
"integer "
},
"closed_issues_count"
:
{
"type"
:
"integer "
},
...
...
spec/requests/api/labels_spec.rb
View file @
2a5ca841
...
@@ -20,7 +20,7 @@ describe API::Labels do
...
@@ -20,7 +20,7 @@ describe API::Labels do
create
(
:labeled_merge_request
,
labels:
[
priority_label
],
author:
user
,
source_project:
project
)
create
(
:labeled_merge_request
,
labels:
[
priority_label
],
author:
user
,
source_project:
project
)
expected_keys
=
%w(
expected_keys
=
%w(
id name color description
id name color
text_color
description
open_issues_count closed_issues_count open_merge_requests_count
open_issues_count closed_issues_count open_merge_requests_count
subscribed priority
subscribed priority
)
)
...
@@ -43,6 +43,7 @@ describe API::Labels do
...
@@ -43,6 +43,7 @@ describe API::Labels do
expect
(
label1_response
[
'open_merge_requests_count'
]).
to
eq
(
0
)
expect
(
label1_response
[
'open_merge_requests_count'
]).
to
eq
(
0
)
expect
(
label1_response
[
'name'
]).
to
eq
(
label1
.
name
)
expect
(
label1_response
[
'name'
]).
to
eq
(
label1
.
name
)
expect
(
label1_response
[
'color'
]).
to
be_present
expect
(
label1_response
[
'color'
]).
to
be_present
expect
(
label1_response
[
'text_color'
]).
to
be_present
expect
(
label1_response
[
'description'
]).
to
be_nil
expect
(
label1_response
[
'description'
]).
to
be_nil
expect
(
label1_response
[
'priority'
]).
to
be_nil
expect
(
label1_response
[
'priority'
]).
to
be_nil
expect
(
label1_response
[
'subscribed'
]).
to
be_falsey
expect
(
label1_response
[
'subscribed'
]).
to
be_falsey
...
@@ -52,6 +53,7 @@ describe API::Labels do
...
@@ -52,6 +53,7 @@ describe API::Labels do
expect
(
group_label_response
[
'open_merge_requests_count'
]).
to
eq
(
0
)
expect
(
group_label_response
[
'open_merge_requests_count'
]).
to
eq
(
0
)
expect
(
group_label_response
[
'name'
]).
to
eq
(
group_label
.
name
)
expect
(
group_label_response
[
'name'
]).
to
eq
(
group_label
.
name
)
expect
(
group_label_response
[
'color'
]).
to
be_present
expect
(
group_label_response
[
'color'
]).
to
be_present
expect
(
group_label_response
[
'text_color'
]).
to
be_present
expect
(
group_label_response
[
'description'
]).
to
be_nil
expect
(
group_label_response
[
'description'
]).
to
be_nil
expect
(
group_label_response
[
'priority'
]).
to
be_nil
expect
(
group_label_response
[
'priority'
]).
to
be_nil
expect
(
group_label_response
[
'subscribed'
]).
to
be_falsey
expect
(
group_label_response
[
'subscribed'
]).
to
be_falsey
...
@@ -61,6 +63,7 @@ describe API::Labels do
...
@@ -61,6 +63,7 @@ describe API::Labels do
expect
(
priority_label_response
[
'open_merge_requests_count'
]).
to
eq
(
1
)
expect
(
priority_label_response
[
'open_merge_requests_count'
]).
to
eq
(
1
)
expect
(
priority_label_response
[
'name'
]).
to
eq
(
priority_label
.
name
)
expect
(
priority_label_response
[
'name'
]).
to
eq
(
priority_label
.
name
)
expect
(
priority_label_response
[
'color'
]).
to
be_present
expect
(
priority_label_response
[
'color'
]).
to
be_present
expect
(
priority_label_response
[
'text_color'
]).
to
be_present
expect
(
priority_label_response
[
'description'
]).
to
be_nil
expect
(
priority_label_response
[
'description'
]).
to
be_nil
expect
(
priority_label_response
[
'priority'
]).
to
eq
(
3
)
expect
(
priority_label_response
[
'priority'
]).
to
eq
(
3
)
expect
(
priority_label_response
[
'subscribed'
]).
to
be_falsey
expect
(
priority_label_response
[
'subscribed'
]).
to
be_falsey
...
...
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