diff --git a/src/app/app.module.ts b/src/app/app.module.ts index d7da9ede..4641877b 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -239,6 +239,7 @@ import { ChooseNameDialogComponent } from './components/projects/choose-name-dia import { PacketCaptureService } from './services/packet-capture.service'; import { StartCaptureOnStartedLinkActionComponent } from './components/project-map/context-menu/actions/start-capture-on-started-link/start-capture-on-started-link.component'; import { LockActionComponent } from './components/project-map/context-menu/actions/lock-action/lock-action.component'; +import { NavigationDialogComponent } from './components/projects/navigation-dialog/navigation-dialog.component'; if (environment.production) { Raven.config('https://b2b1cfd9b043491eb6b566fd8acee358@sentry.io/842726', { @@ -403,7 +404,8 @@ if (environment.production) { QemuImageCreatorComponent, ChooseNameDialogComponent, StartCaptureOnStartedLinkActionComponent, - LockActionComponent + LockActionComponent, + NavigationDialogComponent ], imports: [ BrowserModule, @@ -521,7 +523,8 @@ if (environment.production) { ConfiguratorDialogNatComponent, ConfiguratorDialogTracengComponent, QemuImageCreatorComponent, - ChooseNameDialogComponent + ChooseNameDialogComponent, + NavigationDialogComponent ], bootstrap: [AppComponent] }) diff --git a/src/app/components/project-map/project-map.component.spec.ts b/src/app/components/project-map/project-map.component.spec.ts index 302ce558..27043ee6 100644 --- a/src/app/components/project-map/project-map.component.spec.ts +++ b/src/app/components/project-map/project-map.component.spec.ts @@ -1,7 +1,7 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { ProjectMapComponent } from './project-map.component'; -import { MatIconModule, MatToolbarModule, MatMenuModule, MatCheckboxModule, MatDialogModule } from '@angular/material'; +import { MatIconModule, MatToolbarModule, MatMenuModule, MatCheckboxModule, MatDialogModule, MatBottomSheetModule } from '@angular/material'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { ServerService } from '../../services/server.service'; import { ProjectService } from '../../services/project.service'; @@ -254,7 +254,7 @@ describe('ProjectMapComponent', () => { }; TestBed.configureTestingModule({ - imports: [MatIconModule, MatDialogModule, MatToolbarModule, MatMenuModule, MatCheckboxModule, CommonModule, NoopAnimationsModule], + imports: [MatBottomSheetModule, MatIconModule, MatDialogModule, MatToolbarModule, MatMenuModule, MatCheckboxModule, CommonModule, NoopAnimationsModule], providers: [ { provide: ActivatedRoute }, { provide: ServerService, useClass: MockedServerService }, diff --git a/src/app/components/project-map/project-map.component.ts b/src/app/components/project-map/project-map.component.ts index 8ccea4f0..14732ed9 100644 --- a/src/app/components/project-map/project-map.component.ts +++ b/src/app/components/project-map/project-map.component.ts @@ -53,7 +53,7 @@ import { MapLinkNodeToLinkNodeConverter } from '../../cartography/converters/map import { ProjectMapMenuComponent } from './project-map-menu/project-map-menu.component'; import { ToasterService } from '../../services/toaster.service'; import { ImportProjectDialogComponent } from '../projects/import-project-dialog/import-project-dialog.component'; -import { MatDialog } from '@angular/material'; +import { MatDialog, MatBottomSheet } from '@angular/material'; import { AddBlankProjectDialogComponent } from '../projects/add-blank-project-dialog/add-blank-project-dialog.component'; import { SaveProjectDialogComponent } from '../projects/save-project-dialog/save-project-dialog.component'; import { MapNodesDataSource, MapLinksDataSource, MapDrawingsDataSource, MapSymbolsDataSource, Indexed } from '../../cartography/datasources/map-datasource'; @@ -61,6 +61,7 @@ import { MapSettingsService } from '../../services/mapsettings.service'; import { EditProjectDialogComponent } from '../projects/edit-project-dialog/edit-project-dialog.component'; import { EthernetLinkWidget } from '../../cartography/widgets/links/ethernet-link'; import { SerialLinkWidget } from '../../cartography/widgets/links/serial-link'; +import { NavigationDialogComponent } from '../projects/navigation-dialog/navigation-dialog.component'; @Component({ @@ -137,7 +138,8 @@ export class ProjectMapComponent implements OnInit, OnDestroy { private mapSymbolsDataSource: MapSymbolsDataSource, private mapSettingsService: MapSettingsService, private ethernetLinkWidget: EthernetLinkWidget, - private serialLinkWidget: SerialLinkWidget + private serialLinkWidget: SerialLinkWidget, + private bottomSheet: MatBottomSheet ) {} ngOnInit() { @@ -510,8 +512,16 @@ export class ProjectMapComponent implements OnInit, OnDestroy { dialogRef.afterClosed().subscribe(() => { subscription.unsubscribe(); if (uuid) { - this.projectService.open(this.server, uuid).subscribe(() => { - this.router.navigate(['/server', this.server.id, 'project', uuid]); + this.bottomSheet.open(NavigationDialogComponent); + let bottomSheetRef = this.bottomSheet._openedBottomSheetRef; + bottomSheetRef.instance.projectMessage = 'imported project'; + + const bottomSheetSubscription = bottomSheetRef.afterDismissed().subscribe((result: boolean) => { + if (result) { + this.projectService.open(this.server, uuid).subscribe(() => { + this.router.navigate(['/server', this.server.id, 'project', uuid]); + }); + } }); } }); diff --git a/src/app/components/projects/navigation-dialog/navigation-dialog.component.html b/src/app/components/projects/navigation-dialog/navigation-dialog.component.html new file mode 100644 index 00000000..93169d50 --- /dev/null +++ b/src/app/components/projects/navigation-dialog/navigation-dialog.component.html @@ -0,0 +1,7 @@ +