Remove unused components

This commit is contained in:
Peter Rossa
2023-05-15 12:50:06 +02:00
parent 2eb67063ec
commit 5205b813bc
9 changed files with 0 additions and 280 deletions

View File

@@ -1,3 +0,0 @@
.link_click {
cursor:pointer;
}

View File

@@ -1,28 +0,0 @@
<div class="container">
<div class="row">
<div class="col">
<table class="table">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Game Title</th>
<th scope="col">Publisher</th>
<th scope="col">Developed by</th>
<th scope="col">Publishing Year</th>
<th scope="col">Retail Price</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let title of allTitles; let i = index">
<td>{{i}}</td>
<td>{{title.gameTitleValue}}</td>
<td>{{title.publisherValue}}</td>
<td>{{title.devStudioNameValue}}</td>
<td>{{title.publishingYearValue}}</td>
<td>${{title.retailPriceValue}}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>

View File

@@ -1,90 +0,0 @@
import { Component, OnInit } from "@angular/core";
import { HttpErrorResponse } from "@angular/common/http";
// import { PageSecurityService } from "../common/pageSecurity.service";
import { GameTitlesService } from "../../services/gameTitles.service";
import { LoginService } from "../../auth/login.service";
import { GameTitle } from "../../dataModels/gameTitle.type";
import { PageSecurityService } from "src/app/services/pageSecurity.service";
import { AuthService } from "src/app/auth/auth.service";
@Component({
selector: "app-root",
templateUrl: "./index.component.html",
styleUrls: ["./index.component.css"],
})
export class IndexComponent implements OnInit {
private _allTitles: Array<GameTitle> = [];
public testArray: Array<String> = [];
constructor(
private loginService: LoginService,
private pageSecurityService: PageSecurityService,
private gameTitlesService: GameTitlesService,
private authService: AuthService
) {
this.testArray.push("Test1");
this.testArray.push("Test2");
this.testArray.push("Test3");
this.testArray.push("Test4");
this.testArray.push("Test5");
}
public get allTitles(): Array<GameTitle> {
return this._allTitles;
}
public set allTitles(val: Array<GameTitle>) {
this._allTitles = val;
}
ngOnInit(): void {
// let userLoggedIn: Boolean = this.authService.checkUserLoggedIn();
// if (!userLoggedIn) {
// this.pageSecurityService.gotoLoginPage();
// } else {
this.loadAllGameTitles();
// }
}
private loadAllGameTitles(): void {
let self = this;
self.gameTitlesService.getAllGameTitles().subscribe(
(resp: any) => {
if (resp && resp.length > 0) {
for (var itm of resp) {
if (itm) {
let titleToAdd: GameTitle = new GameTitle(
itm.gameTitle,
itm.publisher,
itm.devStudioName,
itm.publishingYear,
itm.retailPrice
);
self._allTitles.push(titleToAdd);
}
}
}
},
(error: HttpErrorResponse) => {
if (error != null) {
if (error.status === 0) {
// XXX
console.log("Client error.");
} else if (error.status === 401 || error.status === 403) {
// XXX
alert("You are not authorized.");
console.log("You are not authorized.");
self.loginService.removeSessionCurrentUser();
self.pageSecurityService.gotoLoginPage();
} else if (error.status === 500) {
alert("Server error.");
console.log("Server error occurred.");
} else {
alert("Unknown error.");
console.log("Unknown error: " + error.status);
}
}
}
);
}
}