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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
da21119f
Commit
da21119f
authored
Aug 05, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed how the state is created when page is loaded
Removed some un-used data
parent
034f1f07
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
23 deletions
+18
-23
app/assets/javascripts/boards/boards_bundle.js.es6
app/assets/javascripts/boards/boards_bundle.js.es6
+3
-1
app/assets/javascripts/boards/stores/boards_store.js.es6
app/assets/javascripts/boards/stores/boards_store.js.es6
+15
-22
No files found.
app/assets/javascripts/boards/boards_bundle.js.es6
View file @
da21119f
...
@@ -15,7 +15,6 @@ $(function () {
...
@@ -15,7 +15,6 @@ $(function () {
if (gl.IssueBoardsApp) {
if (gl.IssueBoardsApp) {
gl.IssueBoardsApp.$destroy(true);
gl.IssueBoardsApp.$destroy(true);
BoardsStore.reset();
}
}
gl.IssueBoardsApp = new Vue({
gl.IssueBoardsApp = new Vue({
...
@@ -23,6 +22,9 @@ $(function () {
...
@@ -23,6 +22,9 @@ $(function () {
data: {
data: {
state: BoardsStore.state
state: BoardsStore.state
},
},
init: function () {
BoardsStore.create();
},
ready: function () {
ready: function () {
gl.boardService.all()
gl.boardService.all()
.then((resp) => {
.then((resp) => {
...
...
app/assets/javascripts/boards/stores/boards_store.js.es6
View file @
da21119f
((w) => {
((w) => {
w.BoardsStore = {
w.BoardsStore = {
state: {
state: {},
lists: [],
create: function () {
filters: {
this.state.lists = [];
this.state.filters = {
author_id: gl.utils.getParameterValues('author_id')[0],
author_id: gl.utils.getParameterValues('author_id')[0],
assignee_id: gl.utils.getParameterValues('assignee_id')[0],
assignee_id: gl.utils.getParameterValues('assignee_id')[0],
milestone_title: gl.utils.getParameterValues('milestone_title')[0],
milestone_title: gl.utils.getParameterValues('milestone_title')[0],
label_name: gl.utils.getParameterValues('label_name[]')
label_name: gl.utils.getParameterValues('label_name[]')
}
},
reset: function () {
this.state.lists = [];
this.state.filters = {
author: {},
assignee: {},
milestone: {},
label: []
};
};
},
},
new: function (board, persist = true) {
new: function (board, persist = true) {
...
@@ -26,7 +18,6 @@
...
@@ -26,7 +18,6 @@
if (persist) {
if (persist) {
list.save();
list.save();
this.removeBlankState();
this.removeBlankState();
this.addBlankState();
}
}
return list;
return list;
...
@@ -44,10 +35,9 @@
...
@@ -44,10 +35,9 @@
return addBlankState;
return addBlankState;
},
},
addBlankState: function () {
addBlankState: function () {
if ($.cookie('issue_board_welcome_hidden') === 'true') return
;
const addBlankState = this.shouldAddBlankState()
;
const doneList = this.getDoneList(),
if (this.welcomeIsHidden()) return;
addBlankState = this.shouldAddBlankState();
if (addBlankState) {
if (addBlankState) {
this.new({
this.new({
...
@@ -59,13 +49,17 @@
...
@@ -59,13 +49,17 @@
}
}
},
},
removeBlankState: function () {
removeBlankState: function () {
if ($.cookie('issue_board_welcome_hidden') === 'true') return;
if (this.welcomeIsHidden()) return;
this.removeList('blank');
this.removeList('blank');
$.cookie('issue_board_welcome_hidden', 'true', {
$.cookie('issue_board_welcome_hidden', 'true', {
expires: 365 * 10
expires: 365 * 10
});
});
},
},
welcomeIsHidden: function () {
return $.cookie('issue_board_welcome_hidden') === 'true';
},
getDoneList: function () {
getDoneList: function () {
return this.findList('type', 'done');
return this.findList('type', 'done');
},
},
...
@@ -99,15 +93,14 @@
...
@@ -99,15 +93,14 @@
issueTo = listTo.findIssue(issueId);
issueTo = listTo.findIssue(issueId);
let issue = listFrom.findIssue(issueId);
let issue = listFrom.findIssue(issueId);
const issueLists = issue.getLists(),
const issueLists = issue.getLists(),
issue
Labels = issueLists.map(function (issue) {
list
Labels = issueLists.map(function (issue) {
return issue.label;
return issue.label;
});
});
listFrom.removeIssue(issue);
listFrom.removeIssue(issue);
// Add to new lists issues if it doesn't already exist
// Add to new lists issues if it doesn't already exist
if (issueTo) {
if (!issueTo) {
listTo.removeIssue(issueTo);
} else {
listTo.addIssue(issue, listFrom);
listTo.addIssue(issue, listFrom);
}
}
...
@@ -115,7 +108,7 @@
...
@@ -115,7 +108,7 @@
issueLists.forEach((list) => {
issueLists.forEach((list) => {
list.removeIssue(issue);
list.removeIssue(issue);
});
});
issue.removeLabels(
issue
Labels);
issue.removeLabels(
list
Labels);
}
}
},
},
findList: function (key, val) {
findList: function (key, val) {
...
...
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