Skip to content

Commit 43e5df7

Browse files
committed
Landing Page added for wurzelbenutzer user
1 parent b3e647a commit 43e5df7

8 files changed

Lines changed: 95 additions & 18 deletions

src/app/app-routing.module.ts

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,23 @@ import { LoginComponent } from './login/login.component';
88
import { DashboardComponent } from "./dashboard/dashboard.component";
99
import { LogoutComponent } from "./logout/logout.component";
1010
import { LoginService } from "./login.service";
11+
import { LandingPageComponent } from "./landing-page/landing-page.component";
1112

1213
const routes: Routes = [
1314
{ path: '', redirectTo: '/login', pathMatch: 'full' },
14-
{ path: 'login', component: LoginComponent },
15-
{ path: 'logout', component: LogoutComponent, canActivate: [LoginService] },
16-
{ path: 'class', component: ClassComponent, canActivate: [LoginService] },
17-
{ path: 'class/:id', component: ClassComponent, canActivate: [LoginService] },
18-
{ path: 'teacher', component: TeacherComponent, canActivate: [LoginService] },
19-
{ path: 'teacher/:id', component: TeacherComponent, canActivate: [LoginService] },
20-
{ path: 'pupil', component: PupilComponent, canActivate: [LoginService] },
21-
{ path: 'pupil/:id', component: PupilComponent, canActivate: [LoginService] },
22-
{ path: 'notes', component: NotesComponent, canActivate: [LoginService] },
23-
{ path: 'notes/:id', component: NotesComponent, canActivate: [LoginService] },
24-
{ path: 'notes/pupil/:pId', component: NotesComponent, canActivate: [LoginService], data: [{filter: 'pupil'}] },
25-
{ path: 'dashboard', component: DashboardComponent, canActivate: [LoginService] }
15+
{ path: 'login', component: LoginComponent },
16+
{ path: 'logout', component: LogoutComponent, canActivate: [LoginService] },
17+
{ path: 'class', component: ClassComponent, canActivate: [LoginService] },
18+
{ path: 'class/:id', component: ClassComponent, canActivate: [LoginService] },
19+
{ path: 'teacher', component: TeacherComponent, canActivate: [LoginService] },
20+
{ path: 'teacher/:id', component: TeacherComponent, canActivate: [LoginService] },
21+
{ path: 'pupil', component: PupilComponent, canActivate: [LoginService] },
22+
{ path: 'pupil/:id', component: PupilComponent, canActivate: [LoginService] },
23+
{ path: 'notes', component: NotesComponent, canActivate: [LoginService] },
24+
{ path: 'notes/:id', component: NotesComponent, canActivate: [LoginService] },
25+
{ path: 'notes/pupil/:pId', component: NotesComponent, canActivate: [LoginService], data: [{ filter: 'pupil' }] },
26+
{ path: 'dashboard', component: DashboardComponent, canActivate: [LoginService] },
27+
{ path: 'landing-page', component: LandingPageComponent, canActivate: [LoginService] }
2628
];
2729

