diff --git a/app/assets/javascripts/boards/models/label.js.es6 b/app/assets/javascripts/boards/models/label.js.es6 index e81e91fe972f0d9f528cbfe7ea92d40f293d1564..583829552cd398347d95bb32b0a2bcf6481d43cf 100644 --- a/app/assets/javascripts/boards/models/label.js.es6 +++ b/app/assets/javascripts/boards/models/label.js.es6 @@ -3,6 +3,7 @@ class ListLabel { this.id = obj.id; this.title = obj.title; this.color = obj.color; + this.textColor = obj.text_color; this.description = obj.description; this.priority = (obj.priority !== null) ? obj.priority : Infinity; } diff --git a/app/controllers/projects/boards/issues_controller.rb b/app/controllers/projects/boards/issues_controller.rb index 2d894b3dd4ab26a038be16401b30cd01bb1b87bf..1a4f6b50e8f4b2fe72f2354d65c47be8711acb0a 100644 --- a/app/controllers/projects/boards/issues_controller.rb +++ b/app/controllers/projects/boards/issues_controller.rb @@ -12,7 +12,7 @@ module Projects only: [:iid, :title, :confidential], include: { assignee: { only: [:id, :name, :username], methods: [:avatar_url] }, - labels: { only: [:id, :title, :description, :color, :priority] } + labels: { only: [:id, :title, :description, :color, :priority], methods: [:text_color] } }) end diff --git a/spec/fixtures/api/schemas/issue.json b/spec/fixtures/api/schemas/issue.json index 299e4675d6f9dff3fc39801128fb7d5933379c09..532ebb9640e86aa0e6cc9b47d1ae6676fe6225a7 100644 --- a/spec/fixtures/api/schemas/issue.json +++ b/spec/fixtures/api/schemas/issue.json @@ -10,23 +10,31 @@ "title": { "type": "string" }, "confidential": { "type": "boolean" }, "labels": { - "type": ["array"], - "required": [ - "id", - "color", - "description", - "title", - "priority" - ], - "properties": { - "id": { "type": "integer" }, - "color": { - "type": "string", - "pattern": "^#[0-9A-Fa-f]{3}{1,2}+$" + "type": "array", + "items": { + "type": "object", + "required": [ + "id", + "color", + "description", + "title", + "priority" + ], + "properties": { + "id": { "type": "integer" }, + "color": { + "type": "string", + "pattern": "^#[0-9A-Fa-f]{3}{1,2}+$" + }, + "description": { "type": ["string", "null"] }, + "text_color": { + "type": "string", + "pattern": "^#[0-9A-Fa-f]{3}{1,2}+$" + }, + "title": { "type": "string" }, + "priority": { "type": ["integer", "null"] } }, - "description": { "type": ["string", "null"] }, - "title": { "type": "string" }, - "priority": { "type": ["integer", "null"] } + "additionalProperties": false } }, "assignee": {