Merge branch 'master-3.0' into Remove-GNS3-VM-specific-code

This commit is contained in:
piotrpekala7 2021-06-10 15:55:59 +02:00
commit 5270134626
8 changed files with 59 additions and 5 deletions

View File

@ -54,6 +54,7 @@ import { ConsoleGuard } from './guards/console-guard';
import { LoginGuard } from './guards/login-guard'; import { LoginGuard } from './guards/login-guard';
import { DefaultLayoutComponent } from './layouts/default-layout/default-layout.component'; import { DefaultLayoutComponent } from './layouts/default-layout/default-layout.component';
import { ServerResolve } from './resolvers/server-resolve'; import { ServerResolve } from './resolvers/server-resolve';
import { UserManagementComponent } from './components/user-management/user-management.component';
import { LoggedUserComponent } from './components/users/logged-user/logged-user.component'; import { LoggedUserComponent } from './components/users/logged-user/logged-user.component';
const routes: Routes = [ const routes: Routes = [
@ -207,10 +208,15 @@ const routes: Routes = [
component: WebConsoleFullWindowComponent, component: WebConsoleFullWindowComponent,
canActivate: [LoginGuard] canActivate: [LoginGuard]
}, },
{
path: 'user_management',
component: UserManagementComponent
},
{ {
path: '**', path: '**',
component: PageNotFoundComponent, component: PageNotFoundComponent,
}, }
]; ];
@NgModule({ @NgModule({

View File

@ -267,6 +267,7 @@ import { MarkedDirective } from './directives/marked.directive';
import { LoginComponent } from './components/login/login.component'; import { LoginComponent } from './components/login/login.component';
import { LoginService } from './services/login.service'; import { LoginService } from './services/login.service';
import { HttpRequestsInterceptor } from './interceptors/http.interceptor'; import { HttpRequestsInterceptor } from './interceptors/http.interceptor';
import { UserManagementComponent } from './components/user-management/user-management.component'
import { UserService } from './services/user.service'; import { UserService } from './services/user.service';
import { LoggedUserComponent } from './components/users/logged-user/logged-user.component'; import { LoggedUserComponent } from './components/users/logged-user/logged-user.component';
@ -453,6 +454,7 @@ import { LoggedUserComponent } from './components/users/logged-user/logged-user.
TemplateNameDialogComponent, TemplateNameDialogComponent,
ConfigureCustomAdaptersDialogComponent, ConfigureCustomAdaptersDialogComponent,
EditNetworkConfigurationDialogComponent, EditNetworkConfigurationDialogComponent,
UserManagementComponent,
ProjectReadmeComponent ProjectReadmeComponent
], ],
imports: [ imports: [

View File

@ -0,0 +1,3 @@
<p>
user-management works!
</p>

View File

@ -0,0 +1,28 @@
/* tslint:disable:no-unused-variable */
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { DebugElement } from '@angular/core';
import { UserManagementComponent } from './user-management.component';
describe('UserManagementComponent', () => {
let component: UserManagementComponent;
let fixture: ComponentFixture<UserManagementComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ UserManagementComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(UserManagementComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-user-management',
templateUrl: './user-management.component.html',
styleUrls: ['./user-management.component.scss']
})
export class UserManagementComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}

View File

@ -23,6 +23,10 @@
<mat-icon>settings</mat-icon> <mat-icon>settings</mat-icon>
<span>Settings</span> <span>Settings</span>
</button> </button>
<button mat-menu-item routerLink="/user_management">
<mat-icon>groups</mat-icon>
<span>User management</span>
</button>
<button mat-menu-item routerLink="/installed-software" [disabled]="!isInstalledSoftwareAvailable"> <button mat-menu-item routerLink="/installed-software" [disabled]="!isInstalledSoftwareAvailable">
<mat-icon>cloud_download</mat-icon> <mat-icon>cloud_download</mat-icon>
<span>Installed software</span> <span>Installed software</span>

View File

@ -14,7 +14,6 @@ import { ServerManagementService, ServerStateEvent } from '../../services/server
import { ToasterService } from '../../services/toaster.service'; import { ToasterService } from '../../services/toaster.service';
import { MockedToasterService } from '../../services/toaster.service.spec'; import { MockedToasterService } from '../../services/toaster.service.spec';
import { DefaultLayoutComponent } from './default-layout.component'; import { DefaultLayoutComponent } from './default-layout.component';
import { IndexedDbService } from '../../services/indexed-db.service';
import { HttpServer, ServerErrorHandler } from '../../services/http-server.service'; import { HttpServer, ServerErrorHandler } from '../../services/http-server.service';
import { HttpClientModule } from '@angular/common/http'; import { HttpClientModule } from '@angular/common/http';
@ -33,7 +32,6 @@ describe('DefaultLayoutComponent', () => {
let electronServiceMock: ElectronServiceMock; let electronServiceMock: ElectronServiceMock;
let serverManagementService = new MockedServerManagementService(); let serverManagementService = new MockedServerManagementService();
let serverService: ServerService; let serverService: ServerService;
let indexedDbService: IndexedDbService;
let httpServer: HttpServer; let httpServer: HttpServer;
let errorHandler: ServerErrorHandler; let errorHandler: ServerErrorHandler;
@ -62,14 +60,12 @@ describe('DefaultLayoutComponent', () => {
useClass: RecentlyOpenedProjectService, useClass: RecentlyOpenedProjectService,
}, },
{ provide: ServerService }, { provide: ServerService },
{ provide: IndexedDbService },
{ provide: HttpServer }, { provide: HttpServer },
{ provide: ServerErrorHandler }, { provide: ServerErrorHandler },
ProgressService, ProgressService,
], ],
}).compileComponents(); }).compileComponents();
indexedDbService = TestBed.inject(IndexedDbService);
errorHandler = TestBed.inject(ServerErrorHandler); errorHandler = TestBed.inject(ServerErrorHandler);
httpServer = TestBed.inject(HttpServer); httpServer = TestBed.inject(HttpServer);
serverService = TestBed.inject(ServerService); serverService = TestBed.inject(ServerService);