Project

General

Profile

1
import {Component, Input, OnInit} from '@angular/core';
2
import {AlteryxUnhandledData} from '../../../../shared/models/alteryx-unhandled-data.interface';
3
import {AlteryxException} from '../../../../shared/models/alteryx-exception.interface';
4
import {DialogService} from 'primeng/dynamicdialog';
5
import {ExceptionDataPreviewPopupComponent} from './exception-data-preview-popup/exception-data-preview-popup.component';
6
import {InvoiceProcessesService} from '../../../../shared/services/invoice-processes.service';
7
import { NotificationsHandlingService } from 'src/app/shared/services/notifications-handling/notifications-handling.service';
8

    
9
@Component({
10
  selector: 'app-process-exception-manipulation',
11
  templateUrl: './process-exception-manipulation.component.html',
12
  styleUrls: ['./process-exception-manipulation.component.scss']
13
})
14
export class ProcessExceptionManipulationComponent implements OnInit {
15
  @Input()
16
  receivedException: AlteryxException;
17

    
18
  constructor(private dialogService: DialogService, private processService: InvoiceProcessesService, 
19
    private notificationService: NotificationsHandlingService) {
20
  }
21

    
22
  ngOnInit(): void {
23
  }
24

    
25
  preview(exception: AlteryxException): void {
26
    this.dialogService.open(ExceptionDataPreviewPopupComponent, {data: exception});
27
    // this will be done by  pagidas
28
  }
29

    
30
  recalculation(exception: AlteryxException): void {
31
    this.processService.recalculateException(exception.id).subscribe( result => {
32
      this.notificationService.showRecalculateExceptionSuccess();
33
    });
34
  }
35
}
(4-4/4)