Trash can icon added to new order list - deleting line is not enabled yet.

This commit is contained in:
Rene V. Vergara A. 2022-07-16 20:49:58 -05:00
parent e4a557660d
commit cbac13b373
4 changed files with 80 additions and 32 deletions

View file

@ -6,11 +6,12 @@ import { UserService } from '../user.service';
import {Owner} from '../owner.model'; import {Owner} from '../owner.model';
import { OrderService } from '../order/order.service'; import { OrderService } from '../order/order.service';
import { faTimes } from '@fortawesome/free-solid-svg-icons' import { faTimes } from '@fortawesome/free-solid-svg-icons';
import { faTimesCircle } from '@fortawesome/free-solid-svg-icons' import { faTimesCircle } from '@fortawesome/free-solid-svg-icons';
import { faCheck } from '@fortawesome/free-solid-svg-icons' import { faCheck } from '@fortawesome/free-solid-svg-icons';
import { faCheckCircle } from '@fortawesome/free-solid-svg-icons' import { faCheckCircle } from '@fortawesome/free-solid-svg-icons';
import { faHourglass } from '@fortawesome/free-solid-svg-icons' import { faHourglass } from '@fortawesome/free-solid-svg-icons';
import { faTrash } from '@fortawesome/free-solid-svg-icons';
@Component({ @Component({
selector: 'app-list-orders', selector: 'app-list-orders',
@ -32,6 +33,7 @@ export class ListOrdersComponent implements OnInit, OnDestroy{
faCheck = faCheck; faCheck = faCheck;
faCheckCircle = faCheckCircle; faCheckCircle = faCheckCircle;
faHourglass = faHourglass; faHourglass = faHourglass;
faTrash = faTrash;
// ------------------------------------- // -------------------------------------

View file

@ -11,14 +11,41 @@ img.icon{
height: 18px; height: 18px;
} }
.tbheader { .noOrderMsg {
font-family: Roboto Mono; font-family: Roboto Mono;
font-size: 14px;
font-weight: 700;
margin-top: 5px;
align-items: center;
}
.newOrder {
font-family: Roboto Mono !important;
}
.newOrderTitle1 {
font-size: 19px;
font-weight: 700;
height: 20px;
}
.newOrderTitle2 {
font-size: 16px;
font-weight: 400;
height: 18px;
}
.newOrdertbheader {
font-size: 14px; font-size: 14px;
font-weight: 700; font-weight: 700;
} }
.tbdetail { .newOrdertbdetail {
font-family: Roboto Mono;
font-size: 14px; font-size: 14px;
font-weight: 400; font-weight: 400;
} }
.lineTrashCan {
cursor: pointer;
}

View file

@ -1,20 +1,14 @@
<div align="center" <div class="noOrderMsg"
style="font-family: Roboto Mono; *ngIf="order.address.length == 0">
font-size: 14px;
font-weight: 700;
margin-top: 5px;" *ngIf="order.address.length == 0">
No open order! No open order!
</div> </div>
<mat-card style="margin-top: 10px;" *ngIf="order.address.length" > <mat-card style="margin-top: 10px;" *ngIf="order.address.length" >
<div> <div class="newOrder">
<mat-card-title> <mat-card-title>
<table style="width: 100%;" <table style="width: 100%;"
cellspacing="0"> cellspacing="0">
<tr style="font-family: Roboto Mono; <tr class="newOrderTitle1">
font-size: 19px;
font-weight: 700;
height: 20px;">
<td width="50%">Order Total:</td> <td width="50%">Order Total:</td>
<td align="right" <td align="right"
width="50%"> width="50%">
@ -22,10 +16,7 @@
>{{(total/price) | number: '1.0-6'}} >{{(total/price) | number: '1.0-6'}}
</td> </td>
</tr> </tr>
<tr style="font-family: Roboto Mono; <tr class="newOrderTitle2">
font-size: 16px;
font-weight: 400;
height: 18px;">
<td width="50%"> <td width="50%">
<img class="icon" <img class="icon"
style="color: lightgray; style="color: lightgray;
@ -43,35 +34,45 @@
<thead style="width: 100%;"> <thead style="width: 100%;">
<tr style="background: lightblue;"> <tr style="background: lightblue;">
<th class="tbheader" <th class="newOrdertbheader"
style="text-align: left;" style="text-align: left;"
width="55%">Item width="50%">Item
</th> </th>
<th class="tbheader" <th class="newOrdertbheader"
style="text-align: left;" style="text-align: left;"
width="15%">Qty. width="15%">Qty.
</th> </th>
<th class="tbheader" <th class="newOrdertbheader"
style="text-align: right;" style="text-align: right;"
width="30%">Total width="30%">Total
</th> </th>
<th></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr *ngFor="let item of order.lines"> <tr *ngFor="let item of order.lines">
<td class="tbdetail" <td class="newOrdertbdetail"
style="text-align: left;" style="text-align: left;"
width="55%">{{item.name}} width="50%">{{item.name}}
</td> </td>
<td class="tbdetail" <td class="newOrdertbdetail"
style="text-align: left;" style="text-align: left;"
width="15%">{{item.qty}} width="15%">{{item.qty}}
</td> </td>
<td class="tbdetail" <td class="newOrdertbdetail"
style="text-align: right;" style="text-align: right;"
width="30%">{{item.qty * item.cost | number:'1.02' | currency: getCurrency() }} width="30%">{{item.qty * item.cost | number:'1.02' | currency: getCurrency() }}
</td> </td>
<td class="lineTrashCan">
<a (click)='trashCanClicked(item,order.lines)' >
<fa-icon [icon]="faTrashAlt"
style="color: lightslategrey;
font-size: 16px;
margin: auto;">
</fa-icon>
</a>
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

View file

@ -1,6 +1,7 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { MatDialog, MatDialogConfig} from '@angular/material/dialog'; import { MatDialog, MatDialogConfig} from '@angular/material/dialog';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { LineItem } from '../items/lineitem.model';
import { Order } from './order.model'; import { Order } from './order.model';
import { FullnodeService } from '../fullnode.service'; import { FullnodeService } from '../fullnode.service';
import { OrderService } from './order.service'; import { OrderService } from './order.service';
@ -10,6 +11,10 @@ import { PromptInvoiceComponent } from '../prompt-invoice/prompt-invoice.compone
import { ReceiptQRComponent} from '../receipt-qr/receipt-qr.component'; import { ReceiptQRComponent} from '../receipt-qr/receipt-qr.component';
import { faFileInvoiceDollar } from '@fortawesome/free-solid-svg-icons'; import { faFileInvoiceDollar } from '@fortawesome/free-solid-svg-icons';
import { faTrash } from '@fortawesome/free-solid-svg-icons';
import { faTrashAlt } from '@fortawesome/free-solid-svg-icons';
@Component({ @Component({
selector: 'app-order', selector: 'app-order',
templateUrl: './order.component.html', templateUrl: './order.component.html',
@ -42,6 +47,14 @@ export class OrderComponent implements OnInit{
public priceUpdate: Observable<number>; public priceUpdate: Observable<number>;
public totalUpdate: Observable<number>; public totalUpdate: Observable<number>;
// ------------------------------------
//
faTrash = faTrash;
faTrashAlt = faTrashAlt;
// -------------------------------------
constructor( constructor(
public fullnodeService: FullnodeService, public fullnodeService: FullnodeService,
public orderService: OrderService, public orderService: OrderService,
@ -145,4 +158,9 @@ export class OrderComponent implements OnInit{
getCurrency(){ getCurrency(){
return this.order.currency.toUpperCase(); return this.order.currency.toUpperCase();
} }
trashCanClicked(item : LineItem, lines: LineItem[]) {
console.log(item);
console.log(lines);
}
} }