| @@ -31,9 +31,14 @@ export class DashboardComponent implements OnInit { | |||||
| this.orderService.getOrders().then((data) => { | this.orderService.getOrders().then((data) => { | ||||
| this.orderList = data; | this.orderList = data; | ||||
| this.orderList = this.orderList.filter((order) => { | |||||
| return order.orderstatus; | |||||
| }); | |||||
| for (let i = 0; i < this.orderList.length; i += 1) { | |||||
| if (!this.orderList[i].orderstatus) { | |||||
| this.orderList[i].orderstatus = { | |||||
| orderStatus: "", | |||||
| orderstatus_id: 6 | |||||
| } | |||||
| } | |||||
| } | |||||
| }, () => { | }, () => { | ||||
| alert("Error getting the orders"); | alert("Error getting the orders"); | ||||
| }); | }); | ||||
| @@ -60,13 +60,16 @@ export class OrdersComponent implements OnInit { | |||||
| this.orderService.getOrders().then((data) => { | this.orderService.getOrders().then((data) => { | ||||
| this.orderList = data; | this.orderList = data; | ||||
| this.orderList = this.orderList.filter((order) => { | |||||
| return order.orderstatus; | |||||
| }); | |||||
| for (let i = 0; i < this.orderList.length; i += 1) { | |||||
| if (!this.orderList[i].orderstatus) { | |||||
| this.orderList[i].orderstatus = { | |||||
| orderStatus: "", | |||||
| orderstatus_id: 6 | |||||
| } | |||||
| } | |||||
| } | |||||
| this.tempOrderList = this.orderList.filter((order) => { | |||||
| return order.orderstatus; | |||||
| }); | |||||
| this.tempOrderList = JSON.parse(JSON.stringify(this.orderList)); | |||||
| }, () => { | }, () => { | ||||
| alert("Error getting the orders"); | alert("Error getting the orders"); | ||||
| }); | }); | ||||
| @@ -1,10 +1,10 @@ | |||||
| <section class="nav-bar"> | <section class="nav-bar"> | ||||
| <img src="assets/logo.svg" alt="Logo"> | <img src="assets/logo.svg" alt="Logo"> | ||||
| <nav> | <nav> | ||||
| <a [ngClass]="{'active' : selected_nav === 'faq'}" | |||||
| (click)="selected_nav = 'faq'"> FAQ's </a> | |||||
| <a [ngClass]="{'active' : selected_nav === 'support'}" | |||||
| (click)="selected_nav = 'support'"> Support </a> | |||||
| <a [ngClass]="{'active' : selected_nav.name === 'faq'}" | |||||
| (click)="selected_nav.name = 'faq'"> FAQ's </a> | |||||
| <a [ngClass]="{'active' : selected_nav.name === 'support'}" | |||||
| (click)="selected_nav.name = 'support'"> Support </a> | |||||
| <button class="rect-button" (click)="logout()"> Logout </button> | <button class="rect-button" (click)="logout()"> Logout </button> | ||||
| </nav> | </nav> | ||||
| </section> | </section> | ||||