awf-test-lib 0.0.44 → 0.0.45

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.
@@ -336,6 +336,32 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.10", ngImpo
336
336
  }]
337
337
  }] });
338
338
 
339
+ var PmJobStatus;
340
+ (function (PmJobStatus) {
341
+ PmJobStatus["NEW"] = "new";
342
+ PmJobStatus["ACCEPTED"] = "accepted";
343
+ PmJobStatus["CLOSED"] = "closed";
344
+ PmJobStatus["Late"] = "late";
345
+ PmJobStatus["OPEN"] = "open";
346
+ PmJobStatus["WAITING"] = "waiting";
347
+ PmJobStatus["DONE"] = "done";
348
+ PmJobStatus["VALIDATED"] = "validated";
349
+ // statues if i select reason in contact page
350
+ PmJobStatus["DESINSTALLED"] = "desinstalled";
351
+ PmJobStatus["REPORTED"] = "reported";
352
+ PmJobStatus["CANCELLED"] = "cancelled";
353
+ PmJobStatus["OTHER"] = "other";
354
+ })(PmJobStatus || (PmJobStatus = {}));
355
+
356
+ var ReasonCode;
357
+ (function (ReasonCode) {
358
+ ReasonCode["MPM"] = "MPM";
359
+ ReasonCode["RPM"] = "RPM";
360
+ ReasonCode["CPM"] = "CPM";
361
+ ReasonCode["SDI"] = "SDI";
362
+ ReasonCode["OTH"] = "OTH";
363
+ })(ReasonCode || (ReasonCode = {}));
364
+
339
365
  var ReasonContact;
340
366
  (function (ReasonContact) {
341
367
  ReasonContact["MoreDatesFormPm"] = "MoreDatesFormPm";
@@ -357,7 +383,7 @@ class ContactComponent {
357
383
  this.showPm = false;
358
384
  }
359
385
  ngOnChanges() {
360
- this.reasons = this.reasons.filter(x => (x.code == 'SDI' || x.code == 'OTH'));
386
+ this.reasons = this.reasons.filter(x => (x.code == ReasonCode.SDI || x.code == ReasonCode.OTH));
361
387
  this.loadForm();
362
388
  }
363
389
  // convenience getter for easy access to form fields
@@ -394,8 +420,19 @@ class ContactComponent {
394
420
  detailedPmJob.toUpdate = true;
395
421
  detailedPmJob.selectedDate = detailedPmJob.pmJob.startDateTime;
396
422
  detailedPmJob.reasonContact = ReasonContact.Contact;
423
+ detailedPmJob.futureStatus = this.slectsFutureStatus(this.form.value.reason.code);
397
424
  this.sendForm.emit(detailedPmJob);
398
425
  }
426
+ slectsFutureStatus(status) {
427
+ switch (status) {
428
+ case ReasonCode.MPM: return PmJobStatus.WAITING;
429
+ case ReasonCode.RPM: return PmJobStatus.REPORTED;
430
+ case ReasonCode.CPM: return PmJobStatus.CANCELLED;
431
+ case ReasonCode.SDI: return PmJobStatus.DESINSTALLED;
432
+ case ReasonCode.OTH: return PmJobStatus.OTHER;
433
+ default: return "Erreur";
434
+ }
435
+ }
399
436
  loadForm() {
400
437
  let name = sessionStorage.getItem('userName');
401
438
  let email = sessionStorage.getItem('email');
@@ -616,23 +653,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.10", ngImpo
616
653
  type: Output
617
654
  }] } });
618
655
 
