Commit 995edcbc authored by Darrick Yong's avatar Darrick Yong

fix itemPrice type and add order detail table

parent 1e617d45
......@@ -128,30 +128,48 @@
overflow: hidden;
padding: 20px 50px;
box-sizing: border-box;
overflow: scroll;
/* background: white; */
}
.animate {
transition: max-height 1s ease-out;
max-height: 200px;
transition: max-height 0.75s ease-in-out;
max-height: 400px;
}
.order-details-header {
padding: 4px 0;
font-size: 20px;
font-weight: 700;
border-bottom: 1px solid red;
border-bottom: 2px solid black;
}
.order-detail-table {
/* margin: 20px; */
/* border-spacing: 30px; */
margin: 15px;
}
.order-details thead {
.order-detail-table thead {
font-weight: 700;
border-bottom: 1px solid black;
}
.order-detail-table th,
.order-detail-table td {
padding: 5px 20px;
}
.item-detail ~ .item-detail {
border-top: 1px solid red;
/* border-top: 1px solid red; */
}
.item-sku, .item-qty {
text-align: center;
}
.item-price {
text-align: end;
}
.order-detail-table th ~ th,
.order-detail-table td ~ td {
border-left: 1px solid black;
}
\ No newline at end of file
......@@ -4,15 +4,15 @@ const ItemDetails = ({ item }) => {
return (
<tr className="item-detail">
<th>{itemSku}</th>
<th>{itemName}</th>
<th>{`$${itemPrice}`}</th>
<th>{itemQuantity}</th>
<td className="item-sku">{itemSku}</td>
<td className="item-name">{itemName}</td>
<td className="item-qty">{itemQuantity}</td>
<td className="item-price">{`$${itemPrice.toFixed(2)}`}</td>
</tr>
// <li className="item-detail">
// {`${itemName} -- x ${itemQuantity} bought at ${itemPrice}/ea.`}
// </li>
)
);
}
export default ItemDetails;
\ No newline at end of file
......@@ -5,18 +5,14 @@ const OrderDetails = ({ order, showDetails }) => {
return (
<div className={`order-details ${showDetails ? "animate" : ""}`}>
<div className="order-details-container">
{`Warehouse Order #: ${order.id}`}
<div className="order-details-header">
Order Details
</div>
<div className="order-details-header">Order Details:</div>
<table className="order-detail-table">
<thead>
<tr>
<th>SKU #</th>
<th>Name</th>
<th>Price</th>
<th>Quantity</th>
<th>Price</th>
</tr>
</thead>
<tbody>
......@@ -25,6 +21,7 @@ const OrderDetails = ({ order, showDetails }) => {
))}
</tbody>
</table>
{`Warehouse Order #: ${order.id}`}
</div>
</div>
);
......
......@@ -5,6 +5,7 @@ import com.ascendfinalproject.warehouse.models.WarehouseOrder;
import com.ascendfinalproject.warehouse.services.WarehouseOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.annotation.Order;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
......@@ -16,12 +17,6 @@ public class WarehouseController {
@Autowired
WarehouseOrderService orderService;
// @CrossOrigin
// @GetMapping(value = "/orders")
// public Mono<OrderResponse> getOrders() throws InterruptedException {
// return orderService.getOrders();
// }
//
@CrossOrigin
@GetMapping(value = "/orders")
public Flux<WarehouseOrder> getOrders() {
......
......@@ -12,10 +12,10 @@ public class Item {
private String itemId;
private String itemName;
private int itemQuantity;
private int itemPrice;
private double itemPrice;
private int itemSku;
public Item(String itemId, String itemName, int itemQuantity, int itemPrice, int itemSku) {
public Item(String itemId, String itemName, int itemQuantity, double itemPrice, int itemSku) {
this.itemId = itemId;
this.itemName = itemName;
this.itemQuantity = itemQuantity;
......
......@@ -25,26 +25,6 @@ public class WarehouseOrderService {
return orderRepository.findById(id);
}
// public Mono<OrderResponse> getOrders() throws InterruptedException {
// add ResponseEntity
// return orderRepository.findAll();
// OrderResponse res = new OrderResponse();
// Flux<WarehouseOrder> warehouseOrderFlux = orderRepository.findAll().log().map(order -> {
// res.addOrder(order);
// res.appendId(order.getId());
// return order;
// });
// Mono<ResponseEntity<OrderResponse>>
// return warehouseOrderFlux.doOnComplete(() -> Mono.just(res));
// return warehouseOrderFlux.next().map(wareHouse -> res)
// .doOnSuccess(subscription -> Mono.just(res));
//
//
// System.out.println("-----");
// System.out.println(res);
// Thread.sleep(2000);
// return Mono.just(res);
// }
public Flux<WarehouseOrder> getOrders() {
return orderRepository.findAll();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment