From 314fbd4091ac2e305d6bab1259c7a53271b3a247 Mon Sep 17 00:00:00 2001 From: Tucker Chapman Date: Tue, 23 Apr 2019 13:13:40 +0000 Subject: [PATCH] Fix issue with list label text color --- app/assets/javascripts/boards/models/list.js | 1 + changelogs/unreleased/47584-label-text-color.yml | 5 +++++ spec/javascripts/boards/list_spec.js | 3 +++ spec/javascripts/boards/mock_data.js | 1 + 4 files changed, 10 insertions(+) create mode 100644 changelogs/unreleased/47584-label-text-color.yml diff --git a/app/assets/javascripts/boards/models/list.js b/app/assets/javascripts/boards/models/list.js index 6cf77705847..7e5d0e0f888 100644 --- a/app/assets/javascripts/boards/models/list.js +++ b/app/assets/javascripts/boards/models/list.js @@ -90,6 +90,7 @@ class List { this.id = data.id; this.type = data.list_type; this.position = data.position; + this.label = data.label; return this.getIssues(); }); diff --git a/changelogs/unreleased/47584-label-text-color.yml b/changelogs/unreleased/47584-label-text-color.yml new file mode 100644 index 00000000000..7d5eaa62793 --- /dev/null +++ b/changelogs/unreleased/47584-label-text-color.yml @@ -0,0 +1,5 @@ +--- +title: Resolve issue where list labels did not have the correct text color on creation +merge_request: 26794 +author: Tucker Chapman +type: fixed diff --git a/spec/javascripts/boards/list_spec.js b/spec/javascripts/boards/list_spec.js index 0d462a6f872..bb6fc6c693d 100644 --- a/spec/javascripts/boards/list_spec.js +++ b/spec/javascripts/boards/list_spec.js @@ -45,6 +45,7 @@ describe('List model', () => { id: _.random(10000), title: 'test', color: 'red', + text_color: 'white', }, }); list.save(); @@ -53,6 +54,8 @@ describe('List model', () => { expect(list.id).toBe(listObj.id); expect(list.type).toBe('label'); expect(list.position).toBe(0); + expect(list.label.color).toBe('red'); + expect(list.label.textColor).toBe('white'); done(); }, 0); }); diff --git a/spec/javascripts/boards/mock_data.js b/spec/javascripts/boards/mock_data.js index 14fff9223f4..93a0f29af0a 100644 --- a/spec/javascripts/boards/mock_data.js +++ b/spec/javascripts/boards/mock_data.js @@ -16,6 +16,7 @@ export const listObj = { title: 'Testing', color: 'red', description: 'testing;', + textColor: 'white', }, };