619
- var PmJobStatus;
620
- (function (PmJobStatus) {
621
- PmJobStatus["NEW"] = "new";
622
- PmJobStatus["ACCEPTED"] = "accepted";
623
- PmJobStatus["CLOSED"] = "closed";
624
- PmJobStatus["Late"] = "late";
625
- PmJobStatus["OPEN"] = "open";
626
- PmJobStatus["WAITING"] = "waiting";
627
- PmJobStatus["DONE"] = "done";
628
- PmJobStatus["VALIDATED"] = "validated";
629
- // statues if i select reason in contact page
630
- PmJobStatus["DESINSTALLED"] = "desinstalled";
631
- PmJobStatus["REPORTED"] = "reported";
632
- PmJobStatus["CANCELLED"] = "cancelled";
633
- PmJobStatus["OTHER"] = "other";
634
- })(PmJobStatus || (PmJobStatus = {}));
635
-
636
656
  class ContactSupportComponent {
637
657
  constructor(messageService, formBuilder) {
638
658
  this.messageService = messageService;
@@ -651,22 +671,24 @@ class ContactSupportComponent {
651
671
  this.loadDatas();
652
672
  }
653
673
  loadDatas() {
654
- this.filterReasens();
674
+ this.filterReasons();
655
675
  this.setDateRules();
656
676
  this.loadForm();
657
677
  }
658
- filterReasens() {
678
+ filterReasons() {
659
679
  if (this.reasons && this.reasonContact === ReasonContact.MoreDatesFormPm) {
660
680
  this.selectedReason = this.reasons[0];
681
+ this.reasons = this.reasons.filter(x => x.code === ReasonCode.MPM);
661
682
  }
662
683
  if (this.reasons && this.reasonContact === ReasonContact.CancelFormPm) {
663
684
  this.selectedReason = this.reasons[2];
685
+ this.reasons = this.reasons.filter(x => x.code === ReasonCode.CPM);
664
686
  }
665
687
  if (this.detailedPmJob.status === PmJobStatus.DONE) {
666
- this.reasons = this.reasons.filter(x => x.code === "OTH");
688
+ this.reasons = this.reasons.filter(x => x.code === ReasonCode.OTH);
667
689
  }
668
690
  if (this.detailedPmJob.status === PmJobStatus.VALIDATED) {
669
- this.reasons = this.reasons.filter(x => x.code !== "MPM");
691
+ this.reasons = this.reasons.filter(x => x.code !== ReasonCode.MPM);
670
692
  }
671
693
  }
672
694
  cancelContactSupport() {
@@ -694,7 +716,7 @@ class ContactSupportComponent {
694
716
  name: [name !== 'null' ? name : '', [Validators.required, Validators.minLength(3)]],
695
717
  email: [email !== 'null' ? email : '', [Validators.required, Validators.email]],
696
718
  phone: [phone !== 'null' ? phone : '', [Validators.required]],
697
- reason: [{ value: '', disabled: ((this.reasonContact === ReasonContact.CancelFormPm) || (this.reasonContact === ReasonContact.MoreDatesFormPm)) }, [Validators.required]],
719
+ reason: [{ value: '' }, [Validators.required]],
698
720
  system: [{ value: this.detailedPmJob.systemName + ' ' + this.detailedPmJob.systemId, disabled: true }, [Validators.required]],
699
721
  workOrder: [{ value: this.detailedPmJob.pmJob.workorderNumber, disabled: true }, [Validators.required]],
700
722
  message: ['', (this.reasonContact === ReasonContact.MoreDatesFormPm) ? [] : [Validators.required, Validators.minLength(15)]],
@@ -713,7 +735,7 @@ class ContactSupportComponent {
713
735
  this.detailedPmJob.name = this.form.value.name;
714
736
  this.detailedPmJob.phone = this.form.value.phone;
715
737
  this.detailedPmJob.email = this.form.value.email;
716
- this.detailedPmJob.reason = (this.reasonContact === ReasonContact.MoreDatesFormPm) ? this.reasons[0].name : (this.reasonContact === ReasonContact.CancelFormPm) ? this.reasons[2].name : this.form.value.reason.name;
738
+ this.detailedPmJob.reason = (this.reasonContact === ReasonContact.MoreDatesFormPm) ? this.reasons[0].name : this.form.value.reason.name;
717
739
  this.detailedPmJob.comment = this.form.value.message;
718
740
  this.detailedPmJob.reasonContact = this.reasonContact;
719
741
  this.detailedPmJob.futureStatus = this.slectsFutureStatus(this.form.value.reason.code);
@@ -721,11 +743,11 @@ class ContactSupportComponent {
721
743
  }
722
744
  slectsFutureStatus(status) {
723
745
  switch (status) {
724
- case "MPM": return PmJobStatus.WAITING;
725
- case "RPM": return PmJobStatus.REPORTED;
726
- case "CPM": return PmJobStatus.CANCELLED;
727
- case "SDI": return PmJobStatus.DESINSTALLED;
728
- case "OTH": return PmJobStatus.OTHER;
746
+ case ReasonCode.MPM: return PmJobStatus.WAITING;
747
+ case ReasonCode.RPM: return PmJobStatus.REPORTED;
748
+ case ReasonCode.CPM: return PmJobStatus.CANCELLED;
749
+ case ReasonCode.SDI: return PmJobStatus.DESINSTALLED;
750
+ case ReasonCode.OTH: return PmJobStatus.OTHER;
729
751
  default: return "Erreur";
730
752
  }
731
753
  }
@@ -956,13 +978,11 @@ class MaintenanceListComponent {
956
978
  this.emitForAlternativeDates.emit(pmJob);
957
979
  }
958
980
  getLinkedPmJob() {
959
- //this.pmJobLinkedList =[];
960
981
  this.detailedPmJobLinkedList = [];
961
982
  if (this.maintenanceSelected.pmJob.groupList) {
962
983
  this.maintenanceSelected.pmJob.groupList.forEach((linked) => {
963
984
  this.maintenanceList.forEach((item) => {
964
985
  if (linked.workorderId === item.pmJob.workorderId) {
965
- //this.pmJobLinkedList.push(item);
966
986
  this.detailedPmJobLinkedList.push(item);
967
987
  }
968
988
  });
@@ -1004,7 +1024,6 @@ class MaintenanceListComponent {
1004
1024
  this.displayConfirmDialogContact = false;
1005
1025
  if (confirm) {
1006
1026
  this.emailTypes = [];
1007
- //this.maintenanceSelected.futureStatus = this.maintenanceSelected.status ;
1008
1027
  if (this.reasonContact === ReasonContact.ContactFormPm) {
1009
1028
  this.emailTypes.push(EmailType.ContactMe_Clients);
1010
1029
  this.emailTypes.push(EmailType.ContactMe_CSC);