Teacher dashboard

This commit is contained in:
Norbi Peti 2022-05-14 21:58:29 +02:00
parent 441b6ce68d
commit 7573b7f2e5
No known key found for this signature in database
GPG key ID: DBA4C4549A927E56
8 changed files with 78 additions and 3 deletions

View file

@ -23,6 +23,11 @@ const routes: Routes = [
loadChildren: async () => (await import('./students/students.module')).StudentsModule,
data: {title: 'Hallagtói kezdőlap'}
},
{
path: 'teacher',
loadChildren: async () => (await import('./teachers/teachers.module')).TeachersModule,
data: {title: 'Oktatói kezdőlap'}
},
{
path: '',
children: [

View file

@ -1,6 +1,5 @@
<mat-card>
<mat-card-header><h2>Teljesitett tárgyak</h2></mat-card-header>
<mat-card-header><h2>Üdv, {{ loginService.user?.name }}!</h2></mat-card-header>
<mat-card-content>
<mat-progress-bar [value]="50"></mat-progress-bar>
</mat-card-content>
</mat-card>

View file

@ -1,4 +1,6 @@
import { Component, OnInit } from '@angular/core';
import { CourseListByUserGQL } from '../../services/graphql';
import { LoginService } from '../../auth/login.service';
@Component({
selector: 'app-dashboard',
@ -7,7 +9,7 @@ import { Component, OnInit } from '@angular/core';
})
export class DashboardComponent implements OnInit {
constructor() {
constructor(public courses: CourseListByUserGQL, public loginService: LoginService) {
}
ngOnInit(): void {

View file

@ -0,0 +1,5 @@
<mat-card>
<mat-card-header><h2>Üdv, {{ loginService.user?.name }}!</h2></mat-card-header>
<mat-card-content>
</mat-card-content>
</mat-card>

View file

@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { DashboardComponent } from './dashboard.component';
describe('DashboardComponent', () => {
let component: DashboardComponent;
let fixture: ComponentFixture<DashboardComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [DashboardComponent]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(DashboardComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View file

@ -0,0 +1,18 @@
import { Component, OnInit } from '@angular/core';
import { CourseListByUserGQL } from '../../services/graphql';
import { LoginService } from '../../auth/login.service';
@Component({
selector: 'app-dashboard',
templateUrl: './dashboard.component.html',
styleUrls: ['./dashboard.component.css']
})
export class DashboardComponent implements OnInit {
constructor(public courses: CourseListByUserGQL, public loginService: LoginService) {
}
ngOnInit(): void {
}
}

View file

@ -0,0 +1,21 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { DashboardComponent } from './dashboard/dashboard.component';
import { RouterModule, Routes } from '@angular/router';
import { RouteData } from '../app-routing.module';
import { MatCardModule } from '@angular/material/card';
const routes: Routes = [
{path: '', component: DashboardComponent, data: {title: 'Kezdőlap'} as RouteData}
];
@NgModule({
declarations: [DashboardComponent],
imports: [
CommonModule,
RouterModule.forChild(routes),
MatCardModule
]
})
export class TeachersModule {
}