1
|
import { TranslateService } from '@ngx-translate/core';
|
2
|
import { MessageService } from 'primeng/api';
|
3
|
import { Injectable } from '@angular/core';
|
4
|
|
5
|
@Injectable({
|
6
|
providedIn: 'root'
|
7
|
})
|
8
|
export class NotificationsHandlingService {
|
9
|
|
10
|
constructor(private messageService: MessageService, private translate: TranslateService) { }
|
11
|
|
12
|
public showSuccess(title: string, message: string): void {
|
13
|
this.messageService.add({
|
14
|
severity: 'success',
|
15
|
summary: title,
|
16
|
detail: message
|
17
|
});
|
18
|
}
|
19
|
|
20
|
public showCreateRoleSuccess(): void {
|
21
|
this.showSuccess(this.translate.instant('RTA_SUCCESS.CREATE_SUCCESS'), this.translate.instant('RTA_SUCCESS.ROLE_CREATE'));
|
22
|
}
|
23
|
|
24
|
public showUpdateRoleSuccess(): void {
|
25
|
this.showSuccess(this.translate.instant('RTA_SUCCESS.UPDATE_SUCCESS'), this.translate.instant('RTA_SUCCESS.ROLE_UPDATE'));
|
26
|
}
|
27
|
|
28
|
public showUpdateRightsSuccess(): void {
|
29
|
this.showSuccess(this.translate.instant('RTA_SUCCESS.UPDATE_SUCCESS'), this.translate.instant('RTA_SUCCESS.RIGHTS_UPDATE'));
|
30
|
}
|
31
|
|
32
|
public showRoleToggleStatusSuccess(status: boolean): void {
|
33
|
const msg = status ? this.translate.instant('RTA_SUCCESS.ROLE_ENABLED') : this.translate.instant('RTA_SUCCESS.ROLE_DISABLED');
|
34
|
this.showSuccess(this.translate.instant('RTA_SUCCESS.TITLE_SUCCESS'), msg);
|
35
|
}
|
36
|
|
37
|
public showVerificationCompletedSuccess(): void {
|
38
|
this.showSuccess(this.translate.instant('RTA_SUCCESS.TITLE_SUCCESS'), this.translate.instant('RTA_SUCCESS.VERIFICATION_COMPLETED'));
|
39
|
}
|
40
|
|
41
|
public showUpdateCategorySuccess(): void {
|
42
|
this.showSuccess(this.translate.instant('RTA_SUCCESS.UPDATE_SUCCESS'), this.translate.instant('RTA_SUCCESS.CATEGORY_UPDATE'));
|
43
|
}
|
44
|
|
45
|
public showUpdateConfiguratorParameterSuccess(): void {
|
46
|
this.showSuccess(this.translate.instant('RTA_SUCCESS.UPDATE_SUCCESS'), this.translate.instant('RTA_SUCCESS.CONFIGURATOR_PARAMETER_UPDATE'));
|
47
|
}
|
48
|
|
49
|
public showCreateNewCategorySuccess(): void {
|
50
|
this.showSuccess(this.translate.instant('RTA_SUCCESS.CREATE_SUCCESS'), this.translate.instant('RTA_SUCCESS.CATEGORY_CREATE'));
|
51
|
}
|
52
|
|
53
|
public showCreateNewTemplateSuccess(): void {
|
54
|
this.showSuccess(this.translate.instant('RTA_SUCCESS.CREATE_SUCCESS'), this.translate.instant('RTA_SUCCESS.TEMPLATE_CREATE'));
|
55
|
}
|
56
|
|
57
|
public showUpdateTemplateSuccess(): void {
|
58
|
this.showSuccess(this.translate.instant('RTA_SUCCESS.UPDATE_SUCCESS'), this.translate.instant('RTA_SUCCESS.TEMPLATE_UPDATE'));
|
59
|
}
|
60
|
|
61
|
public showCreateNewVerificationRuleSuccess(): void {
|
62
|
this.showSuccess(this.translate.instant('RTA_SUCCESS.CREATE_SUCCESS'), this.translate.instant('RTA_SUCCESS.VERIFICATION_RULE_CREATE'));
|
63
|
}
|
64
|
|
65
|
public showUpdateVerificationRuleSuccess(): void {
|
66
|
this.showSuccess(this.translate.instant('RTA_SUCCESS.UPDATE_SUCCESS'), this.translate.instant('RTA_SUCCESS.VERIFICATION_RULE_UPDATE'));
|
67
|
}
|
68
|
|
69
|
public showDisableUserRoleSuccess(): void {
|
70
|
this.showSuccess(this.translate.instant('RTA_SUCCESS.TITLE_SUCCESS'), this.translate.instant('RTA_SUCCESS.DISABLE_USER_ROLE_SUCCESS'));
|
71
|
}
|
72
|
|
73
|
public showAssignmentNewRoleSuccess(): void {
|
74
|
this.showSuccess(this.translate.instant('RTA_SUCCESS.TITLE_SUCCESS'), this.translate.instant('RTA_SUCCESS.ASSIGNMENT_ROLE_SUCCESS'));
|
75
|
}
|
76
|
|
77
|
public showOnIgnoreFileSuccess(): void {
|
78
|
this.showSuccess(this.translate.instant('RTA_SUCCESS.TITLE_SUCCESS'), this.translate.instant('RTA_SUCCESS.IGNORE_FILE_SUCCESS'));
|
79
|
}
|
80
|
|
81
|
public showOnForwardSuccess(): void {
|
82
|
this.showSuccess(this.translate.instant('RTA_SUCCESS.TITLE_SUCCESS'), this.translate.instant('RTA_SUCCESS.FORWARD_SUCCESS_ABBY'));
|
83
|
}
|
84
|
|
85
|
public showOnClassifySuccess(): void {
|
86
|
this.showSuccess(this.translate.instant('RTA_SUCCESS.TITLE_SUCCESS'), this.translate.instant('RTA_SUCCESS.CLASSIFY_SUCCESS'));
|
87
|
}
|
88
|
|
89
|
public showUpdateTimeIntervalsSuccess(): void {
|
90
|
this.showSuccess(this.translate.instant('RTA_SUCCESS.UPDATE_SUCCESS'), this.translate.instant('RTA_SUCCESS.TIME_INTERVAL_UPDATE'));
|
91
|
}
|
92
|
|
93
|
public showRescheduleSuccess(): void {
|
94
|
this.showSuccess(this.translate.instant('RTA_SUCCESS.TITLE_SUCCESS'), this.translate.instant('RTA_SUCCESS.RESCHEDULE_SUCCESS'));
|
95
|
}
|
96
|
|
97
|
public showHighPrioritySuccess(): void {
|
98
|
this.showSuccess(this.translate.instant('RTA_SUCCESS.TITLE_SUCCESS'), this.translate.instant('RTA_SUCCESS.HIGH_PRIORITY_SUCCESS'));
|
99
|
}
|
100
|
|
101
|
public showReclassifyRecordsSuccess(): void {
|
102
|
this.showSuccess(this.translate.instant('RTA_SUCCESS.TITLE_SUCCESS'), this.translate.instant('RTA_SUCCESS.RECLASSIFY_RECORD_SUCCESS'));
|
103
|
}
|
104
|
|
105
|
public showRecalculateExceptionSuccess(): void {
|
106
|
this.showSuccess(this.translate.instant('RTA_SUCCESS.TITLE_SUCCESS'), this.translate.instant('RTA_SUCCESS.RECALCULATE_EXCEPTIONS_SUCCESS'));
|
107
|
}
|
108
|
|
109
|
public showDeleteCategorySuccess(): void {
|
110
|
this.showSuccess(this.translate.instant('RTA_SUCCESS.TITLE_SUCCESS'), this.translate.instant('RTA_SUCCESS.DELETE_CATEGORY_SUCCESS'));
|
111
|
}
|
112
|
|
113
|
public showCreateCategorySuccess(): void {
|
114
|
this.showSuccess(this.translate.instant('RTA_SUCCESS.TITLE_SUCCESS'), this.translate.instant('RTA_SUCCESS.CATEGORY_CREATE_SUCCESS'));
|
115
|
}
|
116
|
|
117
|
public showDeleteTemplateSuccess(): void {
|
118
|
this.showSuccess(this.translate.instant('RTA_SUCCESS.TITLE_SUCCESS'), this.translate.instant('RTA_SUCCESS.TEMPLATE_DELETE_SUCCESS'));
|
119
|
}
|
120
|
|
121
|
public showDeleteVerificationSuccess(): void {
|
122
|
this.showSuccess(this.translate.instant('RTA_SUCCESS.TITLE_SUCCESS'), this.translate.instant('RTA_SUCCESS.VERIFICATION_DELETE_SUCCESS'));
|
123
|
}
|
124
|
|
125
|
public showUpdateRoleStatusSuccess(): void {
|
126
|
this.showSuccess(this.translate.instant('RTA_SUCCESS.UPDATE_SUCCESS'), this.translate.instant('RTA_SUCCESS.ROLE_STATUS_UPDATE'));
|
127
|
}
|
128
|
|
129
|
public showDeleteRoleSuccess(): void {
|
130
|
this.showSuccess(this.translate.instant('RTA_SUCCESS.TITLE_SUCCESS'), this.translate.instant('RTA_SUCCESS.ROLE_STATUS_DELETE'));
|
131
|
}
|
132
|
|
133
|
public showAlteryxRecalculation(): void {
|
134
|
this.showSuccess(this.translate.instant('RTA_SUCCESS.TITLE_SUCCESS'), this.translate.instant('RTA_SUCCESS.ALTERYX-RECALCULATION'));
|
135
|
}
|
136
|
|
137
|
public showAbbyVerification(): void {
|
138
|
this.showSuccess(this.translate.instant('RTA_SUCCESS.TITLE_SUCCESS'), this.translate.instant('RTA_SUCCESS.ABBYY-VERIFICATION'));
|
139
|
}
|
140
|
|
141
|
public showProcessCancelation(): void {
|
142
|
this.showSuccess(this.translate.instant('RTA_SUCCESS.TITLE_SUCCESS'), this.translate.instant('RTA_SUCCESS.PROCESS-CANCELATION'));
|
143
|
}
|
144
|
|
145
|
public showProcessComplete(): void {
|
146
|
this.showSuccess(this.translate.instant('RTA_SUCCESS.TITLE_SUCCESS'), this.translate.instant('RTA_SUCCESS.PROCESS-COMPLETED'));
|
147
|
}
|
148
|
|
149
|
|
150
|
}
|