Show error messages in dialog box to move tasks
This commit is contained in:
@@ -36,7 +36,7 @@ class TaskMovePositionController extends BaseController
|
|||||||
$values = $this->request->getJson();
|
$values = $this->request->getJson();
|
||||||
|
|
||||||
if (! $this->helper->projectRole->canMoveTask($task['project_id'], $task['column_id'], $values['column_id'])) {
|
if (! $this->helper->projectRole->canMoveTask($task['project_id'], $task['column_id'], $values['column_id'])) {
|
||||||
throw new AccessForbiddenException(e("You don't have the permission to move this task"));
|
throw new AccessForbiddenException(e('You are not allowed to move this task.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = $this->taskPositionModel->movePosition(
|
$result = $this->taskPositionModel->movePosition(
|
||||||
|
|||||||
@@ -1277,4 +1277,5 @@ return array(
|
|||||||
// 'This field is required' => '',
|
// 'This field is required' => '',
|
||||||
// 'Moving a task is not permitted' => '',
|
// 'Moving a task is not permitted' => '',
|
||||||
// 'This value must be in the range %d to %d' => '',
|
// 'This value must be in the range %d to %d' => '',
|
||||||
|
// 'You are not allowed to move this task.' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1277,4 +1277,5 @@ return array(
|
|||||||
// 'This field is required' => '',
|
// 'This field is required' => '',
|
||||||
// 'Moving a task is not permitted' => '',
|
// 'Moving a task is not permitted' => '',
|
||||||
// 'This value must be in the range %d to %d' => '',
|
// 'This value must be in the range %d to %d' => '',
|
||||||
|
// 'You are not allowed to move this task.' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1277,4 +1277,5 @@ return array(
|
|||||||
// 'This field is required' => '',
|
// 'This field is required' => '',
|
||||||
// 'Moving a task is not permitted' => '',
|
// 'Moving a task is not permitted' => '',
|
||||||
// 'This value must be in the range %d to %d' => '',
|
// 'This value must be in the range %d to %d' => '',
|
||||||
|
// 'You are not allowed to move this task.' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1277,4 +1277,5 @@ return array(
|
|||||||
// 'This field is required' => '',
|
// 'This field is required' => '',
|
||||||
// 'Moving a task is not permitted' => '',
|
// 'Moving a task is not permitted' => '',
|
||||||
// 'This value must be in the range %d to %d' => '',
|
// 'This value must be in the range %d to %d' => '',
|
||||||
|
// 'You are not allowed to move this task.' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1277,4 +1277,5 @@ return array(
|
|||||||
// 'This field is required' => '',
|
// 'This field is required' => '',
|
||||||
// 'Moving a task is not permitted' => '',
|
// 'Moving a task is not permitted' => '',
|
||||||
// 'This value must be in the range %d to %d' => '',
|
// 'This value must be in the range %d to %d' => '',
|
||||||
|
// 'You are not allowed to move this task.' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1277,4 +1277,5 @@ return array(
|
|||||||
// 'This field is required' => '',
|
// 'This field is required' => '',
|
||||||
// 'Moving a task is not permitted' => '',
|
// 'Moving a task is not permitted' => '',
|
||||||
// 'This value must be in the range %d to %d' => '',
|
// 'This value must be in the range %d to %d' => '',
|
||||||
|
// 'You are not allowed to move this task.' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1277,4 +1277,5 @@ return array(
|
|||||||
// 'This field is required' => '',
|
// 'This field is required' => '',
|
||||||
// 'Moving a task is not permitted' => '',
|
// 'Moving a task is not permitted' => '',
|
||||||
// 'This value must be in the range %d to %d' => '',
|
// 'This value must be in the range %d to %d' => '',
|
||||||
|
// 'You are not allowed to move this task.' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1278,4 +1278,5 @@ return array(
|
|||||||
'This field is required' => 'Ce champ est requis',
|
'This field is required' => 'Ce champ est requis',
|
||||||
'Moving a task is not permitted' => 'Déplaçer une tâche n\'est pas autorisé',
|
'Moving a task is not permitted' => 'Déplaçer une tâche n\'est pas autorisé',
|
||||||
'This value must be in the range %d to %d' => 'Cette valeur doit être définie entre %d et %d',
|
'This value must be in the range %d to %d' => 'Cette valeur doit être définie entre %d et %d',
|
||||||
|
'You are not allowed to move this task.' => 'Vous n\'êtes pas autorisé à déplacer cette tâche.',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1277,4 +1277,5 @@ return array(
|
|||||||
// 'This field is required' => '',
|
// 'This field is required' => '',
|
||||||
// 'Moving a task is not permitted' => '',
|
// 'Moving a task is not permitted' => '',
|
||||||
// 'This value must be in the range %d to %d' => '',
|
// 'This value must be in the range %d to %d' => '',
|
||||||
|
// 'You are not allowed to move this task.' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1277,4 +1277,5 @@ return array(
|
|||||||
// 'This field is required' => '',
|
// 'This field is required' => '',
|
||||||
// 'Moving a task is not permitted' => '',
|
// 'Moving a task is not permitted' => '',
|
||||||
// 'This value must be in the range %d to %d' => '',
|
// 'This value must be in the range %d to %d' => '',
|
||||||
|
// 'You are not allowed to move this task.' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1277,4 +1277,5 @@ return array(
|
|||||||
// 'This field is required' => '',
|
// 'This field is required' => '',
|
||||||
// 'Moving a task is not permitted' => '',
|
// 'Moving a task is not permitted' => '',
|
||||||
// 'This value must be in the range %d to %d' => '',
|
// 'This value must be in the range %d to %d' => '',
|
||||||
|
// 'You are not allowed to move this task.' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1277,4 +1277,5 @@ return array(
|
|||||||
// 'This field is required' => '',
|
// 'This field is required' => '',
|
||||||
// 'Moving a task is not permitted' => '',
|
// 'Moving a task is not permitted' => '',
|
||||||
// 'This value must be in the range %d to %d' => '',
|
// 'This value must be in the range %d to %d' => '',
|
||||||
|
// 'You are not allowed to move this task.' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1277,4 +1277,5 @@ return array(
|
|||||||
// 'This field is required' => '',
|
// 'This field is required' => '',
|
||||||
// 'Moving a task is not permitted' => '',
|
// 'Moving a task is not permitted' => '',
|
||||||
// 'This value must be in the range %d to %d' => '',
|
// 'This value must be in the range %d to %d' => '',
|
||||||
|
// 'You are not allowed to move this task.' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1277,4 +1277,5 @@ return array(
|
|||||||
// 'This field is required' => '',
|
// 'This field is required' => '',
|
||||||
// 'Moving a task is not permitted' => '',
|
// 'Moving a task is not permitted' => '',
|
||||||
// 'This value must be in the range %d to %d' => '',
|
// 'This value must be in the range %d to %d' => '',
|
||||||
|
// 'You are not allowed to move this task.' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1277,4 +1277,5 @@ return array(
|
|||||||
// 'This field is required' => '',
|
// 'This field is required' => '',
|
||||||
// 'Moving a task is not permitted' => '',
|
// 'Moving a task is not permitted' => '',
|
||||||
// 'This value must be in the range %d to %d' => '',
|
// 'This value must be in the range %d to %d' => '',
|
||||||
|
// 'You are not allowed to move this task.' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1277,4 +1277,5 @@ return array(
|
|||||||
// 'This field is required' => '',
|
// 'This field is required' => '',
|
||||||
// 'Moving a task is not permitted' => '',
|
// 'Moving a task is not permitted' => '',
|
||||||
// 'This value must be in the range %d to %d' => '',
|
// 'This value must be in the range %d to %d' => '',
|
||||||
|
// 'You are not allowed to move this task.' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1277,4 +1277,5 @@ return array(
|
|||||||
// 'This field is required' => '',
|
// 'This field is required' => '',
|
||||||
// 'Moving a task is not permitted' => '',
|
// 'Moving a task is not permitted' => '',
|
||||||
// 'This value must be in the range %d to %d' => '',
|
// 'This value must be in the range %d to %d' => '',
|
||||||
|
// 'You are not allowed to move this task.' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1277,4 +1277,5 @@ return array(
|
|||||||
'This field is required' => 'Este campo é obrigatório',
|
'This field is required' => 'Este campo é obrigatório',
|
||||||
'Moving a task is not permitted' => 'Mover uma tarefa não é permitido',
|
'Moving a task is not permitted' => 'Mover uma tarefa não é permitido',
|
||||||
'This value must be in the range %d to %d' => 'Este valor precisa estar no intervalo %d até %d',
|
'This value must be in the range %d to %d' => 'Este valor precisa estar no intervalo %d até %d',
|
||||||
|
// 'You are not allowed to move this task.' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1277,4 +1277,5 @@ return array(
|
|||||||
'This field is required' => 'Este campo é obrigatório',
|
'This field is required' => 'Este campo é obrigatório',
|
||||||
// 'Moving a task is not permitted' => '',
|
// 'Moving a task is not permitted' => '',
|
||||||
// 'This value must be in the range %d to %d' => '',
|
// 'This value must be in the range %d to %d' => '',
|
||||||
|
// 'You are not allowed to move this task.' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1277,4 +1277,5 @@ return array(
|
|||||||
'This field is required' => 'Заполните это поле',
|
'This field is required' => 'Заполните это поле',
|
||||||
'Moving a task is not permitted' => 'Перемещение задачи не разрешено',
|
'Moving a task is not permitted' => 'Перемещение задачи не разрешено',
|
||||||
'This value must be in the range %d to %d' => 'Значение должно находиться в диапазоне от %d до %d',
|
'This value must be in the range %d to %d' => 'Значение должно находиться в диапазоне от %d до %d',
|
||||||
|
// 'You are not allowed to move this task.' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1277,4 +1277,5 @@ return array(
|
|||||||
// 'This field is required' => '',
|
// 'This field is required' => '',
|
||||||
// 'Moving a task is not permitted' => '',
|
// 'Moving a task is not permitted' => '',
|
||||||
// 'This value must be in the range %d to %d' => '',
|
// 'This value must be in the range %d to %d' => '',
|
||||||
|
// 'You are not allowed to move this task.' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1277,4 +1277,5 @@ return array(
|
|||||||
// 'This field is required' => '',
|
// 'This field is required' => '',
|
||||||
// 'Moving a task is not permitted' => '',
|
// 'Moving a task is not permitted' => '',
|
||||||
// 'This value must be in the range %d to %d' => '',
|
// 'This value must be in the range %d to %d' => '',
|
||||||
|
// 'You are not allowed to move this task.' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1277,4 +1277,5 @@ return array(
|
|||||||
// 'This field is required' => '',
|
// 'This field is required' => '',
|
||||||
// 'Moving a task is not permitted' => '',
|
// 'Moving a task is not permitted' => '',
|
||||||
// 'This value must be in the range %d to %d' => '',
|
// 'This value must be in the range %d to %d' => '',
|
||||||
|
// 'You are not allowed to move this task.' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1277,4 +1277,5 @@ return array(
|
|||||||
// 'This field is required' => '',
|
// 'This field is required' => '',
|
||||||
// 'Moving a task is not permitted' => '',
|
// 'Moving a task is not permitted' => '',
|
||||||
// 'This value must be in the range %d to %d' => '',
|
// 'This value must be in the range %d to %d' => '',
|
||||||
|
// 'You are not allowed to move this task.' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1277,4 +1277,5 @@ return array(
|
|||||||
// 'This field is required' => '',
|
// 'This field is required' => '',
|
||||||
// 'Moving a task is not permitted' => '',
|
// 'Moving a task is not permitted' => '',
|
||||||
// 'This value must be in the range %d to %d' => '',
|
// 'This value must be in the range %d to %d' => '',
|
||||||
|
// 'You are not allowed to move this task.' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -28,6 +28,10 @@
|
|||||||
<label><input type="radio" value="after" v-model="positionChoice"><?= t('Insert after this task') ?></label>
|
<label><input type="radio" value="after" v-model="positionChoice"><?= t('Insert after this task') ?></label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div v-if="errorMessage">
|
||||||
|
<div class="alert alert-error">{{ errorMessage }}</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<submit-cancel
|
<submit-cancel
|
||||||
label-button="<?= t('Save') ?>"
|
label-button="<?= t('Save') ?>"
|
||||||
label-or="<?= t('or') ?>"
|
label-or="<?= t('or') ?>"
|
||||||
|
|||||||
4
assets/js/app.min.js
vendored
4
assets/js/app.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -26,5 +26,10 @@ Vue.component('submit-cancel', {
|
|||||||
onCancel: function () {
|
onCancel: function () {
|
||||||
_KB.get('Popover').close();
|
_KB.get('Popover').close();
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
events: {
|
||||||
|
'submitCancelled': function() {
|
||||||
|
this.loading = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -8,13 +8,15 @@ Vue.component('task-move-position', {
|
|||||||
position: 1,
|
position: 1,
|
||||||
columns: [],
|
columns: [],
|
||||||
tasks: [],
|
tasks: [],
|
||||||
positionChoice: 'before'
|
positionChoice: 'before',
|
||||||
|
errorMessage: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
ready: function () {
|
ready: function () {
|
||||||
this.columns = this.board[0].columns;
|
this.columns = this.board[0].columns;
|
||||||
this.columnId = this.columns[0].id;
|
this.columnId = this.columns[0].id;
|
||||||
this.tasks = this.columns[0].tasks;
|
this.tasks = this.columns[0].tasks;
|
||||||
|
this.errorMessage = '';
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onChangeSwimlane: function () {
|
onChangeSwimlane: function () {
|
||||||
@@ -50,6 +52,8 @@ Vue.component('task-move-position', {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
onSubmit: function () {
|
onSubmit: function () {
|
||||||
|
var self = this;
|
||||||
|
|
||||||
if (this.positionChoice == 'after') {
|
if (this.positionChoice == 'after') {
|
||||||
this.position++;
|
this.position++;
|
||||||
}
|
}
|
||||||
@@ -65,8 +69,16 @@ Vue.component('task-move-position', {
|
|||||||
"swimlane_id": this.swimlaneId,
|
"swimlane_id": this.swimlaneId,
|
||||||
"position": this.position
|
"position": this.position
|
||||||
}),
|
}),
|
||||||
complete: function() {
|
statusCode: {
|
||||||
window.location.reload(true);
|
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