Show error messages in dialog box to move tasks

This commit is contained in:
Frédéric Guillot
2016-10-21 07:41:52 -04:00
parent 6a3e435e89
commit c2e3f1eba9
30 changed files with 52 additions and 6 deletions

View File

@@ -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');
}
}
});
}