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,6 @@
1
+
2
+ export enum TokenStatus {
3
+ Validating,
4
+ Valid,
5
+ Invalid
6
+ }
@@ -0,0 +1,18 @@
1
+
2
+ export class Warranty {
3
+ manufacturerId!: number;
4
+ contractId!: number;
5
+ contractProductId?: number;
6
+ contractProductParentId?: number;
7
+ contractCode!: string;
8
+ saleDate?: Date;
9
+ brand!: string;
10
+ family!: string;
11
+ commercialReference!: string;
12
+ technicalReference!: string;
13
+ productDescription!: string;
14
+ startDate?: Date;
15
+ endDate?: Date;
16
+ PdfLink?:string;
17
+ consId?:number;
18
+ }
@@ -0,0 +1,14 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { SubstringPipe } from '../substring.pipe';
4
+ import { SubrtringWPipe } from '../subrtring-w.pipe';
5
+
6
+
7
+ @NgModule({
8
+ declarations: [SubstringPipe,SubrtringWPipe],
9
+ exports: [SubstringPipe,SubrtringWPipe],
10
+ imports: [
11
+ CommonModule
12
+ ]
13
+ })
14
+ export class PipesModule { }
@@ -0,0 +1,8 @@
1
+ import { SubrtringWPipe } from './subrtring-w.pipe';
2
+
3
+ describe('SubrtringWPipe', () => {
4
+ it('create an instance', () => {
5
+ const pipe = new SubrtringWPipe();
6
+ expect(pipe).toBeTruthy();
7
+ });
8
+ });
@@ -0,0 +1,16 @@
1
+ import { Pipe, PipeTransform } from '@angular/core';
2
+
3
+ @Pipe({
4
+ name: 'subrtringW'
5
+ })
6
+ export class SubrtringWPipe implements PipeTransform {
7
+
8
+ transform(brand: string, manufacturerId: number): string {
9
+ if(manufacturerId==4 && (brand.substring(0, 2)==='FR') )
10
+ {
11
+ return brand.substring(2, 12);
12
+ }
13
+ else
14
+ return brand
15
+ }
16
+ }
@@ -0,0 +1,8 @@
1
+ import { SubstringPipe } from "./SubstringPipe";
2
+
3
+ describe('SubstringPipe', () => {
4
+ it('create an instance', () => {
5
+ const pipe = new SubstringPipe();
6
+ expect(pipe).toBeTruthy();
7
+ });
8
+ });
@@ -0,0 +1,15 @@
1
+
2
+ import { Pipe, PipeTransform } from '@angular/core';
3
+
4
+
5
+ @Pipe({
6
+ name: 'substring'
7
+ })
8
+ export class SubstringPipe implements PipeTransform {
9
+
10
+ transform(time: string, arg1: number, arg2: number): string {
11
+ return time.substring(arg1, arg2);
12
+ }
13
+
14
+ }
15
+
@@ -0,0 +1,12 @@
1
+ <p-toast position="top-center"></p-toast>
2
+ <div>
3
+ <p-dialog [header]="translate.text" [(visible)]="displayAnotherDate" [modal]="true" [style]="{width: '2000px',height:'600px'}" [draggable]="false" [resizable]="false" (onHide)="close()">
4
+ <p-calendar #calendar [(ngModel)]="dates" selectionMode="multiple" [numberOfMonths]="2" [touchUI]="true" [inline]="true" inputId="multiplemonths" (click)="onSelect()"></p-calendar>
5
+ <ng-template pTemplate="footer">
6
+ <div class="popup-footer">
7
+ <p class="popup-footer-message">{{translate.message}}</p>
8
+ <p-button icon="pi pi-calendar-plus" (click)="askDate()" [label]="translate.ask" class="p-button-text"></p-button>
9
+ </div>
10
+ </ng-template>
11
+ </p-dialog>
12
+ </div>
@@ -0,0 +1,12 @@
1
+ .p-datepicker table td.p-datepicker-today>span.p-highlight {
2
+ color: white;
3
+ background: var(--primarycolor);
4
+ }
5
+ .popup-footer{
6
+ display: flex;
7
+ justify-content: space-between;
8
+ &-message{
9
+ font-size: 13px;
10
+ font-weight: 600;
11
+ }
12
+ }
@@ -0,0 +1,25 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { ChooseAnotherDateComponent } from './choose-another-date.component';
4
+
5
+ describe('ChooseAnotherDateComponent', () => {
6
+ let component: ChooseAnotherDateComponent;
7
+ let fixture: ComponentFixture<ChooseAnotherDateComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ declarations: [ ChooseAnotherDateComponent ]
12
+ })
13
+ .compileComponents();
14
+ });
15
+
16
+ beforeEach(() => {
17
+ fixture = TestBed.createComponent(ChooseAnotherDateComponent);
18
+ component = fixture.componentInstance;
19
+ fixture.detectChanges();
20
+ });
21
+
22
+ it('should create', () => {
23
+ expect(component).toBeTruthy();
24
+ });
25
+ });
@@ -0,0 +1,127 @@
1
+ import { Component, EventEmitter, Input,OnChanges,OnInit,Output, ViewChild, ViewEncapsulation } from '@angular/core';
2
+ import { MessageService } from 'primeng/api';
3
+ import { Calendar } from 'primeng/calendar';
4
+ import { AlternativeDate } from '../../models/alternativeDate.model';
5
+ import { PrimeNGConfig } from 'primeng/api';
6
+ @Component({
7
+ selector: 'app-choose-another-date',
8
+ templateUrl: './choose-another-date.component.html',
9
+ styleUrls: ['./choose-another-date.component.scss'],
10
+ encapsulation: ViewEncapsulation.None,
11
+ })
12
+ export class ChooseAnotherDateComponent implements OnChanges, OnInit {
13
+ @Input() displayAnotherDate!: boolean;
14
+ @Input() globaltranslate!: any;
15
+ @Input() translate!: any;
16
+ @Input() alternativeDatesList!: AlternativeDate[];
17
+ @Output() closeAnotherDate = new EventEmitter<boolean>();
18
+ @Output() acceptDate = new EventEmitter<AlternativeDate[]>();
19
+ @ViewChild('calendar') calendar!: Calendar;
20
+
21
+ dates: Date[]= [];
22
+ datesRef: Date[]= [];
23
+ selectedDate !: any;
24
+ show=false;
25
+ dateslength = 0 ;
26
+ indexSelectedDate = 0;
27
+ constructor(private messageService :MessageService) {}
28
+
29
+ ngOnInit(): void {
30
+ this.loadDates() ;
31
+ }
32
+
33
+ ngOnChanges(): void {}
34
+
35
+ close()
36
+ {
37
+ this.closeAnotherDate.emit(true);
38
+ this.messageService.add({ severity: 'error', summary: this.globaltranslate.summaryReject, detail: this.globaltranslate.detailReject });
39
+ }
40
+
41
+
42
+ accept()
43
+ {
44
+ this.controlAlternativeDates();
45
+
46
+ this.acceptDate.emit(this.alternativeDatesList);
47
+ }
48
+
49
+ askDate()
50
+ {
51
+ this.closeAnotherDate.emit(false);
52
+
53
+ }
54
+
55
+
56
+ controlAlternativeDates()
57
+ {
58
+ let i = 0;
59
+ this.alternativeDatesList.forEach((item :AlternativeDate )=>
60
+ {
61
+ item.selected = (i===this.indexSelectedDate) ? "Yes" : "No";
62
+ i++
63
+ });
64
+ }
65
+
66
+
67
+ loadDates()
68
+ {
69
+ this.dates =[] ;
70
+ this.datesRef =[] ;
71
+ if(this.alternativeDatesList)
72
+ {
73
+ this.alternativeDatesList.forEach((element : AlternativeDate) => {
74
+ this.dates.push( new Date(element.startDateTime));
75
+ this.datesRef.push( new Date(element.startDateTime));
76
+ });
77
+
78
+ }
79
+ this.dateslength = this.dates.length ;
80
+ }
81
+
82
+ onSelect()
83
+ {
84
+ if( this.dateslength < this.dates.length )
85
+ {
86
+ this.loadDates();
87
+ }
88
+ else if(this.dateslength > this.dates.length)
89
+ {
90
+ this.selectedDate = this.arrdiff(this.datesRef,this.dates)[0];
91
+
92
+ for (var i = 0; i < this.datesRef.length; i++) {
93
+ if(this.datesRef[i] == this.selectedDate )
94
+ {
95
+ this.indexSelectedDate = i;
96
+ }
97
+ }
98
+ this.controlAlternativeDates();
99
+ this.accept();
100
+ this.loadDates() ;
101
+ }
102
+ this.dates ;
103
+ }
104
+
105
+
106
+ arrdiff (a1 :any, a2 :any) {
107
+ var a = [], diff = [];
108
+ for (var i = 0; i < a1.length; i++) {
109
+ a[a1[i]] = true;
110
+ }
111
+ for (var i = 0; i < a2.length; i++) {
112
+ if (a[a2[i]]) {
113
+ delete a[a2[i]];
114
+ } else {
115
+ a[a2[i]] = true;
116
+ }
117
+ }
118
+ for (var k in a) {
119
+ diff.push(k);
120
+ }
121
+ return diff;
122
+ }
123
+
124
+ }
125
+
126
+
127
+
@@ -0,0 +1,26 @@
1
+ <p-dialog [header]="globaltranslate.confirmation" [(visible)]="displayConfirmDialog" [modal]="true" [style]="{width: '50vw'}" (onHide)="rejectDate()" [maximizable]="true" [baseZIndex]="10000" [draggable]="false" [resizable]="false">
2
+ <div>
3
+ {{ isProposedDate ? translate.textProposed : translate.textAlternative }}
4
+ <div>
5
+ <br> <br>{{translate.start}} : <i class="pi pi-calendar"></i> &nbsp; <strong>
6
+ {{startDateTime | date: "EEE dd MMM yyyy":"":language}} </strong> &nbsp; {{translate.from}}: <strong>08:00 </strong>
7
+ <div *ngIf="detailedPmJobLinkedList.length>0">
8
+ <br> <p style="color:rgb(245, 57, 57) ;"><strong>{{ translate.textWarn }}</strong></p>
9
+ <ul>
10
+ <strong><li *ngFor="let detailedPmJob of detailedPmJobLinkedList">{{ detailedPmJob.pmJob.workorderNumber }}</li></strong>
11
+
12
+ </ul>
13
+ </div>
14
+ <br><br>
15
+ <p>{{translate.infoEmail}}</p>
16
+
17
+ </div>
18
+
19
+ </div>
20
+
21
+ <ng-template pTemplate="footer">
22
+ <p-button icon="pi pi-times" (click)="rejectDate()" class="annuler" [label]="globaltranslate.no"></p-button>
23
+ <p-button icon="pi pi-check" (click)="confirmDate()" [label]="globaltranslate.yes" class="p-button-text"></p-button>
24
+ </ng-template>
25
+ </p-dialog>
26
+ <p-toast position="top-center"></p-toast>
@@ -0,0 +1,25 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { ConfirmDialogComponent } from './confirm-dialog.component';
4
+
5
+ describe('ConfirmDialogComponent', () => {
6
+ let component: ConfirmDialogComponent;
7
+ let fixture: ComponentFixture<ConfirmDialogComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ declarations: [ ConfirmDialogComponent ]
12
+ })
13
+ .compileComponents();
14
+ });
15
+
16
+ beforeEach(() => {
17
+ fixture = TestBed.createComponent(ConfirmDialogComponent);
18
+ component = fixture.componentInstance;
19
+ fixture.detectChanges();
20
+ });
21
+
22
+ it('should create', () => {
23
+ expect(component).toBeTruthy();
24
+ });
25
+ });
@@ -0,0 +1,39 @@
1
+ import { Component, EventEmitter, Input, Output } from '@angular/core';
2
+ import { MessageService } from 'primeng/api';
3
+ import { DetailedPmJob } from '../../models/detailedPmJob.model';
4
+ @Component({
5
+ selector: 'app-confirm-dialog',
6
+ templateUrl: './confirm-dialog.component.html',
7
+ styleUrls: ['./confirm-dialog.component.scss']
8
+ })
9
+ export class ConfirmDialogComponent {
10
+ @Input() displayConfirmDialog!: boolean;
11
+ @Input() startDateTime!: any;
12
+ @Input() endDateTime!: any;
13
+ @Input() globaltranslate!: any;
14
+ @Input() translate!: any;
15
+ @Input() isProposedDate!: boolean;
16
+ @Input() detailedPmJobLinkedList: DetailedPmJob[] = [];
17
+
18
+ @Output() closeConfirmDialog = new EventEmitter<boolean>();
19
+
20
+ languageStored : string | null = localStorage.getItem("lang");
21
+ language: string = this.languageStored ? this.languageStored : navigator.language.substr(0, 2).toLowerCase();
22
+
23
+ constructor(private messageService :MessageService) {
24
+ }
25
+
26
+
27
+
28
+ rejectDate()
29
+ {
30
+ this.closeConfirmDialog.emit(false);
31
+ this.messageService.add({ severity: 'error', summary: this.globaltranslate.summaryReject, detail: this.globaltranslate.detailReject });
32
+ }
33
+
34
+ confirmDate()
35
+ {
36
+ this.closeConfirmDialog.emit(true);
37
+ }
38
+
39
+ }
@@ -0,0 +1,19 @@
1
+ <p-dialog [header]="globaltranslate.confirmation" [(visible)]="displayConfirmDialogContact" [modal]="true" [style]="{width: '50vw'}" (onHide)="rejectDate()" [maximizable]="true" [baseZIndex]="10000" [draggable]="false" [resizable]="false">
2
+ {{ translate.text }}<br>
3
+ <!-- <br>{{translate.start}} : <i class="pi pi-calendar"></i> &nbsp; <strong>
4
+ {{startDateTime | date: 'dd MMM yyyy'}} </strong> &nbsp; {{translate.from}}: <strong>08:00 </strong> -->
5
+ <div *ngIf="detailedPmJobLinkedList.length>0">
6
+ <br> <p style="color:rgb(245, 57, 57) ;"><strong>{{ translate.textWarn }}</strong></p>
7
+ <ul>
8
+ <strong><li *ngFor="let detailedPmJob of detailedPmJobLinkedList">{{ detailedPmJob.pmJob.workorderNumber }}</li></strong>
9
+
10
+ </ul>
11
+ </div>
12
+ <br><br>
13
+ <!-- <p>{{translate.infoEmail}}</p> -->
14
+ <ng-template pTemplate="footer">
15
+ <p-button icon="pi pi-times" (click)="rejectDate()" class="annuler" [label]="globaltranslate.no"></p-button>
16
+ <p-button icon="pi pi-check" (click)="confirmDate()" [label]="globaltranslate.yes" class="p-button-text"></p-button>
17
+ </ng-template>
18
+ </p-dialog>
19
+ <p-toast position="top-center"></p-toast>
@@ -0,0 +1,23 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { ConfirmDialogContactComponent } from './confirm-dialog-contact.component';
4
+
5
+ describe('ConfirmDialogContactComponent', () => {
6
+ let component: ConfirmDialogContactComponent;
7
+ let fixture: ComponentFixture<ConfirmDialogContactComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ declarations: [ ConfirmDialogContactComponent ]
12
+ })
13
+ .compileComponents();
14
+
15
+ fixture = TestBed.createComponent(ConfirmDialogContactComponent);
16
+ component = fixture.componentInstance;
17
+ fixture.detectChanges();
18
+ });
19
+
20
+ it('should create', () => {
21
+ expect(component).toBeTruthy();
22
+ });
23
+ });
@@ -0,0 +1,36 @@
1
+ import { Component, EventEmitter, Input, Output } from '@angular/core';
2
+ import { MessageService } from 'primeng/api';
3
+ import { DetailedPmJob } from '../../models/detailedPmJob.model';
4
+
5
+ @Component({
6
+ selector: 'app-confirm-dialog-contact',
7
+ templateUrl: './confirm-dialog-contact.component.html',
8
+ styleUrls: ['./confirm-dialog-contact.component.css']
9
+ })
10
+ export class ConfirmDialogContactComponent {
11
+
12
+ @Input() displayConfirmDialogContact!: boolean;
13
+ @Input() startDateTime!: any;
14
+ @Input() endDateTime!: any;
15
+ @Input() globaltranslate!: any;
16
+ @Input() translate!: any;
17
+ @Input() detailedPmJobLinkedList: DetailedPmJob[] = [];
18
+
19
+ @Output() closeConfirmDialogContact = new EventEmitter<boolean>();
20
+
21
+ constructor(private messageService :MessageService) { }
22
+
23
+
24
+
25
+ rejectDate()
26
+ {
27
+ this.closeConfirmDialogContact.emit(false);
28
+ this.messageService.add({ severity: 'error', summary: this.globaltranslate.summaryReject, detail: this.globaltranslate.detailReject });
29
+ }
30
+
31
+ confirmDate()
32
+ {
33
+ this.closeConfirmDialogContact.emit(true);
34
+ }
35
+
36
+ }
@@ -0,0 +1,25 @@
1
+ <p-dialog [header]="globaltranslate.information" [(visible)]="displayConfirmedDateInfos" [modal]="true" [style]="{width: '50vw'}" (onHide)="confirmDate()" [maximizable]="true" [baseZIndex]="10000" [draggable]="false" [resizable]="false">
2
+ <i class="pi pi-check icon-check"></i>
3
+
4
+
5
+ <div *ngIf="moreDates" style="text-align:center ;">
6
+ <br><br>
7
+ {{translate.textMoreDates}}
8
+ <br><br>
9
+
10
+ </div>
11
+ <div *ngIf="!moreDates">
12
+ <div class="text-center">
13
+ <p> {{translate.text }} <br> {{translate.start}} : <i class="pi pi-calendar"></i> &nbsp; <strong>
14
+ {{startDateTime | date: "EEE dd MMM yyyy":"":language}}</strong> <br> {{translate.from}}: <strong>08:00 </strong> </p>
15
+ </div>
16
+ <br><br>
17
+ <p>{{translate.infoEmail}}</p>
18
+
19
+ </div>
20
+
21
+
22
+ <ng-template pTemplate="footer">
23
+ <p-button icon="pi pi-times " (click)="confirmDate()" label="Close" class=" text-center d-block"></p-button>
24
+ </ng-template>
25
+ </p-dialog>
@@ -0,0 +1,23 @@
1
+ p-dialog{
2
+ p{
3
+ font-size: 14px;
4
+ line-height: 34px;
5
+ margin-top: 30px;
6
+ }
7
+ .icon-check{
8
+ text-align: center;
9
+ color: white;
10
+ background: var(--primarycolor);
11
+ width: 80px;
12
+ height: 80px;
13
+ display: flex ;
14
+ justify-content: center;
15
+ align-items: center;
16
+ border-radius: 50%;
17
+ font-size: 30px;
18
+ font-weight: bold;
19
+ margin:auto;
20
+ }
21
+
22
+ }
23
+
@@ -0,0 +1,25 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { ConfirmedDateInformationComponent } from './confirmed-date-information.component';
4
+
5
+ describe('ConfirmedDateInformationComponent', () => {
6
+ let component: ConfirmedDateInformationComponent;
7
+ let fixture: ComponentFixture<ConfirmedDateInformationComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ declarations: [ ConfirmedDateInformationComponent ]
12
+ })
13
+ .compileComponents();
14
+ });
15
+
16
+ beforeEach(() => {
17
+ fixture = TestBed.createComponent(ConfirmedDateInformationComponent);
18
+ component = fixture.componentInstance;
19
+ fixture.detectChanges();
20
+ });
21
+
22
+ it('should create', () => {
23
+ expect(component).toBeTruthy();
24
+ });
25
+ });
@@ -0,0 +1,30 @@
1
+ import { Component, EventEmitter, Input, Output, OnDestroy } from '@angular/core';
2
+
3
+ @Component({
4
+ selector: 'app-confirmed-date-information',
5
+ templateUrl: './confirmed-date-information.component.html',
6
+ styleUrls: ['./confirmed-date-information.component.scss']
7
+ })
8
+ export class ConfirmedDateInformationComponent implements OnDestroy {
9
+ @Input() displayConfirmedDateInfos!: boolean;
10
+ @Input() startDateTime!: any;
11
+ @Input() endDateTime!: any;
12
+ @Input() globaltranslate!: any;
13
+ @Input() translate!: any;
14
+ @Input() moreDates!: boolean;
15
+ @Output() closeConfirmedDateInfo = new EventEmitter<boolean>();
16
+ languageStored : string | null = localStorage.getItem("lang");
17
+ language: string = this.languageStored ? this.languageStored : navigator.language.substr(0, 2).toLowerCase();
18
+ constructor() { }
19
+
20
+ ngOnDestroy(): void {
21
+ // this.displayConfirmedDateInfos = false;
22
+ }
23
+
24
+
25
+ confirmDate()
26
+ {
27
+ this.closeConfirmedDateInfo.emit(true);
28
+ }
29
+
30
+ }