BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
cd6285d2
Commit
cd6285d2
authored
Aug 12, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removes checkmarks from new list dropdown when deleting list
parent
86a6d4d8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
13 deletions
+20
-13
new_list_dropdown.js.es6
...ts/javascripts/boards/components/new_list_dropdown.js.es6
+2
-1
list.js.es6
app/assets/javascripts/boards/models/list.js.es6
+1
-1
boards_store.js.es6
app/assets/javascripts/boards/stores/boards_store.js.es6
+3
-11
boards_spec.rb
spec/features/boards/boards_spec.rb
+14
-0
No files found.
app/assets/javascripts/boards/components/new_list_dropdown.js.es6
View file @
cd6285d2
...
@@ -16,7 +16,7 @@ $(() => {
...
@@ -16,7 +16,7 @@ $(() => {
const active = BoardsStore.findList('title', label.title),
const active = BoardsStore.findList('title', label.title),
$li = $('<li />',),
$li = $('<li />',),
$a = $('<a />', {
$a = $('<a />', {
class: (active ?
'is-active'
: ''),
class: (active ?
`is-active js-board-list-${active.id}`
: ''),
text: label.title,
text: label.title,
href: '#'
href: '#'
}),
}),
...
@@ -39,6 +39,7 @@ $(() => {
...
@@ -39,6 +39,7 @@ $(() => {
BoardsStore.new({
BoardsStore.new({
title: label.title,
title: label.title,
position: BoardsStore.state.lists.length - 1,
position: BoardsStore.state.lists.length - 1,
list_type: 'label',
label: {
label: {
id: label.id,
id: label.id,
title: label.title,
title: label.title,
...
...
app/assets/javascripts/boards/models/list.js.es6
View file @
cd6285d2
...
@@ -36,7 +36,7 @@ class List {
...
@@ -36,7 +36,7 @@ class List {
BoardsStore.state.lists = BoardsStore.state.lists.filter((list) => {
BoardsStore.state.lists = BoardsStore.state.lists.filter((list) => {
return list.id !== this.id;
return list.id !== this.id;
});
});
BoardsStore.updateNewListDropdown();
BoardsStore.updateNewListDropdown(
this.id
);
gl.boardService.destroyList(this.id);
gl.boardService.destroyList(this.id);
}
}
...
...
app/assets/javascripts/boards/stores/boards_store.js.es6
View file @
cd6285d2
...
@@ -33,16 +33,8 @@
...
@@ -33,16 +33,8 @@
});
});
this.removeBlankState();
this.removeBlankState();
},
},
updateNewListDropdown () {
updateNewListDropdown (listId) {
const glDropdown = $('.js-new-board-list').data('glDropdown');
$(`.js-board-list-${listId}`).removeClass('is-active');
if (glDropdown) {
const renderedData = glDropdown.renderedData;
if (renderedData) {
glDropdown.renderData(renderedData);
}
}
},
},
shouldAddBlankState () {
shouldAddBlankState () {
// Decide whether to add the blank state
// Decide whether to add the blank state
...
@@ -126,7 +118,7 @@
...
@@ -126,7 +118,7 @@
findList (key, val, type = 'label') {
findList (key, val, type = 'label') {
return this.state.lists.filter((list) => {
return this.state.lists.filter((list) => {
const byType = type ? list['type'] === type : true;
const byType = type ? list['type'] === type : true;
return list[key] === val && byType;
return list[key] === val && byType;
})[0];
})[0];
},
},
...
...
spec/features/boards/boards_spec.rb
View file @
cd6285d2
require
'rails_helper'
require
'rails_helper'
describe
'Issue Boards'
,
feature:
true
,
js:
true
do
describe
'Issue Boards'
,
feature:
true
,
js:
true
do
include
WaitForAjax
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
let!
(
:user2
)
{
create
(
:user
)
}
let!
(
:user2
)
{
create
(
:user
)
}
...
@@ -102,6 +104,18 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -102,6 +104,18 @@ describe 'Issue Boards', feature: true, js: true do
expect
(
page
).
to
have_selector
(
'.board'
,
count:
3
)
expect
(
page
).
to
have_selector
(
'.board'
,
count:
3
)
end
end
it
'removes checkmark in new list dropdown after deleting'
do
click_button
'Create new list'
wait_for_ajax
page
.
within
(
all
(
'.board'
)[
1
])
do
find
(
'.board-delete'
).
click
end
expect
(
page
).
to
have_selector
(
'.board'
,
count:
3
)
expect
(
find
(
".js-board-list-
#{
planning
.
id
}
"
,
visible:
false
)).
not_to
have_css
(
'.is-active'
)
end
it
'infinite scrolls list'
do
it
'infinite scrolls list'
do
50
.
times
do
50
.
times
do
create
(
:issue
,
project:
project
)
create
(
:issue
,
project:
project
)
...
...
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