diff options
author | Frédéric Guillot <fred@kanboard.net> | 2016-10-21 07:41:52 -0400 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2016-10-21 07:41:52 -0400 |
commit | c2e3f1eba95c86efdc429c16b94e87b0687241dd (patch) | |
tree | f43c6bac1b8fe20603ec7ee3f35ed0c4d9e1e7d3 /assets/js/components | |
parent | 6a3e435e89173d6e14377c975d42c3c0b18f2ea3 (diff) |
Show error messages in dialog box to move tasks
Diffstat (limited to 'assets/js/components')
-rw-r--r-- | assets/js/components/submit-cancel.js | 5 | ||||
-rw-r--r-- | assets/js/components/task-move-position.js | 18 |
2 files changed, 20 insertions, 3 deletions
diff --git a/assets/js/components/submit-cancel.js b/assets/js/components/submit-cancel.js index 1950c060..061b1146 100644 --- a/assets/js/components/submit-cancel.js +++ b/assets/js/components/submit-cancel.js @@ -26,5 +26,10 @@ Vue.component('submit-cancel', { onCancel: function () { _KB.get('Popover').close(); } + }, + events: { + 'submitCancelled': function() { + this.loading = false; + } } }); diff --git a/assets/js/components/task-move-position.js b/assets/js/components/task-move-position.js index 390dcff1..11e1068c 100644 --- a/assets/js/components/task-move-position.js +++ b/assets/js/components/task-move-position.js @@ -8,13 +8,15 @@ Vue.component('task-move-position', { position: 1, columns: [], tasks: [], - positionChoice: 'before' + positionChoice: 'before', + errorMessage: '' } }, ready: function () { this.columns = this.board[0].columns; this.columnId = this.columns[0].id; this.tasks = this.columns[0].tasks; + this.errorMessage = ''; }, methods: { onChangeSwimlane: function () { @@ -50,6 +52,8 @@ Vue.component('task-move-position', { }); }, onSubmit: function () { + var self = this; + if (this.positionChoice == 'after') { this.position++; } @@ -65,8 +69,16 @@ Vue.component('task-move-position', { "swimlane_id": this.swimlaneId, "position": this.position }), - complete: function() { - window.location.reload(true); + statusCode: { + 200: function() { + window.location.reload(true); + }, + 403: function(jqXHR) { + var response = JSON.parse(jqXHR.responseText); + self.errorMessage = response.message; + + self.$broadcast('submitCancelled'); + } } }); } |