diff --git a/src/app/components/projects/confirmation-delete-all-projects/confirmation-delete-all-projects.component.spec.ts b/src/app/components/projects/confirmation-delete-all-projects/confirmation-delete-all-projects.component.spec.ts index 0b9f4d37..6bcf137d 100644 --- a/src/app/components/projects/confirmation-delete-all-projects/confirmation-delete-all-projects.component.spec.ts +++ b/src/app/components/projects/confirmation-delete-all-projects/confirmation-delete-all-projects.component.spec.ts @@ -7,8 +7,8 @@ import { MatToolbarModule } from '@angular/material/toolbar'; import { MockedProjectService } from '../../../services/project.service.spec'; import { MockedToasterService } from '../../../services/toaster.service.spec'; import { ProjectService } from '../../../services/project.service'; -import { ServerService } from '../../../services/server.service'; -import { MockedServerService } from '../../../services/server.service.spec'; +import { ControllerService } from '../../../services/controller.service'; +import { MockedControllerService } from '../../../services/controller.service.spec'; import { ToasterService } from '../../../services/toaster.service'; import { ConfirmationDeleteAllProjectsComponent } from './confirmation-delete-all-projects.component'; @@ -16,7 +16,7 @@ import { ConfirmationDeleteAllProjectsComponent } from './confirmation-delete-al describe('ConfirmationDeleteAllProjectsComponent', () => { let component: ConfirmationDeleteAllProjectsComponent; let fixture: ComponentFixture; - let mockedServerService = new MockedServerService(); + let mockedControllerService = new MockedControllerService(); let mockedImageManagerService = new MockedProjectService() let mockedToasterService = new MockedToasterService() @@ -30,7 +30,7 @@ describe('ConfirmationDeleteAllProjectsComponent', () => { MatDialogModule, ], providers: [ - { provide: ServerService, useValue: mockedServerService }, + { provide: ControllerService, useValue: mockedControllerService }, { provide: ProjectService, useValue: mockedImageManagerService }, { provide: MAT_DIALOG_DATA, useValue: {} }, { provide: MatDialogRef, useValue: {} }, diff --git a/src/app/components/projects/confirmation-delete-all-projects/confirmation-delete-all-projects.component.ts b/src/app/components/projects/confirmation-delete-all-projects/confirmation-delete-all-projects.component.ts index a28b2bb2..44bb97ec 100644 --- a/src/app/components/projects/confirmation-delete-all-projects/confirmation-delete-all-projects.component.ts +++ b/src/app/components/projects/confirmation-delete-all-projects/confirmation-delete-all-projects.component.ts @@ -34,7 +34,7 @@ export class ConfirmationDeleteAllProjectsComponent implements OnInit { deleteFile() { const calls = []; this.deleteData.deleteFilesPaths.forEach(project => { - calls.push(this.projectService.delete(this.deleteData.server, project.project_id).pipe(catchError(error => of(error)))) + calls.push(this.projectService.delete(this.deleteData.controller, project.project_id).pipe(catchError(error => of(error)))) }); Observable.forkJoin(calls).subscribe(responses => { this.deleteFliesDetails = responses.filter(x => x !== null) diff --git a/src/app/components/projects/projects.component.ts b/src/app/components/projects/projects.component.ts index 6d02f93b..29ba473d 100644 --- a/src/app/components/projects/projects.component.ts +++ b/src/app/components/projects/projects.component.ts @@ -200,7 +200,7 @@ export class ProjectsComponent implements OnInit { autoFocus: false, disableClose: true, data: { - server: this.server, + controller: this.controller, deleteFilesPaths: this.selection.selected } }); @@ -251,7 +251,7 @@ exportSelectProject(project: Project){ maxHeight: '850px', autoFocus: false, disableClose: true, - data: {serverDetails:this.server,projectDetails:this.project}, + data: {controllerDetails:this.controller,projectDetails:this.project}, }); dialogRef.afterClosed().subscribe((isAddes: boolean) => {}); @@ -276,8 +276,6 @@ export class ProjectDatabase { this.dataChange.next(this.data.slice()); } } - - } export class ProjectDataSource extends DataSource { diff --git a/src/app/layouts/default-layout/default-layout.component.html b/src/app/layouts/default-layout/default-layout.component.html index 0988670a..b2e84204 100644 --- a/src/app/layouts/default-layout/default-layout.component.html +++ b/src/app/layouts/default-layout/default-layout.component.html @@ -19,15 +19,22 @@ - - - diff --git a/src/app/layouts/default-layout/default-layout.component.ts b/src/app/layouts/default-layout/default-layout.component.ts index fbd2fc7e..d0940b74 100644 --- a/src/app/layouts/default-layout/default-layout.component.ts +++ b/src/app/layouts/default-layout/default-layout.component.ts @@ -36,7 +36,7 @@ export class DefaultLayoutComponent implements OnInit, OnDestroy { private controllerManagement: ControllerManagementService, private toasterService: ToasterService, private progressService: ProgressService, - private router: Router, + public router: Router, private route: ActivatedRoute, private controllerService: ControllerService ) { @@ -50,8 +50,6 @@ export class DefaultLayoutComponent implements OnInit, OnDestroy { ngOnInit() { this.checkIfUserIsLoginPage(); - this.controller = this.route.snapshot.data['server']; - this.routeSubscription = this.router.events.subscribe((val) => { if (val instanceof NavigationEnd) this.checkIfUserIsLoginPage(); }); @@ -85,7 +83,7 @@ export class DefaultLayoutComponent implements OnInit, OnDestroy { } checkIfUserIsLoginPage() { - if (this.router.url.includes('login')) { + if (this.router.url.includes("login")) { this.isLoginPage = true; } else { this.isLoginPage = false; @@ -111,26 +109,6 @@ export class DefaultLayoutComponent implements OnInit, OnDestroy { .catch((error) => this.toasterService.error('Cannot navigate to the last opened project')); } - goToPreferences() { - let controllerId = this.router.url.split('/server/')[1].split('/')[0]; - this.router - .navigate(['/server', controllerId, 'preferences']) - .catch((error) => this.toasterService.error('Cannot navigate to the preferences')); - } - - goToSystemStatus() { - let controllerId = this.router.url.split('/server/')[1].split('/')[0]; - this.router - .navigate(['/server', controllerId, 'systemstatus']) - .catch((error) => this.toasterService.error('Cannot navigate to the system status')); - } - goToImageManager() { - let controllerId = this.router.url.split('/server/')[1].split('/')[0]; - this.router - .navigate(['/server', controllerId, 'image-manager']) - .catch((error) => this.toasterService.error('Cannot navigate to the system status')); - } - @HostListener('window:beforeunload', ['$event']) async onBeforeUnload($event) { if (!this.shouldStopControllersOnClosing) {