Merge pull request #100 from Mueller-Patrick/develop

Some fancy changes
This commit is contained in:
Patrick 2021-06-18 10:29:55 +02:00 committed by GitHub
commit c3c0fa73b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 150 additions and 127 deletions

View File

@ -11,7 +11,7 @@
<!-- About Section Content-->
<div class="row">
<div class="col-lg-4 ms-auto"><p class="lead">You follow the same passion as we do and you want to find alternatives to the de-facto monopolist Amazon?</p></div>
<div class="col-lg-4 me-auto"><p class="lead">In this case, welcome aboard! Were happy that you share our passion and hope that we can help you achieving this goal with the website</p></div>
<div class="col-lg-4 me-auto"><p class="lead">In this case, welcome aboard! Were happy that you share our passion and hope that we can help you achieving this goal with the website.</p></div>
</div>
</div>
</section>

View File

@ -1,15 +1,16 @@
import { Component, OnInit } from '@angular/core';
import {Component, OnInit} from '@angular/core';
@Component({
selector: 'app-about-us',
templateUrl: './about-us.component.html',
styleUrls: ['./about-us.component.css']
selector: 'app-about-us',
templateUrl: './about-us.component.html',
styleUrls: ['./about-us.component.css']
})
export class AboutUsComponent implements OnInit {
constructor() { }
constructor() {
}
ngOnInit(): void {
}
ngOnInit(): void {
}
}

View File

@ -1,44 +1,47 @@
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import {ApiService} from "../../../services/api.service";
import {Router} from "@angular/router";
import {Component, OnInit} from '@angular/core';
import {FormBuilder, FormGroup, Validators} from '@angular/forms';
import {ApiService} from '../../../services/api.service';
import {Router} from '@angular/router';
@Component({
selector: 'app-registration',
templateUrl: './registration.component.html',
styleUrls: ['./registration.component.css']
selector: 'app-registration',
templateUrl: './registration.component.html',
styleUrls: ['./registration.component.css']
})
export class RegistrationComponent implements OnInit {
form: any;
loading = false;
submitted = false;
constructor(
private formBuilder: FormBuilder,
private api : ApiService,
private router: Router
) { }
constructor(
private formBuilder: FormBuilder,
private api: ApiService,
private router: Router
) {
}
ngOnInit(): void {
this.form = this.formBuilder.group({
username: ['', Validators.required],
email: ['', Validators.required],
password: ['', [
Validators.required,
Validators.minLength(8)]
],
});
}
ngOnInit(): void {
this.form = this.formBuilder.group({
username: ['', Validators.required],
email: ['', Validators.required],
password: ['', [
Validators.required,
Validators.minLength(8)]
],
});
}
get me() { return this.form.controls; }
get me() {
return this.form.controls;
}
onSubmit() {
this.api.registerUser(this.form.value.username, this.form.value.password, this.form.value.email).subscribe(
res=> {
this.api.saveSessionInfoToLocalStorage(res);
this.router.navigate(['/']);
}
);
}
onSubmit(): void {
this.api.registerUser(this.form.value.username, this.form.value.password, this.form.value.email).subscribe(
res => {
this.api.saveSessionInfoToLocalStorage(res);
this.router.navigate(['/']);
}
);
}
}

View File

@ -1,15 +1,16 @@
import { Component, OnInit } from '@angular/core';
import {Component, OnInit} from '@angular/core';
@Component({
selector: 'app-resetpasswort',
templateUrl: './resetpasswort.component.html',
styleUrls: ['./resetpasswort.component.css']
selector: 'app-resetpasswort',
templateUrl: './resetpasswort.component.html',
styleUrls: ['./resetpasswort.component.css']
})
export class ResetpasswortComponent implements OnInit {
constructor() { }
constructor() {
}
ngOnInit(): void {
}
ngOnInit(): void {
}
}

View File

@ -1,15 +1,16 @@
import { Component, OnInit } from '@angular/core';
import {Component, OnInit} from '@angular/core';
@Component({
selector: 'app-bottom-bar',
templateUrl: "./bottom-bar.component.html",
styleUrls: ["./bottom-bar.component.css"]
selector: 'app-bottom-bar',
templateUrl: './bottom-bar.component.html',
styleUrls: ['./bottom-bar.component.css']
})
export class BottomBarComponent implements OnInit {
constructor() { }
constructor() {
}
ngOnInit(): void {
}
ngOnInit(): void {
}
}

