Merge "workflow parameters API"
[vid.git] / vid-webpack-master / src / app / shared / components / error / error.component.service.ts
1 import {Injectable} from "@angular/core";
2 import {MessageBoxService } from '../messageBox/messageBox.service';
3 import {MessageBoxData} from '../messageBox/messageBox.data';
4 import { SdcUiCommon} from "onap-ui-angular";
5 @Injectable()
6 export class ErrorService {
7   static showErrorWithMessage(error : ErrorMessage) : void {
8     setTimeout(()=>{
9         let messageBoxData : MessageBoxData = new MessageBoxData(
10           error.title,
11           error.text,
12           SdcUiCommon.ModalType.error,
13           SdcUiCommon.ModalSize.medium,
14           [
15             {text:"Close", size:"large", closeModal:true}
16           ]);
17         MessageBoxService.openModal.next(messageBoxData);
18       }
19       ,500);
20   }
21 }
22
23 export class ErrorMessage {
24   title : string;
25   text : string;
26   errorNumber : number;
27
28   constructor( title : string, text : string,errorNumber : number){
29     this.title = title;
30     this.text = text;
31     this.errorNumber = errorNumber;
32   }
33 }
34