summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/assets/javascripts/boards/boards_bundle.js.es612
-rw-r--r--app/assets/javascripts/boards/models/list.js.es621
-rw-r--r--app/assets/javascripts/boards/stores/boards_store.js.es62
3 files changed, 15 insertions, 20 deletions
diff --git a/app/assets/javascripts/boards/boards_bundle.js.es6 b/app/assets/javascripts/boards/boards_bundle.js.es6
index cb41d5f5864..ec48c8afcd2 100644
--- a/app/assets/javascripts/boards/boards_bundle.js.es6
+++ b/app/assets/javascripts/boards/boards_bundle.js.es6
@@ -88,17 +88,7 @@ $(() => {
if (list) {
// If list already exists, update the data
- list.title = board.title;
-
- if (board.position !== null) {
- list.position = board.position;
- }
-
- if (list.label) {
- list.label.description = board.label.description;
- list.label.color = board.label.color;
- list.label.textColor = board.label.text_color;
- }
+ list.setData(board);
} else {
// If list doesn't exist, create a new list
Store.addList(board);
diff --git a/app/assets/javascripts/boards/models/list.js.es6 b/app/assets/javascripts/boards/models/list.js.es6
index 00b533a11b9..201df0160bb 100644
--- a/app/assets/javascripts/boards/models/list.js.es6
+++ b/app/assets/javascripts/boards/models/list.js.es6
@@ -3,7 +3,6 @@ class List {
constructor (obj) {
this.id = obj.id;
this._uid = this.guid();
- this.title = obj.title;
this.type = obj.list_type;
this.preset = ['backlog', 'done', 'blank'].indexOf(this.type) > -1;
this.filters = gl.issueBoards.BoardsStore.state.filters;
@@ -22,6 +21,19 @@ class List {
lazyStart: true,
});
+ this.setData(obj);
+
+ if (this.type !== 'blank' && this.id) {
+ this.getIssues()
+ .then(() => {
+ this._interval.start();
+ });
+ }
+ }
+
+ setData(obj) {
+ this.title = obj.title;
+
if (this.type === 'done') {
this.position = Infinity;
} else if (this.type === 'backlog') {
@@ -33,13 +45,6 @@ class List {
if (obj.label) {
this.label = new ListLabel(obj.label);
}
-
- if (this.type !== 'blank' && this.id) {
- this.getIssues()
- .then(() => {
- this._interval.start();
- });
- }
}
guid() {
diff --git a/app/assets/javascripts/boards/stores/boards_store.js.es6 b/app/assets/javascripts/boards/stores/boards_store.js.es6
index fd1140606c9..93b0c8b0d9f 100644
--- a/app/assets/javascripts/boards/stores/boards_store.js.es6
+++ b/app/assets/javascripts/boards/stores/boards_store.js.es6
@@ -21,7 +21,7 @@
milestone_title: gl.utils.getParameterValues('milestone_title')[0],
label_name: gl.utils.getParameterValues('label_name[]'),
search: '',
- per_page: 20
+ per_page: 20,
};
},
addList (listObj) {