View File

@ -1,15 +1,16 @@
import { Component, OnInit } from '@angular/core';
import {Component, OnInit} from '@angular/core';
@Component({
selector: 'app-copyright',
templateUrl: './copyright.component.html',
styleUrls: ['./copyright.component.css']
selector: 'app-copyright',
templateUrl: './copyright.component.html',
styleUrls: ['./copyright.component.css']
})
export class CopyrightComponent implements OnInit {
constructor() { }
constructor() {
}
ngOnInit(): void {
}
ngOnInit(): void {
}
}

View File

@ -1,23 +1,24 @@
import { Component, OnInit } from '@angular/core';
import {Component, OnInit} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
@Component({
selector: 'app-footer',
templateUrl: './footer.component.html',
styleUrls: ['./footer.component.css']
selector: 'app-footer',
templateUrl: './footer.component.html',
styleUrls: ['./footer.component.css']
})
export class FooterComponent implements OnInit {
constructor(
private router: Router,
private route: ActivatedRoute
) {}
constructor(
private router: Router,
private route: ActivatedRoute
) {
}
ngOnInit(): void {
}
ngOnInit(): void {
}
navigateImprint(): void {
this.router.navigate([('/impressum')]);
}
navigateImprint(): void {
this.router.navigate([('/impressum')]);
}
}

View File

@ -1,15 +1,16 @@
import { Component, OnInit } from '@angular/core';
import {Component, OnInit} from '@angular/core';
@Component({
selector: 'app-greeting-info-slider',
templateUrl: './greeting-info-slider.component.html',
styleUrls: ['./greeting-info-slider.component.css']
selector: 'app-greeting-info-slider',
templateUrl: './greeting-info-slider.component.html',
styleUrls: ['./greeting-info-slider.component.css']
})
export class GreetingInfoSliderComponent implements OnInit {
constructor() { }
constructor() {
}
ngOnInit(): void {
}
ngOnInit(): void {
}
}

View File

