summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2017-02-09 15:51:49 +0000
committerPhil Hughes <me@iamphill.com>2017-02-09 15:51:49 +0000
commit2bd1a229060c959a177171ddbb32d1f2202b4801 (patch)
tree97fa7f83a61da1c4143e003c6d799468f693a233
parent110cd58999abb45f52273f5870fe16a3ad026746 (diff)
downloadgitlab-ce-add-issues-button-disable.tar.gz
Disables add issue buttonadd-issues-button-disable
Previously was disabled until any list was present (except for done) this now takes into account the welcome blank state Closes #27931
-rw-r--r--app/assets/javascripts/boards/boards_bundle.js.es62
-rw-r--r--spec/features/boards/boards_spec.rb6
2 files changed, 7 insertions, 1 deletions
diff --git a/app/assets/javascripts/boards/boards_bundle.js.es6 b/app/assets/javascripts/boards/boards_bundle.js.es6
index 8f30900198e..878ad1b6031 100644
--- a/app/assets/javascripts/boards/boards_bundle.js.es6
+++ b/app/assets/javascripts/boards/boards_bundle.js.es6
@@ -95,7 +95,7 @@ $(() => {
},
computed: {
disabled() {
- return Store.shouldAddBlankState();
+ return !this.store.lists.filter(list => list.type !== 'blank' && list.type !== 'done').length;
},
},
template: `
diff --git a/spec/features/boards/boards_spec.rb b/spec/features/boards/boards_spec.rb
index 7225f38b7e5..1b25b51cfb2 100644
--- a/spec/features/boards/boards_spec.rb
+++ b/spec/features/boards/boards_spec.rb
@@ -28,6 +28,12 @@ describe 'Issue Boards', feature: true, js: true do
expect(page).to have_content('Welcome to your Issue Board!')
end
+ it 'disables add issues button by default' do
+ button = page.find('.issue-boards-search button', text: 'Add issues')
+
+ expect(button[:disabled]).to eq true
+ end
+
it 'hides the blank state when clicking nevermind button' do
page.within(find('.board-blank-state')) do
click_button("Nevermind, I'll use my own")