From 2bd1a229060c959a177171ddbb32d1f2202b4801 Mon Sep 17 00:00:00 2001
From: Phil Hughes <me@iamphill.com>
Date: Thu, 9 Feb 2017 15:51:49 +0000
Subject: [PATCH] Disables add issue button

Previously was disabled until any list was present (except for done) this now takes into account the welcome blank state

Closes #27931
---
 app/assets/javascripts/boards/boards_bundle.js.es6 | 2 +-
 spec/features/boards/boards_spec.rb                | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

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")
-- 
2.30.9