Commit cd6285d2 authored by Phil Hughes's avatar Phil Hughes

Removes checkmarks from new list dropdown when deleting list

parent 86a6d4d8
......@@ -16,7 +16,7 @@ $(() => {
const active = BoardsStore.findList('title', label.title),
$li = $('<li />',),
$a = $('<a />', {
class: (active ? 'is-active' : ''),
class: (active ? `is-active js-board-list-${active.id}` : ''),
text: label.title,
href: '#'
}),
......@@ -39,6 +39,7 @@ $(() => {
BoardsStore.new({
title: label.title,
position: BoardsStore.state.lists.length - 1,
list_type: 'label',
label: {
id: label.id,
title: label.title,
......
......@@ -36,7 +36,7 @@ class List {
BoardsStore.state.lists = BoardsStore.state.lists.filter((list) => {
return list.id !== this.id;
});
BoardsStore.updateNewListDropdown();
BoardsStore.updateNewListDropdown(this.id);
gl.boardService.destroyList(this.id);
}
......
......@@ -33,16 +33,8 @@
});
this.removeBlankState();
},
updateNewListDropdown () {
const glDropdown = $('.js-new-board-list').data('glDropdown');
if (glDropdown) {
const renderedData = glDropdown.renderedData;
if (renderedData) {
glDropdown.renderData(renderedData);
}
}
updateNewListDropdown (listId) {
$(`.js-board-list-${listId}`).removeClass('is-active');
},
shouldAddBlankState () {
// Decide whether to add the blank state
......@@ -126,7 +118,7 @@
findList (key, val, type = 'label') {
return this.state.lists.filter((list) => {
const byType = type ? list['type'] === type : true;
return list[key] === val && byType;
})[0];
},
......
require 'rails_helper'
describe 'Issue Boards', feature: true, js: true do
include WaitForAjax
let(:project) { create(:project) }
let(:user) { create(:user) }
let!(:user2) { create(:user) }
......@@ -102,6 +104,18 @@ describe 'Issue Boards', feature: true, js: true do
expect(page).to have_selector('.board', count: 3)
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
50.times do
create(:issue, project: project)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment