Lazy commit - should be several

This commit is contained in:
kiswa 2017-04-27 22:41:05 +00:00
parent b5fc471f61
commit e3096aa5c6
15 changed files with 117 additions and 115 deletions

View File

@ -134,11 +134,11 @@ Because I like seeing the numbers.
Language | Files | Blank | Comment | Code Language | Files | Blank | Comment | Code
-------------|--------:|---------:|--------:|---------: -------------|--------:|---------:|--------:|---------:
TypeScript | 53 | 575 | 23 | 2729 TypeScript | 54 | 586 | 25 | 2765
PHP | 18 | 554 | 19 | 1724 PHP | 18 | 559 | 19 | 1743
HTML | 17 | 125 | 9 | 1143 HTML | 18 | 126 | 9 | 1148
SASS | 13 | 209 | 11 | 950 SASS | 13 | 209 | 11 | 953
__SUM:__ | __101__ | __1463__ | __62__ | __6546__ __SUM:__ | __103__ | __1480__ | __64__ | __6609__
Command: `cloc --exclude-dir=vendor --exclude-ext=json src/` Command: `cloc --exclude-dir=vendor --exclude-ext=json src/`
@ -146,9 +146,9 @@ Command: `cloc --exclude-dir=vendor --exclude-ext=json src/`
Language | Files | Blank | Comment | Code Language | Files | Blank | Comment | Code
-------------|-------:|---------:|--------:|---------: -------------|-------:|---------:|--------:|---------:
PHP | 10 | 683 | 16 | 1994 PHP | 10 | 687 | 16 | 2008
JavaScript | 31 | 392 | 37 | 1636 JavaScript | 31 | 392 | 37 | 1636
__SUM:__ | __41__ | __1075__ | __53__ | __3630__ __SUM:__ | __41__ | __1079__ | __53__ | __3644__
Command: `cloc --exclude-ext=xml test/` Command: `cloc --exclude-ext=xml test/`

View File

@ -27,20 +27,20 @@
}, },
"homepage": "https://github.com/kiswa/TaskBoard#readme", "homepage": "https://github.com/kiswa/TaskBoard#readme",
"devDependencies": { "devDependencies": {
"@angular/common": "4.0.0", "@angular/common": "4.1.0",
"@angular/compiler": "4.0.0", "@angular/compiler": "4.1.0",
"@angular/core": "4.0.0", "@angular/core": "4.1.0",
"@angular/forms": "4.0.0", "@angular/forms": "4.1.0",
"@angular/http": "4.0.0", "@angular/http": "4.1.0",
"@angular/platform-browser": "4.0.0", "@angular/platform-browser": "4.1.0",
"@angular/platform-browser-dynamic": "4.0.0", "@angular/platform-browser-dynamic": "4.1.0",
"@angular/router": "4.0.0", "@angular/router": "4.1.0",
"@types/chartist": "^0.9.34", "@types/chartist": "^0.9.34",
"@types/core-js": "^0.9.39", "@types/core-js": "^0.9.41",
"bourbon": "^4.3.3", "bourbon": "^4.3.4",
"bourbon-neat": "^1.8.0", "bourbon-neat": "^1.8.0",
"chai": "^3.5.0", "chai": "^3.5.0",
"chartist": "^0.10.1", "chartist": "^0.11.0",
"chartist-plugin-tooltip": "git+https://github.com/Globegitter/chartist-plugin-tooltip.git", "chartist-plugin-tooltip": "git+https://github.com/Globegitter/chartist-plugin-tooltip.git",
"core-js": "^2.4.1", "core-js": "^2.4.1",
"del": "^2.2.2", "del": "^2.2.2",
@ -53,28 +53,27 @@
"gulp-concat": "^2.6.1", "gulp-concat": "^2.6.1",
"gulp-cssimport": "^5.0.0", "gulp-cssimport": "^5.0.0",
"gulp-cssnano": "^2.1.2", "gulp-cssnano": "^2.1.2",
"gulp-imagemin": "^3.1.1", "gulp-imagemin": "^3.2.0",
"gulp-istanbul": "^1.1.1", "gulp-istanbul": "^1.1.1",
"gulp-mocha": "^3.0.1", "gulp-mocha": "^3.0.1",
"gulp-phpunit": "^0.22.2", "gulp-phpunit": "^0.22.2",
"gulp-sass": "^3.1.0", "gulp-sass": "^3.1.0",
"gulp-scss-lint": "^0.4.0", "gulp-scss-lint": "^0.4.0",
"gulp-tslint": "^7.1.0", "gulp-tslint": "^8.0.0",
"gulp-typescript": "^3.1.6", "gulp-typescript": "^3.1.6",
"gulp-uglify": "^2.1.2", "gulp-uglify": "^2.1.2",
"gulp-util": "^3.0.8", "gulp-util": "^3.0.8",
"merge-stream": "^1.0.1", "merge-stream": "^1.0.1",
"mock-browser": "^0.92.12", "ng2-dragula": "^1.3.1",
"ng2-dragula": "^1.3.0", "node-normalize-scss": "^2.0.0",
"node-normalize-scss": "^1.4.0",
"reflect-metadata": "^0.1.10", "reflect-metadata": "^0.1.10",
"rxjs": "5.2.0", "rxjs": "5.3.0",
"scss-base": "^1.2.3", "scss-base": "^1.3.1",
"systemjs": "0.20.10", "systemjs": "0.20.12",
"systemjs-builder": "0.16.4", "systemjs-builder": "0.16.4",
"touch": "^1.0.0", "touch": "^1.0.0",
"tslint": "^4.5.1", "tslint": "^5.1.0",
"typescript": "^2.2.1", "typescript": "^2.3.1",
"zone.js": "^0.8.5" "zone.js": "^0.8.9"
} }
} }

