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
Boxiang Sun
gitlab-ce
Commits
aaf176f2
Commit
aaf176f2
authored
Aug 08, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updates new dropdown list when removing lists
parent
9982dc1d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
14 deletions
+22
-14
app/assets/javascripts/boards/components/new_list_dropdown.js.es6
...ts/javascripts/boards/components/new_list_dropdown.js.es6
+14
-13
app/assets/javascripts/boards/stores/boards_store.js.es6
app/assets/javascripts/boards/stores/boards_store.js.es6
+7
-0
app/views/shared/issuable/_filter.html.haml
app/views/shared/issuable/_filter.html.haml
+1
-1
No files found.
app/assets/javascripts/boards/components/new_list_dropdown.js.es6
View file @
aaf176f2
...
...
@@ -11,11 +11,10 @@ $(() => {
});
},
renderRow: (label) => {
const isHidden = BoardsStore.findList('title', label.title),
$li = $('<li />', {
class: (isHidden ? 'hidden' : '')
}),
const active = BoardsStore.findList('title', label.title),
$li = $('<li />',),
$a = $('<a />', {
class: (active ? 'is-active' : ''),
text: label.title,
href: '#'
}),
...
...
@@ -33,6 +32,8 @@ $(() => {
selectable: true,
clicked: (label, $el, e) => {
e.preventDefault();
if (!BoardsStore.findList('title', label.title)) {
BoardsStore.new({
title: label.title,
position: BoardsStore.state.lists.length - 1,
...
...
@@ -40,10 +41,10 @@ $(() => {
id: label.id,
title: label.title,
color: label.color
},
issues: []
}
});
}
}
});
});
});
app/assets/javascripts/boards/stores/boards_store.js.es6
View file @
aaf176f2
...
...
@@ -18,10 +18,15 @@
if (persist) {
list.save();
this.removeBlankState();
this.updateNewListDropdown();
}
return list;
},
updateNewListDropdown: function () {
const data = $('.js-new-board-list').data('glDropdown').renderedData;
$('.js-new-board-list').data('glDropdown').renderData(data);
},
shouldAddBlankState: function () {
// Decide whether to add the blank state
let addBlankState = true;
...
...
@@ -73,6 +78,8 @@
this.state.lists = _.reject(this.state.lists, (list) => {
return list.id === id;
});
this.updateNewListDropdown();
},
moveList: function (oldIndex, newIndex) {
const listFrom = this.findList('position', oldIndex),
...
...
app/views/shared/issuable/_filter.html.haml
View file @
aaf176f2
...
...
@@ -33,7 +33,7 @@
.dropdown
%button
.btn.btn-create.js-new-board-list
{
type:
"button"
,
data:
{
toggle:
"dropdown"
,
labels:
labels_filter_path
}
}
Create new list
.dropdown-menu.dropdown-menu-paging.dropdown-menu-align-right.dropdown-menu-issues-board-new
.dropdown-menu.dropdown-menu-paging.dropdown-menu-align-right.dropdown-menu-issues-board-new
.dropdown-menu-selectable
=
render
partial:
"shared/issuable/label_page_default"
,
locals:
{
show_footer:
true
,
show_create:
true
,
show_boards_content:
true
,
title:
"Create a new list"
}
-
if
can?
(
current_user
,
:admin_label
,
@project
)
=
render
partial:
"shared/issuable/label_page_create"
...
...
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