Added routing by permissions #130
This commit is contained in:
@@ -122,7 +122,7 @@ export class DashboardComponent implements OnInit {
|
||||
}
|
||||
|
||||
selectServer(server: Server) {
|
||||
this.sidebar.serverName$.next(server.name ?? "");
|
||||
this.sidebar.server$.next(server);
|
||||
this.router.navigate(["/server", server.id]);
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1 @@
|
||||
<p>profile works!</p>
|
@@ -0,0 +1,23 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ProfileComponent } from './profile.component';
|
||||
|
||||
describe('ProfileComponent', () => {
|
||||
let component: ProfileComponent;
|
||||
let fixture: ComponentFixture<ProfileComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ ProfileComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(ProfileComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
@@ -0,0 +1,10 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-profile',
|
||||
templateUrl: './profile.component.html',
|
||||
styleUrls: ['./profile.component.scss']
|
||||
})
|
||||
export class ProfileComponent {
|
||||
|
||||
}
|
@@ -42,7 +42,7 @@ export class ServerDashboardComponent implements OnInit {
|
||||
}
|
||||
).subscribe(server => {
|
||||
this.server = server;
|
||||
this.sidebar.serverName$.next(server.name ?? "");
|
||||
this.sidebar.server$.next(server);
|
||||
this.spinner.hideSpinner();
|
||||
});
|
||||
}
|
||||
|
@@ -1,9 +1,11 @@
|
||||
import { NgModule } from "@angular/core";
|
||||
import { RouterModule, Routes } from "@angular/router";
|
||||
import { ServerDashboardComponent } from "./server-dashboard/server-dashboard.component";
|
||||
import { ProfileComponent } from "./profile/profile.component";
|
||||
|
||||
const routes: Routes = [
|
||||
{ path: '', component: ServerDashboardComponent },
|
||||
{ path: 'profile', component: ProfileComponent },
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
|
@@ -3,12 +3,14 @@ import { CommonModule } from '@angular/common';
|
||||
import { ServerDashboardComponent } from './server-dashboard/server-dashboard.component';
|
||||
import { ServerRoutingModule } from './server-routing.module';
|
||||
import { SharedModule } from '../../shared/shared.module';
|
||||
import { ProfileComponent } from './profile/profile.component';
|
||||
|
||||
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
ServerDashboardComponent
|
||||
ServerDashboardComponent,
|
||||
ProfileComponent
|
||||
],
|
||||
imports: [
|
||||
CommonModule,
|
||||
|
Reference in New Issue
Block a user