20
src/api/composer.lock generated
View File

@ -256,16 +256,16 @@
}, },
{ {
"name": "myclabs/php-enum", "name": "myclabs/php-enum",
"version": "1.5.0", "version": "1.5.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/myclabs/php-enum.git", "url": "https://github.com/myclabs/php-enum.git",
"reference": "e42fa9d2ae5dd660dbd0fb573d94c61e5a0dbb02" "reference": "61f4a24da5be216301447f3278ea6562609d61f5"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/myclabs/php-enum/zipball/e42fa9d2ae5dd660dbd0fb573d94c61e5a0dbb02", "url": "https://api.github.com/repos/myclabs/php-enum/zipball/61f4a24da5be216301447f3278ea6562609d61f5",
"reference": "e42fa9d2ae5dd660dbd0fb573d94c61e5a0dbb02", "reference": "61f4a24da5be216301447f3278ea6562609d61f5",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -296,7 +296,7 @@
"keywords": [ "keywords": [
"enum" "enum"
], ],
"time": "2016-10-09 21:43:05" "time": "2017-03-26 10:24:21"
}, },
{ {
"name": "nikic/fast-route", "name": "nikic/fast-route",
@ -1639,16 +1639,16 @@
}, },
{ {
"name": "symfony/yaml", "name": "symfony/yaml",
"version": "v3.2.6", "version": "v3.2.7",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/yaml.git", "url": "https://github.com/symfony/yaml.git",
"reference": "093e416ad096355149e265ea2e4cc1f9ee40ab1a" "reference": "62b4cdb99d52cb1ff253c465eb1532a80cebb621"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/093e416ad096355149e265ea2e4cc1f9ee40ab1a", "url": "https://api.github.com/repos/symfony/yaml/zipball/62b4cdb99d52cb1ff253c465eb1532a80cebb621",
"reference": "093e416ad096355149e265ea2e4cc1f9ee40ab1a", "reference": "62b4cdb99d52cb1ff253c465eb1532a80cebb621",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1690,7 +1690,7 @@
], ],
"description": "Symfony Yaml Component", "description": "Symfony Yaml Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2017-03-07 16:47:02" "time": "2017-03-20 09:45:15"
}, },
{ {
"name": "webmozart/assert", "name": "webmozart/assert",

View File

@ -68,6 +68,9 @@ class Tasks extends BaseController {
$task->title . ' added.'); $task->title . ' added.');
$this->apiJson->addData(R::exportAll($task)); $this->apiJson->addData(R::exportAll($task));
$board = R::load('board', $column->board_id);
$this->apiJson->addData(R::exportAll($board));
return $this->jsonResponse($response); return $this->jsonResponse($response);
} }