@ -4,9 +4,9 @@ import {Product} from '../../models/product';
import {ActivatedRoute, Router} from '@angular/router';
@Component({
selector: 'app-hot-deals-widget',
templateUrl: './hot-deals-widget.component.html',
styleUrls: ['./hot-deals-widget.component.css']
selector: 'app-hot-deals-widget',
templateUrl: './hot-deals-widget.component.html',
styleUrls: ['./hot-deals-widget.component.css']
})
export class HotDealsWidgetComponent implements OnInit {
@ -52,7 +52,7 @@ export class HotDealsWidgetComponent implements OnInit {
default: {
this.getProductsByIds();
this.getAmazonPricesForBestDeals();
this.getVendors()
this.getVendors();
break;
}
}
@ -73,7 +73,7 @@ export class HotDealsWidgetComponent implements OnInit {
deals => {
deals.forEach(deal => {
this.bestDealsProductIds.push(deal.product_id);
this.productsPricesMap [deal.product_id] = {lowestPrice: deal}
this.productsPricesMap [deal.product_id] = {lowestPrice: deal};
});
this.loadParams();
}
@ -92,7 +92,7 @@ export class HotDealsWidgetComponent implements OnInit {
}
getAmazonPricesForBestDeals(): void{
getAmazonPricesForBestDeals(): void {
this.bestDealsProductIds.forEach(id => {
this.apiService.getAmazonPrice(id).subscribe(
price => {

View File

@ -4,9 +4,9 @@ import {Product} from '../../models/product';
import {ActivatedRoute, Router} from '@angular/router';
@Component({
selector: 'app-kunden',
templateUrl: './kunden.component.html',
styleUrls: ['./kunden.component.css']
selector: 'app-kunden',
templateUrl: './kunden.component.html',
styleUrls: ['./kunden.component.css']
})
export class KundenComponent implements OnInit {
products: Product[] = [];

View File

@ -46,7 +46,7 @@ export class ProductDetailsComponent implements OnInit {
this.getProduct();
this.getVendors();
this.getPrices();
if (this.apiService.getSessionInfoFromLocalStorage().session_id != "") {
if (this.apiService.getSessionInfoFromLocalStorage().session_id != '') {
this.isLoggedIn = true;
}
}
@ -123,10 +123,10 @@ export class ProductDetailsComponent implements OnInit {
return Math.round(percentage);
}
setPriceAlarm() {
this.apiService.createPriceAlarms(this.productId, this.price*100).subscribe(
setPriceAlarm(): void {
this.apiService.createPriceAlarms(this.productId, this.price * 100).subscribe(
alarms => console.log(alarms)
)
);
}

View File

@ -19,3 +19,8 @@ table, th, td {
cursor: pointer;
color: #0d5a4b;
}
.edit {
width: 5%;
height: 5%;
}

View File

@ -89,7 +89,7 @@
{{alarm.defined_price/100}}€
</td>
<td>
<img class="delete" src="../assets/images/Delete_icon-icons.com_55931.png" (click)="delete(alarm.alarm_id)">
<img class="delete" src="../assets/images/pencil.png">
</td>
<td>
<img class="delete" src="../assets/images/Delete_icon-icons.com_55931.png" (click)="delete(alarm.alarm_id)">

View File

@ -1,25 +1,26 @@
import { Component, OnInit } from '@angular/core';
import {ApiService} from "../../services/api.service";
import {Component, OnInit} from '@angular/core';
import {ApiService} from '../../services/api.service';
@Component({
selector: 'app-profile',
templateUrl: './profile.component.html',
styleUrls: ['./profile.component.css']
selector: 'app-profile',
templateUrl: './profile.component.html',
styleUrls: ['./profile.component.css']
})
export class ProfileComponent implements OnInit {
currentUser: any;
obj:any;
obj: any;
alarms: any [];
productsMap: any = {};
constructor(private api: ApiService ) { }
constructor(private api: ApiService) {
}
ngOnInit(): void {
this.api.getUserInfo().subscribe(
user=> {
this.currentUser = user
user => {
this.currentUser = user;
console.log(this.currentUser);
},
);
@ -30,29 +31,33 @@ export class ProfileComponent implements OnInit {
getPriceAlarms(): void {
this.api.getPriceAlarms().subscribe(
alarms => {
this.alarms = alarms
this.getProductsByIds()
this.alarms = alarms;
this.getProductsByIds();
}
)
);
}
getProductsByIds(): void {
let productIds: number [] = [];
const productIds: number [] = [];
this.alarms.forEach(
alarm => {productIds.push(alarm.product_id)}
alarm => {
productIds.push(alarm.product_id);
}
);
this.api.getProductsByIds(productIds).subscribe(
products => {
products.forEach(
product => {this.productsMap[product.product_id] = product}
)
product => {
this.productsMap[product.product_id] = product;
}
);
}
)
);
}
delete(id:number): void {
delete(id: number): void {
this.api.deletePriceAlarm(id).subscribe(
res => window.location.reload()
)
);
}
}

View File

@ -1,15 +1,16 @@
import { Component, OnInit } from '@angular/core';
import {Component, OnInit} from '@angular/core';
@Component({
selector: 'app-slider-for-products',
templateUrl: './slider-for-products.component.html',
styleUrls: ['./slider-for-products.component.css']
selector: 'app-slider-for-products',
templateUrl: './slider-for-products.component.html',
styleUrls: ['./slider-for-products.component.css']
})
export class SliderForProductsComponent implements OnInit {
constructor() { }
constructor() {
}
ngOnInit(): void {
}
ngOnInit(): void {
}
}

View File

@ -1,6 +1,6 @@
import {Component, Input, OnInit} from '@angular/core';
import {ApiService} from "../../services/api.service";
import {Router} from "@angular/router";
import {ApiService} from '../../services/api.service';
import {NavigationEnd, Router} from '@angular/router';
@Component({
@ -20,13 +20,12 @@ export class TopBarComponent implements OnInit {
) {
}
ngOnInit() {
ngOnInit(): void {
this.api.getUserInfo().subscribe(data => {
console.log(data)
console.log(data);
});
if (this.api.getSessionInfoFromLocalStorage().session_id != "") {
if (this.api.getSessionInfoFromLocalStorage().session_id !== '') {
this.isLoggedIn = true;
}
}
@ -34,7 +33,11 @@ export class TopBarComponent implements OnInit {
logout(): void {
localStorage.setItem('session_id', '');
localStorage.setItem('session_key', '');
this.router.navigate(['/']);
if (this.router.url === '/profile') {
this.router.navigate(['/']);
} else {
window.location.reload();
}
}
getSearchedProducts(): void {

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB