Initial Auto Actions admin setup

This commit is contained in:
Matthew Ross 2017-01-17 06:29:32 -05:00
parent 0dd62749df
commit 4ffea04278
6 changed files with 161 additions and 93 deletions

View File

@ -7,7 +7,8 @@ import {
Settings,
UserAdmin,
BoardAdmin,
UserSettings
UserSettings,
AutoActions
} from './settings/index';
import { Dashboard, Charts, Calendar } from './dashboard/index';
@ -40,6 +41,7 @@ export const ROUTE_COMPONENTS = [
UserAdmin,
BoardAdmin,
UserSettings,
AutoActions,
Dashboard,
Charts,
Calendar

View File

@ -0,0 +1,92 @@
<section *ngIf="showActions">
<h2>Automatic Actions</h2>
<div class="row">
<h3>Current Actions</h3>
<table class="alternating no-bottom-margin">
<thead>
<tr>
<th>Board</th>
<th>Trigger</th>
<th>Action</th>
<th>Remove</th>
</tr>
</thead>
<tbody>
<tr>
<td>Example Board</td>
<td>Item assigned to user: admin</td>
<td>Set item color: #debee8</td>
<td>
<a href="#" title="Remove Automatic Action">
<i class="icon icon-trash-empty color-secondary"></i>
</a>
</td>
</tr>
<tr>
<td>Example Board</td>
<td>Item moved to column: Col3</td>
<td>Set item color: #debee8</td>
<td>
<a href="#" title="Remove Automatic Action">
<i class="icon icon-trash-empty color-secondary"></i>
</a>
</td>
</tr>
</tbody>
</table>
</div>
<div class="row">
<h3>Add Action</h3>
<table>
<thead>
<tr class="borderless">
<th>Select Board:</th>
<th>Select Trigger:</th>
<th>Select Action:</th>
</tr>
</thead>
<tbody>
<tr class="borderless">
<td>
<select>
<option>Select Board...</option>
</select>
</td>
<td>
<select>
<option>Item moves to column</option>
</select>
</td>
<td>
<select>
<option>Set item color</option>
</select>
</td>
</tr>
<tr class="borderless">
<td></td>
<td>
<select>
<option>Select Column</option>
</select>
</td>
<td>
<select>
<option>Select Color</option>
</select>
</td>
</tr>
</tbody>
</table>
<button class="right" disabled>
<i class="icon icon-plus"></i>
Add Action
</button>
</div>
</section>

View File

@ -0,0 +1,46 @@
import { Component } from '@angular/core';
import { AutoActionsService } from './auto-actions.service';
import {
ApiResponse,
User,
Modal,
Notification,
AuthService,
ModalService,
NotificationsService
} from '../../shared/index';
@Component({
selector: 'tb-auto-actions',
templateUrl: 'app/settings/auto-actions/auto-actions.component.html',
providers: [ AutoActionsService ]
})
export class AutoActions {
private activeUser: User;
private showActions: boolean;
constructor(private auth: AuthService,
private modal: ModalService,
private notes: NotificationsService,
private actions: AutoActionsService) {
this.showActions = false;
auth.userChanged
.subscribe(activeUser => {
this.activeUser = new User(+activeUser.default_board_id,
activeUser.email,
+activeUser.id,
activeUser.last_login,
+activeUser.security_level,
+activeUser.user_option_id,
activeUser.username,
activeUser.board_access);
if (+activeUser.security_level < 3) {
this.showActions = true;
}
});
}
}

View File

@ -0,0 +1,18 @@
import { Injectable } from '@angular/core';
import { Http } from '@angular/http';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/of';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/catch';
import {
ApiResponse
} from '../../shared/index';
@Injectable()
export class AutoActionsService {
constructor(private http: Http) {
}
}

View File

@ -2,4 +2,5 @@ export * from './user-admin/user-admin.component';
export * from './user-settings/user-settings.component';
export * from './board-admin/board-admin.component';
export * from './settings.component';
export * from './auto-actions/auto-actions.component';

View File

@ -8,98 +8,7 @@
<div class="half-page">
<tb-board-admin></tb-board-admin>
<section>
<h2>Automatic Actions</h2>
<div class="row">
<h3>Current Actions</h3>
<table class="alternating no-bottom-margin">
<thead>
<tr>
<th>Board</th>
<th>Trigger</th>
<th>Action</th>
<th>Remove</th>
</tr>
</thead>
<tbody>
<tr>
<td>Example Board</td>
<td>Item assigned to user: admin</td>
<td>Set item color: #debee8</td>
<td>
<a href="#" title="Remove Automatic Action">
<i class="icon icon-trash-empty color-secondary"></i>
</a>
</td>
</tr>
<tr>
<td>Example Board</td>
<td>Item moved to column: Col3</td>
<td>Set item color: #debee8</td>
<td>
<a href="#" title="Remove Automatic Action">
<i class="icon icon-trash-empty color-secondary"></i>
</a>
</td>
</tr>
</tbody>
</table>
</div>
<div class="row">
<h3>Add Action</h3>
<table>
<thead>
<tr class="borderless">
<th>Select Board:</th>
<th>Select Trigger:</th>
<th>Select Action:</th>
</tr>
</thead>
<tbody>
<tr class="borderless">
<td>
<select>
<option>Select Board...</option>
</select>
</td>
<td>
<select>
<option>Item moves to column</option>
</select>
</td>
<td>
<select>
<option>Set item color</option>
</select>
</td>
</tr>
<tr class="borderless">
<td></td>
<td>
<select>
<option>Select Column</option>
</select>
</td>
<td>
<select>
<option>Select Color</option>
</select>
</td>
</tr>
</tbody>
</table>
<button class="right" disabled>
<i class="icon icon-plus"></i>
Add Action
</button>
</div>
</section>
<tb-auto-actions></tb-auto-actions>
</div>
</div>