Seitenverzeichnis hinzugefügt. Seite 'home' dorthin verschoben und Seite 'envelope' hinzugefügt.
This commit is contained in:
parent
1c11a0e8f0
commit
63613f2073
@ -2,7 +2,7 @@ import { Component } from '@angular/core';
|
|||||||
import { RouterOutlet } from '@angular/router';
|
import { RouterOutlet } from '@angular/router';
|
||||||
import { NavbarComponent } from "./components/navbar/navbar.component";
|
import { NavbarComponent } from "./components/navbar/navbar.component";
|
||||||
import { LoginComponent } from "./components/login/login.component";
|
import { LoginComponent } from "./components/login/login.component";
|
||||||
import { HomeComponent } from "./components/home/home.component";
|
import { HomeComponent } from "./pages/home/home.component";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-root',
|
selector: 'app-root',
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
import { Routes } from '@angular/router';
|
import { Routes } from '@angular/router';
|
||||||
import { EnvelopeTableComponent } from '../app/components/envelope-table/envelope-table.component'
|
import { HomeComponent } from '../app/pages/home/home.component'
|
||||||
import { HomeComponent } from '../app/components/home/home.component'
|
|
||||||
import { authGuard } from './guards/auth.guard'
|
import { authGuard } from './guards/auth.guard'
|
||||||
|
import { EnvelopeComponent } from './pages/envelope/envelope.component';
|
||||||
|
|
||||||
export const routes: Routes = [
|
export const routes: Routes = [
|
||||||
{ path: '', component: HomeComponent },
|
{ path: '', component: HomeComponent },
|
||||||
{ path: 'login', component: HomeComponent },
|
{ path: 'login', component: HomeComponent },
|
||||||
{ path: 'envelope', component: EnvelopeTableComponent, canActivate: [authGuard] }
|
{ path: 'envelope', component: EnvelopeComponent, canActivate: [authGuard] }
|
||||||
];
|
];
|
||||||
@ -13,7 +13,7 @@ export const authGuard: CanActivateFn = (route, state) => {
|
|||||||
return authService.isAuthenticated().pipe(
|
return authService.isAuthenticated().pipe(
|
||||||
map(isAuthenticated => {
|
map(isAuthenticated => {
|
||||||
if (!isAuthenticated) {
|
if (!isAuthenticated) {
|
||||||
router.navigate(['/']);
|
router.navigate(['/login']);
|
||||||
}
|
}
|
||||||
return isAuthenticated;
|
return isAuthenticated;
|
||||||
})
|
})
|
||||||
|
|||||||
@ -0,0 +1,8 @@
|
|||||||
|
<mat-tab-group>
|
||||||
|
<mat-tab label="First">
|
||||||
|
<app-envelope-table></app-envelope-table>
|
||||||
|
</mat-tab>
|
||||||
|
<mat-tab label="Second">
|
||||||
|
<app-envelope-table></app-envelope-table>
|
||||||
|
</mat-tab>
|
||||||
|
</mat-tab-group>
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { EnvelopeComponent } from './envelope.component';
|
||||||
|
|
||||||
|
describe('EnvelopeComponent', () => {
|
||||||
|
let component: EnvelopeComponent;
|
||||||
|
let fixture: ComponentFixture<EnvelopeComponent>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
imports: [EnvelopeComponent]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(EnvelopeComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
import { EnvelopeTableComponent } from "../../components/envelope-table/envelope-table.component";
|
||||||
|
import {MatTabsModule} from '@angular/material/tabs';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-envelope',
|
||||||
|
standalone: true,
|
||||||
|
templateUrl: './envelope.component.html',
|
||||||
|
styleUrl: './envelope.component.scss',
|
||||||
|
imports: [EnvelopeTableComponent, MatTabsModule]
|
||||||
|
})
|
||||||
|
export class EnvelopeComponent {
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,5 +1,5 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { LoginComponent } from "../login/login.component";
|
import { LoginComponent } from "../../components/login/login.component";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-home',
|
selector: 'app-home',
|
||||||
Loading…
x
Reference in New Issue
Block a user