Skip to content

Commit

Permalink
refactor(client): migrate to self-closed tags in templates
Browse files Browse the repository at this point in the history
  • Loading branch information
Char2sGu committed Sep 17, 2024
1 parent 7dd16e7 commit 7300a7a
Show file tree
Hide file tree
Showing 30 changed files with 52 additions and 57 deletions.
6 changes: 3 additions & 3 deletions angular-client/src/app/context/app-context.component.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<p-toast></p-toast>
<app-sidebar></app-sidebar>
<router-outlet></router-outlet>
<p-toast />
<app-sidebar />
<router-outlet />
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@
icon="speed"
title="Acceleration Over Time"
color="purple"
>
</info-graph>
/>
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
[data]="data"
[title]="title"
[color]="color"
></graph-component>
/>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
[plotOptions]="chartOptions.plotOptions"
[labels]="chartOptions.labels"
[fill]="chartOptions.fill"
></apx-chart>
/>
</div>
2 changes: 1 addition & 1 deletion angular-client/src/components/hstack/hstack.component.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div fxLayout="row" [fxLayoutAlign]="alignment" [fxLayoutGap]="spacing" style="height: 100%">
<ng-content></ng-content>
<ng-content />
</div>
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<div class="container" (click)="onClick()" [style]="{ 'background-color': backgroundColor }">
<div *ngIf="title" class="title-container">
<div class="title">
<mat-icon *ngIf="icon" aria-hidden="false" [fontIcon]="icon"></mat-icon>
<mat-icon *ngIf="svgIcon" aria-hidden="false" [svgIcon]="svgIcon"></mat-icon>
<mat-icon *ngIf="icon" aria-hidden="false" [fontIcon]="icon" />
<mat-icon *ngIf="svgIcon" aria-hidden="false" [svgIcon]="svgIcon" />
<typography variant="info-title" content="{{ title }}" />
</div>
<div *ngIf="button">
<mat-icon *ngIf="button" aria-hidden="false" (click)="button.onClick()" [fontIcon]="button.icon"></mat-icon>
<mat-icon *ngIf="button" aria-hidden="false" (click)="button.onClick()" [fontIcon]="button.icon" />
</div>
</div>
<typography
Expand All @@ -15,5 +15,5 @@
variant="info-subtitle"
content="Click for more details"
/>
<ng-content></ng-content>
<ng-content />
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
[data]="data"
[title]="subTitle"
[color]="color"
></graph-component>
/>
</info-background>
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div class="spinner-container">
<p-progressSpinner></p-progressSpinner>
<p-progressSpinner />
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
[legend]="chartOptions.legend"
[dataLabels]="chartOptions.dataLabels"
[fill]="chartOptions.fill"
></apx-chart>
/>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<hstack style="width: 100%; height: 100%">
<vstack style="width: 20%">
<circular-percentage [percentage]="cpuUsage" [dimension]="85" [ringColor]="colorRed"></circular-percentage>
<circular-percentage [percentage]="cpuUsage" [dimension]="85" [ringColor]="colorRed" />

<typography variant="info-subtitle" content="CPU Usage" />
</vstack>
Expand All @@ -19,7 +19,7 @@
<divider style="height: 100px"></divider>

<vstack style="width: 20%">
<circular-percentage [percentage]="ramUsage" [dimension]="85" [ringColor]="colorPurple"></circular-percentage>
<circular-percentage [percentage]="ramUsage" [dimension]="85" [ringColor]="colorPurple" />
<div style="display: flex; justify-content: center; align-items: center">
<typography variant="info-subtitle" content="RAM Usage" />
</div>
Expand All @@ -31,7 +31,7 @@
<hstack style="height: 110px">
<typography variant="info-value" [content]="wifiRSSI.toString()" />
<div>
<mat-icon svgIcon="wifi"></mat-icon>
<mat-icon svgIcon="wifi" />
<span class="wifi-dbm-unit">dBM</span>
</div>
</hstack>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<vstack style="width: 100%">
<hstack style="width: 100%; height: 100%">
<vstack style="width: 33%">
<circular-percentage [percentage]="cpuUsage" [dimension]="85" [ringColor]="colorRed"></circular-percentage>
<circular-percentage [percentage]="cpuUsage" [dimension]="85" [ringColor]="colorRed" />

<typography variant="info-subtitle" content="CPU Usage" />
</vstack>
Expand Down Expand Up @@ -29,7 +29,7 @@

