awf-test-lib 0.1.24 → 0.1.25

Sign up to get free protection for your applications and to get access to all the features.
Files changed (216) hide show
  1. package/karma.conf.js +44 -0
  2. package/ng-package.json +7 -0
  3. package/package.json +10 -24
  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 +83 -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} +17 -14
  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} +7 -5
  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 +19 -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} +18 -16
  42. package/src/lib/models/pMGroupedJob.model.ts +4 -0
  43. package/{lib/models/pmJob.model.d.ts → src/lib/models/pmJob.model.ts} +26 -25
  44. package/src/lib/models/pmJobRequest.model.ts +6 -0
  45. package/{lib/models/pmJobStatus.d.ts → src/lib/models/pmJobStatus.ts} +19 -14
  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} +7 -5
  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} +6 -6
  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} +45 -38
  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 +12 -0
  66. package/src/lib/shared/choose-another-date/choose-another-date.component.scss +12 -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 +127 -0
  69. package/src/lib/shared/confirm-dialog/confirm-dialog.component.html +26 -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 +39 -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 +30 -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 +169 -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 +188 -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 +23 -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 +403 -0
  97. package/src/lib/shared/shared-routing.module.ts +10 -0
  98. package/src/lib/shared/shared.module.ts +80 -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 +78 -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} +57 -42
  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/esm2022/awf-test-lib.mjs +0 -5
  115. package/esm2022/lib/core/core-routing.module.mjs +0 -18
  116. package/esm2022/lib/core/core.module.mjs +0 -51
  117. package/esm2022/lib/core/menu/menu.component.mjs +0 -44
  118. package/esm2022/lib/core/menu-consomer/menu-consomer.component.mjs +0 -28
  119. package/esm2022/lib/core/menu-ge-portal/menu-ge-portal.component.mjs +0 -108
  120. package/esm2022/lib/core/menu-warranty/menu-warranty.component.mjs +0 -37
  121. package/esm2022/lib/core/not-found/not-found.component.mjs +0 -21
  122. package/esm2022/lib/core/top-bar/top-bar.component.mjs +0 -43
  123. package/esm2022/lib/models/account.model.mjs +0 -15
  124. package/esm2022/lib/models/alternativeDate.model.mjs +0 -7
  125. package/esm2022/lib/models/applicationName.mjs +0 -7
  126. package/esm2022/lib/models/cancelPMMailRequest.model.mjs +0 -6
  127. package/esm2022/lib/models/customObject.model.mjs +0 -4
  128. package/esm2022/lib/models/detailedPmJob.model.mjs +0 -23
  129. package/esm2022/lib/models/emailStatus.mjs +0 -6
  130. package/esm2022/lib/models/emailType.mjs +0 -17
  131. package/esm2022/lib/models/eventStatus.mjs +0 -9
  132. package/esm2022/lib/models/field.mjs +0 -9
  133. package/esm2022/lib/models/language.mjs +0 -6
  134. package/esm2022/lib/models/mailRequest.model.mjs +0 -17
  135. package/esm2022/lib/models/pMGroupedJob.model.mjs +0 -4
  136. package/esm2022/lib/models/pmJob.model.mjs +0 -23
  137. package/esm2022/lib/models/pmJobRequest.model.mjs +0 -5
  138. package/esm2022/lib/models/pmJobStatus.mjs +0 -17
  139. package/esm2022/lib/models/reason.model.mjs +0 -5
  140. package/esm2022/lib/models/reasonCode.mjs +0 -9
  141. package/esm2022/lib/models/reasonContact.mjs +0 -8
  142. package/esm2022/lib/models/reportDateMailRequest.model.mjs +0 -6
  143. package/esm2022/lib/models/role.mjs +0 -7
  144. package/esm2022/lib/models/service.model.mjs +0 -9
  145. package/esm2022/lib/models/serviceName.mjs +0 -12
  146. package/esm2022/lib/models/socialLoginRequest.model.mjs +0 -7
  147. package/esm2022/lib/models/socialMadia.mjs +0 -5
  148. package/esm2022/lib/models/stingBoolean.mjs +0 -6
  149. package/esm2022/lib/models/system.mjs +0 -14
  150. package/esm2022/lib/models/theme.model.mjs +0 -2
  151. package/esm2022/lib/models/tokenStatus.mjs +0 -7
  152. package/esm2022/lib/models/warranty.mjs +0 -18
  153. package/esm2022/lib/pipes/pipes/pipes.module.mjs +0 -21
  154. package/esm2022/lib/pipes/subrtring-w.pipe.mjs +0 -20
  155. package/esm2022/lib/pipes/substring.pipe.mjs +0 -16
  156. package/esm2022/lib/shared/choose-another-date/choose-another-date.component.mjs +0 -117
  157. package/esm2022/lib/shared/confirm-dialog/confirm-dialog.component.mjs +0 -52
  158. package/esm2022/lib/shared/confirm-dialog-contact/confirm-dialog-contact.component.mjs +0 -48
  159. package/esm2022/lib/shared/confirmed-date-information/confirmed-date-information.component.mjs +0 -44
  160. package/esm2022/lib/shared/contact/contact.component.mjs +0 -170
  161. package/esm2022/lib/shared/contact-support/contact-support.component.mjs +0 -186
  162. package/esm2022/lib/shared/dashboard/dashboard.component.mjs +0 -39
  163. package/esm2022/lib/shared/maintenance-list/maintenance-list.component.mjs +0 -372
  164. package/esm2022/lib/shared/shared-routing.module.mjs +0 -18
  165. package/esm2022/lib/shared/shared.module.mjs +0 -144
  166. package/esm2022/lib/shared/show-links/show-links.component.mjs +0 -86
  167. package/esm2022/lib/shared/system-list/system-list.component.mjs +0 -35
  168. package/esm2022/public-api.mjs +0 -48
  169. package/fesm2022/awf-test-lib.mjs +0 -1860
  170. package/fesm2022/awf-test-lib.mjs.map +0 -1
  171. package/index.d.ts +0 -5
  172. package/lib/core/core-routing.module.d.ts +0 -7
  173. package/lib/core/core.module.d.ts +0 -15
  174. package/lib/core/menu/menu.component.d.ts +0 -17
  175. package/lib/core/menu-consomer/menu-consomer.component.d.ts +0 -12
  176. package/lib/core/menu-ge-portal/menu-ge-portal.component.d.ts +0 -20
  177. package/lib/core/menu-warranty/menu-warranty.component.d.ts +0 -15
  178. package/lib/core/not-found/not-found.component.d.ts +0 -10
  179. package/lib/core/top-bar/top-bar.component.d.ts +0 -13
  180. package/lib/models/alternativeDate.model.d.ts +0 -6
  181. package/lib/models/applicationName.d.ts +0 -5
  182. package/lib/models/customObject.model.d.ts +0 -3
  183. package/lib/models/detailedPmJob.model.d.ts +0 -23
  184. package/lib/models/emailStatus.d.ts +0 -4
  185. package/lib/models/emailType.d.ts +0 -15
  186. package/lib/models/eventStatus.d.ts +0 -7
  187. package/lib/models/field.d.ts +0 -7
  188. package/lib/models/language.d.ts +0 -4
  189. package/lib/models/pMGroupedJob.model.d.ts +0 -3
  190. package/lib/models/pmJobRequest.model.d.ts +0 -5
  191. package/lib/models/reason.model.d.ts +0 -4
  192. package/lib/models/reasonCode.d.ts +0 -7
  193. package/lib/models/reasonContact.d.ts +0 -6
  194. package/lib/models/role.d.ts +0 -5
  195. package/lib/models/service.model.d.ts +0 -8
  196. package/lib/models/serviceName.d.ts +0 -10
  197. package/lib/models/socialMadia.d.ts +0 -3
  198. package/lib/models/stingBoolean.d.ts +0 -4
  199. package/lib/models/system.d.ts +0 -14
  200. package/lib/models/tokenStatus.d.ts +0 -5
  201. package/lib/models/warranty.d.ts +0 -17
  202. package/lib/pipes/pipes/pipes.module.d.ts +0 -9
  203. package/lib/pipes/subrtring-w.pipe.d.ts +0 -7
  204. package/lib/pipes/substring.pipe.d.ts +0 -7
  205. package/lib/shared/choose-another-date/choose-another-date.component.d.ts +0 -33
  206. package/lib/shared/confirm-dialog/confirm-dialog.component.d.ts +0 -21
  207. package/lib/shared/confirm-dialog-contact/confirm-dialog-contact.component.d.ts +0 -19
  208. package/lib/shared/confirmed-date-information/confirmed-date-information.component.d.ts +0 -17
  209. package/lib/shared/contact/contact.component.d.ts +0 -39
  210. package/lib/shared/contact-support/contact-support.component.d.ts +0 -50
  211. package/lib/shared/dashboard/dashboard.component.d.ts +0 -18
  212. package/lib/shared/maintenance-list/maintenance-list.component.d.ts +0 -81
  213. package/lib/shared/shared-routing.module.d.ts +0 -7
  214. package/lib/shared/shared.module.d.ts +0 -40
  215. package/lib/shared/show-links/show-links.component.d.ts +0 -24
  216. package/lib/shared/system-list/system-list.component.d.ts +0 -16
