@@ -9,6 +9,7 @@ import { MatBottomSheet, MatDialog } from '@angular/material';
99import { KeyboardSheetComponent } from '../keyboard-sheet/keyboard-sheet.component' ;
1010import { FormControl } from '@angular/forms' ;
1111import { BookDialogComponent } from '../book-dialog/book-dialog.component' ;
12+ import { HelpDialogComponent } from '../help-dialog/help-dialog.component' ;
1213
1314@Component ( {
1415 selector : 'app-book-page' ,
@@ -35,7 +36,7 @@ export class BookPageComponent implements OnInit {
3536 private usrIdle : UserIdleService ,
3637 private bookService : BookService ,
3738 private bottomSheet : MatBottomSheet ,
38- public bookDialog : MatDialog ) {
39+ public dialogRef : MatDialog ) {
3940
4041 this . matIconRegistry . addSvgIcon (
4142 "BackArrow" ,
@@ -49,6 +50,10 @@ export class BookPageComponent implements OnInit {
4950 "Cancel" ,
5051 this . domSanitizer . bypassSecurityTrustResourceUrl ( "./assets/Cancel.svg" )
5152 ) ;
53+ this . matIconRegistry . addSvgIcon (
54+ "Help" ,
55+ this . domSanitizer . bypassSecurityTrustResourceUrl ( "./assets/helpOutline.svg" )
56+ ) ;
5257
5358 this . usrIdle . startWatching ( ) ;
5459 this . usrIdle . onTimerStart ( ) . subscribe ( ) ;
@@ -78,6 +83,10 @@ export class BookPageComponent implements OnInit {
7883 this . router . navigate ( [ '/' ] ) ;
7984 }
8085
86+ requestHelp ( ) : void {
87+ const dialog = this . dialogRef . open ( HelpDialogComponent , { } ) ;
88+ }
89+
8190 saveEventData ( ) : void {
8291 let bookEvent = this . getEventData ( ) ;
8392 if ( bookEvent != null ) {
@@ -142,13 +151,13 @@ export class BookPageComponent implements OnInit {
142151 }
143152
144153 openBookDialog ( event : ScheduledEvent ) : void {
145- const dialogRef = this . bookDialog . open ( BookDialogComponent , {
154+ const dialog = this . dialogRef . open ( BookDialogComponent , {
146155 width : '400px' ,
147156 panelClass : 'custom-dialog-container' ,
148157 data : event
149158 } ) ;
150159
151- dialogRef . afterClosed ( ) . subscribe ( result => {
160+ dialog . afterClosed ( ) . subscribe ( result => {
152161 console . log ( 'Book dialog was closed' ) ;
153162 if ( result == 'success' ) {
154163 this . routeToMain ( ) ;
0 commit comments