@@ -2,10 +2,15 @@ import { Component, OnDestroy, OnInit, QueryList, ViewChildren } from '@angular/
2
2
import { UntypedFormControl , UntypedFormGroup } from '@angular/forms' ;
3
3
import { ActivatedRoute } from '@angular/router' ;
4
4
import { Subscription } from 'rxjs' ;
5
+ import { TranslateService } from '@ngx-translate/core' ;
6
+ import { MatDialog } from '@angular/material/dialog' ;
5
7
import { CardComponent } from '../../../shared/card/card.component' ;
6
8
import { ActionDto } from '../../../_models/actionDto' ;
7
9
import { ActionService } from '../../../_services/api/action.service' ;
8
10
import { NotificationService } from '../../../_services/notification.service' ;
11
+ import { AddEditBaseModalComponent } from '../../../shared/modals/add-edit-base-modal/add-edit-base-modal.component' ;
12
+ import { ADD_MODAL_MAX_WIDTH } from '../../../_constants/common' ;
13
+ import { EventActionsAddEditModalComponent } from '../../event-actions-add-edit-modal/event-actions-add-edit-modal.component' ;
9
14
10
15
@Component ( {
11
16
selector : 'app-event-actions' ,
@@ -28,7 +33,9 @@ export class EventActionsComponent implements OnInit, OnDestroy {
28
33
constructor (
29
34
private activeRoute : ActivatedRoute ,
30
35
private actionService : ActionService ,
31
- private notificationService : NotificationService
36
+ private notificationService : NotificationService ,
37
+ private dialog : MatDialog ,
38
+ private translateService : TranslateService
32
39
) { }
33
40
34
41
ngOnInit ( ) : void {
@@ -96,6 +103,24 @@ export class EventActionsComponent implements OnInit, OnDestroy {
96
103
this . maxHeight = Math . max ( ...heights ) ;
97
104
}
98
105
106
+ openCreateEventActionModal ( ) : void {
107
+ const dialogRef = this . dialog . open ( AddEditBaseModalComponent , {
108
+ maxWidth : ADD_MODAL_MAX_WIDTH ,
109
+ data : {
110
+ title : this . translateService . instant ( 'strings.headingCreateNewAction' ) ,
111
+ component : EventActionsAddEditModalComponent ,
112
+ } ,
113
+ } ) ;
114
+
115
+ this . subscriptions . push (
116
+ dialogRef . afterClosed ( ) . subscribe ( ( result ) => {
117
+ // eslint-disable-next-line no-empty
118
+ if ( result ) {
119
+ }
120
+ } )
121
+ ) ;
122
+ }
123
+
99
124
ngOnDestroy ( ) : void {
100
125
this . subscriptions . forEach ( ( subscription ) => subscription . unsubscribe ( ) ) ;
101
126
}
0 commit comments