@@ -0,0 +1,188 @@
1
+ import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core';
2
+ import { FormBuilder, FormGroup, Validators } from '@angular/forms';
3
+
4
+ import { MessageService } from 'primeng/api';
5
+ import { DetailedPmJob } from '../../models/detailedPmJob.model';
6
+ import { PmJobStatus } from '../../models/pmJobStatus';
7
+ import { Reason } from '../../models/reason.model';
8
+ import { ReasonCode } from '../../models/reasonCode';
9
+ import { ReasonContact } from '../../models/reasonContact';
10
+
11
+ @Component({
12
+ selector: 'app-contact-support',
13
+ templateUrl: './contact-support.component.html',
14
+ styleUrls: ['./contact-support.component.scss'],
15
+ providers: [MessageService]
16
+ })
17
+
18
+ export class ContactSupportComponent implements OnInit, OnChanges {
19
+ @Input() displaycontactSupport!: boolean;
20
+ @Input() globaltranslate!: any;
21
+ @Input() translate!: any;
22
+ @Input() showDate!: boolean;
23
+ @Input() detailedPmJob!: DetailedPmJob;
24
+ @Input() reasonContact!: string;
25
+ @Input() reasons!: Reason[];
26
+ @Output() sendDetailedPm = new EventEmitter<any>();
27
+ @Output() sendForm: EventEmitter<any> = new EventEmitter();
28
+ @Output() closeContactSupport = new EventEmitter<boolean>();
29
+ form!: FormGroup;
30
+ dates!: Date[];
31
+ loading = false;
32
+ submitted = false;
33
+ minDate!: Date;
34
+ maxDate!: Date;
35
+ displayNumber = false;
36
+
37
+ selectedReason!: Reason;
38
+
39
+ constructor(private messageService: MessageService, private formBuilder: FormBuilder) { }
40
+ ngOnChanges(changes: SimpleChanges): void {
41
+ this.loadDatas();
42
+ }
43
+
44
+ ngOnInit(): void {
45
+ this.loadDatas();
46
+ }
47
+
48
+ loadDatas() {
49
+ this.filterReasons();
50
+ this.setDateRules();
51
+ this.loadForm();
52
+ }
53
+
54
+ filterReasons() {
55
+ if (this.reasons && this.reasonContact === ReasonContact.MoreDatesFormPm) {
56
+ this.selectedReason = this.reasons[0];
57
+ this.reasons = this.reasons.filter(x => x.code === ReasonCode.MPM)
58
+ }
59
+ if (this.reasons && this.reasonContact === ReasonContact.CancelFormPm) {
60
+ this.selectedReason = this.reasons[2];
61
+ this.reasons = this.reasons.filter(x => x.code === ReasonCode.CPM)
62
+ }
63
+ if (this.detailedPmJob.status === PmJobStatus.DONE) {
64
+ this.reasons = this.reasons.filter(x => x.code === ReasonCode.OTH)
65
+ }
66
+ if (this.detailedPmJob.status === PmJobStatus.VALIDATED) {
67
+ this.reasons = this.reasons.filter(x => x.code !== ReasonCode.MPM)
68
+ }
69
+ }
70
+
71
+
72
+ cancelContactSupport() {
73
+
74
+ this.closeContactSupport.emit(true);
75
+ this.messageService.add({ severity: 'error', summary: this.globaltranslate.summaryReject, detail: this.globaltranslate.detailReject });
76
+
77
+
78
+
79
+ }
80
+ get f() {
81
+ return this.form.controls;
82
+ }
83
+
84
+
85
+
86
+ setDateRules() {
87
+ let today = new Date();
88
+ let month = today.getMonth();
89
+ let year = today.getFullYear();
90
+ let prevMonth = (month === 0) ? 11 : month - 1;
91
+ let prevYear = (prevMonth === 11) ? year - 1 : year;
92
+ this.minDate = new Date();
93
+ this.minDate.setMonth(month);
94
+ this.minDate.setFullYear(prevYear);
95
+
96
+ }
97
+
98
+ loadForm() {
99
+ let name = sessionStorage.getItem('userName') ? sessionStorage.getItem('userName') : localStorage.getItem('userName') ;
100
+ let email = sessionStorage.getItem('email') ? sessionStorage.getItem('email') : localStorage.getItem('email');
101
+ let phone = sessionStorage.getItem('mobilePhoneNumber') ? sessionStorage.getItem('mobilePhoneNumber') : localStorage.getItem('mobilePhoneNumber');
102
+
103
+ this.form = this.formBuilder.group({
104
+ name: [name !== 'null' ? name : '', [Validators.required, Validators.minLength(3)]],
105
+ email: [email !== 'null' ? email : '', [Validators.required, Validators.email]],
106
+ phone: [this.checkPhone(phone) ? phone : '', [Validators.required]],
107
+ extentionOrComment: [''],
108
+ reason: [{ value: '' }, [Validators.required]],
109
+ system: [{ value: this.detailedPmJob.systemName + ' ' + this.detailedPmJob.systemId, disabled: true }, [Validators.required]],
110
+ workOrder: [{ value: this.detailedPmJob.pmJob.workorderNumber, disabled: true }, [Validators.required]],
111
+ message: ['', (this.reasonContact === ReasonContact.MoreDatesFormPm) ? [] : [Validators.required, Validators.minLength(15)]],
112
+ });
113
+ }
114
+
115
+ checkPhone(phone : any): boolean{
116
+ if (phone == null || phone == 'null' || phone == undefined || phone.length == 0) {
117
+ return false;
118
+ } else {
119
+ return true
120
+ }
121
+ }
122
+
123
+ contacted() {
124
+ this.sendContactMeEmailMethode();
125
+
126
+ }
127
+ contact() {
128
+ this.displayNumber = true;
129
+
130
+ }
131
+
132
+ closeNumber() {
133
+ this.displayNumber = false;
134
+ }
135
+
136
+ sendContactMeEmailMethode() {
137
+
138
+ if(this.form.value.reason.name == "Demander d'autres dates de PM"){
139
+ this.reasonContact =ReasonContact.MoreDatesFormPm;
140
+ }
141
+ this.detailedPmJob.name = this.form.value.name;
142
+ this.detailedPmJob.phone = this.form.value.phone;
143
+ this.detailedPmJob.extentionOrComment = this.form.value.extentionOrComment;
144
+ this.detailedPmJob.email = this.form.value.email;
145
+ // this.detailedPmJob.reason = (this.reasonContact === ReasonContact.MoreDatesFormPm) ? this.reasons[0].name : this.form.value.reason.name;
146
+ this.detailedPmJob.reason = this.form.value.reason.name;
147
+ this.detailedPmJob.extentionOrComment = this.form.value.extentionOrComment;
148
+ this.detailedPmJob.comment = this.form.value.message;
149
+ this.detailedPmJob.reasonContact = this.reasonContact;
150
+ this.detailedPmJob.futureStatus = this.slectsFutureStatus(this.form.value.reason.code);
151
+ this.sendDetailedPm.emit(this.detailedPmJob);
152
+ }
153
+
154
+ slectsFutureStatus(status: any) {
155
+ switch (status) {
156
+ case ReasonCode.MPM: return PmJobStatus.WAITING;
157
+ case ReasonCode.RPM: return PmJobStatus.REPORTED;
158
+ case ReasonCode.CPM: return PmJobStatus.CANCELLED;
159
+ case ReasonCode.SDI: return PmJobStatus.DESINSTALLED;
160
+ case ReasonCode.OTH: return PmJobStatus.OTHER;
161
+ default: return "Erreur";
162
+ }
163
+ }
164
+
165
+
166
+
167
+ onSubmit() {
168
+ this.submitted = true;
169
+ if (this.form.invalid) {
170
+ this.messageService.add({ severity: 'error', summary: this.globaltranslate.summaryError, detail: this.globaltranslate.invalidForm });
171
+ return;
172
+ }
173
+ this.contacted();
174
+ }
175
+
176
+ preventStringKeypress(event: any): void {
177
+ if (
178
+ isNaN(Number(String.fromCharCode(event.charCode))) ||
179
+ String.fromCharCode(event.charCode) === ' '
180
+ ) {
181
+ event.preventDefault();
182
+ }
183
+ }
184
+
185
+ }
186
+
187
+
188
+
@@ -0,0 +1,81 @@
1
+ <div class="GE">
2
+ <div class="home">
3
+ <h3 class="title">{{translate.title}}</h3>
4
+ <div class="row">
5
+ <div class="col-md-8">
6
+ <div class="row">
7
+ <div class="col-md-12 card-bg" style="cursor: pointer;" routerLink="./systems">
8
+ <div class="conteur">
9
+ <img class="d-block mx-auto" height="60px" src="assets/img/GEPortal/tools.png">
10
+ <h3 class="counter text-center mt-4">{{systems.length}} &nbsp; {{translate.systems}}</h3>
11
+ </div>
12
+ </div>
13
+ </div>
14
+ <br>
15
+
16
+ <div class="row">
17
+ <div class="col-md-12 card-bg" style="cursor: pointer;" routerLink="./maintenance">
18
+ <div class="conteur conteur bg--primary">
19
+ <img class="d-block mx-auto " height="60px" src="assets/img/GEPortal/calendar-check.png">
20
+ <h3 class="counter text-center mt-4">{{toBeScheduledMaintenanceList.length}} &nbsp; {{translate.upComing}}</h3>
21
+ </div>
22
+ </div>
23
+ <!-- <div class="col-md-6 card-bg">
24
+ <div class="d-block mx-auto conteur bg--primary">
25
+ <img class="d-block mx-auto" height="60px" src="assets/img/GEPortal/calendar-check.png">
26
+ <h3 class="counter text-center mt-4"> {{alreadyScheduledMaintenanceList.length}} &nbsp; {{translate.toValidate}}</h3>
27
+ </div>
28
+ </div> -->
29
+ </div>
30
+ <div class="row mt-4">
31
+ <div class="col-md-12 card-bg">
32
+ <div class="conteur">
33
+ <h4> {{translate.upcoming}}</h4>
34
+ <p-table [value]="toBeScheduledMaintenanceList" responsiveLayout="scroll">
35
+ <ng-template pTemplate="header">
36
+ <tr>
37
+ <th>{{translate.name}}</th>
38
+ <th>{{translate.systemId}}</th>
39
+ <th>{{translate.workorderId}}</th>
40
+ <th>{{translate.endDateTime}}</th>
41
+ </tr>
42
+ </ng-template>
43
+ <ng-template pTemplate="body" let-product>
44
+ <tr>
45
+ <td>{{product.systemName }}</td>
46
+ <td>{{product.systemId }}</td>
47
+ <td>{{product.pmJob.workorderNumber}}</td>
48
+ <td>{{product.pmJob.endDateTime | date: "EEE dd MMM yyyy":"":language}} </td>
49
+ </tr>
50
+ </ng-template>
51
+ </p-table>
52
+
53
+ </div>
54
+ </div>
55
+ </div>
56
+ </div>
57
+ <div class="col-md-4" >
58
+ <div routerLink="./contact" class="card- d-grid text-center justify-content-center align-items-center p-5" style="cursor: pointer;">
59
+ <img src="assets/img/GEPortal/phone.png" width="80px" class="img-fluid mx-auto">
60
+ <h5 class="mt-5"> {{ translate.contact}}</h5>
61
+ </div>
62
+ <div class="card- d-grid mt-4 p-4">
63
+ <h4>{{ translate.profil}}</h4>
64
+ <div class="d-flex align-items-center mb-3 mt-4"> <img src="assets/img/GEPortal/user.png">
65
+ <p>&nbsp;{{name}}</p>
66
+ </div>
67
+ <div class="d-flex align-items-center mb-3"> <img src="assets/img/GEPortal/mail.png">
68
+ <p>&nbsp;{{email}}</p>
69
+ </div>
70
+ <!-- <div class="d-flex align-items-center mb-3"> <img src="assets/img/GEPortal/map.png">
71
+ <p>31 rue marseille France</p>
72
+ </div> -->
73
+ <div class="d-flex align-items-center mb-3"> <img src="assets/img/GEPortal/phone-call.png">
74
+ <p>&nbsp;{{number}}</p>
75
+ </div>
76
+ </div>
77
+ </div>
78
+
79
+ </div>
80
+ </div>
81
+ </div>
@@ -0,0 +1,5 @@
1
+ h3 {
2
+ &.counter {
3
+ font-size: 20px;
4
+ }
5
+ }
@@ -0,0 +1,23 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { DashboardComponent } from './dashboard.component';
4
+
5
+ describe('DashboardComponent', () => {
6
+ let component: DashboardComponent;
7
+ let fixture: ComponentFixture<DashboardComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ declarations: [ DashboardComponent ]
12
+ })
13
+ .compileComponents();
14
+
15
+ fixture = TestBed.createComponent(DashboardComponent);
16
+ component = fixture.componentInstance;
17
+ fixture.detectChanges();
18
+ });
19
+
20
+ it('should create', () => {
21
+ expect(component).toBeTruthy();
22
+ });
23
+ });
@@ -0,0 +1,23 @@
1
+ import { Component, OnChanges,Input, SimpleChanges } from '@angular/core';
2
+ import { DetailedPmJob } from '../../models/detailedPmJob.model';
3
+ import { System } from '../../models/system';
4
+
5
+
6
+ @Component({
7
+ selector: 'awf-dashboard',
8
+ templateUrl: './dashboard.component.html',
9
+ styleUrls: ['./dashboard.component.scss']
10
+ })
11
+ export class DashboardComponent implements OnChanges {
12
+ @Input() name!: string;
13
+ @Input() email!: string;
14
+ @Input() number!: string;
15
+ @Input() systems!: System[] ;
16
+ @Input() toBeScheduledMaintenanceList: DetailedPmJob[] = [];
17
+ @Input() alreadyScheduledMaintenanceList: DetailedPmJob[] = [];
18
+ @Input() translate!: any;
19
+ languageStored : string | null = localStorage.getItem("lang");
20
+ language: string = this.languageStored ? this.languageStored : navigator.language.substr(0, 2).toLowerCase();
21
+ constructor() { }
22
+ ngOnChanges(changes: SimpleChanges): void {}
23
+ }
@@ -0,0 +1,105 @@
1
+ <p-table #dt [value]="maintenanceList" responsiveLayout="stack" [rows]="10" [showCurrentPageReport]="true" [rowsPerPageOptions]="[5,10,25,50]"
2
+ [globalFilterFields]="['systemId','pmJob.caseId','systemName','pmJob.workorderNumber','pmJob.startDateTime','pmJob.endDateTime','pmJob.case_type','pmJob.case_category','status']"
3
+ [paginator]="true" [rowHover]="true" dataKey="id" [currentPageReportTemplate]="globaltranslate.countPages" [first]="first">
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="caseId">Case Id <p-sortIcon field="caseId"></p-sortIcon> -->
16
+ <th pSortableColumn="systemName">{{translate.maintenanceList.system}}
17
+ <p-sortIcon field="systemName"></p-sortIcon>
18
+ <th pSortableColumn="room">{{translate.maintenanceList.room}}
19
+ <p-sortIcon field="room"></p-sortIcon>
20
+ <th pSortableColumn="systemId">System Id
21
+ <p-sortIcon field="systemId"></p-sortIcon>
22
+ <th pSortableColumn="pmJob.workorderNumber">{{translate.maintenanceList.workOrder}}
23
+ <p-sortIcon field="pmJob.workorderNumber"></p-sortIcon>
24
+ <th pSortableColumn="pmJob.startDateTime">{{translate.maintenanceList.startDate}}
25
+ <p-sortIcon field="pmJob.startDateTime"></p-sortIcon>
26
+ <th pSortableColumn="pmJob.caseType">{{translate.maintenanceList.type}}
27
+ <p-sortIcon field="pmJob.caseType"></p-sortIcon>
28
+ <th pSortableColumn="status">{{translate.maintenanceList.status}}
29
+ <p-sortIcon field="status"></p-sortIcon>
30
+ <th>{{translate.maintenanceList.NbrLinks}}
31
+ <th> Action</th>
32
+ </tr>
33
+ </ng-template>
34
+ <ng-template pTemplate="body" let-product let-columns="columns">
35
+ <tr>
36
+ <td>{{product.systemName }} </td>
37
+ <td>{{product.room }}</td>
38
+ <td>{{product.systemId }}</td>
39
+ <td>{{product.pmJob.workorderNumber }}</td>
40
+ <td>{{product.pmJob.startDateTime | date: "EEE dd MMM yyyy":"":language}}</td>
41
+ <td *ngIf="product.pmJob.caseType === 'Planned Maintenance'">{{translate.maintenanceList.typePlanned}}</td>
42
+ <td *ngIf="product.pmJob.caseType === 'QARA'">{{translate.maintenanceList.typeQARA}}</td>
43
+ <td>
44
+ <span [class]="'product-status status-' + product.status"
45
+ [pTooltip]="getStatusTooltip(product.status)">
46
+ {{transformStatus(product.status)}}
47
+ </span>
48
+ </td>
49
+ <td *ngIf="product.pmJob.groupList !== null " (click)="showLinks(product)"> <span class="circle">{{product.pmJob.groupList.length }}</span> <i class="pi pi-link" style="font-size: 1rem"></i> </td>
50
+ <td *ngIf="product.pmJob.groupList === null" (click)="showLinks(product)"> <span class="circlelinked">{{product.pmJob.groupList.length }}</span> <i class="pi pi-link" style="font-size: 1rem"></i> </td>
51
+ <td>
52
+ <button pButton pRipple type="button" label="" icon="pi pi-calendar" class="p-button-rounded" #actualTarget (click)="selectElement(product)" (click)="op.toggle($event)" [disabled]="((product.status ==='late' || product.status ==='accepted') && !isAlreadyScheduled) || product.status ==='waiting'"></button>
53
+ </td>
54
+ </tr>
55
+ </ng-template>
56
+ <ng-template pTemplate="summary">
57
+ <div class="p-d-flex p-ai-center p-jc-between">
58
+ {{globaltranslate.count}} {{maintenanceList ? maintenanceList.length : 0 }} {{globaltranslate.elements}}.
59
+ </div>
60
+ </ng-template>
61
+ </p-table>
62
+
63
+ <p-toast position="top-center"></p-toast>
64
+ <p-overlayPanel #op [dismissable]="true" [showCloseIcon]="false" [showTransitionOptions]="'0ms'" [hideTransitionOptions]="'0ms'">
65
+ <ng-template pTemplate>
66
+
67
+ <button style="width: 100%;" *ngIf="!isAlreadyScheduled" icon="pi pi-thumbs-up" (click)="confirmDialog()" [label]="translate.maintenanceList.confirmDate" class="p-button-text p-button-raised" pButton pRipple type="button">
68
+ </button>
69
+ <hr *ngIf="!isAlreadyScheduled">
70
+ <button style="width: 100%;" *ngIf="!isAlreadyScheduled && (alternativeDatesList !== null) " icon="pi pi-calendar-plus" (click)="proposeAnotherDate()" [label]="translate.maintenanceList.chooseAnotherDate" class="p-button-text p-button-raised" pButton pRipple type="button"></button>
71
+ <hr *ngIf="!isAlreadyScheduled && (alternativeDatesList!==null) ">
72
+ <button style="width: 100%;" icon="pi pi-phone" (click)="contactSupport(false)" [label]="translate.maintenanceList.contactSuppor" class="p-button-text p-button-raised" pButton pRipple type="button"></button>
73
+ <hr *ngIf="isWithLinks">
74
+ <button style="width: 100%;" icon="pi pi-link" *ngIf="isWithLinks" (click)="showLinks()" [label]="translate.maintenanceList.showLinks" class="p-button-text p-button-raised" pButton pRipple type="button"></button>
75
+ <hr *ngIf="isAlreadyScheduled && pmSelectedStatus ==='validated'">
76
+ <button style="width: 100%;" *ngIf="isAlreadyScheduled && pmSelectedStatus ==='validated'" icon="pi pi-pencil" (click)="editPm()" [label]="translate.maintenanceList.cancel" class="p-button-text p-button-raised" pButton pRipple type="button">
77
+ </button>
78
+ </ng-template>
79
+ </p-overlayPanel>
80
+
81
+ <div *ngIf="displaycontactSupport " >
82
+ <app-contact-support [reasonContact]="reasonContact" (closeContactSupport)="closeContactSupport($event)" (sendDetailedPm)="sendContactMeForm($event)" [detailedPmJob] ="maintenanceSelected" [globaltranslate]="globaltranslate" [reasons]="reasons" [translate]="translate.contactSupport" [displaycontactSupport]="displaycontactSupport" [showDate]="showDate" ></app-contact-support>
83
+ </div>
84
+ <div *ngIf="displayConfirmDialog">
85
+ <app-confirm-dialog [detailedPmJobLinkedList]="detailedPmJobLinkedList" [isProposedDate]="isProposedDate" [globaltranslate]="globaltranslate" [translate]="translate.confirmDialog"
86
+ [startDateTime]="startDateTime" [endDateTime]="endDateTime" [displayConfirmDialog]="displayConfirmDialog" (closeConfirmDialog)="closeConfirmDialog($event)">
87
+ </app-confirm-dialog>
88
+ </div>
89
+ <div *ngIf="displayConfirmDialogContact">
90
+ <app-confirm-dialog-contact [detailedPmJobLinkedList]="detailedPmJobLinkedList" [globaltranslate]="globaltranslate" [translate]="translate.confirmDialogContact"
91
+ [startDateTime]="startDateTime" [endDateTime]="endDateTime" [displayConfirmDialogContact]="displayConfirmDialogContact" (closeConfirmDialogContact)="closeConfirmDialogContact($event)">
92
+ </app-confirm-dialog-contact >
93
+ </div>
94
+ <div *ngIf="displayConfirmedDateInfo">
95
+ <app-confirmed-date-information [moreDates]="moreDates" [globaltranslate]="globaltranslate" [translate]="translate.confirmDateInformation" [startDateTime]="startDateTime" [endDateTime]="endDateTime" [displayConfirmedDateInfos]="displayConfirmedDateInfo" (closeConfirmedDateInfo)="closeConfirmedDateInfo()"></app-confirmed-date-information>
96
+ </div>
97
+ <div *ngIf="displayAnotherDate && alternativeDatesList">
98
+ <app-choose-another-date [globaltranslate]="globaltranslate" [translate]="translate.chooseAnotherDate" [alternativeDatesList]="alternativeDatesList" [displayAnotherDate]="displayAnotherDate" (closeAnotherDate)="closeAnotherDate($event)" (acceptDate)="acceptDate($event)">
99
+ </app-choose-another-date>
100
+ </div>
101
+ <div *ngIf="displayShowLinks && selectedWorkorderId">
102
+ <app-show-links [status]="status" [selectedWorkorderId]="selectedWorkorderId" [translate]="translate" [globaltranslate]="globaltranslate" [displayShowLinks]="displayShowLinks" (closeShowLinks)="closeShowLinks()" [detailedPmJobLinkedList]="detailedPmJobLinkedList"></app-show-links>
103
+ </div>
104
+
105
+
@@ -0,0 +1,26 @@
1
+ span.circle {
2
+ background: #f86359;
3
+ border-radius: 50%;
4
+ -moz-border-radius: 50%;
5
+ -webkit-border-radius: 50%;
6
+ color: #f8f8f8;
7
+ display: inline-block;
8
+ font-weight: bold;
9
+ line-height: 20px;
10
+ margin-right: 5px;
11
+ text-align: center;
12
+ width: 20px;
13
+ &linked {
14
+ background: #80a161;
15
+ border-radius: 50%;
16
+ -moz-border-radius: 50%;
17
+ -webkit-border-radius: 50%;
18
+ color: #ffffff;
19
+ display: inline-block;
20
+ font-weight: bold;
21
+ line-height: 20px;
22
+ margin-right: 5px;
23
+ text-align: center;
24
+ width: 20px;
25
+ }
26
+ }
@@ -0,0 +1,25 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { MaintenanceListComponent } from './maintenance-list.component';
4
+
5
+ describe('MaintenanceListComponent', () => {
6
+ let component: MaintenanceListComponent;
7
+ let fixture: ComponentFixture<MaintenanceListComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ declarations: [ MaintenanceListComponent ]
12
+ })
13
+ .compileComponents();
14
+ });
15
+
16
+ beforeEach(() => {
17
+ fixture = TestBed.createComponent(MaintenanceListComponent);
18
+ component = fixture.componentInstance;
19
+ fixture.detectChanges();
20
+ });
21
+
22
+ it('should create', () => {
23
+ expect(component).toBeTruthy();
24
+ });
25
+ });