Skip to content

Development #1

Merged
merged 11 commits into from May 1, 2019
118 changes: 30 additions & 88 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions src/app/generator-search/generator-search.component.css
Expand Up @@ -18,3 +18,7 @@ mat-card.generator-card {
height: 300px;
margin: 5px;
}

mat-card:hover {
cursor: pointer;
}
3 changes: 3 additions & 0 deletions src/app/header/header.component.css
Expand Up @@ -10,4 +10,7 @@
}
.clearfix {
overflow: auto;
}
a:hover {
cursor: pointer;
}
6 changes: 3 additions & 3 deletions src/app/header/header.component.html
Expand Up @@ -9,11 +9,11 @@
<div class="collapse navbar-collapse" id="navbarSupportedContent">

<ul class="navbar-nav mr-auto">
<li class="nav-item">
<li class="nav-item" >
<a class="nav-image" id="dash-image" (click)="resetGenerator()"><img src="assets/images/home.png"
class=" d-block img-fluid py-3 pl-3" alt="Dashboard Image" height="42" width="42"></a>
</li>
<li class="nav-item">
<li class="nav-item" *ngIf="isLoggedIn()">
<a class="nav-image" id="visualize-image" (click)="resetGenAndVisualize()"><img src="assets/images/graph.jpg"
class=" d-block img-fluid py-3 pl-3" alt="Visualization Image" height="42" width="42"></a>
</li>
Expand All @@ -22,7 +22,7 @@
<form class="form-inline my-2 my-lg-0">
<a class="nav-left-image" id="logout-image" (click)="resetAndClear()"><img
src="assets/images/logout.png" class=" d-block img-fluid py-3 pl-3" alt="Logout Image"
height="42" width="42"></a>
height="42" width="42" *ngIf="isLoggedIn()"></a>
</form>

</div>
Expand Down
11 changes: 11 additions & 0 deletions src/app/header/header.component.ts
Expand Up @@ -23,6 +23,17 @@ export class HeaderComponent implements OnInit {
resetGenAndVisualize() {
this.resetAndRedirect('/visualize-all');
}
isLoggedIn()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the logic behind this function? A user being logged in shouldn't be dictated by the router url, as anyone can have a link to a URL and suddenly be shown icons as if they were logged in.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modified isLoggedIn() to check for auth_token availability instead. Let me know if that is a good solution or not

{
if(this.router.url != '/' && this.router.url != '/#')
{
return true;
}
else
{
return false;
}
}

resetAndRedirect(url: string) {
this.login.getToken().then(() => {
Expand Down
12 changes: 12 additions & 0 deletions src/app/statistics/statistics.component.css
Expand Up @@ -48,4 +48,16 @@ h6
height: 100%;
height: 46px;
}
radial-gauge:hover {
cursor: pointer;
}
linear-gauge:hover {
cursor: pointer;
}
button
{
width: 150px;
background-color: orange;
color: white;
}

2 changes: 1 addition & 1 deletion src/app/statistics/statistics.component.html
@@ -1,6 +1,6 @@
<div class="container">
<div class="row mt-3">
<button (click)="goToGraphGen()" class="btn btn-primary btn-block m-1">Graph</button>
<button mat-raised-button (click)="goToGraphGen()" class = "mx-auto">Graph</button>
</div>

<ng-template #timedOut>
Expand Down
3 changes: 2 additions & 1 deletion src/app/visualize-one/visualize-one.component.ts
Expand Up @@ -218,7 +218,8 @@ export class VisualizeOneComponent implements OnInit {
if (this.chart !== null) {
this.chart.destroy();
}
this.chart = this.graphData.createChart(labels, data, [localStorage.getItem('gen_name')]);
this.genName$ = localStorage.getItem('gen_name');
this.chart = this.graphData.createChart(labels, data, [this.genName$]);
this.unit$ = this.data.getUnits(dataVal);
this.startTime$ = startArray[1] + '/' + startArray[2] + '/' + startArray[0];
this.endTime$ = endArray[1] + '/' + endArray[2] + '/' + endArray[0];
Expand Down