WIP - Board display
This commit is contained in:
parent
df1280c6d4
commit
99ce275b79
@ -2,7 +2,10 @@ import { Routes, RouterModule } from '@angular/router';
|
|||||||
|
|
||||||
import { AuthGuard } from './shared/index';
|
import { AuthGuard } from './shared/index';
|
||||||
import { Login } from './login/login.component';
|
import { Login } from './login/login.component';
|
||||||
import { BoardDisplay } from './board/board.component';
|
import {
|
||||||
|
BoardDisplay,
|
||||||
|
ColumnDisplay
|
||||||
|
} from './board/index';
|
||||||
import {
|
import {
|
||||||
Settings,
|
Settings,
|
||||||
UserAdmin,
|
UserAdmin,
|
||||||
@ -42,6 +45,7 @@ const ROUTES: Routes = [
|
|||||||
export const ROUTE_COMPONENTS = [
|
export const ROUTE_COMPONENTS = [
|
||||||
Login,
|
Login,
|
||||||
BoardDisplay,
|
BoardDisplay,
|
||||||
|
ColumnDisplay,
|
||||||
Settings,
|
Settings,
|
||||||
UserAdmin,
|
UserAdmin,
|
||||||
BoardAdmin,
|
BoardAdmin,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<tb-top-nav></tb-top-nav>
|
<tb-top-nav page-name="{{ pageName }}"></tb-top-nav>
|
||||||
|
|
||||||
<div class="board-nav">
|
<div class="board-nav">
|
||||||
<label>
|
<label>
|
||||||
@ -19,20 +19,28 @@
|
|||||||
</label>
|
</label>
|
||||||
<label>
|
<label>
|
||||||
User Filter:
|
User Filter:
|
||||||
<select>
|
<select [(ngModel)]="userFilter">
|
||||||
<option>Any</option>
|
<option [ngValue]="null">Any</option>
|
||||||
|
<option *ngFor="let user of activeBoard.users"
|
||||||
|
[ngValue]="user.id">
|
||||||
|
{{ user.username }}
|
||||||
|
</option>
|
||||||
</select>
|
</select>
|
||||||
</label>
|
</label>
|
||||||
<label>
|
<label>
|
||||||
Category Filter:
|
Category Filter:
|
||||||
<select>
|
<select [(ngModel)]="categoryFilter">
|
||||||
<option>Any</option>
|
<option [ngValue]="null">Any</option>
|
||||||
|
<option *ngFor="let category of activeBoard.categories"
|
||||||
|
[ngValue]="category.id">
|
||||||
|
{{ category.name }}
|
||||||
|
</option>
|
||||||
</select>
|
</select>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="no-boards center" *ngIf="!boards || boards.length === 0">
|
<div class="no-boards center" *ngIf="!loading && (!boards || boards.length === 0)">
|
||||||
<h1>No Boards</h1>
|
<h1>No Boards</h1>
|
||||||
|
|
||||||
<p>{{ noBoardsMessage }}</p>
|
<p>{{ noBoardsMessage }}</p>
|
||||||
@ -50,6 +58,10 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="board" *ngIf="activeBoard">
|
<div class="board" *ngIf="activeBoard">
|
||||||
|
<tb-column class="column"
|
||||||
|
*ngFor="let column of activeBoard.columns"
|
||||||
|
[column]="column"></tb-column>
|
||||||
|
<!--
|
||||||
<div class="column">
|
<div class="column">
|
||||||
<h3>
|
<h3>
|
||||||
<span class="icon icon-minus-squared-alt" title="Collapse All Tasks"></span>
|
<span class="icon icon-minus-squared-alt" title="Collapse All Tasks"></span>
|
||||||
@ -195,7 +207,6 @@
|
|||||||
<button class="flat"><i class="icon icon-plus"></i></button>
|
<button class="flat"><i class="icon icon-plus"></i></button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<pre><code>{{ activeUser | json }}</code></pre>
|
-->
|
||||||
<pre><code>{{ activeBoard | json }}</code></pre>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -29,7 +29,11 @@ export class BoardDisplay implements OnInit {
|
|||||||
private boards: Array<Board>;
|
private boards: Array<Board>;
|
||||||
|
|
||||||
private boardNavId: number;
|
private boardNavId: number;
|
||||||
|
private userFilter: number;
|
||||||
|
private categoryFilter: number;
|
||||||
private noBoardsMessage: string;
|
private noBoardsMessage: string;
|
||||||
|
private pageName: string;
|
||||||
|
private loading: boolean;
|
||||||
|
|
||||||
constructor(private title: Title,
|
constructor(private title: Title,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
@ -41,9 +45,16 @@ export class BoardDisplay implements OnInit {
|
|||||||
private dragula: DragulaService) {
|
private dragula: DragulaService) {
|
||||||
title.setTitle('TaskBoard - Kanban App');
|
title.setTitle('TaskBoard - Kanban App');
|
||||||
this.boardNavId = null;
|
this.boardNavId = null;
|
||||||
|
this.userFilter = null;
|
||||||
|
this.categoryFilter = null;
|
||||||
|
|
||||||
|
this.pageName = 'Boards';
|
||||||
|
this.loading = true;
|
||||||
|
|
||||||
|
|
||||||
boardService.getBoards().subscribe((response: ApiResponse) => {
|
boardService.getBoards().subscribe((response: ApiResponse) => {
|
||||||
this.updateBoardsList(response.data[1]);
|
this.updateBoardsList(response.data[1]);
|
||||||
|
this.loading = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
auth.userChanged.subscribe((user: User) => {
|
auth.userChanged.subscribe((user: User) => {
|
||||||
@ -109,6 +120,7 @@ export class BoardDisplay implements OnInit {
|
|||||||
this.boards.forEach(board => {
|
this.boards.forEach(board => {
|
||||||
if (board.id === this.boardNavId) {
|
if (board.id === this.boardNavId) {
|
||||||
this.activeBoard = board;
|
this.activeBoard = board;
|
||||||
|
this.pageName = board.name;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
27
src/app/board/column/column.component.html
Normal file
27
src/app/board/column/column.component.html
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<h3>
|
||||||
|
<span class="icon icon-minus-squared-alt"
|
||||||
|
title="Collapse All Tasks"></span>
|
||||||
|
|
||||||
|
{{ column.name }}
|
||||||
|
|
||||||
|
<span class="badge" title="Tasks in Column">
|
||||||
|
{{ taskCount }}
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<span class="icon icon-angle-double-up"
|
||||||
|
title="Expand Column" (click)="toggleCollapsed()"></span>
|
||||||
|
<span class="right icon icon-angle-double-down"
|
||||||
|
title="Collapse Column" (click)="toggleCollapsed()"></span>
|
||||||
|
</h3>
|
||||||
|
|
||||||
|
<div class="quick-add">
|
||||||
|
<input type="text" placeholder="Quick Add Task - Title Only">
|
||||||
|
<button class="flat"><i class="icon icon-plus"></i></button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="tasks">
|
||||||
|
<div class="task">
|
||||||
|
<pre style="margin: 0">{{ column | json }}</pre>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
29
src/app/board/column/column.component.ts
Normal file
29
src/app/board/column/column.component.ts
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
import {
|
||||||
|
Component,
|
||||||
|
Input,
|
||||||
|
ElementRef
|
||||||
|
} from '@angular/core';
|
||||||
|
|
||||||
|
import { Column } from '../../shared/index';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'tb-column',
|
||||||
|
templateUrl: 'app/board/column/column.component.html'
|
||||||
|
})
|
||||||
|
export class ColumnDisplay {
|
||||||
|
private templateElement: any;
|
||||||
|
private taskCount: number;
|
||||||
|
|
||||||
|
@Input('column') column: Column;
|
||||||
|
|
||||||
|
constructor(private elRef: ElementRef) {
|
||||||
|
this.templateElement = elRef.nativeElement;
|
||||||
|
this.taskCount = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
toggleCollapsed() {
|
||||||
|
this.templateElement.classList.toggle('collapsed');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
3
src/app/board/index.ts
Normal file
3
src/app/board/index.ts
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
export * from './column/column.component';
|
||||||
|
export * from './board.component';
|
||||||
|
|
@ -239,7 +239,7 @@ export class AutoActions {
|
|||||||
switch (+action.type) {
|
switch (+action.type) {
|
||||||
case ActionType.SetColor:
|
case ActionType.SetColor:
|
||||||
desc = 'Set item color: <span style="color: ' +
|
desc = 'Set item color: <span style="color: ' +
|
||||||
action.change_to + '";>' + action.change_to + '</span>';
|
action.change_to + ';">' + action.change_to + '</span>';
|
||||||
break;
|
break;
|
||||||
case ActionType.SetCategory:
|
case ActionType.SetCategory:
|
||||||
desc = 'Set item category: ';
|
desc = 'Set item category: ';
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
|
export * from './auto-actions/auto-actions.component';
|
||||||
|
export * from './board-admin/board-admin.component';
|
||||||
export * from './user-admin/user-admin.component';
|
export * from './user-admin/user-admin.component';
|
||||||
export * from './user-settings/user-settings.component';
|
export * from './user-settings/user-settings.component';
|
||||||
export * from './board-admin/board-admin.component';
|
|
||||||
export * from './settings.component';
|
export * from './settings.component';
|
||||||
export * from './auto-actions/auto-actions.component';
|
|
||||||
|
|
||||||
|
@ -46,7 +46,6 @@ export class UserAdmin {
|
|||||||
|
|
||||||
auth.userChanged
|
auth.userChanged
|
||||||
.subscribe(activeUser => {
|
.subscribe(activeUser => {
|
||||||
console.log('userChanged');
|
|
||||||
this.activeUser = new User(+activeUser.default_board_id,
|
this.activeUser = new User(+activeUser.default_board_id,
|
||||||
activeUser.email,
|
activeUser.email,
|
||||||
+activeUser.id,
|
+activeUser.id,
|
||||||
@ -60,19 +59,16 @@ export class UserAdmin {
|
|||||||
|
|
||||||
settings.boardsChanged
|
settings.boardsChanged
|
||||||
.subscribe(boards => {
|
.subscribe(boards => {
|
||||||
console.log('boardsChanged');
|
|
||||||
this.boards = boards;
|
this.boards = boards;
|
||||||
});
|
});
|
||||||
|
|
||||||
settings.getUsers()
|
settings.getUsers()
|
||||||
.subscribe((response: ApiResponse) => {
|
.subscribe((response: ApiResponse) => {
|
||||||
console.log('getUsers');
|
|
||||||
if (response.data[1]) {
|
if (response.data[1]) {
|
||||||
response.data[1].forEach((user: any) => {
|
response.data[1].forEach((user: any) => {
|
||||||
this.users.push(this.convertUser(user));
|
this.users.push(this.convertUser(user));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
console.log(this.users);
|
|
||||||
|
|
||||||
this.getBoards();
|
this.getBoards();
|
||||||
});
|
});
|
||||||
@ -90,7 +86,6 @@ export class UserAdmin {
|
|||||||
if (isAdd) {
|
if (isAdd) {
|
||||||
this.userService.addUser(this.modalProps.user)
|
this.userService.addUser(this.modalProps.user)
|
||||||
.subscribe((response: ApiResponse) => {
|
.subscribe((response: ApiResponse) => {
|
||||||
console.log('addUser');
|
|
||||||
response.alerts.forEach(note => this.notes.add(note));
|
response.alerts.forEach(note => this.notes.add(note));
|
||||||
|
|
||||||
this.replaceUserList(response);
|
this.replaceUserList(response);
|
||||||
@ -132,7 +127,6 @@ export class UserAdmin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private getBoards(): void {
|
private getBoards(): void {
|
||||||
console.log('getBoards');
|
|
||||||
this.settings.getBoards()
|
this.settings.getBoards()
|
||||||
.subscribe((response: ApiResponse) => {
|
.subscribe((response: ApiResponse) => {
|
||||||
let boards = response.data[1];
|
let boards = response.data[1];
|
||||||
@ -190,7 +184,6 @@ export class UserAdmin {
|
|||||||
response.data[1].forEach((user: any) => {
|
response.data[1].forEach((user: any) => {
|
||||||
this.users.push(this.convertUser(user));
|
this.users.push(this.convertUser(user));
|
||||||
});
|
});
|
||||||
console.log('replaceUserList', this.users);
|
|
||||||
|
|
||||||
this.updateUserList();
|
this.updateUserList();
|
||||||
}
|
}
|
||||||
@ -270,7 +263,6 @@ export class UserAdmin {
|
|||||||
user.can_admin = false;
|
user.can_admin = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
console.log('updateUserList', this.users);
|
|
||||||
|
|
||||||
this.settings.updateUsers(<Array<User>> this.users);
|
this.settings.updateUsers(<Array<User>> this.users);
|
||||||
}
|
}
|
||||||
|
@ -43,6 +43,7 @@
|
|||||||
height: calc(100% - 7px);
|
height: calc(100% - 7px);
|
||||||
margin-left: 7px;
|
margin-left: 7px;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
position: relative;
|
||||||
white-space: normal;
|
white-space: normal;
|
||||||
|
|
||||||
h3 {
|
h3 {
|
||||||
@ -61,6 +62,11 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.quick-add {
|
||||||
|
padding: 6px;
|
||||||
|
padding-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
&:last-of-type {
|
&:last-of-type {
|
||||||
margin-right: 7px;
|
margin-right: 7px;
|
||||||
}
|
}
|
||||||
@ -89,7 +95,7 @@
|
|||||||
.icon-angle-double-down,
|
.icon-angle-double-down,
|
||||||
.icon-minus-squared-alt,
|
.icon-minus-squared-alt,
|
||||||
.icon-plus-squared-alt,
|
.icon-plus-squared-alt,
|
||||||
.task,
|
.tasks,
|
||||||
.quick-add {
|
.quick-add {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
@ -101,8 +107,14 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.tasks {
|
.tasks {
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
overflow-y: auto;
|
||||||
padding: 7px;
|
padding: 7px;
|
||||||
padding-bottom: 0;
|
padding-top: 0;
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
top: 5.2em;
|
||||||
|
|
||||||
div:last-of-type {
|
div:last-of-type {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
|
Reference in New Issue
Block a user