View File

@ -45,24 +45,20 @@ class BeanLoader {
$board->name = isset($data->name) ? $data->name : ''; $board->name = isset($data->name) ? $data->name : '';
$board->is_active = isset($data->is_active) ? $data->is_active : ''; $board->is_active = isset($data->is_active) ? $data->is_active : '';
try { if (isset($data->categories)) {
if (isset($data->categories)) { self::updateObjectList('category', 'LoadCategory',
self::updateObjectList('category', 'LoadCategory', $board->xownCategoryList, $data->categories);
$board->xownCategoryList, $data->categories); }
}
if (isset($data->issue_trackers)) { if (isset($data->issue_trackers)) {
self::updateObjectList('issuetracker', 'LoadIssueTracker', self::updateObjectList('issuetracker', 'LoadIssueTracker',
$board->xownIssueTrackerList, $board->xownIssueTrackerList,
$data->issue_trackers); $data->issue_trackers);
} }
if (isset($data->columns)) { if (isset($data->columns)) {
self::updateObjectList('column', 'LoadColumn', self::updateObjectList('column', 'LoadColumn',
$board->xownColumnList, $data->columns); $board->xownColumnList, $data->columns);
}
} catch(Exception $ex) {
return false;
} }
// Users do not get deleted when removed from a board // Users do not get deleted when removed from a board
@ -112,7 +108,7 @@ class BeanLoader {
if (isset($data->tasks)) { if (isset($data->tasks)) {
self::updateObjectList('task', 'LoadTask', self::updateObjectList('task', 'LoadTask',
$column->xownTaskList, $data->tasks); $column->xownTaskList, $data->tasks);
} }
if (!isset($data->name) || !isset($data->position) || if (!isset($data->name) || !isset($data->position) ||
@ -181,7 +177,7 @@ class BeanLoader {
foreach ($data->assignees as $assignee) { foreach ($data->assignees as $assignee) {
$user = R::load('user', $assignee->id); $user = R::load('user', $assignee->id);
if((int) $user->id) { if ((int)$user->id) {
$task->sharedUserList[] = $user; $task->sharedUserList[] = $user;
} }
} }
@ -274,21 +270,15 @@ class BeanLoader {
foreach ($dataList as $obj) { foreach ($dataList as $obj) {
$object = R::load($type, (isset($obj->id) ? $obj->id : 0)); $object = R::load($type, (isset($obj->id) ? $obj->id : 0));
if ((int)$object->id === 0) {
call_user_func_array(array(__CLASS__, $loadFunc),
array(&$object, json_encode($obj)));
$objectList[] = $object;
continue;
}
call_user_func_array(array(__CLASS__, $loadFunc), call_user_func_array(array(__CLASS__, $loadFunc),
array(&$objectList[$object->id], array(&$object, json_encode($obj)));
json_encode($obj))); $objectList[] = $object;
} }
} }
private static function updateObjectList($type, $loadFunc, private static function updateObjectList($type, $loadFunc,
&$objectList = [], &$dataList = []) { &$objectList = [],
&$dataList = []) {
if (count($objectList) && count($dataList)) { if (count($objectList) && count($dataList)) {
self::removeObjectsNotInData($type, $dataList, $objectList); self::removeObjectsNotInData($type, $dataList, $objectList);
} }

View File

@ -21,7 +21,7 @@ export const API_HTTP_PROVIDERS = [
{ {
provide: Http, provide: Http,
useFactory: (xhrBackend: XHRBackend, requestOptions: RequestOptions, useFactory: (xhrBackend: XHRBackend, requestOptions: RequestOptions,
router: Router) => new ApiHttp(xhrBackend, requestOptions, router), router: Router) => new ApiHttp(xhrBackend, requestOptions, router),
deps: [XHRBackend, RequestOptions, Router] deps: [XHRBackend, RequestOptions, Router]
} }
]; ];

View File

@ -28,14 +28,8 @@
</div> </div>
<div class="tasks"> <div class="tasks">
<tb-task *ngFor="let task of columnData.ownTask" <tb-task class="task-container" *ngFor="let task of columnData.ownTask"
class="task"
[task]="task"></tb-task> [task]="task"></tb-task>
<!--<div *ngFor="let task of columnData.ownTask"-->
<!-- class="task" [ngClass]="{ 'compact': collapseTasks }"-->
<!-- [style.backgroundColor]="task.color"-->
<!-- [style.color]="getTextColor(task.color)">-->
<!--</div>-->
</div> </div>
<!--<tb-modal modal-title="Confirm Task Removal" blocking="true">--> <!--<tb-modal modal-title="Confirm Task Removal" blocking="true">-->
@ -60,6 +54,7 @@
Description Description
<textarea name="description" rows="5" <textarea name="description" rows="5"
placeholder="What needs to get done?" placeholder="What needs to get done?"
(keyup.enter)="preventEnter($event)"
[(ngModel)]="modalProps.description"></textarea> [(ngModel)]="modalProps.description"></textarea>
</label> </label>

View File

@ -105,8 +105,15 @@ export class ColumnDisplay implements OnInit {
addTask() { addTask() {
this.boardService.addTask(this.modalProps) this.boardService.addTask(this.modalProps)
.subscribe(res => { .subscribe((response: ApiResponse) => {
console.log(res); // tslint:disable-line 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
}); });
} }
@ -117,5 +124,11 @@ export class ColumnDisplay implements OnInit {
this.modal.open(this.MODAL_ID + this.columnData.id); this.modal.open(this.MODAL_ID + this.columnData.id);
} }
private preventEnter(event: any) {
if (event && event.stopPropagation) {
event.stopPropagation();
}
}
} }

View File

@ -1,4 +1,5 @@
<div [style.backgroundColor]="taskData.color" <div class="task"
[style.backgroundColor]="taskData.color"
[style.color]="getTextColor(taskData.color)"> [style.color]="getTextColor(taskData.color)">
<h4> <h4>
<span class="icon" <span class="icon"

View File

@ -170,22 +170,22 @@ export class AutoActions {
case ActionTrigger.MovedToColumn: case ActionTrigger.MovedToColumn:
this.buildSourcesArray('triggerSources', this.buildSourcesArray('triggerSources',
'Column', 'columns'); 'Column', 'columns');
break; break;
case ActionTrigger.AssignedToUser: case ActionTrigger.AssignedToUser:
this.buildSourcesArray('triggerSources', this.buildSourcesArray('triggerSources',
'User', 'users', 'username'); 'User', 'users', 'username');
break; break;
case ActionTrigger.AddedToCategory: case ActionTrigger.AddedToCategory:
this.buildSourcesArray('triggerSources', this.buildSourcesArray('triggerSources',
'Category', 'categories'); 'Category', 'categories');
break; break;
case ActionTrigger.PointsChanged: case ActionTrigger.PointsChanged:
// Leave triggerSources empty // Leave triggerSources empty
this.types = [ [ this.types = [ [
ActionType.AlterColorByPoints, ActionType.AlterColorByPoints,
this.strings.settings_alterByPoints this.strings.settings_alterByPoints
] ]; ] ];
break; break;
} }
this.newAction.type = this.types ? this.newAction.type = this.types ?
@ -203,15 +203,15 @@ export class AutoActions {
case ActionType.AddCategory: case ActionType.AddCategory:
this.buildSourcesArray('actionSources', this.buildSourcesArray('actionSources',
'Category', 'categories'); 'Category', 'categories');
break; break;
case ActionType.SetAssignee: case ActionType.SetAssignee:
case ActionType.AddAssignee: case ActionType.AddAssignee:
this.buildSourcesArray('actionSources', this.buildSourcesArray('actionSources',
'Assignee', 'users', 'username'); 'Assignee', 'users', 'username');
break; break;
case ActionType.SetColor: case ActionType.SetColor:
this.newAction.change_to = '#000000'; this.newAction.change_to = '#000000';
break; break;
} }
this.checkAddDisabled(); this.checkAddDisabled();
@ -260,20 +260,20 @@ export class AutoActions {
case ActionTrigger.MovedToColumn: case ActionTrigger.MovedToColumn:
desc = this.strings.settings_triggerMoveToColumn + ' '; desc = this.strings.settings_triggerMoveToColumn + ' ';
desc += this.getNameFromArray(board.columns, action.source_id); desc += this.getNameFromArray(board.columns, action.source_id);
break; break;
case ActionTrigger.AssignedToUser: case ActionTrigger.AssignedToUser:
desc = this.strings.settings_triggerAssignedToUser + ' '; desc = this.strings.settings_triggerAssignedToUser + ' ';
desc += this.getNameFromArray(board.users, desc += this.getNameFromArray(board.users,
action.source_id, 'username'); action.source_id, 'username');
break; break;
case ActionTrigger.AddedToCategory: case ActionTrigger.AddedToCategory:
desc = this.strings.settings_triggerAddedToCategory + ' '; desc = this.strings.settings_triggerAddedToCategory + ' ';
desc += this.getNameFromArray(board.categories, desc += this.getNameFromArray(board.categories,
action.source_id); action.source_id);
break; break;
case ActionTrigger.PointsChanged: case ActionTrigger.PointsChanged:
desc = this.strings.settings_triggerPointsChanged; desc = this.strings.settings_triggerPointsChanged;
break; break;
} }
return desc; return desc;
@ -291,33 +291,33 @@ export class AutoActions {
case ActionType.SetColor: case ActionType.SetColor:
desc = this.strings.settings_actionSetColor + ' <span style="background-color: ' + desc = this.strings.settings_actionSetColor + ' <span style="background-color: ' +
action.change_to + ';">' + action.change_to + '</span>'; action.change_to + ';">' + action.change_to + '</span>';
break; break;
case ActionType.SetCategory: case ActionType.SetCategory:
desc = this.strings.settings_actionSetCategory + ' '; desc = this.strings.settings_actionSetCategory + ' ';
desc += this.getNameFromArray(board.categories, desc += this.getNameFromArray(board.categories,
+action.change_to); +action.change_to);
break; break;
case ActionType.AddCategory: case ActionType.AddCategory:
desc = this.strings.settings_actionAddCategory + ' '; desc = this.strings.settings_actionAddCategory + ' ';
desc += this.getNameFromArray(board.categories, desc += this.getNameFromArray(board.categories,
+action.change_to); +action.change_to);
break; break;
case ActionType.SetAssignee: case ActionType.SetAssignee:
desc = this.strings.settings_actionSetAssignee + ' '; desc = this.strings.settings_actionSetAssignee + ' ';
desc += this.getNameFromArray(board.users, desc += this.getNameFromArray(board.users,
+action.change_to, 'username'); +action.change_to, 'username');
break; break;
case ActionType.AddAssignee: case ActionType.AddAssignee:
desc = this.strings.settings_actionAddAssignee + ' '; desc = this.strings.settings_actionAddAssignee + ' ';
desc += this.getNameFromArray(board.users, desc += this.getNameFromArray(board.users,
+action.change_to, 'username'); +action.change_to, 'username');
break; break;
case ActionType.ClearDueDate: case ActionType.ClearDueDate:
desc = this.strings.settings_actionClearDueDate; desc = this.strings.settings_actionClearDueDate;
break; break;
case ActionType.AlterColorByPoints: case ActionType.AlterColorByPoints:
desc = this.strings.settings_actionAlterColor; desc = this.strings.settings_actionAlterColor;
break; break;
} }
return this.sanitizer.bypassSecurityTrustHtml(desc); return this.sanitizer.bypassSecurityTrustHtml(desc);