<hstack style="width: 50%">
<vstack style="width: 50%">
<circular-percentage [percentage]="ramUsage" [dimension]="85" [ringColor]="colorPurple"></circular-percentage>
<circular-percentage [percentage]="ramUsage" [dimension]="85" [ringColor]="colorPurple" />
<div style="display: flex; justify-content: center; align-items: center">
<typography variant="info-subtitle" content="RAM Usage" />
</div>
Expand All @@ -41,7 +41,7 @@
<hstack style="height: 110px">
<typography variant="info-value" [content]="wifiRSSI.toString()" />
<div>
<mat-icon svgIcon="wifi"></mat-icon>
<mat-icon svgIcon="wifi" />
<span class="wifi-dbm-unit">dBM</span>
</div>
</hstack>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
[ramUsage]="ramUsage"
[wifiRSSI]="wifiRSSI"
[mcs]="mcs"
></raspberry-pi-mobile>
/>
<ng-template #isDesktop>
<raspberry-pi-desktop
style="width: 100%"
[cpuUsage]="cpuUsage"
[ramUsage]="ramUsage"
[wifiRSSI]="wifiRSSI"
[mcs]="mcs"
></raspberry-pi-desktop>
/>
</ng-template>
</info-background>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="chip">
<mat-icon style="margin-right: 10px" [svgIcon]="icon"></mat-icon>
<mat-icon style="margin-right: 10px" [svgIcon]="icon" />
<typography variant="sidebar-label" [content]="value" />
</div>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<mat-icon style="color: white" aria-hidden="false" svgIcon="menu" (click)="toggleSidebar()"></mat-icon>
<mat-icon style="color: white" aria-hidden="false" svgIcon="menu" (click)="toggleSidebar()" />
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<info-background svgIcon="speed" title="Speed">
<half-gauge [current]="34" [max]="100" [min]="0" unit="m/s" color="#ff0000" [size]="400"></half-gauge>
<half-gauge [current]="34" [max]="100" [min]="0" unit="m/s" color="#ff0000" [size]="400" />
</info-background>
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
<info-graph [data]="data" graphContainerId="speedOverTimeGraph" icon="speed" title="Speed Over Time" color="primary">
</info-graph>
<info-graph [data]="data" graphContainerId="speedOverTimeGraph" icon="speed" title="Speed Over Time" color="primary" />
2 changes: 1 addition & 1 deletion angular-client/src/components/vstack/vstack.component.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div fxLayout="column" fxLayoutAlign="center {{ align }}" [fxLayoutGap]="spacing">
<ng-content></ng-content>
<ng-content />
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[dischargeCurrentLimit]="dischargeCurrentLimit"
[packTemp]="packTemp"
[stateOfCharge]="stateOfCharge"
></battery-info-mobile>
/>
<ng-template #isDesktop>
<battery-info-desktop
style="width: 100%"
Expand All @@ -16,6 +16,6 @@
[dischargeCurrentLimit]="dischargeCurrentLimit"
[packTemp]="packTemp"
[stateOfCharge]="stateOfCharge"
></battery-info-desktop>
/>
</ng-template>
</info-background>
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
<!--TODO: (temp fix: padding-bottom) temp fix for voltage graph being centered (and not all the way on bottom of comp)-->
<!--if it is not desktop, we want to show graph seperately... TODO: need to figure out best logic for enforcing that this is done...
or just don't enforce -->
<cell-temp-graph style="width: 80%; padding-bottom: 5vh"></cell-temp-graph>
<cell-temp-graph style="width: 80%; padding-bottom: 5vh" />
</hstack>
</info-background>
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@
icon="speed"
title="Voltage Over Time"
color="#ffffff"
>
</graph-component>
/>
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@
<!--TODO: (temp fix: padding-bottom) temp fix for voltage graph being centered (and not all the way on bottom of comp)-->
<!--if it is not desktop, we want to show graph seperately... TODO: need to figure out best logic for enforcing that this is done...
or just don't enforce -->
<high-low-cell-graph style="width: 70%; padding-bottom: 5vh"></high-low-cell-graph>
<high-low-cell-graph style="width: 70%; padding-bottom: 5vh" />
</hstack>
</info-background>
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@
[data2]="lowVoltsData"
graphContainerId="highLowCellGraph"
icon="speed"
>
</double-line-graph>
/>
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<hstack style="width: 20%">
<typography variant="info-value" [content]="voltage.toString() + 'V'" />
</hstack>
<pack-voltage-graph style="width: 70%; padding-bottom: 5vh"></pack-voltage-graph>
<pack-voltage-graph style="width: 70%; padding-bottom: 5vh" />
</hstack>
</info-background>
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
<graph-component title="Pack Temp" color="#ffff00" [data]="packVoltData" graphContainerId="packTempGraph" icon="speed">
</graph-component>
<graph-component title="Pack Temp" color="#ffff00" [data]="packVoltData" graphContainerId="packTempGraph" icon="speed" />
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
[onClick]="onClearDataType"
label="Clear Data Type"
additionalStyles="background-color: #323232; border: 1.4px solid #027bd7"
></argos-button>
/>
<div *ngIf="run; else otherBlock">
<argos-button
[onClick]="onSetRealtime"
label="Realtime"
additionalStyles="background-color: #323232; border: 1.4px solid #027bd7"
></argos-button>
/>
</div>
<ng-template #otherBlock>
<div style="width: 140px; height: 45px"></div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<argos-button [onClick]="openDialog" [label]="label" additionalStyles="background-color: #027bd7"></argos-button>
<argos-button [onClick]="openDialog" [label]="label" additionalStyles="background-color: #027bd7" />
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<mat-toolbar class="search-block mat-elevation-z4">
<mat-toolbar-row style="padding: 0px">
<button mat-icon-button style="padding: 6px; width: 36px; height: 36px" disabled>
<mat-icon style="padding: 0px; color: #808080" svgIcon="search"></mat-icon>
<mat-icon style="padding: 0px; color: #808080" svgIcon="search" />
</button>
<form [formGroup]="filterForm">
<input matInput class="search-control" type="text" placeholder="Search Topic" formControlName="searchFilter" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
<typography variant="x-large-title" [content]="time | date: 'HH:mm:ss'"></typography>
<typography variant="x-large-title" content="{{ time | date: 'MM/dd/yyyy' }}"></typography>

