From a3edc975844777a91d2c001a084bf42705539e62 Mon Sep 17 00:00:00 2001 From: "Christopher J. Walker" Date: Thu, 22 Feb 2024 17:33:44 -0500 Subject: [PATCH] Update Angular client --- web-app/proxy.conf.json | 4 +-- web-app/src/app/app.component.html | 40 +++++++++++++++++------------- web-app/src/app/app.component.ts | 11 +++----- web-app/src/index.html | 1 + web-app/src/styles.scss | 18 ++++++++++++++ 5 files changed, 48 insertions(+), 26 deletions(-) diff --git a/web-app/proxy.conf.json b/web-app/proxy.conf.json index 7b91889..7266a12 100644 --- a/web-app/proxy.conf.json +++ b/web-app/proxy.conf.json @@ -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 } } diff --git a/web-app/src/app/app.component.html b/web-app/src/app/app.component.html index 80ccbce..828bc45 100644 --- a/web-app/src/app/app.component.html +++ b/web-app/src/app/app.component.html @@ -1,20 +1,26 @@ -
-

BrainWare Orders

-

This is the BrainWare orders page! Welcome

-
-
-
+
+
+

BrainWare Orders

+

This is the BrainWare orders page! Welcome

+
+
+

Your Orders

+
-
-
    -
  • - {{order.description}} (Total: ${{order.orderTotal}}) -
      -
    • - {{orderProduct.product.name}} ({{orderProduct.quantity}} @@ ${{orderProduct.price}}/ea) -
    • -
    -
  • -
\ No newline at end of file +
    +
  • + {{order.Description}} (Total: ${{order.OrderTotal}}) +
      +
    • + {{orderProduct.Product.Name}} ({{orderProduct.Quantity}} @ ${{orderProduct.Price}}/ea) +
    • +
    +
  • +
+
+
+

© {{year}} - BrainWare, Inc

+
+
\ No newline at end of file diff --git a/web-app/src/app/app.component.ts b/web-app/src/app/app.component.ts index 65cfa3e..b34d954 100644 --- a/web-app/src/app/app.component.ts +++ b/web-app/src/app/app.component.ts @@ -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('/api/order/1').subscribe((orders) => { + constructor(http: HttpClient) { + http.get('/api/order/1').subscribe((orders) => { this.orders = orders; - this.cd.detectChanges(); }); } } diff --git a/web-app/src/index.html b/web-app/src/index.html index 520e313..daaf49b 100644 --- a/web-app/src/index.html +++ b/web-app/src/index.html @@ -6,6 +6,7 @@ + diff --git a/web-app/src/styles.scss b/web-app/src/styles.scss index 90d4ee0..581fa38 100644 --- a/web-app/src/styles.scss +++ b/web-app/src/styles.scss @@ -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; +} \ No newline at end of file