View File

@ -200,22 +200,22 @@ export class BoardAdmin {
this.displayBoards.sort((a: Board, b: Board) => { this.displayBoards.sort((a: Board, b: Board) => {
return a.name.localeCompare(b.name); return a.name.localeCompare(b.name);
}); });
break; break;
case 'name-desc': case 'name-desc':
this.displayBoards.sort((a: Board, b: Board) => { this.displayBoards.sort((a: Board, b: Board) => {
return b.name.localeCompare(a.name); return b.name.localeCompare(a.name);
}); });
break; break;
case 'id-desc': case 'id-desc':
this.displayBoards.sort((a: Board, b: Board) => { this.displayBoards.sort((a: Board, b: Board) => {
return b.id - a.id; return b.id - a.id;
}); });
break; break;
case 'id-asc': case 'id-asc':
this.displayBoards.sort((a: Board, b: Board) => { this.displayBoards.sort((a: Board, b: Board) => {
return a.id - b.id; return a.id - b.id;
}); });
break; break;
} }
} }

View File

@ -60,19 +60,19 @@ export class UserSettings implements OnInit {
switch (option) { switch (option) {
case 'new_tasks': case 'new_tasks':
this.userOptions.new_tasks_at_bottom = event === 'true'; this.userOptions.new_tasks_at_bottom = event === 'true';
break; break;
case 'mult_tasks': case 'mult_tasks':
this.userOptions.multiple_tasks_per_row = event; this.userOptions.multiple_tasks_per_row = event;
break; break;
case 'show_anim': case 'show_anim':
this.userOptions.show_animations = event; this.userOptions.show_animations = event;
break; break;
case 'show_assign': case 'show_assign':
this.userOptions.show_assignee = event; this.userOptions.show_assignee = event;
break; break;
case 'language': case 'language':
this.userOptions.language = event; this.userOptions.language = event;
break; break;
} }
this.updateUserOptions(); this.updateUserOptions();
} }

