Bottom sheet for imported projects

This commit is contained in:
Piotr Pekala
2019-10-03 07:16:57 -07:00
parent 6cf670d5cf
commit 41c67ae6ec
7 changed files with 94 additions and 11 deletions

View File

@ -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]);
});
}
});
}
});