1
|
import {Component, OnInit} from '@angular/core';
|
2
|
import {DynamicDialogConfig, DynamicDialogRef} from 'primeng/dynamicdialog';
|
3
|
import {AlteryxException} from 'src/app/shared/models/alteryx-exception.interface';
|
4
|
import { NotificationsHandlingService } from 'src/app/shared/services/notifications-handling/notifications-handling.service';
|
5
|
import {InvoiceProcessesService} from '../../../../../shared/services/invoice-processes.service';
|
6
|
|
7
|
@Component({
|
8
|
selector: 'app-exception-data-preview-popup',
|
9
|
templateUrl: './exception-data-preview-popup.component.html',
|
10
|
styleUrls: ['./exception-data-preview-popup.component.scss']
|
11
|
})
|
12
|
export class ExceptionDataPreviewPopupComponent implements OnInit {
|
13
|
receivedException: AlteryxException;
|
14
|
|
15
|
constructor(public ref: DynamicDialogRef, public config: DynamicDialogConfig, private processService: InvoiceProcessesService,
|
16
|
private notificationService: NotificationsHandlingService
|
17
|
) {
|
18
|
this.config.header = 'Previewing of Unhandled Data';
|
19
|
this.config.height = 'auto';
|
20
|
this.config.width = 'auto';
|
21
|
this.config.closable = false;
|
22
|
}
|
23
|
|
24
|
ngOnInit(): void {
|
25
|
this.config.data = Array.of(this.config.data);
|
26
|
console.log(this.config.data);
|
27
|
}
|
28
|
|
29
|
recalculation() { //TODO create me when endpoint is created
|
30
|
this.processService.recalculateException(this.receivedException.id).subscribe( result => {
|
31
|
this.notificationService.showRecalculateExceptionSuccess();
|
32
|
});
|
33
|
}
|
34
|
|
35
|
}
|