diff --git a/src/app/app.component.html b/src/app/app.component.html
index 90c6b64..0680b43 100644
--- a/src/app/app.component.html
+++ b/src/app/app.component.html
@@ -1 +1 @@
-
\ No newline at end of file
+
diff --git a/src/app/app.component.ts b/src/app/app.component.ts
index beaa4c8..58970ff 100644
--- a/src/app/app.component.ts
+++ b/src/app/app.component.ts
@@ -1,18 +1,17 @@
-import { Component, OnInit } from '@angular/core';
-import { AuthService } from './core/services/auth.service';
-import { AppService } from './core/services/app.service';
+import { Component, OnInit } from "@angular/core";
+import { AuthService } from "./core/services/auth.service";
+import { AppService } from "./core/services/app.service";
@Component({
- selector: 'app-root',
- templateUrl: './app.component.html',
- styleUrls: ['./app.component.scss']
+ selector: "app-root",
+ templateUrl: "./app.component.html",
+ styleUrls: ["./app.component.scss"],
})
export class AppComponent implements OnInit {
constructor(
private authService: AuthService,
- private appService: AppService,
- ) {
- }
+ private appService: AppService
+ ) {}
ngOnInit(): void {
this.authService.readUserState();
diff --git a/src/app/app.module.ts b/src/app/app.module.ts
index ca351f2..efcb67e 100644
--- a/src/app/app.module.ts
+++ b/src/app/app.module.ts
@@ -1,21 +1,28 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { HttpClientModule } from '@angular/common/http';
-import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
+import { NgModule } from "@angular/core";
+import { BrowserModule } from "@angular/platform-browser";
+import { HttpClientModule } from "@angular/common/http";
+import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
-import { AppComponent } from './app.component';
-import { RouterModule, Routes } from '@angular/router';
-import { SharedModule } from './shared/shared.module';
-import { HomeComponent } from './core/components/home/home.component';
-import { CoreModule } from './core/core.module';
-import { AuthGuard } from './core/guards/auth.guard';
-import { SettingsComponent } from './core/components/settings/settings.component';
+import { AppComponent } from "./app.component";
+import { RouterModule, Routes } from "@angular/router";
+import { SharedModule } from "./shared/shared.module";
+import { HomeComponent } from "./core/components/home/home.component";
+import { CoreModule } from "./core/core.module";
+import { AuthGuard } from "./core/guards/auth.guard";
+import { SettingsComponent } from "./core/components/settings/settings.component";
const routes: Routes = [
- { path: 'auth', loadChildren: () => import('./core/auth/auth.module').then(m => m.AuthModule) },
- { path: '', component: HomeComponent, canActivate: [AuthGuard], children: [
- {path: 'settings', component: SettingsComponent}
- ]},
+ {
+ path: "auth",
+ loadChildren: () =>
+ import("./core/auth/auth.module").then((m) => m.AuthModule),
+ },
+ {
+ path: "",
+ component: HomeComponent,
+ canActivate: [AuthGuard],
+ children: [{ path: "settings", component: SettingsComponent }],
+ },
];
@NgModule({
@@ -24,6 +31,7 @@ const routes: Routes = [
BrowserModule,
BrowserAnimationsModule,
HttpClientModule,
+ RouterModule,
RouterModule.forRoot(routes),
SharedModule,
CoreModule,
diff --git a/src/app/core/auth/auth.module.ts b/src/app/core/auth/auth.module.ts
index 883512c..07c0917 100644
--- a/src/app/core/auth/auth.module.ts
+++ b/src/app/core/auth/auth.module.ts
@@ -1,33 +1,32 @@
-import { NgModule } from '@angular/core';
-import { CommonModule } from '@angular/common';
-import { LoginComponent } from './components/login/login.component';
-import { RegistrationComponent } from './components/registration/registration.component';
-import { ConfirmRegistrationComponent } from './components/confirm-registration/confirm-registration.component';
-import { RouterModule, Routes } from '@angular/router';
-import { ReactiveFormsModule } from '@angular/forms';
+import { NgModule } from "@angular/core";
+import { CommonModule } from "@angular/common";
+import { LoginComponent } from "./components/login/login.component";
+import { RegistrationComponent } from "./components/registration/registration.component";
+import { ConfirmRegistrationComponent } from "./components/confirm-registration/confirm-registration.component";
+import { RouterModule, Routes } from "@angular/router";
+import { ReactiveFormsModule } from "@angular/forms";
const routes: Routes = [
- { path: 'login', component: LoginComponent },
- { path: 'registration', component: RegistrationComponent },
- { path: 'registration/:registrationId', component: ConfirmRegistrationComponent },
- { path: '', redirectTo: 'login', pathMatch: 'full' },
+ { path: "login", component: LoginComponent },
+ { path: "registration", component: RegistrationComponent },
+ {
+ path: "registration/:registrationId",
+ component: ConfirmRegistrationComponent,
+ },
+ { path: "", redirectTo: "login", pathMatch: "full" },
];
@NgModule({
declarations: [
LoginComponent,
RegistrationComponent,
- ConfirmRegistrationComponent
+ ConfirmRegistrationComponent,
],
exports: [
LoginComponent,
RegistrationComponent,
- ConfirmRegistrationComponent
+ ConfirmRegistrationComponent,
],
- imports: [
- RouterModule.forChild(routes),
- CommonModule,
- ReactiveFormsModule
- ]
+ imports: [RouterModule.forChild(routes), CommonModule, ReactiveFormsModule],
})
-export class AuthModule { }
+export class AuthModule {}
diff --git a/src/app/core/auth/components/confirm-registration/confirm-registration.component.html b/src/app/core/auth/components/confirm-registration/confirm-registration.component.html
index 463299d..1b46718 100644
--- a/src/app/core/auth/components/confirm-registration/confirm-registration.component.html
+++ b/src/app/core/auth/components/confirm-registration/confirm-registration.component.html
@@ -1,23 +1,49 @@
-
-
+
-
- Beekeeper
-
-
- Registrierung Abschließen
-
+
+ Beekeeper
+
+
+ Registrierung Abschließen
+
diff --git a/src/app/core/auth/components/confirm-registration/confirm-registration.component.ts b/src/app/core/auth/components/confirm-registration/confirm-registration.component.ts
index f6f4c8b..d15379f 100644
--- a/src/app/core/auth/components/confirm-registration/confirm-registration.component.ts
+++ b/src/app/core/auth/components/confirm-registration/confirm-registration.component.ts
@@ -1,18 +1,18 @@
-import { Component } from '@angular/core';
-import { FormControl, FormGroup, Validators } from '@angular/forms';
-import { ActivatedRoute, Router } from '@angular/router';
-import { filter } from 'rxjs';
-import { AuthService } from 'src/app/core/services/auth.service';
+import { Component } from "@angular/core";
+import { FormControl, FormGroup, Validators } from "@angular/forms";
+import { ActivatedRoute, Router } from "@angular/router";
+import { filter } from "rxjs";
+import { AuthService } from "src/app/core/services/auth.service";
@Component({
- selector: 'app-confirm-registration',
- templateUrl: './confirm-registration.component.html',
- styleUrls: ['./confirm-registration.component.scss']
+ selector: "app-confirm-registration",
+ templateUrl: "./confirm-registration.component.html",
+ styleUrls: ["./confirm-registration.component.scss"],
})
export class ConfirmRegistrationComponent {
confirmRegistrationForm = new FormGroup({
- password: new FormControl('', [Validators.required]),
- passwordConfirmation: new FormControl('', [Validators.required]),
+ password: new FormControl("", [Validators.required]),
+ passwordConfirmation: new FormControl("", [Validators.required]),
});
registrationId: string | undefined;
@@ -22,27 +22,23 @@ export class ConfirmRegistrationComponent {
private activatedRoute: ActivatedRoute,
private router: Router
) {
- this.activatedRoute.params.subscribe(
- (params) => {
- this.registrationId = params['registrationId'];
- }
- );
-
- this.authService.currentState$.pipe(
- filter(state=>state !== undefined && state !== null)
- ).subscribe((state) =>
- this.router.navigateByUrl('/')
- );
+ this.activatedRoute.params.subscribe((params) => {
+ this.registrationId = params["registrationId"];
+ });
+
+ this.authService.currentState$
+ .pipe(filter((state) => state !== undefined && state !== null))
+ .subscribe((state) => this.router.navigateByUrl("/"));
}
confirm(): void {
- if (this.registrationId === undefined)
- return;
+ if (this.registrationId === undefined) return;
this.authService.confirmRegistration({
id: this.registrationId!,
password: this.confirmRegistrationForm.value.password!,
- passwordConfirmation: this.confirmRegistrationForm.value.passwordConfirmation!
+ passwordConfirmation:
+ this.confirmRegistrationForm.value.passwordConfirmation!,
});
}
}
diff --git a/src/app/core/auth/components/login/login.component.html b/src/app/core/auth/components/login/login.component.html
index c45b672..46a14a1 100644
--- a/src/app/core/auth/components/login/login.component.html
+++ b/src/app/core/auth/components/login/login.component.html
@@ -1,24 +1,59 @@
-
-
+
-
- Beekeeper
-
-
- Anmeldung
-
+
+ Beekeeper
+
+ Anmeldung
diff --git a/src/app/core/auth/components/login/login.component.ts b/src/app/core/auth/components/login/login.component.ts
index 98577c7..700b9e8 100644
--- a/src/app/core/auth/components/login/login.component.ts
+++ b/src/app/core/auth/components/login/login.component.ts
@@ -1,35 +1,30 @@
-import { Component } from '@angular/core';
-import { FormControl, FormGroup, Validators } from '@angular/forms';
-import { Router } from '@angular/router';
-import { filter, map } from 'rxjs';
-import { AuthService } from 'src/app/core/services/auth.service';
+import { Component } from "@angular/core";
+import { FormControl, FormGroup, Validators } from "@angular/forms";
+import { Router } from "@angular/router";
+import { filter, map } from "rxjs";
+import { AuthService } from "src/app/core/services/auth.service";
@Component({
- selector: 'app-login',
- templateUrl: './login.component.html',
- styleUrls: ['./login.component.scss']
+ selector: "app-login",
+ templateUrl: "./login.component.html",
+ styleUrls: ["./login.component.scss"],
})
export class LoginComponent {
loginForm = new FormGroup({
- identifier: new FormControl('', [Validators.required]),
- password: new FormControl('', [Validators.required]),
+ identifier: new FormControl("", [Validators.required]),
+ password: new FormControl("", [Validators.required]),
});
- constructor(
- private authService: AuthService,
- private router: Router
- ) {
- this.authService.currentState$.pipe(
- filter(state=>state !== undefined && state !== null)
- ).subscribe((state) =>
- this.router.navigateByUrl('/')
- );
+ constructor(private authService: AuthService, private router: Router) {
+ this.authService.currentState$
+ .pipe(filter((state) => state !== undefined && state !== null))
+ .subscribe((state) => this.router.navigateByUrl("/"));
}
login(): void {
this.authService.login({
identifier: this.loginForm.value.identifier!,
- password: this.loginForm.value.password!
+ password: this.loginForm.value.password!,
});
}
}
diff --git a/src/app/core/auth/components/registration/registration.component.html b/src/app/core/auth/components/registration/registration.component.html
index bdcda16..4a3e88b 100644
--- a/src/app/core/auth/components/registration/registration.component.html
+++ b/src/app/core/auth/components/registration/registration.component.html
@@ -1,24 +1,59 @@
-
-
+
-
- Beekeeper
-
-
- Registrierung
-
+
+ Beekeeper
+
+ Registrierung
diff --git a/src/app/core/auth/components/registration/registration.component.ts b/src/app/core/auth/components/registration/registration.component.ts
index 2502fa4..6244137 100644
--- a/src/app/core/auth/components/registration/registration.component.ts
+++ b/src/app/core/auth/components/registration/registration.component.ts
@@ -1,37 +1,32 @@
-import { Component } from '@angular/core';
-import { FormControl, FormGroup, Validators } from '@angular/forms';
-import { Router } from '@angular/router';
-import { filter } from 'rxjs';
-import { AuthService } from 'src/app/core/services/auth.service';
+import { Component } from "@angular/core";
+import { FormControl, FormGroup, Validators } from "@angular/forms";
+import { Router } from "@angular/router";
+import { filter } from "rxjs";
+import { AuthService } from "src/app/core/services/auth.service";
@Component({
- selector: 'app-registration',
- templateUrl: './registration.component.html',
- styleUrls: ['./registration.component.scss']
+ selector: "app-registration",
+ templateUrl: "./registration.component.html",
+ styleUrls: ["./registration.component.scss"],
})
export class RegistrationComponent {
registrationForm = new FormGroup({
- mail: new FormControl('', [Validators.required]),
- username: new FormControl('', [Validators.required]),
+ mail: new FormControl("", [Validators.required]),
+ username: new FormControl("", [Validators.required]),
});
- constructor(
- private authService: AuthService,
- private router: Router
- ) {
- this.authService.currentState$.pipe(
- filter(state=>state !== undefined && state !== null)
- ).subscribe((state) =>
- this.router.navigateByUrl('/')
- );
+ constructor(private authService: AuthService, private router: Router) {
+ this.authService.currentState$
+ .pipe(filter((state) => state !== undefined && state !== null))
+ .subscribe((state) => this.router.navigateByUrl("/"));
}
register(): void {
this.authService.register({
mail: this.registrationForm.value.mail!,
- username: this.registrationForm.value.username!
+ username: this.registrationForm.value.username!,
});
- this.router.navigateByUrl('/auth/login');
+ this.router.navigateByUrl("/auth/login");
}
}
diff --git a/src/app/core/components/home/home.component.html b/src/app/core/components/home/home.component.html
index de0a307..4b8a0ee 100644
--- a/src/app/core/components/home/home.component.html
+++ b/src/app/core/components/home/home.component.html
@@ -1,26 +1,5 @@
-
- I'm working
-
-
-
- I'm working
-
-
-
- I'm working
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
+
+
diff --git a/src/app/core/components/home/home.component.ts b/src/app/core/components/home/home.component.ts
index a6cf3ac..be17790 100644
--- a/src/app/core/components/home/home.component.ts
+++ b/src/app/core/components/home/home.component.ts
@@ -1,40 +1,8 @@
-import { Component } from '@angular/core';
-import { RequestService } from 'src/app/core/services/request.service';
-import { ColumnDefinition } from 'src/app/shared/components/table/table.component';
-
-interface Colony {
- name: string;
-
-}
+import { Component } from "@angular/core";
@Component({
- selector: 'app-home',
- templateUrl: './home.component.html',
- styleUrls: ['./home.component.scss'],
+ selector: "app-home",
+ templateUrl: "./home.component.html",
+ styleUrls: ["./home.component.scss"],
})
-export class HomeComponent {
-
- columns: ColumnDefinition[] = [
- {
- header: 'Name',
- columnFunction: (colony:Colony) => colony.name,
- routerLink: (colony:Colony) => '#',
- },
- {
- header: 'Name2',
- columnFunction: (colony:Colony) => colony.name,
- }
- ];
-
- colonies: Colony[] = [
- {
- name: 'Die Römer'
- },
- {
- name: 'Die Griechen'
- }
- ];
-
- constructor(public requestService: RequestService) {
- }
-}
+export class HomeComponent {}
diff --git a/src/app/core/components/navigation/navigation.component.html b/src/app/core/components/navigation/navigation.component.html
index d261342..8d7c27d 100644
--- a/src/app/core/components/navigation/navigation.component.html
+++ b/src/app/core/components/navigation/navigation.component.html
@@ -1,60 +1,105 @@
-
-