Updated Navbar link
This commit is contained in:
parent
3b80d8dd89
commit
a3de450b2d
|
@ -8,7 +8,7 @@
|
|||
<mat-card-header>
|
||||
<h1>Inventory Deposits</h1>
|
||||
</mat-card-header>
|
||||
<mat-card-header> <h4 class="card-title">(Total Inventory - Total Prints) since 10/5/2020: ""| safe:" samples_since" Labels
|
||||
<mat-card-header> <h4 class="card-title">(Total Inventory - Total Prints) since 10/5/2020: {{topBarData[7]}} Labels
|
||||
Remaining</h4>
|
||||
</mat-card-header>
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
import { GraphService } from '../services/graph.service'
|
||||
import { PageEvent } from '@angular/material/paginator'
|
||||
import { ApiService } from '../services/api.service';
|
||||
import { InventoryDeposit } from "../models/deposit.interface";
|
||||
|
||||
import { SearchForm } from '../models/search_form'
|
||||
@Component({
|
||||
selector: 'app-deposits',
|
||||
templateUrl: './deposits.component.html',
|
||||
|
@ -19,16 +19,28 @@ export class DepositsComponent implements OnInit {
|
|||
date_temp = new Date(Date.now());
|
||||
notify_data : Array<Array<number>>[] = [];
|
||||
constructor(
|
||||
private depositService: ApiService) {
|
||||
private depositService: ApiService,
|
||||
private graphService: GraphService) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
form: SearchForm = {
|
||||
start_date: "10/05/2020",
|
||||
end_date: new Date().toLocaleDateString(),
|
||||
student_id: "",
|
||||
location: "",
|
||||
compute_id: "",
|
||||
include_tests: false
|
||||
};
|
||||
|
||||
remainingLabels: number;
|
||||
|
||||
topBarData: Array<number> = [0, 0, 0, 0, 0, 0, 0, 0];
|
||||
addDeposit(): void {
|
||||
this.newDeposit.date_added = this.date_temp.toLocaleDateString();
|
||||
|
||||
this.depositService.addDeposit(this.newDeposit).subscribe()
|
||||
this.current_page = 0;
|
||||
this.depositService.getDeposits(0).subscribe(searchResult => this.depositList = searchResult);
|
||||
this.depositService.addDeposit(this.newDeposit).subscribe();
|
||||
this.loadPage(0);
|
||||
}
|
||||
|
||||
current_page: number = 0;
|
||||
|
@ -37,25 +49,35 @@ export class DepositsComponent implements OnInit {
|
|||
pageSizeOptions: number[] = [10,20,50,100];
|
||||
displayedColumns: string[] = ['position', 'name', 'weight'];
|
||||
|
||||
updatePage(event: PageEvent) {
|
||||
changePage(event: PageEvent) {
|
||||
this.current_page = event.pageIndex;
|
||||
this.depositService.getDeposits(this.current_page).subscribe(searchResult => this.depositList = searchResult);
|
||||
}
|
||||
loadPage(event: number) {
|
||||
this.current_page = event;
|
||||
this.depositService.getDeposits(this.current_page).subscribe(searchResult => this.depositList = searchResult);
|
||||
this.graphService.getTopBarData(this.form).subscribe(tempData => {
|
||||
this.topBarData = tempData;
|
||||
});
|
||||
}
|
||||
|
||||
next(){
|
||||
if (this.depositList.length > 0){
|
||||
this.current_page += 1;
|
||||
this.depositService.getDeposits(this.current_page).subscribe(depositList => this.depositList = depositList); }}
|
||||
this.loadPage(this.current_page);
|
||||
}
|
||||
}
|
||||
|
||||
prev(){
|
||||
if (this.current_page > 0){
|
||||
this.current_page -= 1;
|
||||
this.depositService.getDeposits(this.current_page).subscribe(depositList => this.depositList = depositList);
|
||||
this.loadPage(this.current_page);
|
||||
}
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.depositService.getDeposits(0).subscribe(searchResult => this.depositList = searchResult);
|
||||
|
||||
this.loadPage(0);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -142,34 +142,34 @@
|
|||
<ng-container matColumnDef="position">
|
||||
<th mat-header-cell *matHeaderCellDef> Barcode </th>
|
||||
|
||||
<td mat-cell *matCellDef="let sample; let i = index;"> {{sample.barcode}} </td>
|
||||
<td mat-cell *matCellDef="let sample; "> {{sample.barcode}} </td>
|
||||
</ng-container>
|
||||
|
||||
<!-- Name Column -->
|
||||
<ng-container matColumnDef="name">
|
||||
<th mat-header-cell *matHeaderCellDef> Date </th>
|
||||
|
||||
<td mat-cell *matCellDef="let sample; let i = index;"> {{sample.date}}</td>
|
||||
<td mat-cell *matCellDef="let sample; "> {{sample.date}}</td>
|
||||
</ng-container>
|
||||
|
||||
<!-- Weight Column -->
|
||||
<ng-container matColumnDef="weight">
|
||||
<th mat-header-cell *matHeaderCellDef> Location </th>
|
||||
|
||||
<td mat-cell *matCellDef="let sample; let i = index;"> Location: {{sample.location}}<br>Station:
|
||||
<td mat-cell *matCellDef="let sample; "> Location: {{sample.location}}<br>Station:
|
||||
{{sample.station}}</td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="email">
|
||||
|
||||
<th mat-header-cell *matHeaderCellDef> IDs </th>
|
||||
<td mat-cell *matCellDef="let sample; let i = index;">
|
||||
<td mat-cell *matCellDef="let sample; ">
|
||||
Compute ID: {{sample.compute_id}}<br>Student ID: {{sample.student_id}}
|
||||
</td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="text">
|
||||
<th mat-header-cell *matHeaderCellDef> Contacts </th>
|
||||
<td mat-cell *matCellDef="let sample; let i = index;">
|
||||
<td mat-cell *matCellDef="let sample; ">
|
||||
Phone: {{sample.phone}}<br>Email: {{sample.email}}
|
||||
</td>
|
||||
</ng-container>
|
||||
|
|
|
@ -5,6 +5,7 @@ import { Label } from 'ng2-charts';
|
|||
import { GraphService } from '../services/graph.service'
|
||||
import { Sample } from '../models/sample.interface'
|
||||
import { SearchForm } from '../models/search_form'
|
||||
|
||||
import {PageEvent} from '@angular/material/paginator'
|
||||
import * as pluginDataLabels from 'chartjs-plugin-datalabels';
|
||||
|
||||
|
@ -19,7 +20,7 @@ export class GraphsComponent implements OnInit {
|
|||
|
||||
constructor(private graphService: GraphService) { }
|
||||
|
||||
topBarData: Array<number> = [0, 0, 0, 0, 0, 0, 0];
|
||||
topBarData: Array<number> = [0, 0, 0, 0, 0, 0, 0, 0];
|
||||
ChartName: String = "Location Activity";
|
||||
dailyChartLabels: Label[] = [];
|
||||
weekdayChartLabels: Label[] = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"];
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<button id="nav_location" mat-button routerLink="/settings">{{locationId === '0000' ? 'Click here to set location' : 'Location: ' + locationId}}</button>
|
||||
<span fxFlex></span>
|
||||
<button id="nav_home" mat-icon-button routerLink="/"><mat-icon>home</mat-icon></button>
|
||||
<button id="nav_dash" mat-icon-button routerLink="/dashboard"><mat-icon>dashboard</mat-icon></button>
|
||||
<button id="nav_dash" mat-icon-button [routerLink]="['/dashboard', 'graphs']"><mat-icon>dashboard</mat-icon></button>
|
||||
<button id="nav_settings" mat-icon-button routerLink="/settings"><mat-icon>settings</mat-icon></button>
|
||||
</mat-toolbar-row>
|
||||
</mat-toolbar>
|
||||
|
|
Loading…
Reference in New Issue