awf-test-lib 0.1.9 → 0.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (218) hide show
  1. package/karma.conf.js +44 -0
  2. package/ng-package.json +7 -0
  3. package/package.json +10 -30
  4. package/src/lib/core/core-routing.module.ts +10 -0
  5. package/src/lib/core/core.module.ts +35 -0
  6. package/src/lib/core/menu/menu.component.css +18 -0
  7. package/src/lib/core/menu/menu.component.html +8 -0
  8. package/src/lib/core/menu/menu.component.spec.ts +23 -0
  9. package/src/lib/core/menu/menu.component.ts +28 -0
  10. package/src/lib/core/menu-consomer/menu-consomer.component.html +20 -0
  11. package/src/lib/core/menu-consomer/menu-consomer.component.scss +20 -0
  12. package/src/lib/core/menu-consomer/menu-consomer.component.spec.ts +25 -0
  13. package/src/lib/core/menu-consomer/menu-consomer.component.ts +21 -0
  14. package/src/lib/core/menu-ge-portal/menu-ge-portal.component.html +7 -0
  15. package/src/lib/core/menu-ge-portal/menu-ge-portal.component.scss +17 -0
  16. package/src/lib/core/menu-ge-portal/menu-ge-portal.component.spec.ts +25 -0
  17. package/src/lib/core/menu-ge-portal/menu-ge-portal.component.ts +24 -0
  18. package/src/lib/core/menu-warranty/menu-warranty.component.html +20 -0
  19. package/src/lib/core/menu-warranty/menu-warranty.component.scss +16 -0
  20. package/src/lib/core/menu-warranty/menu-warranty.component.spec.ts +25 -0
  21. package/src/lib/core/menu-warranty/menu-warranty.component.ts +31 -0
  22. package/src/lib/core/not-found/not-found.component.css +31 -0
  23. package/src/lib/core/not-found/not-found.component.html +6 -0
  24. package/src/lib/core/not-found/not-found.component.spec.ts +23 -0
  25. package/src/lib/core/not-found/not-found.component.ts +15 -0
  26. package/src/lib/core/top-bar/top-bar.component.css +116 -0
  27. package/src/lib/core/top-bar/top-bar.component.html +1 -0
  28. package/src/lib/core/top-bar/top-bar.component.spec.ts +23 -0
  29. package/src/lib/core/top-bar/top-bar.component.ts +39 -0
  30. package/{lib/models/account.model.d.ts → src/lib/models/account.model.ts} +6 -3
  31. package/src/lib/models/alternativeDate.model.ts +6 -0
  32. package/src/lib/models/applicationName.ts +6 -0
  33. package/{lib/models/cancelPMMailRequest.model.d.ts → src/lib/models/cancelPMMailRequest.model.ts} +3 -1
  34. package/src/lib/models/customObject.model.ts +4 -0
  35. package/src/lib/models/detailedPmJob.model.ts +25 -0
  36. package/src/lib/models/emailStatus.ts +4 -0
  37. package/src/lib/models/emailType.ts +17 -0
  38. package/src/lib/models/eventStatus.ts +8 -0
  39. package/src/lib/models/field.ts +7 -0
  40. package/src/lib/models/language.ts +4 -0
  41. package/{lib/models/mailRequest.model.d.ts → src/lib/models/mailRequest.model.ts} +3 -1
  42. package/src/lib/models/pMGroupedJob.model.ts +4 -0
  43. package/{lib/models/pmJob.model.d.ts → src/lib/models/pmJob.model.ts} +7 -6
  44. package/src/lib/models/pmJobRequest.model.ts +6 -0
  45. package/{lib/models/pmJobStatus.d.ts → src/lib/models/pmJobStatus.ts} +8 -3
  46. package/src/lib/models/reason.model.ts +7 -0
  47. package/src/lib/models/reasonCode.ts +9 -0
  48. package/src/lib/models/reasonContact.ts +7 -0
  49. package/{lib/models/reportDateMailRequest.model.d.ts → src/lib/models/reportDateMailRequest.model.ts} +3 -1
  50. package/src/lib/models/role.ts +5 -0
  51. package/src/lib/models/service.model.ts +8 -0
  52. package/src/lib/models/serviceName.ts +14 -0
  53. package/{lib/models/socialLoginRequest.model.d.ts → src/lib/models/socialLoginRequest.model.ts} +1 -1
  54. package/src/lib/models/socialMadia.ts +4 -0
  55. package/src/lib/models/stingBoolean.ts +7 -0
  56. package/src/lib/models/system.ts +15 -0
  57. package/{lib/models/theme.model.d.ts → src/lib/models/theme.model.ts} +18 -11
  58. package/src/lib/models/tokenStatus.ts +6 -0
  59. package/src/lib/models/warranty.ts +18 -0
  60. package/src/lib/pipes/pipes/pipes.module.ts +14 -0
  61. package/src/lib/pipes/subrtring-w.pipe.spec.ts +8 -0
  62. package/src/lib/pipes/subrtring-w.pipe.ts +16 -0
  63. package/src/lib/pipes/substring.pipe.spec.ts +8 -0
  64. package/src/lib/pipes/substring.pipe.ts +15 -0
  65. package/src/lib/shared/choose-another-date/choose-another-date.component.html +9 -0
  66. package/src/lib/shared/choose-another-date/choose-another-date.component.scss +4 -0
  67. package/src/lib/shared/choose-another-date/choose-another-date.component.spec.ts +25 -0
  68. package/src/lib/shared/choose-another-date/choose-another-date.component.ts +126 -0
  69. package/src/lib/shared/confirm-dialog/confirm-dialog.component.html +27 -0
  70. package/src/lib/shared/confirm-dialog/confirm-dialog.component.scss +0 -0
  71. package/src/lib/shared/confirm-dialog/confirm-dialog.component.spec.ts +25 -0
  72. package/src/lib/shared/confirm-dialog/confirm-dialog.component.ts +35 -0
  73. package/src/lib/shared/confirm-dialog-contact/confirm-dialog-contact.component.css +0 -0
  74. package/src/lib/shared/confirm-dialog-contact/confirm-dialog-contact.component.html +19 -0
  75. package/src/lib/shared/confirm-dialog-contact/confirm-dialog-contact.component.spec.ts +23 -0
  76. package/src/lib/shared/confirm-dialog-contact/confirm-dialog-contact.component.ts +36 -0
  77. package/src/lib/shared/confirmed-date-information/confirmed-date-information.component.html +25 -0
  78. package/src/lib/shared/confirmed-date-information/confirmed-date-information.component.scss +23 -0
  79. package/src/lib/shared/confirmed-date-information/confirmed-date-information.component.spec.ts +25 -0
  80. package/src/lib/shared/confirmed-date-information/confirmed-date-information.component.ts +28 -0
  81. package/src/lib/shared/contact/contact.component.css +144 -0
  82. package/src/lib/shared/contact/contact.component.html +136 -0
  83. package/src/lib/shared/contact/contact.component.spec.ts +23 -0
  84. package/src/lib/shared/contact/contact.component.ts +176 -0
  85. package/src/lib/shared/contact-support/contact-support.component.html +130 -0
  86. package/src/lib/shared/contact-support/contact-support.component.scss +10 -0
  87. package/src/lib/shared/contact-support/contact-support.component.spec.ts +25 -0
  88. package/src/lib/shared/contact-support/contact-support.component.ts +182 -0
  89. package/src/lib/shared/dashboard/dashboard.component.html +81 -0
  90. package/src/lib/shared/dashboard/dashboard.component.scss +5 -0
  91. package/src/lib/shared/dashboard/dashboard.component.spec.ts +23 -0
  92. package/src/lib/shared/dashboard/dashboard.component.ts +21 -0
  93. package/src/lib/shared/maintenance-list/maintenance-list.component.html +105 -0
  94. package/src/lib/shared/maintenance-list/maintenance-list.component.scss +26 -0
  95. package/src/lib/shared/maintenance-list/maintenance-list.component.spec.ts +25 -0
  96. package/src/lib/shared/maintenance-list/maintenance-list.component.ts +398 -0
  97. package/src/lib/shared/shared-routing.module.ts +10 -0
  98. package/src/lib/shared/shared.module.ts +84 -0
  99. package/src/lib/shared/show-links/show-links.component.html +49 -0
  100. package/src/lib/shared/show-links/show-links.component.scss +0 -0
  101. package/src/lib/shared/show-links/show-links.component.spec.ts +25 -0
  102. package/src/lib/shared/show-links/show-links.component.ts +80 -0
  103. package/src/lib/shared/system-list/system-list.component.css +0 -0
  104. package/src/lib/shared/system-list/system-list.component.html +40 -0
  105. package/src/lib/shared/system-list/system-list.component.spec.ts +23 -0
  106. package/src/lib/shared/system-list/system-list.component.ts +26 -0
  107. package/{public-api.d.ts → src/public-api.ts} +16 -1
  108. package/src/test.ts +27 -0
  109. package/tsconfig.lib.dev.json +10 -0
  110. package/tsconfig.lib.json +15 -0
  111. package/tsconfig.lib.pp.json +10 -0
  112. package/tsconfig.lib.prod.json +10 -0
  113. package/tsconfig.spec.json +17 -0
  114. package/esm2020/awf-test-lib.mjs +0 -5
  115. package/esm2020/lib/core/core-routing.module.mjs +0 -18
  116. package/esm2020/lib/core/core.module.mjs +0 -51
  117. package/esm2020/lib/core/menu/menu.component.mjs +0 -40
  118. package/esm2020/lib/core/menu-consomer/menu-consomer.component.mjs +0 -27
  119. package/esm2020/lib/core/menu-ge-portal/menu-ge-portal.component.mjs +0 -31
  120. package/esm2020/lib/core/menu-warranty/menu-warranty.component.mjs +0 -35
  121. package/esm2020/lib/core/not-found/not-found.component.mjs +0 -19
  122. package/esm2020/lib/core/top-bar/top-bar.component.mjs +0 -41
  123. package/esm2020/lib/models/account.model.mjs +0 -3
  124. package/esm2020/lib/models/alternativeDate.model.mjs +0 -3
  125. package/esm2020/lib/models/applicationName.mjs +0 -7
  126. package/esm2020/lib/models/cancelPMMailRequest.model.mjs +0 -4
  127. package/esm2020/lib/models/customObject.model.mjs +0 -3
  128. package/esm2020/lib/models/detailedPmJob.model.mjs +0 -3
  129. package/esm2020/lib/models/emailStatus.mjs +0 -6
  130. package/esm2020/lib/models/emailType.mjs +0 -15
  131. package/esm2020/lib/models/eventStatus.mjs +0 -9
  132. package/esm2020/lib/models/field.mjs +0 -9
  133. package/esm2020/lib/models/language.mjs +0 -6
  134. package/esm2020/lib/models/mailRequest.model.mjs +0 -3
  135. package/esm2020/lib/models/pMGroupedJob.model.mjs +0 -3
  136. package/esm2020/lib/models/pmJob.model.mjs +0 -3
  137. package/esm2020/lib/models/pmJobRequest.model.mjs +0 -3
  138. package/esm2020/lib/models/pmJobStatus.mjs +0 -17
  139. package/esm2020/lib/models/reason.model.mjs +0 -3
  140. package/esm2020/lib/models/reasonCode.mjs +0 -9
  141. package/esm2020/lib/models/reasonContact.mjs +0 -8
  142. package/esm2020/lib/models/reportDateMailRequest.model.mjs +0 -4
  143. package/esm2020/lib/models/role.mjs +0 -7
  144. package/esm2020/lib/models/service.model.mjs +0 -3
  145. package/esm2020/lib/models/serviceName.mjs +0 -12
  146. package/esm2020/lib/models/socialLoginRequest.model.mjs +0 -3
  147. package/esm2020/lib/models/socialMadia.mjs +0 -5
  148. package/esm2020/lib/models/stingBoolean.mjs +0 -6
  149. package/esm2020/lib/models/system.mjs +0 -3
  150. package/esm2020/lib/models/theme.model.mjs +0 -2
  151. package/esm2020/lib/models/tokenStatus.mjs +0 -7
  152. package/esm2020/lib/models/warranty.mjs +0 -3
  153. package/esm2020/lib/pipes/pipes/pipes.module.mjs +0 -21
  154. package/esm2020/lib/pipes/subrtring-w.pipe.mjs +0 -20
  155. package/esm2020/lib/pipes/substring.pipe.mjs +0 -16
  156. package/esm2020/lib/shared/choose-another-date/choose-another-date.component.mjs +0 -110
  157. package/esm2020/lib/shared/confirm-dialog/confirm-dialog.component.mjs +0 -44
  158. package/esm2020/lib/shared/confirm-dialog-contact/confirm-dialog-contact.component.mjs +0 -42
  159. package/esm2020/lib/shared/confirmed-date-information/confirmed-date-information.component.mjs +0 -38
  160. package/esm2020/lib/shared/contact/contact.component.mjs +0 -167
  161. package/esm2020/lib/shared/contact-support/contact-support.component.mjs +0 -164
  162. package/esm2020/lib/shared/dashboard/dashboard.component.mjs +0 -34
  163. package/esm2020/lib/shared/maintenance-list/maintenance-list.component.mjs +0 -347
  164. package/esm2020/lib/shared/shared-routing.module.mjs +0 -18
  165. package/esm2020/lib/shared/shared.module.mjs +0 -144
  166. package/esm2020/lib/shared/show-links/show-links.component.mjs +0 -81
  167. package/esm2020/lib/shared/system-list/system-list.component.mjs +0 -32
  168. package/esm2020/public-api.mjs +0 -48
  169. package/fesm2015/awf-test-lib.mjs +0 -1569
  170. package/fesm2015/awf-test-lib.mjs.map +0 -1
  171. package/fesm2020/awf-test-lib.mjs +0 -1565
  172. package/fesm2020/awf-test-lib.mjs.map +0 -1
  173. package/index.d.ts +0 -5
  174. package/lib/core/core-routing.module.d.ts +0 -7
  175. package/lib/core/core.module.d.ts +0 -15
  176. package/lib/core/menu/menu.component.d.ts +0 -17
  177. package/lib/core/menu-consomer/menu-consomer.component.d.ts +0 -12
  178. package/lib/core/menu-ge-portal/menu-ge-portal.component.d.ts +0 -13
  179. package/lib/core/menu-warranty/menu-warranty.component.d.ts +0 -15
  180. package/lib/core/not-found/not-found.component.d.ts +0 -10
  181. package/lib/core/top-bar/top-bar.component.d.ts +0 -13
  182. package/lib/models/alternativeDate.model.d.ts +0 -6
  183. package/lib/models/applicationName.d.ts +0 -5
  184. package/lib/models/customObject.model.d.ts +0 -3
  185. package/lib/models/detailedPmJob.model.d.ts +0 -23
  186. package/lib/models/emailStatus.d.ts +0 -4
  187. package/lib/models/emailType.d.ts +0 -13
  188. package/lib/models/eventStatus.d.ts +0 -7
  189. package/lib/models/field.d.ts +0 -7
  190. package/lib/models/language.d.ts +0 -4
  191. package/lib/models/pMGroupedJob.model.d.ts +0 -3
  192. package/lib/models/pmJobRequest.model.d.ts +0 -5
  193. package/lib/models/reason.model.d.ts +0 -4
  194. package/lib/models/reasonCode.d.ts +0 -7
  195. package/lib/models/reasonContact.d.ts +0 -6
  196. package/lib/models/role.d.ts +0 -5
  197. package/lib/models/service.model.d.ts +0 -8
  198. package/lib/models/serviceName.d.ts +0 -10
  199. package/lib/models/socialMadia.d.ts +0 -3
  200. package/lib/models/stingBoolean.d.ts +0 -4
  201. package/lib/models/system.d.ts +0 -14
  202. package/lib/models/tokenStatus.d.ts +0 -5
  203. package/lib/models/warranty.d.ts +0 -17
  204. package/lib/pipes/pipes/pipes.module.d.ts +0 -9
  205. package/lib/pipes/subrtring-w.pipe.d.ts +0 -7
  206. package/lib/pipes/substring.pipe.d.ts +0 -7
  207. package/lib/shared/choose-another-date/choose-another-date.component.d.ts +0 -33
  208. package/lib/shared/confirm-dialog/confirm-dialog.component.d.ts +0 -20
  209. package/lib/shared/confirm-dialog-contact/confirm-dialog-contact.component.d.ts +0 -19
  210. package/lib/shared/confirmed-date-information/confirmed-date-information.component.d.ts +0 -16
  211. package/lib/shared/contact/contact.component.d.ts +0 -39
  212. package/lib/shared/contact-support/contact-support.component.d.ts +0 -49
  213. package/lib/shared/dashboard/dashboard.component.d.ts +0 -17
  214. package/lib/shared/maintenance-list/maintenance-list.component.d.ts +0 -79
  215. package/lib/shared/shared-routing.module.d.ts +0 -7
  216. package/lib/shared/shared.module.d.ts +0 -40
  217. package/lib/shared/show-links/show-links.component.d.ts +0 -23
  218. package/lib/shared/system-list/system-list.component.d.ts +0 -15
