Update task visually when changed by drag and drop. Fixes #507.
This commit is contained in:
parent
ba9771ba79
commit
5493ce5d6e
10
README.md
10
README.md
@ -195,11 +195,11 @@ Because I like seeing the numbers.
|
|||||||
|
|
||||||
Language | Files | Blank | Comment | Code
|
Language | Files | Blank | Comment | Code
|
||||||
-----------|--------:|---------:|---------:|---------:
|
-----------|--------:|---------:|---------:|---------:
|
||||||
TypeScript | 67 | 978 | 129 | 4107
|
TypeScript | 69 | 1032 | 122 | 4307
|
||||||
PHP | 20 | 752 | 40 | 2265
|
PHP | 21 | 790 | 40 | 2396
|
||||||
HTML | 21 | 268 | 2 | 1573
|
HTML | 22 | 287 | 2 | 1604
|
||||||
SASS | 14 | 299 | 10 | 1347
|
SASS | 14 | 302 | 10 | 1365
|
||||||
**SUM:** | **122** | **2297** | **181** | **9292**
|
**SUM:** | **126** | **2411** | **174** | **9672**
|
||||||
|
|
||||||
Command: `cloc --exclude-dir=vendor,favicons --exclude-ext=json,svg,ini src/`
|
Command: `cloc --exclude-dir=vendor,favicons --exclude-ext=json,svg,ini src/`
|
||||||
|
|
||||||
|
@ -244,6 +244,11 @@ export class ColumnDisplayComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
updateTaskColorByCategory(event: Category[]) {
|
updateTaskColorByCategory(event: Category[]) {
|
||||||
this.modalProps.categories = event;
|
this.modalProps.categories = event;
|
||||||
|
|
||||||
|
if (!event.length) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.modalProps.color = event[event.length - 1].default_task_color;
|
this.modalProps.color = event[event.length - 1].default_task_color;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -299,7 +304,27 @@ export class ColumnDisplayComponent implements OnInit, OnDestroy {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const task = this.activeBoard.columns[colIndex].tasks[event.currentIndex];
|
const task = this.activeBoard.columns[colIndex].tasks[event.currentIndex];
|
||||||
this.boardService.updateTask(task).subscribe(() => {});
|
this.boardService.updateTask(task).subscribe((response: ApiResponse) => {
|
||||||
|
response.alerts.forEach(alert => {
|
||||||
|
if (alert.type === 'success') {
|
||||||
|
return; // No need to show "task updated" for drag and drop
|
||||||
|
}
|
||||||
|
|
||||||
|
this.notes.add(alert);
|
||||||
|
});
|
||||||
|
|
||||||
|
if (response.status !== 'success') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const newTask = response.data[1][0];
|
||||||
|
const updatedTask = new Task(newTask.id, newTask.title, newTask.description,
|
||||||
|
newTask.color, newTask.due_date, newTask.points,
|
||||||
|
newTask.position, newTask.column_id, newTask.ownComment,
|
||||||
|
newTask.ownAttachment, newTask.sharedUser, newTask.sharedCategory);
|
||||||
|
|
||||||
|
this.activeBoard.columns[colIndex].tasks[event.currentIndex] = updatedTask;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
updateTask() {
|
updateTask() {
|
||||||
|
Reference in New Issue
Block a user