2830
@NgModule({

src/app/app.module.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ import { NotesComponent } from './notes/notes.component';
1313
import { LoginComponent } from './login/login.component';
1414
import { DashboardComponent } from './dashboard/dashboard.component';
1515
import { LogoutComponent } from './logout/logout.component';
16-
1716
import { LoginService } from './login.service';
1817
import { DataService } from './data.service';
18+
import { LandingPageComponent } from './landing-page/landing-page.component';
1919

2020
@NgModule({
2121
declarations: [
@@ -26,15 +26,16 @@ import { DataService } from './data.service';
2626
NotesComponent,
2727
LoginComponent,
2828
DashboardComponent,
29-
LogoutComponent
29+
LogoutComponent,
30+
LandingPageComponent
3031
],
3132
imports: [
3233
BrowserModule,
3334
AppRoutingModule,
3435
NgbModule.forRoot(),
3536
FormsModule
3637
],
37-
providers: [LoginService,DataService],
38+
providers: [LoginService, DataService],
3839
bootstrap: [AppComponent]
3940
})
4041
export class AppModule { }

src/app/landing-page/landing-page.component.css

Whitespace-only changes.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<div class="container">
2+
<div class="jumbotron">
3+
4+
<h1>Willkommen!</h1>
5+
Vielen Dank dass sie sich für das digitale Klassenbuch entschieden haben. Zur leichteren Einarbeitung wurden bereits Beispieldaten
6+
für sie generiert. Auf dem praktischen Dashboard finden sie alle notwendigen Schnellzugriffe, um ihre Arbeit zu erleichtern.
7+
Aus Sicherheitsgründen werden alle notwendigen Daten in ihrem Browser gespeichert, was ihnen eine sorglose Benutzung
8+
gewährleistet.
9+
10+
<h2>Notfallsicherheit</h2>
11+
Egal was passiert, das digitale Klassenbuch lässt sie nicht im Stich. Im Notfall steht ihnen der Wurzelbenutzer zur Verfügung
12+
um Datenverlust zu verhindern.
13+
14+
<h2>Modernes Design</h2>
15+
Erleben sie neuste Webtechnologien im Einsatz um Ihnen das bestmögliche Benutzererlebnis zu gewährleisten. Dabei wurde auf
16+
unnötig verzögernde Animationen verzichtet um ein effizientes und entspanntes Arbeiten zu ermöglichen.
17+
18+
<h2>Effizienz</h2>
19+
Verwalten sie ihre Klassenbucheinträge mit bisher ungewohnter Effizienz. Hinzufügen, Bearbeiten, Anschauen - alles notwendige
20+
in wenigen Klicks erreichbar und auf einen Blick sichtbar, dadurch zeichnet sich das digitale Klassenbuch durch exzellente
21+
Simplizität aus.
22+
<br>
23+
<div class="pull-right">
24+
<a class="btn btn-outline-success" routerLink="{{'/dashboard'}}">Los geht's!</a>
25+
</div>
26+
</div>
27+
</div>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2+
3+
import { LandingPageComponent } from './landing-page.component';
4+
5+
describe('LandingPageComponent', () => {
6+
let component: LandingPageComponent;
7+
let fixture: ComponentFixture<LandingPageComponent>;
8+
9+
beforeEach(async(() => {
10+
TestBed.configureTestingModule({
11+
declarations: [ LandingPageComponent ]
12+
})
13+
.compileComponents();
14+
}));
15+
16+
beforeEach(() => {
17+
fixture = TestBed.createComponent(LandingPageComponent);
18+
component = fixture.componentInstance;
19+
fixture.detectChanges();
20+
});
21+
22+
it('should create', () => {
23+
expect(component).toBeTruthy();
24+
});
25+
});
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { Component, OnInit } from '@angular/core';
2+
3+
@Component({
4+
selector: 'app-landing-page',
5+
templateUrl: './landing-page.component.html',
6+
styleUrls: ['./landing-page.component.css']
7+
})
8+
export class LandingPageComponent implements OnInit {
9+
10+
constructor() { }
11+
12+
ngOnInit() {
13+
}
14+
15+
}

src/app/login.service.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,19 @@ export class LoginService implements CanActivate {
99

1010
constructor(private router: Router, private dataService: DataService) {
1111
console.log(dataService);
12-
1312
}
1413
public logOut() {
1514
this.dataService.setLoggedInUser(undefined);
1615
}
1716
public authentificate(email: string, password: string) {
18-
console.log("auth");
1917
return new Promise((resolve, reject) => {
2018
if (email === "Wurzelbenutzer" && password === "Wurzelbenutzer") {
2119
this.dataService.setLoggedInUser(0);
2220
resolve();
21+
return;
2322
}
2423
let teacher = this.dataService.getTeacherByMail(email);
25-
console.log(teacher);
24+
console.log(teacher, email);
2625
bcrypt.compare(password, teacher.pass)
2726
.then((result) => {
2827
if (result) {
@@ -60,6 +59,9 @@ export class LoginService implements CanActivate {
6059
}
6160

6261
public isLoggedIn() {
62+
if (this.dataService.getTeachers() == []) {
63+
return false;
64+
}
6365
return this.dataService.getLoggedInUser() !== undefined;
6466
}
6567

src/app/login/login.component.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ export class LoginComponent implements OnInit {
2727
this.loginService.authentificate(this.model.user, this.model.pass)
2828
.then(() => {
2929
console.log("authentificated");
30+
if (this.model.user == "Wurzelbenutzer") {
31+
this.router.navigate(['/landing-page']);
32+
console.log("wurzelchen");
33+
return;
34+
}
3035
this.wrongCredentials = false;
3136
this.router.navigate(['/dashboard']);
3237
}).catch((err) => {

0 commit comments

Comments
 (0)