summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2016-10-05 14:27:29 +0100
committerPhil Hughes <me@iamphill.com>2016-10-06 11:00:01 +0100
commita68f1fdd2975a9e7cab39ab7d40e3eae2cc676db (patch)
tree2fad4aaa6507f0fe6bda595fede36ba03396cbd8
parentb9ede4f1a5aa213f0342daff5e7281758e989a8e (diff)
downloadgitlab-ce-a68f1fdd2975a9e7cab39ab7d40e3eae2cc676db.tar.gz
Fix form not re-enabling thanks to jQuery
Stop issue being dragged if it doesn't have an ID
-rw-r--r--app/assets/javascripts/boards/components/board_list.js.es62
-rw-r--r--app/assets/javascripts/boards/components/board_new_issue.js.es66
-rw-r--r--app/assets/javascripts/boards/models/list.js.es62
-rw-r--r--app/views/projects/boards/components/_board.html.haml3
-rw-r--r--app/views/projects/boards/components/_card.html.haml2
5 files changed, 10 insertions, 5 deletions
diff --git a/app/assets/javascripts/boards/components/board_list.js.es6 b/app/assets/javascripts/boards/components/board_list.js.es6
index 208aac504fd..7022a29e818 100644
--- a/app/assets/javascripts/boards/components/board_list.js.es6
+++ b/app/assets/javascripts/boards/components/board_list.js.es6
@@ -76,7 +76,7 @@
group: 'issues',
sort: false,
disabled: this.disabled,
- filter: '.board-list-count, .board-new-issue-form',
+ filter: '.board-list-count, .is-disabled',
onStart: (e) => {
const card = this.$refs.issue[e.oldIndex];
diff --git a/app/assets/javascripts/boards/components/board_new_issue.js.es6 b/app/assets/javascripts/boards/components/board_new_issue.js.es6
index eb26ed9721d..315c16ee242 100644
--- a/app/assets/javascripts/boards/components/board_new_issue.js.es6
+++ b/app/assets/javascripts/boards/components/board_new_issue.js.es6
@@ -25,7 +25,11 @@
labels
});
- this.list.newIssue(issue);
+ this.list.newIssue(issue)
+ .then(() => {
+ // Need this because our jQuery very kindly disables buttons on ALL form submissions
+ $(this.$els.submitButton).enable();
+ });
this.cancel();
},
diff --git a/app/assets/javascripts/boards/models/list.js.es6 b/app/assets/javascripts/boards/models/list.js.es6
index 14e42db4cd2..5d0a561cdba 100644
--- a/app/assets/javascripts/boards/models/list.js.es6
+++ b/app/assets/javascripts/boards/models/list.js.es6
@@ -91,7 +91,7 @@ class List {
this.addIssue(issue);
this.issuesSize++;
- gl.boardService.newIssue(this.id, issue)
+ return gl.boardService.newIssue(this.id, issue)
.then((resp) => {
const data = resp.json();
issue.id = data.iid;
diff --git a/app/views/projects/boards/components/_board.html.haml b/app/views/projects/boards/components/_board.html.haml
index 4d7d8319204..26b2236b581 100644
--- a/app/views/projects/boards/components/_board.html.haml
+++ b/app/views/projects/boards/components/_board.html.haml
@@ -54,7 +54,8 @@
":id" => "list.id + '-title'" }
.clearfix.prepend-top-10
%button.btn.btn-success.pull-left{ type: "submit",
- ":disabled" => "title === ''" }
+ ":disabled" => "title === ''",
+ "v-el:submit-button" => true }
Submit issue
%button.btn.btn-default.pull-right{ type: "button",
"@click" => "cancel" }
diff --git a/app/views/projects/boards/components/_card.html.haml b/app/views/projects/boards/components/_card.html.haml
index 25701b0a99e..f15c87c8185 100644
--- a/app/views/projects/boards/components/_card.html.haml
+++ b/app/views/projects/boards/components/_card.html.haml
@@ -7,7 +7,7 @@
":issue-link-base" => "issueLinkBase",
":disabled" => "disabled",
"track-by" => "id" }
- %li.card{ ":class" => "{ 'user-can-drag': !disabled }",
+ %li.card{ ":class" => "{ 'user-can-drag': !disabled && issue.id, 'is-disabled': disabled || !issue.id }",
":index" => "index" }
%h4.card-title
= icon("eye-slash", class: "confidential-icon", "v-if" => "issue.confidential")