Stub out login page
This commit is contained in:
parent
9a5dbb4d18
commit
deab6bb0b1
8 changed files with 75 additions and 15 deletions
|
@ -1,4 +1,6 @@
|
|||
<app-nav-rail></app-nav-rail>
|
||||
@if ($showNavRail()) {
|
||||
<app-nav-rail></app-nav-rail>
|
||||
}
|
||||
<main>
|
||||
<router-outlet></router-outlet>
|
||||
</main>
|
||||
|
|
|
@ -1,14 +1,19 @@
|
|||
import { Routes } from '@angular/router';
|
||||
import { Plan } from './routes/plan/plan';
|
||||
import { Login } from './routes/login/login';
|
||||
|
||||
export const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
pathMatch: 'full',
|
||||
redirectTo: '/plan'
|
||||
},
|
||||
{
|
||||
path: 'plan',
|
||||
component: Plan
|
||||
},
|
||||
{
|
||||
path: 'login',
|
||||
component: Login,
|
||||
},
|
||||
{
|
||||
path: 'plan',
|
||||
component: Plan,
|
||||
},
|
||||
{
|
||||
path: '',
|
||||
pathMatch: 'full',
|
||||
redirectTo: '/login',
|
||||
},
|
||||
];
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
:host {
|
||||
display: grid;
|
||||
grid-template-columns: min-content auto;
|
||||
min-height: 100vh;
|
||||
display: grid;
|
||||
grid-template-areas: 'nav' 'main';
|
||||
grid-template-columns: min-content auto;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
main {
|
||||
grid-area: main;
|
||||
}
|
||||
|
|
|
@ -1,11 +1,19 @@
|
|||
import { Component } from '@angular/core';
|
||||
import { Component, computed, signal } from '@angular/core';
|
||||
import { RouterOutlet } from '@angular/router';
|
||||
import { NavRail } from './components/nav-rail/nav-rail';
|
||||
|
||||
const ROUTES_THAT_HIDE_NAV_RAIL = /^\/login$/;
|
||||
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
imports: [RouterOutlet, NavRail],
|
||||
styleUrl: './app.scss',
|
||||
templateUrl: './app.html',
|
||||
})
|
||||
export class App {}
|
||||
export class App {
|
||||
private readonly $_pathname = signal(location.pathname);
|
||||
readonly $showNavRail = computed(() => {
|
||||
const pathname = this.$_pathname();
|
||||
return pathname.length > 0 && !ROUTES_THAT_HIDE_NAV_RAIL.test(pathname);
|
||||
});
|
||||
}
|
||||
|
|
1
webapp/src/app/routes/login/login.html
Normal file
1
webapp/src/app/routes/login/login.html
Normal file
|
@ -0,0 +1 @@
|
|||
<p>login works!</p>
|
5
webapp/src/app/routes/login/login.scss
Normal file
5
webapp/src/app/routes/login/login.scss
Normal file
|
@ -0,0 +1,5 @@
|
|||
:host {
|
||||
display: grid;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
23
webapp/src/app/routes/login/login.spec.ts
Normal file
23
webapp/src/app/routes/login/login.spec.ts
Normal file
|
@ -0,0 +1,23 @@
|
|||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { Login } from './login';
|
||||
|
||||
describe('Login', () => {
|
||||
let component: Login;
|
||||
let fixture: ComponentFixture<Login>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [Login]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(Login);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
11
webapp/src/app/routes/login/login.ts
Normal file
11
webapp/src/app/routes/login/login.ts
Normal file
|
@ -0,0 +1,11 @@
|
|||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-login',
|
||||
imports: [],
|
||||
templateUrl: './login.html',
|
||||
styleUrl: './login.scss'
|
||||
})
|
||||
export class Login {
|
||||
|
||||
}
|
Loading…
Add table
Reference in a new issue