@@ -0,0 +1,398 @@
1
+ import {
2
+ Component,
3
+ EventEmitter,
4
+ Input,
5
+ OnDestroy,
6
+ Output,
7
+ ViewChild
8
+ } from '@angular/core';
9
+ import { Table } from 'primeng/table';
10
+ import { ConfirmationService, MessageService } from 'primeng/api';
11
+ import { Subscription } from 'rxjs';
12
+ import { DetailedPmJob } from '../../models/detailedPmJob.model';
13
+ import { AlternativeDate } from '../../models/alternativeDate.model';
14
+ import { EmailType } from '../../models/emailType';
15
+ import { EventStatus } from '../../models/eventStatus';
16
+ import { PmJob } from '../../models/pmJob.model';
17
+ import { PMGroupedJob } from '../../models/pMGroupedJob.model';
18
+ import { PmJobStatus } from '../../models/pmJobStatus';
19
+ import { ReasonContact } from '../../models/reasonContact';
20
+ import { StingBoolean } from '../../models/stingBoolean';
21
+
22
+
23
+ @Component({
24
+ selector: 'awf-maintenance-list',
25
+ templateUrl: './maintenance-list.component.html',
26
+ styleUrls: ['./maintenance-list.component.scss'],
27
+ providers: [MessageService, ConfirmationService],
28
+ })
29
+ export class MaintenanceListComponent implements OnDestroy {
30
+ @ViewChild('dt') dt: Table | undefined;
31
+ @ViewChild('op') op: any | undefined;
32
+ @Input() translate: any;
33
+ @Input() reasons: any;
34
+ @Input() globaltranslate: any;
35
+ @Input() maintenanceList: DetailedPmJob[] = [];
36
+ @Input() maintenanceListNotDisplayed: DetailedPmJob[] = [];
37
+ @Input() pmJobList: DetailedPmJob[] = [];
38
+ @Input() isAlreadyScheduled!: Boolean;
39
+ @Input() displayConfirmedDateInfo=false;
40
+ @Input() alternativeDatesList!: any ;
41
+ @Output() emitForUpdate = new EventEmitter<any>();
42
+ @Output() emitForAlternativeDates = new EventEmitter<any>();
43
+ @Output() sendContactMeEmail = new EventEmitter<any>();
44
+ @Input() status: any;
45
+
46
+ @Output() sendForm: EventEmitter<any> = new EventEmitter();
47
+ moreDates!:boolean;
48
+ detailedPmJobLinkedList : DetailedPmJob[] = [];
49
+ updatePmSubscription!: Subscription;
50
+ alternativeDatesSubscription!: Subscription;
51
+ showDate!: boolean;
52
+ maintenanceSelected!: DetailedPmJob;
53
+ startDateTime!: any;
54
+ endDateTime!: any;
55
+ selectedWorkorderId!: any;
56
+ alternativeDate!: AlternativeDate ;
57
+ alternativeDatesSelected: AlternativeDate[] = [];
58
+ displaycontactSupport = false;
59
+ displayConfirmDialog = false;
60
+ displayConfirmDialogContact = false;
61
+ displayShowLinks = false;
62
+ displayAnotherDate = false;
63
+ isWithLinks = false;
64
+ isProposedDate = true;
65
+ pmSelectedStatus!:string ;
66
+ emailTypes!:string[];
67
+ alreadyScheduledMsg !:boolean;
68
+ reasonContact="";
69
+ contactMeRequest!:DetailedPmJob ;
70
+ first = 0;
71
+ constructor() {}
72
+
73
+ ngOnDestroy(): void {
74
+ if (this.updatePmSubscription) {
75
+ this.updatePmSubscription.unsubscribe();
76
+ }
77
+ if (this.alternativeDatesSubscription) {
78
+ this.alternativeDatesSubscription.unsubscribe();
79
+ }
80
+
81
+ }
82
+ applyFilterGlobal($event: any, stringVal: any) {
83
+ this.dt?.filterGlobal(
84
+ ($event.target as HTMLInputElement).value,
85
+ stringVal
86
+ );
87
+ }
88
+ selectElement(element: DetailedPmJob) {
89
+ this.alternativeDatesList = null;
90
+ this.emailTypes =[];
91
+ if(element)
92
+ {
93
+ this.pmSelectedStatus = element.status ;
94
+ }
95
+
96
+ if(element.pmJob.groupList)
97
+ {
98
+ this.isWithLinks = element.pmJob.groupList?.length > 0 ? true : false;
99
+ }
100
+
101
+ this.selectedWorkorderId = element.pmJob.workorderNumber;
102
+ this.maintenanceSelected = element;
103
+ this.maintenanceSelected.WorkorderNumberSelected = this.maintenanceSelected.pmJob.workorderId ;
104
+
105
+ if (!this.isAlreadyScheduled) {
106
+ this.getAlternativeDates(element.pmJob);
107
+ }
108
+ this.startDateTime = this.maintenanceSelected.pmJob.startDateTime;
109
+ this.endDateTime = this.maintenanceSelected.pmJob.endDateTime;
110
+ this.getLinkedPmJob();
111
+ }
112
+ getAlternativeDates(pmJob : PmJob ) {
113
+ this.emitForAlternativeDates.emit(pmJob);
114
+ }
115
+ getLinkedPmJob()
116
+ {
117
+ this.detailedPmJobLinkedList =[];
118
+ if(this.maintenanceSelected.pmJob.groupList)
119
+ {
120
+ this.maintenanceSelected.pmJob.groupList.forEach((linked : PMGroupedJob ) => {
121
+
122
+ this.maintenanceList.forEach((item :DetailedPmJob ) => {
123
+ if(linked.workorderId === item.pmJob.workorderId)
124
+ {
125
+ this.detailedPmJobLinkedList.push(item);
126
+ }
127
+ });
128
+ });
129
+
130
+ }
131
+ // if the linked PM in the other maintenance list not selected
132
+ if(this.maintenanceSelected.pmJob.groupList && (this.maintenanceSelected.pmJob.groupList.length !== this.detailedPmJobLinkedList.length))
133
+ {
134
+ this.maintenanceSelected.pmJob.groupList.forEach((linked : PMGroupedJob ) => {
135
+
136
+ this.maintenanceListNotDisplayed.forEach((item :DetailedPmJob ) => {
137
+ item.toUpdate = false ;
138
+ if(linked.workorderId === item.pmJob.workorderId)
139
+ {
140
+ this.detailedPmJobLinkedList.push(item);
141
+ }
142
+ });
143
+ });
144
+
145
+ }
146
+
147
+ }
148
+ confirmDialog() {
149
+ this.isProposedDate = true ;
150
+ this.op.hide();
151
+ this.displayConfirmDialog = true;
152
+ }
153
+ closeConfirmDialog(confirm: any) {
154
+ this.displayConfirmDialog = false;
155
+ this.maintenanceSelected.futureStatus = PmJobStatus.ACCEPTED ;
156
+ if (confirm) {
157
+ if(!this.isProposedDate)
158
+ {
159
+
160
+ this.updateAlternativeDate();
161
+ }
162
+ else
163
+ {
164
+ this.updateProposedDate();
165
+ }
166
+ this.emailTypes.push(EmailType.Accepted_CSC) ;
167
+ this.emailTypes.push(EmailType.Accepted_Clients) ;
168
+ this.updatePmJob();
169
+ }
170
+ }
171
+ closeConfirmDialogContact(confirm: any) {
172
+ this.displayConfirmDialogContact = false;
173
+
174
+ if (confirm) {
175
+
176
+ this.emailTypes = [] as string[];
177
+ if(this.reasonContact === ReasonContact.ContactFormPm )
178
+ {
179
+
180
+ this.emailTypes.push(EmailType.ContactMe_Clients);
181
+ this.emailTypes.push(EmailType.ContactMe_CSC);
182
+
183
+ }
184
+ else if(this.reasonContact === ReasonContact.CancelFormPm )
185
+ {
186
+ this.maintenanceSelected.pmJob.customObject= {};
187
+ this.maintenanceSelected.pmJob.customObject.customerWaiting =StingBoolean.YES ;
188
+ this.maintenanceSelected.futureStatus = PmJobStatus.WAITING ;
189
+ this.emailTypes.push(EmailType.CancelPM_CSC);
190
+ this.emailTypes.push(EmailType.CancelPM_Clients);
191
+
192
+ }
193
+ else
194
+ {
195
+ this.maintenanceSelected.pmJob.customObject= {};
196
+ this.maintenanceSelected.pmJob.customObject.customerWaiting =StingBoolean.YES;
197
+ this.maintenanceSelected.futureStatus = PmJobStatus.WAITING ;
198
+ this.emailTypes.push(EmailType.SendNewDates_CSC);
199
+ this.emailTypes.push(EmailType.SendNewDates_Clients);
200
+ }
201
+
202
+ this.updateLinkedPMFormContact();
203
+
204
+ this.closeContactSupport(true) ;
205
+
206
+ }
207
+
208
+ }
209
+ updateLinkedPMFormContact()
210
+ {
211
+ this.pmJobList =[];
212
+ this.pmJobList.push(this.maintenanceSelected);
213
+ if(this.detailedPmJobLinkedList.length >0)
214
+ {
215
+ this.detailedPmJobLinkedList.forEach((item:DetailedPmJob) => {
216
+ item.futureStatus = item.status ;
217
+ item.selectedDate = item.pmJob.startDateTime;
218
+ item.WorkorderNumberSelected = this.maintenanceSelected.pmJob.workorderId ;
219
+ if(this.reasonContact === ReasonContact.MoreDatesFormPm ||this.reasonContact === ReasonContact.CancelFormPm )
220
+ {
221
+ item.reason = this.maintenanceSelected.reason;
222
+ item.reasonContact = this.maintenanceSelected.reasonContact;
223
+ item.pmJob.customObject= {};
224
+ item.pmJob.customObject.customerWaiting =StingBoolean.YES ;
225
+ item.futureStatus = PmJobStatus.WAITING ;
226
+
227
+ }
228
+
229
+ this.pmJobList.push(item);
230
+ });
231
+
232
+ }
233
+
234
+ this.callApiToUpdate();
235
+ }
236
+ closeContactSupport(event :any)
237
+ {
238
+ this.displaycontactSupport = false;
239
+ this.showDate = false;
240
+ this.reasonContact ="";
241
+
242
+ }
243
+ proposeAnotherDate() {
244
+ this.isProposedDate = false ;
245
+ this.op.hide();
246
+ this.displayAnotherDate = true;
247
+ }
248
+ contactSupport(fromOtherDate : boolean) {
249
+
250
+
251
+ this.op.hide();
252
+
253
+ this.reasonContact = fromOtherDate ? ReasonContact.MoreDatesFormPm : ReasonContact.ContactFormPm ;
254
+ this.displaycontactSupport = true;
255
+ }
256
+ showLinks(element?:any)
257
+ {
258
+ if(element)
259
+ {
260
+ this.selectElement(element);
261
+ }
262
+
263
+ this.op.hide();
264
+ this.displayShowLinks = true ;
265
+ }
266
+ closeShowLinks(){
267
+ this.displayShowLinks = false ;
268
+ }
269
+ closeConfirmedDateInfo() {
270
+ this.displayConfirmedDateInfo = false;
271
+ }
272
+ acceptDate(alternativeDates: AlternativeDate[]) {
273
+
274
+ this.displayConfirmDialog = true;
275
+ this.alternativeDatesSelected = alternativeDates;
276
+ this.findDatesSelected();
277
+ }
278
+ findDatesSelected(){
279
+ this.alternativeDatesSelected.forEach((alternativeDate: AlternativeDate) => {
280
+ if(alternativeDate.selected==="Yes")
281
+ {
282
+ this.startDateTime = alternativeDate.startDateTime;
283
+ this.endDateTime = alternativeDate.endDateTime;
284
+ this.maintenanceSelected.selectedDate = alternativeDate.startDateTime;
285
+ return;
286
+ }
287
+ });
288
+ }
289
+ closeAnotherDate(event: any) {
290
+ this.displayAnotherDate = false;
291
+ if(event===false)
292
+ {
293
+ this.alreadyScheduledMsg = false ;
294
+ this.op.hide();
295
+ this.contactSupport(true);
296
+ }
297
+ }
298
+ updatePmJob() {
299
+ this.pmJobList =[];
300
+ this.pmJobList.push(this.maintenanceSelected);
301
+ if(this.detailedPmJobLinkedList.length >0)
302
+ {
303
+ this.detailedPmJobLinkedList.forEach((pMJob:DetailedPmJob) => {
304
+
305
+ this.pmJobList.push(pMJob);
306
+ });
307
+
308
+ }
309
+ this.callApiToUpdate();
310
+
311
+ }
312
+ editPm(){
313
+ this.alreadyScheduledMsg = true ;
314
+ this.op.hide();
315
+ this.reasonContact = ReasonContact.CancelFormPm ;
316
+ this.prepareForPopup() ;
317
+ this.displaycontactSupport = true;
318
+ }
319
+ prepareForPopup(){
320
+ if(this.maintenanceSelected.pmJob.customerAccepted ==="Yes")
321
+ {
322
+ this.startDateTime = this.maintenanceSelected.pmJob.startDateTime;
323
+ this.endDateTime = this.maintenanceSelected.pmJob.endDateTime;
324
+ }
325
+ else
326
+ {
327
+ this.alternativeDatesSelected = this.maintenanceSelected.pmJob.alternativeDates;
328
+ this.findDatesSelected();
329
+ }
330
+
331
+ }
332
+ updateProposedDate(){
333
+ this.maintenanceSelected.pmJob.customerAccepted = StingBoolean.YES;
334
+ this.maintenanceSelected.pmJob.eventStatus = EventStatus.ASSIGNEDANC;
335
+ this.detailedPmJobLinkedList.forEach((item :DetailedPmJob ) => {
336
+ item.pmJob.customerAccepted = StingBoolean.YES;
337
+ item.pmJob.eventStatus = EventStatus.ASSIGNEDANC;
338
+ item.futureStatus = PmJobStatus.ACCEPTED ;
339
+ item.WorkorderNumberSelected = this.maintenanceSelected.pmJob.workorderId ;
340
+ });
341
+ }
342
+ updateAlternativeDate(){
343
+ this.findDatesSelected();
344
+ this.maintenanceSelected.pmJob.alternativeDates = this.alternativeDatesSelected ;
345
+ this.detailedPmJobLinkedList.forEach((item :DetailedPmJob ) => {
346
+ item.pmJob.alternativeDates = this.alternativeDatesSelected ;
347
+ item.pmJob.eventStatus = EventStatus.ASSIGNEDANC;
348
+ item.futureStatus = PmJobStatus.ACCEPTED ;
349
+ item.WorkorderNumberSelected = this.maintenanceSelected.pmJob.workorderId ;
350
+ });
351
+ this.displayAnotherDate = false;
352
+ }
353
+ sendContactMeForm(contactMeRequest:any){
354
+ this.moreDates = false;
355
+ if( contactMeRequest.reasonContact === ReasonContact.MoreDatesFormPm )
356
+ {
357
+ this.moreDates = true;
358
+ }
359
+ this.displayConfirmDialogContact = true;
360
+ this.maintenanceSelected = contactMeRequest ;
361
+ }
362
+
363
+ callApiToUpdate(){
364
+ let PmJobListForUpdate = {} as any;
365
+ PmJobListForUpdate.pmJobList = this.pmJobList;
366
+ PmJobListForUpdate.emailTypes = this.emailTypes;
367
+ this.emitForUpdate.emit(PmJobListForUpdate);
368
+ }
369
+
370
+ transformStatus(status: string): string {
371
+ switch (status) {
372
+ case PmJobStatus.NEW : return this.status.new;
373
+ case PmJobStatus.ACCEPTED : return this.status.accepted;
374
+ case PmJobStatus.CLOSED : return this.status.closed;
375
+ case PmJobStatus.Late : return this.status.late;
376
+ case PmJobStatus.OPEN : return this.status.open;
377
+ case PmJobStatus.WAITING : return this.status.waiting;
378
+ case PmJobStatus.DONE : return this.status.done;
379
+ case PmJobStatus.VALIDATED : return this.status.validated;
380
+ default : return "Erreur";
381
+ }
382
+ }
383
+
384
+ getStatusTooltip(status: string): string {
385
+ switch (status) {
386
+ case PmJobStatus.ACCEPTED : return this.status.acceptedTooltip;
387
+ case PmJobStatus.NEW : return this.status.newTooltip;
388
+ case PmJobStatus.CLOSED : return this.status.closedTooltip;
389
+ case PmJobStatus.Late : return this.status.lateTooltip;
390
+ case PmJobStatus.OPEN : return this.status.openTooltip;
391
+ case PmJobStatus.WAITING : return this.status.waitingTooltip;
392
+ case PmJobStatus.DONE : return this.status.doneTooltip;
393
+ case PmJobStatus.VALIDATED : return this.status.validatedTooltip;
394
+ default : return "Erreur";
395
+ }
396
+ }
397
+
398
+ }
@@ -0,0 +1,10 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { RouterModule, Routes } from '@angular/router';
3
+
4
+ const routes: Routes = [];
5
+
6
+ @NgModule({
7
+ imports: [RouterModule.forChild(routes)],
8
+ exports: [RouterModule]
9
+ })
10
+ export class SharedRoutingModule { }
@@ -0,0 +1,84 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { SystemListComponent } from './system-list/system-list.component';
4
+ import {TableModule} from 'primeng/table';
5
+ import {InputTextModule} from 'primeng/inputtext';
6
+ import { PipesModule } from '../pipes/pipes/pipes.module';
7
+ import { ContactComponent } from './contact/contact.component';
8
+ import { FormsModule, ReactiveFormsModule } from '@angular/forms';
9
+ import {ToastModule} from 'primeng/toast';
10
+ import {InputTextareaModule} from 'primeng/inputtextarea';
11
+ import {MultiSelectModule} from 'primeng/multiselect';
12
+ import { ChooseAnotherDateComponent } from './choose-another-date/choose-another-date.component';
13
+ import { ConfirmDialogComponent } from './confirm-dialog/confirm-dialog.component';
14
+ import { ConfirmedDateInformationComponent } from './confirmed-date-information/confirmed-date-information.component';
15
+ import { ContactSupportComponent } from './contact-support/contact-support.component';
16
+ import { MaintenanceListComponent } from './maintenance-list/maintenance-list.component';
17
+ import { ShowLinksComponent } from './show-links/show-links.component';
18
+ import {CalendarModule} from 'primeng/calendar';
19
+ import {SliderModule} from 'primeng/slider';
20
+ import {ContextMenuModule} from 'primeng/contextmenu';
21
+ import {DialogModule} from 'primeng/dialog';
22
+ import {ButtonModule} from 'primeng/button';
23
+ import {DropdownModule} from 'primeng/dropdown';
24
+ import { ToolbarModule } from 'primeng/toolbar';
25
+ import {OverlayPanelModule} from 'primeng/overlaypanel';
26
+ import {TooltipModule} from 'primeng/tooltip';
27
+ import {ProgressSpinnerModule} from 'primeng/progressspinner';
28
+ import { ConfirmDialogModule } from 'primeng/confirmdialog';
29
+ import { ConfirmPopupModule } from 'primeng/confirmpopup';
30
+ import {SelectButtonModule} from 'primeng/selectbutton';
31
+ import {RadioButtonModule} from 'primeng/radiobutton';
32
+ import {CheckboxModule} from 'primeng/checkbox';
33
+ import { SharedRoutingModule } from './shared-routing.module';
34
+ import { DashboardComponent } from './dashboard/dashboard.component';
35
+ import { ConfirmDialogContactComponent } from './confirm-dialog-contact/confirm-dialog-contact.component';
36
+
37
+
38
+
39
+
40
+
41
+
42
+ @NgModule({
43
+ declarations: [
44
+ SystemListComponent,
45
+ ContactComponent,
46
+ ChooseAnotherDateComponent,
47
+ ConfirmDialogComponent,
48
+ ConfirmedDateInformationComponent,
49
+ ContactSupportComponent,
50
+ MaintenanceListComponent,
51
+ ShowLinksComponent,
52
+ DashboardComponent,
53
+ ConfirmDialogContactComponent
54
+ ],
55
+ imports: [
56
+ CommonModule,
57
+ SharedRoutingModule,
58
+ TableModule,
59
+ InputTextModule,
60
+ PipesModule,
61
+ ToastModule,
62
+ InputTextareaModule,
63
+ MultiSelectModule,
64
+ FormsModule,
65
+ ReactiveFormsModule,
66
+ ProgressSpinnerModule,
67
+ RadioButtonModule,
68
+ CheckboxModule,
69
+ SelectButtonModule,
70
+ TooltipModule,
71
+ OverlayPanelModule,
72
+ CalendarModule,
73
+ SliderModule,
74
+ DialogModule,
75
+ ConfirmPopupModule,
76
+ ConfirmDialogModule,
77
+ ContextMenuModule,
78
+ DropdownModule,
79
+ ButtonModule,
80
+ ToolbarModule,
81
+ ],
82
+ exports:[SystemListComponent,ContactComponent,MaintenanceListComponent,DashboardComponent]
83
+ })
84
+ export class SharedModule { }
@@ -0,0 +1,49 @@
1
+ <p-dialog [header]="translate.titleShowLinks+ selectedWorkorderId " [(visible)]="displayShowLinks" [modal]="true" [style]="{width: '50vw'}" (onHide)="close()" [maximizable]="true" [baseZIndex]="10000" [draggable]="false" [resizable]="false">
2
+ <p-table #dt [value]="detailedPmJobLinkedList" responsiveLayout="stack" [rows]="5" [showCurrentPageReport]="false" [rowsPerPageOptions]="[5,10,25,50]" [paginator]="true" [globalFilterFields]="['systemId','pmJob.caseId','systemName','pmJob.workorderNumber','pmJob.startDateTime','pmJob.endDateTime','pmJob.case_type','pmJob.case_category','status']"
3
+ [rowHover]="true" dataKey="id" [currentPageReportTemplate]="globaltranslate.countPages">
4
+ <ng-template pTemplate="caption">
5
+ <div>
6
+ <span class="p-input-icon-left">
7
+ <i class="pi pi-search"></i>
8
+ <input pInputText type="text" (input)="applyFilterGlobal($event, 'contains')"
9
+ [placeholder]="globaltranslate.search" />
10
+ </span>
11
+ </div>
12
+ </ng-template>
13
+ <ng-template pTemplate="header" let-columns>
14
+ <tr>
15
+ <th pSortableColumn="systemName">{{translate.maintenanceList.system}}
16
+ <p-sortIcon field="systemId"></p-sortIcon>
17
+ <th pSortableColumn="systemId">System Id
18
+ <p-sortIcon field="systemName"></p-sortIcon>
19
+ <th pSortableColumn="workorderNumber">{{translate.maintenanceList.workOrder}}
20
+ <p-sortIcon field="workorderNumber"></p-sortIcon>
21
+ <th pSortableColumn="startDateTime">{{translate.maintenanceList.startDate}}
22
+ <p-sortIcon field="startDateTime"></p-sortIcon>
23
+ <th pSortableColumn="case_type">{{translate.maintenanceList.type}}
24
+ <p-sortIcon field="case_type"></p-sortIcon>
25
+ <th pSortableColumn="status">{{translate.maintenanceList.status}}
26
+ <p-sortIcon field="status"></p-sortIcon>
27
+
28
+ </tr>
29
+ </ng-template>
30
+ <ng-template pTemplate="body" let-product let-columns="columns">
31
+ <tr>
32
+ <td>{{product.systemName }}</td>
33
+ <td>{{product.systemId }}</td>
34
+ <td>{{product.pmJob.workorderNumber }}</td>
35
+ <td>{{product.pmJob.startDateTime | date: 'dd MMM yyyy' }}</td>
36
+ <td *ngIf="product.pmJob.caseType == 'Planned Maintenance'">{{translate.maintenanceList.typePlanned}}</td>
37
+ <td *ngIf="product.pmJob.caseType == 'QARA'">{{translate.maintenanceList.typeQARA}}</td>
38
+ <td><span [class]="'product-status status-' + product.status" [pTooltip]="getStatusTooltip(product.status)">{{transformStatus(product.status) }}</span>
39
+ </td>
40
+ </tr>
41
+ </ng-template>
42
+ <ng-template pTemplate="summary">
43
+ <div class="p-d-flex p-ai-center p-jc-between">
44
+ {{globaltranslate.count}} {{detailedPmJobLinkedList ? detailedPmJobLinkedList.length : 0 }} {{globaltranslate.elements}}.
45
+ </div>
46
+ </ng-template>
47
+ </p-table>
48
+
49
+ </p-dialog>
@@ -0,0 +1,25 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { ShowLinksComponent } from './show-links.component';
4
+
5
+ describe('ShowLinksComponent', () => {
6
+ let component: ShowLinksComponent;
7
+ let fixture: ComponentFixture<ShowLinksComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ declarations: [ ShowLinksComponent ]
12
+ })
13
+ .compileComponents();
14
+ });
15
+
16
+ beforeEach(() => {
17
+ fixture = TestBed.createComponent(ShowLinksComponent);
18
+ component = fixture.componentInstance;
19
+ fixture.detectChanges();
20
+ });
21
+
22
+ it('should create', () => {
23
+ expect(component).toBeTruthy();
24
+ });
25
+ });
@@ -0,0 +1,80 @@
1
+ import { Component, EventEmitter, Input, Output, ViewChild } from '@angular/core';
2
+ import { Table } from 'primeng/table';
3
+ import { DetailedPmJob } from '../../models/detailedPmJob.model';
4
+ import { PmJobStatus } from '../../models/pmJobStatus';
5
+
6
+ @Component({
7
+ selector: 'app-show-links',
8
+ templateUrl: './show-links.component.html',
9
+ styleUrls: ['./show-links.component.scss']
10
+ })
11
+ export class ShowLinksComponent {
12
+ @ViewChild('dt') dt: Table | undefined;
13
+ @Input() displayShowLinks!: boolean;
14
+ @Output() closeShowLinks = new EventEmitter<boolean>();
15
+ @Input() detailedPmJobLinkedList: DetailedPmJob[] = [];
16
+ @Input() selectedWorkorderId!: any;
17
+ @Input() globaltranslate: any;
18
+ @Input() translate: any;
19
+ @Input() status: any;
20
+ header ="header";
21
+ constructor() {
22
+ this.header = "PM : " + this.selectedWorkorderId ;
23
+ }
24
+
25
+
26
+ close()
27
+ {
28
+ this.closeShowLinks.emit(false);
29
+
30
+ }
31
+ applyFilterGlobal($event: any, stringVal: any) {
32
+ this.dt?.filterGlobal(
33
+ ($event.target as HTMLInputElement).value,
34
+ stringVal
35
+ );
36
+ }
37
+
38
+
39
+ transformStatus(status: string): string {
40
+ switch (status) {
41
+
42
+ case PmJobStatus.NEW : return this.status.new;
43
+ case PmJobStatus.ACCEPTED : return this.status.accepted;
44
+ case PmJobStatus.CLOSED : return this.status.closed;
45
+ case PmJobStatus.Late : return this.status.late;
46
+ case PmJobStatus.OPEN : return this.status.open;
47
+ case PmJobStatus.WAITING : return this.status.waiting;
48
+ case PmJobStatus.DONE : return this.status.done;
49
+ case PmJobStatus.VALIDATED : return this.status.validated;
50
+ default : return "Erreur";
51
+ }
52
+ }
53
+
54
+ getStatusTooltip(status: string): string {
55
+ switch (status) {
56
+ case PmJobStatus.ACCEPTED : return this.status.acceptedTooltip;
57
+ case PmJobStatus.NEW : return this.status.newTooltip;
58
+ case PmJobStatus.CLOSED : return this.status.closedTooltip;
59
+ case PmJobStatus.Late : return this.status.lateTooltip;
60
+
61
+ case PmJobStatus.OPEN : return this.status.openTooltip;
62
+ case PmJobStatus.WAITING : return this.status.waitingTooltip;
63
+ case PmJobStatus.DONE : return this.status.doneTooltip;
64
+ case PmJobStatus.VALIDATED : return this.status.validatedTooltip;
65
+ default : return "Erreur";
66
+ }
67
+ }
68
+ transformType(type : string) {
69
+
70
+ if( type ==="Planned Maintenance"){
71
+ return "Maintenance planifiée" ;
72
+ console.log("test");
73
+
74
+ }
75
+ console.log("test2");
76
+
77
+ return type;
78
+ }
79
+
80
+ }