From 17fc5b006b6bde4737e796771af2e5402098c047 Mon Sep 17 00:00:00 2001 From: Finn Date: Fri, 12 Jul 2019 20:18:28 +0100 Subject: [PATCH] made fixes to imports and supplier list --- .../dashboard/dashboard-customer.component.ts | 1 - src/app/dashboard/suppliers.component.html | 100 ++++++++++-------- src/app/dashboard/suppliers.component.ts | 12 +-- src/app/shared/supplier-result.component.ts | 2 +- 4 files changed, 62 insertions(+), 53 deletions(-) diff --git a/src/app/dashboard/dashboard-customer.component.ts b/src/app/dashboard/dashboard-customer.component.ts index 559530d..bb6f871 100644 --- a/src/app/dashboard/dashboard-customer.component.ts +++ b/src/app/dashboard/dashboard-customer.component.ts @@ -9,7 +9,6 @@ import { CustBarSnippetComponent } from '../snippets/cust-snippet-bar.component' import { PiePanel } from '../panels/pie-panel.component'; import { DataType } from '../shared/data-types.enum'; import * as moment from 'moment'; -import { SuppliersComponent } from '../dashboard/suppliers.component'; import { MoreStuffComponent } from '../dashboard/more-graphs-and-tables.component'; // import { StackedBarChartComponent } from '../panels/stacked-bar.component'; diff --git a/src/app/dashboard/suppliers.component.html b/src/app/dashboard/suppliers.component.html index 9c442b7..52a53fd 100644 --- a/src/app/dashboard/suppliers.component.html +++ b/src/app/dashboard/suppliers.component.html @@ -1,46 +1,58 @@ -
-
- - - - - - - - - - - -
Name - - - Postcode - - - Spend - - -
- - - +
+
+
+
+ List of Suppliers + This lists all suppliers that have been submitted. +
+
+ + + + + + + + + + + +
Name + + + Postcode + + + Spend + + +
+ + + +
+
+ No Suppliers available. +
+
+
-
+
diff --git a/src/app/dashboard/suppliers.component.ts b/src/app/dashboard/suppliers.component.ts index 170f674..e3cbf0f 100644 --- a/src/app/dashboard/suppliers.component.ts +++ b/src/app/dashboard/suppliers.component.ts @@ -3,16 +3,12 @@ import { ApiService } from '../providers/api-service'; import { AgmCoreModule } from '@agm/core'; import { BsModalService, ModalDirective } from 'ngx-bootstrap/modal'; import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service'; - -interface SuppliersComponent { - name : string; -} +import { PaginationInstance } from 'ngx-pagination'; @Component({ templateUrl: 'suppliers.component.html', }) export class SuppliersComponent implements OnInit, AfterViewInit { - @Input() public recurList: Array; @Output() public onClick = new EventEmitter(); @Input() public categories: any; @@ -44,9 +40,11 @@ export class SuppliersComponent implements OnInit, AfterViewInit { this.api.externalSuppliers(logPage, this.sortBy, this.sortDir).subscribe( result => { this.supplierList = result.suppliers; + if (this.supplierList) { + this.supplierListAvailable = true; + } this.paginateConfig.totalItems = result.page_no; this.paginateConfig.currentPage = logPage; - this.noTransactionList = false; }, error => { console.log('Retrieval Error'); @@ -59,7 +57,7 @@ export class SuppliersComponent implements OnInit, AfterViewInit { sortName() { this.sortByColumn('name'); } sortPostcode() { this.sortByColumn('postcode'); } sortSpend() { this.sortByColumn('spend'); } - + sortByColumn(name) { this.sortBy = name; this.sortDir = this.sortDir === 'asc' ? 'desc' : 'asc'; diff --git a/src/app/shared/supplier-result.component.ts b/src/app/shared/supplier-result.component.ts index 83ffc4c..aac4e75 100644 --- a/src/app/shared/supplier-result.component.ts +++ b/src/app/shared/supplier-result.component.ts @@ -3,7 +3,7 @@ import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; interface SupplierData { name: string; postcode: string; - spend: number = 0; + spend: number; } @Component({