Show error messages in dialog box to move tasks
This commit is contained in:
@@ -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');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user