Merge branch 'main' of bitbucket.org:bigtincan/brainware into net8-api

This commit is contained in:
Christopher J. Walker 2024-02-22 17:43:18 -05:00
commit 9b1e8efe36
5 changed files with 48 additions and 26 deletions

View File

@ -1,10 +1,10 @@
{
"/api": {
"target": "http://localhost:5242",
"target": "http://localhost:54730",
"secure": false
},
"/swagger": {
"target": "http://localhost:5242",
"target": "http://localhost:54730",
"secure": false
}
}

View File

@ -1,3 +1,4 @@
<div class="container body-content">
<div class="jumbotron">
<h1>BrainWare Orders</h1>
<p class="lead">This is the BrainWare orders page! Welcome</p>
@ -10,11 +11,16 @@
</div>
<ul>
<li *ngFor="let order of orders">
{{order.description}} (Total: ${{order.orderTotal}})
{{order.Description}} (Total: ${{order.OrderTotal}})
<ul>
<li *ngFor="let orderProduct of order.orderProducts">
{{orderProduct.product.name}} ({{orderProduct.quantity}} &#64;&#64; ${{orderProduct.price}}/ea)
<li *ngFor="let orderProduct of order.OrderProducts">
{{orderProduct.Product.Name}} ({{orderProduct.Quantity}} &#64; ${{orderProduct.Price}}/ea)
</li>
</ul>
</li>
</ul>
<hr />
<footer>
<p>&copy; {{year}} - BrainWare, Inc</p>
</footer>
</div>

View File

@ -1,6 +1,6 @@
import { CommonModule } from '@angular/common';
import { HttpClient } from '@angular/common/http';
import { ChangeDetectorRef, Component, inject } from '@angular/core';
import { Component } from '@angular/core';
import { RouterModule } from '@angular/router';
@Component({
@ -11,15 +11,12 @@ import { RouterModule } from '@angular/router';
styleUrl: './app.component.scss',
})
export class AppComponent {
private http = inject(HttpClient);
private cd = inject(ChangeDetectorRef);
orders: any[] = [];
year = new Date().getFullYear();
constructor() {
this.http.get<any>('/api/order/1').subscribe((orders) => {
constructor(http: HttpClient) {
http.get<any>('/api/order/1').subscribe((orders) => {
this.orders = orders;
this.cd.detectChanges();
});
}
}

View File

@ -6,6 +6,7 @@
<base href="/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.4.1/dist/css/bootstrap.min.css" />
</head>
<body>
<web-app-root></web-app-root>

View File

@ -1 +1,19 @@
/* You can add global styles to this file, and also import other style files */
body {
padding-top: 50px;
padding-bottom: 20px;
}
/* Set padding to keep content from hitting the edges */
.body-content {
padding-top: 15px;
padding-left: 15px;
padding-right: 15px;
}
/* Set width on the form input elements since they're 100% wide by default */
input,
select,
textarea {
max-width: 280px;
}