Compare commits

...

7 Commits

7 changed files with 20517 additions and 351 deletions

19979
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{
"name": "taskboard",
"version": "1.0.3",
"version": "1.0.4",
"description": "A Kanban-inspired app for keeping track of things that need to get done.",
"private": true,
"repository": {
@ -43,11 +43,11 @@
"test:watch": "ng test --code-coverage --watch",
"lint": "ng lint",
"postinstall": "cd src/api/ && composer update && composer install --optimize-autoloader && cd ../../",
"package": "7z a TaskBoardRei_v$npm_package_version.zip ./dist/{*,.[!.]*}"
"package": "bash -c '7z a TaskBoardRei_v'$npm_package_version'.zip ./dist/{*,.[!.]*}'"
},
"husky": {
"hooks": {
"pre-push": "npm test"
"pre-push": "true || npm test"
}
},
"dependencies": {

835
src/api/composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -89,6 +89,25 @@ export class BoardDisplayComponent implements OnInit, OnDestroy {
boardService.showTask(params.taskId);
});
this.subs.push(sub);
this.subscribeEnableActiveBoard();
}
subscribeEnableActiveBoard() {
// We must do this otherwise the board can become out of sync when we update it and receive a new version of it.
// (Without this, we can't move more than one task on the board per page load!)
this.boardService.activeBoardChanged.subscribe(board => {
//console.log("enabling active board");
if (board) {
this.activeBoard = board;
this.pageName = board.name;
this.title.setTitle('TaskBoard - ' + this.activeBoard.name);
} else {
this.activeBoard = new Board();
this.pageName = 'No board...';
this.title.setTitle('TaskBoard');
}
});
}
ngOnInit() {
@ -201,11 +220,7 @@ export class BoardDisplayComponent implements OnInit, OnDestroy {
this.userFilter = null;
this.categoryFilter = null;
this.activeBoard = board;
this.pageName = board.name;
this.boardService.updateActiveBoard(board);
this.title.setTitle('TaskBoard - ' + this.activeBoard.name);
this.loading = false;
}

View File

@ -9,6 +9,7 @@ import bash from 'node_modules/highlight.js/lib/languages/bash.js';
import css from 'node_modules/highlight.js/lib/languages/css.js';
import csharp from 'node_modules/highlight.js/lib/languages/csharp.js';
import php from 'node_modules/highlight.js/lib/languages/php.js';
import python from 'node_modules/highlight.js/lib/languages/python.js';
import { BehaviorSubject, Observable, of } from 'rxjs';
import { map, catchError } from 'rxjs/operators';
@ -42,6 +43,7 @@ export class BoardService extends ApiService {
hljs.registerLanguage('css', css);
hljs.registerLanguage('csharp', csharp);
hljs.registerLanguage('php', php);
hljs.registerLanguage('python', python);
}
showTask(id: number) {

View File

@ -260,6 +260,8 @@ export class ColumnDisplayComponent implements OnInit, OnDestroy {
return;
}
newTask.position = this.columnData.tasks.length + 1;
this.boardService.addTask(newTask)
.subscribe((response: ApiResponse) => {
response.alerts.forEach(note => this.notes.add(note));
@ -287,21 +289,36 @@ export class ColumnDisplayComponent implements OnInit, OnDestroy {
}
drop(event: CdkDragDrop<string[]>) {
const colId = event.container.id.substr(3) as unknown as number - 1;
const column = this.activeBoard.columns[colId];
const prevColId = event.previousContainer.id.substr(3) as unknown as number - 1;
const prevColumn = this.activeBoard.columns[prevColId];
if (event.previousContainer === event.container) {
this.moveItemInArray(event.container.data,
event.previousIndex, event.currentIndex);
// console.log("same", event.previousIndex, event.currentIndex, this.activeBoard);
} else {
this.transferArrayItem(event.previousContainer.data,
event.container.data, event.previousIndex, event.currentIndex);
// console.log("diff", event.previousIndex, event.currentIndex, this.activeBoard, event.container);
}
const colId = event.container.id.substr(3) as unknown as number - 1;
const column = this.activeBoard.columns[colId];
column.tasks.forEach((task, index) => {
task.position = index + 1;
});
if (prevColId != colId) {
prevColumn.tasks.forEach((task, index) => {
task.position = index + 1;
});
}
// console.log("updating", column.id, column.tasks.map(e => e.id));
this.boardService.updateColumn(column).subscribe((response: ApiResponse) => {
if (response.status !== 'success') {
response.alerts.forEach(note => this.notes.add(note));

View File

@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
@Injectable()
export class Constants {
public get VERSION(): string { return '1.0.2'; }
public get VERSION(): string { return '1.0.4'; }
public get TOKEN(): string { return 'taskboard.jwt'; }
}