Initial add task functionality and README update

This commit is contained in:
kiswa 2017-04-28 22:13:55 +00:00
parent 5e6d0c0378
commit 0c7179fea4
6 changed files with 84 additions and 11 deletions

View File

@ -12,7 +12,7 @@ The goal of TaskBoard is to provide a simple and clean interface to a functional
A web server running PHP 5.5, 5.6, or 7.0 with sqlite enabled.
The server must have `sqlite3` and `php5-sqlite` (or `php7-sqlite`) installed, as well as the `rewrite` Apache module.
The server must have `sqlite3` and `php5-sqlite` (or `php7-sqlite`) installed.
If you're comfortable changing code, you can use any database [supported by RedBeanPHP](http://www.redbeanphp.com/index.php?p=/connection).
@ -24,6 +24,22 @@ Installing TaskBoard is as easy as 1, 2, 3!
2. Extract it to your webserver
3. Verify the `api` directory is writable
### Server Config
#### Apache
The directory you create for TaskBoard must have `AllowOverride` set so the .htaccess files work.
You also have to have `mod_rewrite` installed and enabled.
#### NGINX
TODO
#### IIS
See the [Wiki Page](https://github.com/kiswa/TaskBoard/wiki/TaskBoard-on-IIS)
### First Use
Open a web browser to the location you installed TaskBoard and use `admin` as the username and password to log into TaskBoard.
@ -134,11 +150,11 @@ Because I like seeing the numbers.
Language | Files | Blank | Comment | Code
-------------|--------:|---------:|--------:|---------:
TypeScript | 54 | 586 | 25 | 2765
TypeScript | 54 | 590 | 24 | 2785
PHP | 18 | 559 | 19 | 1743
HTML | 18 | 126 | 9 | 1148
HTML | 18 | 126 | 9 | 1149
SASS | 13 | 209 | 11 | 953
__SUM:__ | __103__ | __1480__ | __64__ | __6609__
__SUM:__ | __103__ | __1484__ | __63__ | __6630__
Command: `cloc --exclude-dir=vendor --exclude-ext=json src/`
@ -147,8 +163,8 @@ Command: `cloc --exclude-dir=vendor --exclude-ext=json src/`
Language | Files | Blank | Comment | Code
-------------|-------:|---------:|--------:|---------:
PHP | 10 | 687 | 16 | 2008
JavaScript | 31 | 392 | 37 | 1636
__SUM:__ | __41__ | __1079__ | __53__ | __3644__
JavaScript | 32 | 399 | 38 | 1661
__SUM:__ | __42__ | __1086__ | __54__ | __3669__
Command: `cloc --exclude-ext=xml test/`

View File

@ -55,6 +55,10 @@ export class BoardDisplay implements OnInit {
this.loading = false;
});
boardService.activeBoardChanged.subscribe((board: Board) => {
this.activeBoard = board;
});
auth.userChanged.subscribe((user: User) => {
this.updateActiveUser(user);
});

View File

@ -46,7 +46,7 @@
modal-id="{{ MODAL_ID + columnData.id }}">
<label>
Title
<input type="text" name="title" placeholder="Task Title"
<input #focusMe type="text" name="title" placeholder="Task Title"
[(ngModel)]="modalProps.title">
</label>
@ -68,7 +68,8 @@
<label>
Categories
<select name="categories" multiple [(ngModel)]="modalProps.categories">
<select name="categories" multiple [ngModel]="modalProps.categories"
(ngModelChange)="updateTaskColorByCategory($event)">
<option *ngFor="let category of activeBoard.categories"
[ngValue]="category">{{ category.name }}</option>
</select>

View File

@ -8,6 +8,7 @@ import {
import {
ApiResponse,
Board,
Category,
Column,
Modal,
Notification,
@ -103,17 +104,35 @@ export class ColumnDisplay implements OnInit {
this.collapseTasks = !this.collapseTasks;
}
updateTaskColorByCategory(event: Array<Category>) {
this.modalProps.categories = event;
this.modalProps.color = event[event.length - 1].default_task_color;
}
addTask() {
this.boardService.addTask(this.modalProps)
.subscribe((response: ApiResponse) => {
response.alerts.forEach(note => this.notes.add(note));
this.notes.add({ type: 'info', text: 'Refresh... for now.'});
this.modal.close(this.MODAL_ID + this.columnData.id);
let boardData = response.data[2][0];
// TODO - Update board display with new data
boardData.ownColumn.forEach((column: any) => {
if (!column.ownTask) {
column.ownTask = [];
}
});
let newBoard = new Board(+boardData.id, boardData.name,
boardData.is_active === '1',
boardData.ownColumn,
boardData.ownCategory,
boardData.ownAutoAction,
boardData.ownIssuetracker,
boardData.sharedUser);
this.boardService.updateActiveBoard(newBoard);
});
}

View File

@ -0,0 +1,20 @@
/* global expect TitleMock RouterMock ActivatedRouteMock AuthServiceMock BoardServiceMock */
var path = '../../../build/board/',
BoardDisplay = require(path + 'board.component.js').BoardDisplay;
describe('BoardDisplay', () => {
var board,
title;
beforeEach(() => {
title = new TitleMock();
board = new BoardDisplay(title, new RouterMock(), ActivatedRouteMock,
AuthServiceMock, BoardServiceMock);
});
it('sets the title when contstructed', () => {
expect(title.getTitle()).to.equal('TaskBoard - Kanban App');
});
});

View File

@ -124,6 +124,10 @@ global.RouterMock = function() {
};
};
global.ActivatedRouteMock = {
params: RxJs.Observable.of({})
};
global.AuthServiceMock = {
userOptions: {
show_animations: false
@ -376,6 +380,15 @@ global.UserSettingsServiceMock = {
}
};
global.BoardServiceMock = {
getBoards: () => {
return RxJs.Observable.of({
data: [ '', [] ]
});
},
activeBoardChanged: RxJs.Observable.of({})
};
global.HttpMock = {
post: (url, data) => {
var response = new global.ResponseMock(url);