<driver-component style="width: 100%"></driver-component>
<driver-component style="width: 100%" />

<speed-over-time-display style="width: 100%"></speed-over-time-display>
<acceleration-over-time-display style="width: 100%"></acceleration-over-time-display>
<speed-over-time-display style="width: 100%" />
<acceleration-over-time-display style="width: 100%" />

<acceleration-graphs style="width: 100%"></acceleration-graphs>
<acceleration-graphs style="width: 100%" />

<map-info-display style="width: 100%"></map-info-display>
<map-info-display style="width: 100%" />

<motor-info style="width: 100%; height: 250px"></motor-info>
<battery-info-display style="width: 100%; height: 250px"></battery-info-display>
<raspberry-pi style="width: 100%"></raspberry-pi>
<motor-info style="width: 100%; height: 250px" />
<battery-info-display style="width: 100%; height: 250px" />
<raspberry-pi style="width: 100%" />
</vstack>
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<hstack style="width: 100%"
><typography variant="header" content="{{ time | date: 'MM/dd/yyyy' }} | {{ location }} " />
<latency-display style="width: 40%" />
<argos-button [onClick]="this.onStartNewRun" label="Start New Run"></argos-button>
<argos-button [onClick]="this.onStartNewRun" label="Start New Run" />
</hstack>

<hstack style="width: 100%">
Expand All @@ -37,7 +37,7 @@
<map-info-display style="width: 50%" />

<vstack style="width: 50%">
<motor-info style="width: 100%; height: 250px"> </motor-info>
<motor-info style="width: 100%; height: 250px" />
</vstack>
</hstack>

Expand Down
6 changes: 3 additions & 3 deletions angular-client/src/pages/map/map.component.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<div *ngIf="isError; else checkIsLoading">
<error-page [errorMessage]="error!.message"></error-page>
<error-page [errorMessage]="error!.message" />
</div>
<ng-template #checkIsLoading>
<div *ngIf="isLoading; else displayMap">
<loading-page></loading-page>
<loading-page />
</div>
</ng-template>
<ng-template #displayMap>
<div id="map" class="map-container">
<sidebar-toggle style="position: absolute; margin-top: 16px; margin-left: 16px"></sidebar-toggle>
<sidebar-toggle style="position: absolute; margin-top: 16px; margin-left: 16px" />
<run-selector
style="position: absolute; margin-bottom: 16px; margin-right: 16px; bottom: 0; right: 0"
[selectRun]="onRunSelected"
Expand Down

0 comments on commit 7300a7a

Please sign in to comment.