View File

@ -2,17 +2,17 @@ export class PassForm {
constructor(public current: string = '', public newPass: string = '', constructor(public current: string = '', public newPass: string = '',
public verPass: string = '', public submitted: boolean = false) { public verPass: string = '', public submitted: boolean = false) {
} }
}; }
export class UsernameForm { export class UsernameForm {
constructor(public newName: string = '', constructor(public newName: string = '',
public submitted: boolean = false) { public submitted: boolean = false) {
} }
}; }
export class EmailForm { export class EmailForm {
constructor(public newEmail: string = '', constructor(public newEmail: string = '',
public submitted: boolean = false) { public submitted: boolean = false) {
} }
}; }

View File

@ -80,8 +80,8 @@
justify-content: space-between; justify-content: space-between;
} }
.task { .task-container {
width: 49.3%; width: calc(50% - 3.5px);
} }
} }
@ -135,12 +135,14 @@
} }
} }
.task-container {
display: block;
margin-bottom: 7px;
}
.task { .task {
@include shadow-low(); @include shadow-low();
background-color: #ffffe0;
margin-bottom: 7px;
h4 { h4 {
border-bottom: 1px solid lighten($color-border, 25%); border-bottom: 1px solid lighten($color-border, 25%);
cursor: move; cursor: move;
@ -171,6 +173,7 @@
.stats { .stats {
font-size: .9em; font-size: .9em;
overflow: hidden;
padding: 0 5px; padding: 0 5px;
} }

View File

@ -27,8 +27,6 @@
"no-switch-case-fall-through": true, "no-switch-case-fall-through": true,
"no-unsafe-finally": true, "no-unsafe-finally": true,
"no-unused-expression": true, "no-unused-expression": true,
"no-unused-new": true,
"no-use-before-declare": true,
"no-var-keyword": true, "no-var-keyword": true,
"radix": true, "radix": true,
"triple-equals": [ true, "triple-equals": [ true,