Teacher dashboard
This commit is contained in:
parent
441b6ce68d
commit
7573b7f2e5
8 changed files with 78 additions and 3 deletions
|
@ -23,6 +23,11 @@ const routes: Routes = [
|
||||||
loadChildren: async () => (await import('./students/students.module')).StudentsModule,
|
loadChildren: async () => (await import('./students/students.module')).StudentsModule,
|
||||||
data: {title: 'Hallagtói kezdőlap'}
|
data: {title: 'Hallagtói kezdőlap'}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: 'teacher',
|
||||||
|
loadChildren: async () => (await import('./teachers/teachers.module')).TeachersModule,
|
||||||
|
data: {title: 'Oktatói kezdőlap'}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
children: [
|
children: [
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<mat-card>
|
<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-card-content>
|
||||||
<mat-progress-bar [value]="50"></mat-progress-bar>
|
|
||||||
</mat-card-content>
|
</mat-card-content>
|
||||||
</mat-card>
|
</mat-card>
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { CourseListByUserGQL } from '../../services/graphql';
|
||||||
|
import { LoginService } from '../../auth/login.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-dashboard',
|
selector: 'app-dashboard',
|
||||||
|
@ -7,7 +9,7 @@ import { Component, OnInit } from '@angular/core';
|
||||||
})
|
})
|
||||||
export class DashboardComponent implements OnInit {
|
export class DashboardComponent implements OnInit {
|
||||||
|
|
||||||
constructor() {
|
constructor(public courses: CourseListByUserGQL, public loginService: LoginService) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
|
|
|
@ -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>
|
|
@ -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();
|
||||||
|
});
|
||||||
|
});
|
18
frontend/src/app/teachers/dashboard/dashboard.component.ts
Normal file
18
frontend/src/app/teachers/dashboard/dashboard.component.ts
Normal 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 {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
21
frontend/src/app/teachers/teachers.module.ts
Normal file
21
frontend/src/app/teachers/teachers.module.ts
Normal 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 {
|
||||||
|
}
|
Loading…
Reference in a new issue